From boxbackup-dev at fluffy.co.uk Mon Dec 5 15:41:17 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Mon, 5 Dec 2005 15:41:17 +0000 Subject: [Box Backup-dev] test Message-ID: <75879284-CF54-4F7B-9B03-451E448058E5@fluffy.co.uk> Test message. From boxbackup-dev at fluffy.co.uk Mon Dec 5 16:27:48 2005 From: boxbackup-dev at fluffy.co.uk (Gary) Date: Mon, 5 Dec 2005 08:27:48 -0800 (PST) Subject: [Box Backup-dev] Re: [Box Backup] Win32 port Message-ID: <20051205162748.15572.qmail@web36704.mail.mud.yahoo.com> Ben, As a sidenote: > 2) Some extra features, for example, the > dumping of state to disc. Yes, those are the changes that I implemented to make boxbackup work in my environment. A copy off a clean 0.09 is available at: http://home.earthlink.net/~gniemcew/ So it should be easy to create a differential. 1. StoreObjectInfoFile is just a nice improvement, but it does save a lot of backup time when boxbackup is used in a non-server environment when a machine is rebooted frequently (a laptop, etc.) 2. Unlimited MaximumDiffingTime is useful if a user has to absolutely minimize upload time (slow upload connections, etc.) 3. KeepAliveTime is absolutely crucial to complete backups of large files (otherwise, the SSL layer times out after 300 seconds of diffing). Even though the 0.09-chromi speeds up the diffing time substantially, I still run into this problem from time to time, so that option still has its merit. Let me know if you want me to produce a diff, a branch, a marge, perhaps rewrite some of the code - I would be happy to see those improvements in the next version of boxbackup. Gary __________________________________ Start your day with Yahoo! - Make it your home page! http://www.yahoo.com/r/hs From boxbackup-dev at fluffy.co.uk Mon Dec 5 16:34:41 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Mon, 5 Dec 2005 16:34:41 +0000 (GMT) Subject: [Box Backup-dev] Re: [Box Backup] Win32 port In-Reply-To: <20051205162748.15572.qmail@web36704.mail.mud.yahoo.com> References: <20051205162748.15572.qmail@web36704.mail.mud.yahoo.com> Message-ID: Hi Gary and all, > Yes, those are the changes that I implemented to make boxbackup work in > my environment. A copy off a clean 0.09 is available at: > > http://home.earthlink.net/~gniemcew/ > > So it should be easy to create a differential. Cool, thanks for that. > Let me know if you want me to produce a diff, a branch, a marge, > perhaps rewrite some of the code - I would be happy to see those > improvements in the next version of boxbackup. I agree that we should look at merging your changes, but I think it should be done separately from the win32 effort. What I intend to do, unless there are any objections, is to unmerge that patch from (my copy of) the win32 tree, to avoid mixing win32 patches with other unrelated patches. This way we can get a better idea of what is involved in the Win32 port. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Mon Dec 5 16:36:59 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Mon, 5 Dec 2005 16:36:59 +0000 Subject: [Box Backup-dev] Re: [Box Backup] Win32 port In-Reply-To: <20051205162748.15572.qmail@web36704.mail.mud.yahoo.com> References: <20051205162748.15572.qmail@web36704.mail.mud.yahoo.com> Message-ID: On 5 Dec 2005, at 16:27, Gary wrote: > Ben, > > As a sidenote: > >> 2) Some extra features, for example, the >> dumping of state to disc. > > Yes, those are the changes that I implemented to make boxbackup > work in > my environment. A copy off a clean 0.09 is available at: > > http://home.earthlink.net/~gniemcew/ > > So it should be easy to create a differential. > > 1. StoreObjectInfoFile is just a nice improvement, but it does save a > lot of backup time when boxbackup is used in a non-server environment > when a machine is rebooted frequently (a laptop, etc.) > > 2. Unlimited MaximumDiffingTime is useful if a user has to absolutely > minimize upload time (slow upload connections, etc.) > > 3. KeepAliveTime is absolutely crucial to complete backups of large > files (otherwise, the SSL layer times out after 300 seconds of > diffing). Even though the 0.09-chromi speeds up the diffing time > substantially, I still run into this problem from time to time, so > that > option still has its merit. > > Let me know if you want me to produce a diff, a branch, a marge, > perhaps rewrite some of the code - I would be happy to see those > improvements in the next version of boxbackup. If it's really easy to do, it would make life easier if they were all separated out and based on 0.09. But I'm sure we can work from what we've got. Ben From boxbackup-dev at fluffy.co.uk Mon Dec 5 17:04:52 2005 From: boxbackup-dev at fluffy.co.uk (Gary) Date: Mon, 5 Dec 2005 09:04:52 -0800 (PST) Subject: [Box Backup-dev] Re: [Box Backup] Win32 port In-Reply-To: Message-ID: <20051205170452.79079.qmail@web36705.mail.mud.yahoo.com> Chris, > What I intend to do, unless there are any objections, is to > unmerge that patch from (my copy of) the win32 tree, to avoid > mixing win32 patches with > other unrelated patches. Good point, I think that's the way to go as well. However, let me know if you want those changes in the next version of boxbackup at all (I would recommend the KeepAliveTime, since without it 4GB file diffing becomes unmanageable - either the SLL layer fails up, or you are restricted to 300 seconds of diffing time, in which case uploads are enormous). If so, should I create a branch in SVN or you guys want to handle that? Gary __________________________________ Start your day with Yahoo! - Make it your home page! http://www.yahoo.com/r/hs From boxbackup-dev at fluffy.co.uk Mon Dec 5 17:15:12 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Mon, 5 Dec 2005 17:15:12 +0000 (GMT) Subject: [Box Backup-dev] Re: [Box Backup] Win32 port In-Reply-To: <20051205170452.79079.qmail@web36705.mail.mud.yahoo.com> References: <20051205170452.79079.qmail@web36705.mail.mud.yahoo.com> Message-ID: Hi Gary, >> What I intend to do, unless there are any objections, is to >> unmerge that patch from (my copy of) the win32 tree, to avoid >> mixing win32 patches with >> other unrelated patches. > > Good point, I think that's the way to go as well. However, let me know > if you want those changes in the next version of boxbackup at all (I > would recommend the KeepAliveTime, since without it 4GB file diffing > becomes unmanageable - either the SLL layer fails up, or you are > restricted to 300 seconds of diffing time, in which case uploads are > enormous). I think it would be a great idea to get them into Subversion and review them - separately from the win32 patch. If they look good then I don't see why we shouldn't merge them. > If so, should I create a branch in SVN or you guys want to handle that? I'd be happy for you to go ahead and create the branch. Makes it easier for all of us to see what everyone is doing and how to order the merges. We should also get a clean copy of 0.09 into SVN to compare it with and generate patches against. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Mon Dec 5 17:17:16 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Mon, 5 Dec 2005 17:17:16 +0000 (GMT) Subject: [Box Backup-dev] Re: [Box Backup] Win32 port In-Reply-To: <8BEF076B-5313-4241-827A-5237EE68B6DC@fluffy.co.uk> References: <8BEF076B-5313-4241-827A-5237EE68B6DC@fluffy.co.uk> Message-ID: Hi Ben, Nick and all, On Mon, 5 Dec 2005, Ben Summers wrote: > I think we should go with UNIX style endings whereever it does not cause > problems with Win32. Otherwise SVN doesn't work terribly well with diffs. Aye aye. >> I would like to clean up the comments and line lengths before this gets >> merged, since I'm certain you won't allow me to change them afterwards :-) >> Any objections? > > Cleaning up sounds good to me! You can find my first attempt at [http://bbdev.fluffy.co.uk/svn/box/chris/win32/2-code-formatting/]. I haven't tested whether it compiles yet, but you can compare it with [http://bbdev.fluffy.co.uk/svn/box/chris/win32/1-line-endings/] for reference. Comments welcome. > I do not want to include a regex library in the sources. I would much > prefer to not include it at all when it's not available, and make it > easy to include it when it is. OK, fair enough. If it's OK with you, I will distribute a regex library with Boxi, so that both Box and Boxi can use it when built from that distribution. >> > There are two parts to the Win32 port: >> > >> > 1) The actual porting effort. >> > >> > 2) Some extra features, for example, the dumping of state to disc. >> > >> > They should, perhaps be separated. Nick had to do a LOT of work to get Box working on win32 - the POSIX emulation library he wrote is 1600 lines. I also think that he did a great job, and I want to thank and congratulate him on that. I also want to say, before I start nitpicking every line of code :-) that none of what I write below is intended to criticise that work. I just want to minimise the number of changes to Box in order to make the merge as smooth as possible. On the question of what should be considered as strictly Win32 porting, and what constitutes extra features or bug fixes, I have a few questions: 1. Nick's bin/bbackupd/BackupClientContext.cpp changes the way that BackupClientContext::FindFilename works, by decrypting the filenames first rather than comparing encrypted names. The intent seems similar to that documented in BackupClientDirectoryRecord.cpp. This looks like a bug fix rather than Win32 port. Should I break it out into a separate patch? 2. Nick's BackupClientContext.cpp also includes a bunch of stuff related to maximum diffing time and SSL keepalives (BackupClientContext::SetMaximumDiffingTime). Is this already included in someone else's patches (perhaps Gary's?), and should I consider it part of the Win32 port or break it out? It's also only enabled on Win32 - if this is important then perhaps we should make it cross-platform? 3. Nick created a new member in BackupClientContext.h, a boolean called mbIsManaged. Since we're not using full Hungarian notation (thank ****), perhaps it should be called mIsManaged? 4. In BackupClientDirectoryRecord.cpp, Nick comments that lstat() failure at this point causes an exception which aborts the backup. This can happen if the file is locked (on win32) or removed during the backup. Should I merge his comments to that effect, or try to find a better solution to this problem? 5. Nick made a number of things conditional on BERKELY_V4, for example: --- bb-0.8/bin/bbackupd/BackupClientInodeToIDMap.cpp +++ bb-win32-nick/bin/bbackupd/BackupClientInodeToIDMap.cpp @@ -69,7 +71,11 @@ #ifndef BACKIPCLIENTINODETOIDMAP_IN_MEMORY_IMPLEMENTATION if(dbp != 0) { +#ifdef BERKELY_V4 + dbp->close(0); +#elif dbp->close(dbp); +#endif } #endif } I'm no bdb guru, but is db4 not backwards-compatible with previous versions? Shouldn't it be possible to write the code so that it works with any version of bdb? In any case, BERKELY_V4 isn't defined in BoxPlatform.h (it's commented out), so can we just remove all of these for now? 6. Nick's BackupDaemon.cpp has a separate Windows thread for monitoring the named pipe for bbackupd control. Is this strictly required, or an improvement? My own patch set (for Boxi) does this in a different way - no extra thread is created, but instead the main thread polls the command socket more often. Any suggestions on which approach is preferred? The thread stuff looks harder to make cross-platform compatible. 7. Nick's BackupDaemon.cpp has the following code: + DWORD timeout = BoxTimeToMilliSeconds(RequiredDelay); + + while ( this->mReceivedCommandConn == false ) + { + Sleep(1); + + if ( timeout == 0 ) + { + DoSyncFlagOut = false; + SyncIsForcedOut = false; + return; + } + timeout--; + } This looks wrong to me. We sleep for one second, but decrease the timeout (in milliseconds) by one? 8. Nick's HousekeepStoreAccounts does some extra stuff when housekeeping is aborted: if(!continueHousekeeping) { + // If any files were marked "delete now", then update + // the size of the store. + if(mBlocksUsedDelta != 0 || mBlocksInOldFilesDelta != 0 + || mBlocksInDeletedFilesDelta != 0) + { + info->ChangeBlocksUsed(mBlocksUsedDelta); + info->ChangeBlocksInOldFiles(mBlocksInOldFilesDelta); + info->ChangeBlocksInDeletedFiles(mBlocksInDeletedFilesDe lta); + + // Save the store info back + info->Save(); + } + return; } Does this count as a bug fix for a separate patch? 9. Ditto for the check for a null buffer pointer before freeing it in BackupStoreFileCombine.cpp 10. Someone else should review Nick's changes to BackupStoreFile.cpp, as I don't understand the alignment restrictions that his CodingChunkAlloc is enforcing, nor how the call to MaxBlockSizeForChunkSize can be replaced with a fixed size of 256. 11. What's the rationale for private distributions? (BOX_PRIVATE_BEGIN) i.e. what code should be protected by such sections? 12. I think that Nick's WinNamedPipe and PipeGetLine can, and should, be merged into SocketStream and IOStreamGetLine, reducing code duplication. 13. Nick's bbackupctl sends error messages to syslog (or the Windows Event Log) in addition to the standard output. I think this is not a good idea for a Unix command-line tool, and I'm not sure of the value on Windows. So I suggest either removing these entirely, or making them conditional on WIN32. 14. The emulation library provides stubs for lstat and readlink which do nothing, since Windows doesn't have symbolic links. I suggest that we remove these and disable any tests or code that requires them on Win32. Otherwise they may present a hazard for the unwary coder in future. 15. Nick's Configuration.cpp contains code to detect when the config file has been modified and reload it automatically. Shall I break this out into a separate patch? All comments gratefully appreciated. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Mon Dec 5 17:47:56 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Mon, 05 Dec 2005 17:47:56 +0000 Subject: [Box Backup-dev] Re: [Box Backup] Win32 port In-Reply-To: References: <8BEF076B-5313-4241-827A-5237EE68B6DC@fluffy.co.uk> Message-ID: <20051205174756.srl27p56dcs8ok0k@ebourne.me.uk> Chris Wilson wrote: > I'm no bdb guru, but is db4 not backwards-compatible with previous > versions? Shouldn't it be possible to write the code so that it works > with any version of bdb? No, it isn't. I'm not sure what the rationale is for using 1.85 (? from memory). I would prefer to port to V4 fully unless there are good reasons. I can only assume it is because bdb is notorious for having binary incompatible data files between releases, and therefore a lot of people pick a version and stick with it. I'm not sure that really matters for box, since the files are only really a cache anyway. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Mon Dec 5 17:55:34 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Mon, 5 Dec 2005 17:55:34 +0000 Subject: [Box Backup-dev] Re: [Box Backup] Win32 port In-Reply-To: <20051205174756.srl27p56dcs8ok0k@ebourne.me.uk> References: <8BEF076B-5313-4241-827A-5237EE68B6DC@fluffy.co.uk> <20051205174756.srl27p56dcs8ok0k@ebourne.me.uk> Message-ID: On 5 Dec 2005, at 17:47, Martin Ebourne wrote: > Chris Wilson wrote: >> I'm no bdb guru, but is db4 not backwards-compatible with previous >> versions? Shouldn't it be possible to write the code so that it >> works >> with any version of bdb? > > No, it isn't. > > I'm not sure what the rationale is for using 1.85 (? from memory). Pre-installed on most *BSD systems by default, so less hassles on the primary target platform of OpenBSD. Just a project history thing. > I would prefer to port to V4 fully unless there are good reasons. I > can only assume it is because bdb is notorious for having binary > incompatible data files between releases, and therefore a lot of > people pick a version and stick with it. I'm not sure that really > matters for box, since the files are only really a cache anyway. I would prefer it at least retained the option of using the older version. Ben From boxbackup-dev at fluffy.co.uk Mon Dec 5 18:10:15 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Mon, 5 Dec 2005 18:10:15 +0000 Subject: [Box Backup-dev] Re: [Box Backup] Win32 port In-Reply-To: References: <8BEF076B-5313-4241-827A-5237EE68B6DC@fluffy.co.uk> Message-ID: <663C956E-A67D-4BE4-8B49-2F04FF2E2790@fluffy.co.uk> On 5 Dec 2005, at 17:17, Chris Wilson wrote: > Hi Ben, Nick and all, > > On Mon, 5 Dec 2005, Ben Summers wrote: > >> I do not want to include a regex library in the sources. I would >> much prefer to not include it at all when it's not available, and >> make it easy to include it when it is. > > OK, fair enough. If it's OK with you, I will distribute a regex > library with Boxi, so that both Box and Boxi can use it when built > from that distribution. That's not a problem. > >>> > There are two parts to the Win32 port: >>> > > 1) The actual porting effort. >>> > > 2) Some extra features, for example, the dumping of state to >>> disc. >>> > > They should, perhaps be separated. > > Nick had to do a LOT of work to get Box working on win32 - the > POSIX emulation library he wrote is 1600 lines. I also think that > he did a great job, and I want to thank and congratulate him on that. Yes, it's all very good. And quite something to emulate enough of POSIX! > > I also want to say, before I start nitpicking every line of > code :-) that none of what I write below is intended to criticise > that work. I just want to minimise the number of changes to Box in > order to make the merge as smooth as possible. > > On the question of what should be considered as strictly Win32 > porting, and what constitutes extra features or bug fixes, I have a > few questions: > > 1. Nick's bin/bbackupd/BackupClientContext.cpp changes the way that > BackupClientContext::FindFilename works, by decrypting the > filenames > first rather than comparing encrypted names. The intent seems > similar > to that documented in BackupClientDirectoryRecord.cpp. > > This looks like a bug fix rather than Win32 port. Should I break > it out > into a separate patch? I suspect it would be better to somehow avoid this need in the first place. But for now, that's probably fine. > > 2. Nick's BackupClientContext.cpp also includes a bunch of stuff > related > to maximum diffing time and SSL keepalives > (BackupClientContext::SetMaximumDiffingTime). Is this already > included > in someone else's patches (perhaps Gary's?), and should I > consider it > part of the Win32 port or break it out? It's also only enabled > on Win32 > - if this is important then perhaps we should make it cross- > platform? Cross platform is preferred. > > 4. In BackupClientDirectoryRecord.cpp, Nick comments that lstat() > failure > at this point causes an exception which aborts the backup. This can > happen if the file is locked (on win32) or removed during the > backup. > Should I merge his comments to that effect, or try to find a better > solution to this problem? If the contributors are willing to participate in a bit of a redesign of some of the backup engine (to take advantage of stuff learnt from this version) then merge the comments. Otherwise we should fix it. > > 6. Nick's BackupDaemon.cpp has a separate Windows thread for > monitoring > the named pipe for bbackupd control. Is this strictly required, > or an > improvement? My own patch set (for Boxi) does this in a > different way - > no extra thread is created, but instead the main thread polls the > command socket more often. Any suggestions on which approach is > preferred? The thread stuff looks harder to make cross-platform > compatible. It's usually best to wait using the OS' provided API, rather than to poll. > 8. Nick's HousekeepStoreAccounts does some extra stuff when > housekeeping > is aborted: > > if(!continueHousekeeping) > { > + // If any files were marked "delete now", then update > + // the size of the store. > + if(mBlocksUsedDelta != 0 || mBlocksInOldFilesDelta ! > = 0 > + || mBlocksInDeletedFilesDelta != 0) > + { > + info->ChangeBlocksUsed(mBlocksUsedDelta); > + info->ChangeBlocksInOldFiles(mBlocksInOldFilesDelta); > + info->ChangeBlocksInDeletedFiles(mBlocksInDeletedFilesDe > lta); > + > + // Save the store info back > + info->Save(); > + } > + > return; > } > > Does this count as a bug fix for a separate patch? I think I added that in 0.09. Nick did merge in some changes 0.08 -> 0.09 manually. > > 9. Ditto for the check for a null buffer pointer before freeing it in > BackupStoreFileCombine.cpp > > 10. Someone else should review Nick's changes to > BackupStoreFile.cpp, as I > don't understand the alignment restrictions that his > CodingChunkAlloc > is enforcing, nor how the call to MaxBlockSizeForChunkSize can be > replaced with a fixed size of 256. I will do that tomorrow. > > 11. What's the rationale for private distributions? > (BOX_PRIVATE_BEGIN) > i.e. what code should be protected by such sections? It's some other stuff I wrote. I didn't write a generic UNIX daemon and client set of libraries just to use it on one project. It should be pulled out of the distribution. > > 12. I think that Nick's WinNamedPipe and PipeGetLine can, and > should, be > merged into SocketStream and IOStreamGetLine, reducing code > duplication. Yes. > > 13. Nick's bbackupctl sends error messages to syslog (or the > Windows Event > Log) in addition to the standard output. I think this is not a > good > idea for a Unix command-line tool, and I'm not sure of the > value on > Windows. So I suggest either removing these entirely, or making > them > conditional on WIN32. I'd vote for remove (or perhaps #ifndef NDEBUG on WIN32 only). Maybe it was a debugging thing? It can be tricky to see the output in syslog sometimes. > > 14. The emulation library provides stubs for lstat and readlink > which do > nothing, since Windows doesn't have symbolic links. I suggest > that we > remove these and disable any tests or code that requires them on > Win32. Otherwise they may present a hazard for the unwary coder in > future. I would prefer that they threw an exception so that #ifdefs are minimised. Although the tests can't get much more ugly. > > 15. Nick's Configuration.cpp contains code to detect when the > config file > has been modified and reload it automatically. Shall I break > this out > into a separate patch? I'd prefer it if that never made it into the tree. It'll break some of my code, and is a bit nasty anyway. Again, take comments as wanting the next Box Backup to be as high quality as possible, rather than criticising the code randomly. (Thanks Nick) Ben From boxbackup-dev at fluffy.co.uk Mon Dec 5 18:27:28 2005 From: boxbackup-dev at fluffy.co.uk (Charles Lecklider) Date: Mon, 05 Dec 2005 18:27:28 +0000 Subject: [Box Backup-dev] Re: [Box Backup] Win32 port In-Reply-To: References: <8BEF076B-5313-4241-827A-5237EE68B6DC@fluffy.co.uk> Message-ID: <43948690.8000806@invis.net> Chris Wilson wrote: > 7. Nick's BackupDaemon.cpp has the following code: > > + DWORD timeout = BoxTimeToMilliSeconds(RequiredDelay); > + > + while ( this->mReceivedCommandConn == false ) > + { > + Sleep(1); > + > + if ( timeout == 0 ) > + { > + DoSyncFlagOut = false; > + SyncIsForcedOut = false; > + return; > + } > + timeout--; > + } > > This looks wrong to me. We sleep for one second, but decrease the > timeout (in milliseconds) by one? Sleep is a Windows API call which takes a number of milliseconds to sleep. It really should be Sleep(0) - that gives up the timeslice, rather than entering a kernel wait for all of 1ms. Same effect, more friendly to the system. -C From boxbackup-dev at fluffy.co.uk Mon Dec 5 18:50:39 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Mon, 5 Dec 2005 18:50:39 +0000 (GMT) Subject: [Box Backup-dev] Re: [Box Backup] Win32 port In-Reply-To: <43948690.8000806@invis.net> References: <8BEF076B-5313-4241-827A-5237EE68B6DC@fluffy.co.uk> <43948690.8000806@invis.net> Message-ID: Hi Charles, On Mon, 5 Dec 2005, Charles Lecklider wrote: > Sleep is a Windows API call which takes a number of milliseconds to > sleep. It really should be Sleep(0) - that gives up the timeslice, > rather than entering a kernel wait for all of 1ms. Same effect, more > friendly to the system. Thanks for spotting that. Shows how much I know about the Win32 API :-) Anyway, if we want the timeout to work properly, shouldn't we keep track of wall clock time rather than assuming that the system will sleep for exactly 1ms, or whatever a timeslice happens to be? Anyone know a Win32 API function to get the wall clock time with millisecond resolution or better? Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Mon Dec 5 18:57:11 2005 From: boxbackup-dev at fluffy.co.uk (Charles Lecklider) Date: Mon, 05 Dec 2005 18:57:11 +0000 Subject: [Box Backup-dev] Re: [Box Backup] Win32 port In-Reply-To: References: <8BEF076B-5313-4241-827A-5237EE68B6DC@fluffy.co.uk> <43948690.8000806@invis.net> Message-ID: <43948D87.5010007@invis.net> Chris Wilson wrote: > Thanks for spotting that. Shows how much I know about the Win32 API :-) np. > Anyway, if we want the timeout to work properly, shouldn't we keep track > of wall clock time rather than assuming that the system will sleep for > exactly 1ms, or whatever a timeslice happens to be? Anyone know a Win32 > API function to get the wall clock time with millisecond resolution or > better? You're polling the command pipe, yes? If so, don't worry about it - I plan to rewrite that part of the code to use overlapped IO like a real Windows app should :-) I'm just waiting on a coherent set of Win32 source.... -C From boxbackup-dev at fluffy.co.uk Mon Dec 5 19:14:53 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Mon, 5 Dec 2005 19:14:53 +0000 (GMT) Subject: [Box Backup-dev] Failing test (was: Win32 port) In-Reply-To: <663C956E-A67D-4BE4-8B49-2F04FF2E2790@fluffy.co.uk> References: <8BEF076B-5313-4241-827A-5237EE68B6DC@fluffy.co.uk> <663C956E-A67D-4BE4-8B49-2F04FF2E2790@fluffy.co.uk> Message-ID: Hi all, After a few more tweaks I've got the ported 0.08 to compile again on Linux (I think this should fix it for all *nixes). However, some of the tests are failing and I don't know why. Common tests are showing two problems: realloc doesn't move the allocated block, which I think Ben said is normal on some platforms, so I'm ignoring it. However, the GetLine tests are also failing. I don't know why that should be, as the port doesn't touch GetLine as far as I know. Running in GDB: 198 TEST_CHECK_THROWS(getline.GetLine(true), CommonException, GetLineEOF); (gdb) n Exception thrown: CommonException(GetLineEOF) at FdGetLine.cpp(76) Exception thrown: CommonException(GetLineEOF) at FdGetLine.cpp(76) Exception thrown: CommonException(GetLineEOF) at IOStreamGetLine.cpp(70) Exception thrown: CommonException(GetLineEOF) at IOStreamGetLine.cpp(70) Exception thrown: CommonException(OSFileError) at Configuration.cpp(104) FAILED: Exception caught: Common OSFileError >From the definition of TEST_CHECK_THROWS, I think it should have caught this exception, and I don't know why it didn't. I hate debugging macros - I can't step through it to make sure the code path being followed is what I'm expecting. Anyone have any ideas? Backupstore tests aren't compiling, and I'm working on that. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Mon Dec 5 22:07:14 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Mon, 5 Dec 2005 22:07:14 +0000 (GMT) Subject: [Box Backup-dev] Re: [Box Backup] Win32 port In-Reply-To: <663C956E-A67D-4BE4-8B49-2F04FF2E2790@fluffy.co.uk> References: <8BEF076B-5313-4241-827A-5237EE68B6DC@fluffy.co.uk> <663C956E-A67D-4BE4-8B49-2F04FF2E2790@fluffy.co.uk> Message-ID: Hi Ben and all, On Mon, 5 Dec 2005, Ben Summers wrote: >> 1. Nick's bin/bbackupd/BackupClientContext.cpp changes the way that >> BackupClientContext::FindFilename works, by decrypting the filenames >> first rather than comparing encrypted names. The intent seems similar >> to that documented in BackupClientDirectoryRecord.cpp. >> >> This looks like a bug fix rather than Win32 port. Should I break it out >> into a separate patch? > > I suspect it would be better to somehow avoid this need in the first place. > But for now, that's probably fine. OK, done. Removed in [http://bbdev.fluffy.co.uk/svn/box/chris/win32/4-removed-decrypt-filenames/] >> 2. Nick's BackupClientContext.cpp also includes a bunch of stuff related >> to maximum diffing time and SSL keepalives >> (BackupClientContext::SetMaximumDiffingTime). Is this already >> included >> in someone else's patches (perhaps Gary's?), and should I consider it >> part of the Win32 port or break it out? It's also only enabled on Win32 >> - if this is important then perhaps we should make it cross-platform? > > Cross platform is preferred. Since this is covered by Gary's patch, I'll remove it for now. It contained some Win32-specific parts which Gary's patch doesn't have, so I'll send those to Gary for inclusion in his patch, when the time comes. [http://bbdev.fluffy.co.uk/svn/box/chris/win32/3-removed-garys-patch/] >> 4. In BackupClientDirectoryRecord.cpp, Nick comments that lstat() failure >> at this point causes an exception which aborts the backup. This can >> happen if the file is locked (on win32) or removed during the >> backup. >> Should I merge his comments to that effect, or try to find a better >> solution to this problem? > > If the contributors are willing to participate in a bit of a redesign of some > of the backup engine (to take advantage of stuff learnt from this version) > then merge the comments. Otherwise we should fix it. I'm certainly willing to help with this effort in any way that I can, with my limited skills and knowledge of the code. It seems easier to merge with these comments than to try to redesign at this stage, so I vote that we include the comments, finish the merge, and then look at this problem again. >> 6. Nick's BackupDaemon.cpp has a separate Windows thread for monitoring >> the named pipe for bbackupd control. Is this strictly required, or an >> improvement? My own patch set (for Boxi) does this in a different way - >> no extra thread is created, but instead the main thread polls the >> command socket more often. Any suggestions on which approach is >> preferred? The thread stuff looks harder to make cross-platform >> compatible. > > It's usually best to wait using the OS' provided API, rather than to poll. Any suggestions on how to use threads in a cross-platform way to achieve this? I know wxWidgets has a cross-platform thread library, but it may be a bit too heavyweight a dependency for your taste. >> 8. Nick's HousekeepStoreAccounts does some extra stuff when housekeeping >> is aborted: [...] > I think I added that in 0.09. Nick did merge in some changes 0.08 -> 0.09 > manually. You're right, this is already included in 0.09. In fact, the files are identical. I've removed this patch since it doesn't need to be merged. [http://bbdev.fluffy.co.uk/svn/box/chris/win32/5-removed-housekeeping-update-from-0.09] >> 11. What's the rationale for private distributions? (BOX_PRIVATE_BEGIN) >> i.e. what code should be protected by such sections? > > It's some other stuff I wrote. I didn't write a generic UNIX daemon and > client set of libraries just to use it on one project. It should be pulled > out of the distribution. Should I assume that nobody except you should be creating BOX_PRIVATE sections? (not that it matters now, there aren't any left in the win32 port). >> 12. I think that Nick's WinNamedPipe and PipeGetLine can, and should, be >> merged into SocketStream and IOStreamGetLine, reducing code >> duplication. > > Yes. OK, I will have a deeper look at this. >> 13. Nick's bbackupctl sends error messages to syslog (or the Windows Event >> Log) in addition to the standard output. I think this is not a good >> idea for a Unix command-line tool, and I'm not sure of the value on >> Windows. So I suggest either removing these entirely, or making them >> conditional on WIN32. > > I'd vote for remove (or perhaps #ifndef NDEBUG on WIN32 only). Maybe it was a > debugging thing? It can be tricky to see the output in syslog sometimes. OK, done. [http://bbdev.fluffy.co.uk/svn/box/chris/win32/6-made-bbackupctl-syslogging-conditional] >> 14. The emulation library provides stubs for lstat and readlink which do >> nothing, since Windows doesn't have symbolic links. I suggest that we >> remove these and disable any tests or code that requires them on >> Win32. Otherwise they may present a hazard for the unwary coder in >> future. > > I would prefer that they threw an exception so that #ifdefs are minimised. > Although the tests can't get much more ugly. If they throw exceptions, then the tests will have to do something like this: #ifdef WIN32 TEST_CHECK_THROWS(, SomeException, SubType) #else TEST_THAT( == 0) #endif Is that better than just #ifndef WIN32 around the call? If so then I'm happy to implement it, if you can tell me what kind of exception you'd like it to throw. Although I personally prefer that such code is checked at compile time rather than runtime. >> 15. Nick's Configuration.cpp contains code to detect when the config file >> has been modified and reload it automatically. Shall I break this out >> into a separate patch? > > I'd prefer it if that never made it into the tree. It'll break some of my > code, and is a bit nasty anyway. It seems to have been part of Gary's 0.09-mod patch, so it's gone now that that patch is removed. > Again, take comments as wanting the next Box Backup to be as high quality as > possible, rather than criticising the code randomly. (Thanks Nick) Nick++ :-) I'm eagerly awaiting a barrage of criticism for my own misdeeds in the name of the porting effort. :-) Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Mon Dec 5 23:37:29 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Mon, 5 Dec 2005 23:37:29 +0000 (GMT) Subject: [Box Backup-dev] Re: [Box Backup] Win32 port In-Reply-To: <663C956E-A67D-4BE4-8B49-2F04FF2E2790@fluffy.co.uk> References: <8BEF076B-5313-4241-827A-5237EE68B6DC@fluffy.co.uk> <663C956E-A67D-4BE4-8B49-2F04FF2E2790@fluffy.co.uk> Message-ID: Hi Ben, >> 9. Ditto for the check for a null buffer pointer before freeing it in >> BackupStoreFileCombine.cpp >> >> 10. Someone else should review Nick's changes to BackupStoreFile.cpp, as I >> don't understand the alignment restrictions that his CodingChunkAlloc >> is enforcing, nor how the call to MaxBlockSizeForChunkSize can be >> replaced with a fixed size of 256. > > I will do that tomorrow. No need to review either of these - they're already in 0.09. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Tue Dec 6 00:30:47 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Tue, 6 Dec 2005 00:30:47 +0000 (GMT) Subject: [Box Backup-dev] Win32 port In-Reply-To: References: <8BEF076B-5313-4241-827A-5237EE68B6DC@fluffy.co.uk> <663C956E-A67D-4BE4-8B49-2F04FF2E2790@fluffy.co.uk> Message-ID: Hi all, The original patch (Martin's test tree against 0.08) was actually 8909 lines. I don't know how I got my original 4,700 line figure; perhaps it was wishful thinking ;-) After a mammoth patching session, I've got the diff down to 5682 lines (http://bbdev.fluffy.co.uk/svn/box/chris/win32/11-code-cleanups/ against 0.08). Excluding files newly added, this drops to 1952 lines. I think it's starting to get to the point where we could apply it to the trunk without major conflicts and without including too much unrelated stuff. It's also starting to get to the point where it can be reviewed in about 2 hours, compared to about 8 hours before (hint hint :-) The next major drop would be from dropping the Berkeley DB4 support, if we decide to go ahead with that. Anyway, I hope to complete a trial merge against Martin's autoconf branch tomorrow. Now, after about 14 hours straight coding, I think it's time for me to sleep :-) Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Tue Dec 6 09:59:49 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Tue, 6 Dec 2005 09:59:49 +0000 Subject: [Box Backup-dev] Re: [Box Backup] Win32 port In-Reply-To: References: <8BEF076B-5313-4241-827A-5237EE68B6DC@fluffy.co.uk> <663C956E-A67D-4BE4-8B49-2F04FF2E2790@fluffy.co.uk> Message-ID: <41FC4711-0F1B-40A1-8D8D-EC16EC2070D6@fluffy.co.uk> On 5 Dec 2005, at 22:07, Chris Wilson wrote: > >>> 6. Nick's BackupDaemon.cpp has a separate Windows thread for >>> monitoring >>> the named pipe for bbackupd control. Is this strictly >>> required, or an >>> improvement? My own patch set (for Boxi) does this in a >>> different way - >>> no extra thread is created, but instead the main thread polls >>> the >>> command socket more often. Any suggestions on which approach is >>> preferred? The thread stuff looks harder to make cross-platform >>> compatible. >> >> It's usually best to wait using the OS' provided API, rather than >> to poll. > > Any suggestions on how to use threads in a cross-platform way to > achieve this? I know wxWidgets has a cross-platform thread library, > but it may be a bit too heavyweight a dependency for your taste. In general, we should avoid using threads. It's a bit of a nightmare on many UNIX platforms, especially when you have C++ in the mix. (although this may have changed.) I personally would make sure that my UNIX daemons forked rather than used threads just to avoid any potential portability hassles. So if others agree this is a fair strategy, then threading is only there for Win32. So no need to abstract it. >>> 11. What's the rationale for private distributions? >>> (BOX_PRIVATE_BEGIN) >>> i.e. what code should be protected by such sections? >> >> It's some other stuff I wrote. I didn't write a generic UNIX >> daemon and client set of libraries just to use it on one project. >> It should be pulled out of the distribution. > > Should I assume that nobody except you should be creating > BOX_PRIVATE sections? (not that it matters now, there aren't any > left in the win32 port). Yes, fair assumption. >>> 14. The emulation library provides stubs for lstat and readlink >>> which do >>> nothing, since Windows doesn't have symbolic links. I suggest >>> that we >>> remove these and disable any tests or code that requires >>> them on >>> Win32. Otherwise they may present a hazard for the unwary >>> coder in >>> future. >> >> I would prefer that they threw an exception so that #ifdefs are >> minimised. Although the tests can't get much more ugly. > > If they throw exceptions, then the tests will have to do something > like this: > > #ifdef WIN32 > TEST_CHECK_THROWS(, SomeException, SubType) > #else > TEST_THAT( == 0) > #endif > > Is that better than just #ifndef WIN32 around the call? Well yes and no. I personally would just #ifndef WIN32 it, but maybe I'm being lazy rather than strictly correct. > If so then I'm happy to implement it, if you can tell me what kind > of exception you'd like it to throw. Although I personally prefer > that such code is checked at compile time rather than runtime. Normally I would say a compile time failure would be better. However, those calls should never actually be used in this particular application, so it simply make it easier to code. Common/NotImplementedOnThisPlatform sounds like a nice exception name to me. > > > I'm eagerly awaiting a barrage of criticism for my own misdeeds in > the name of the porting effort. :-) I will have a look as soon as I can. Incidentally, I'm a little concerned about the uncertainty of the starting version for the Win32 code. But I think we're (you're!) going through it carefully enough to make this not a big worry. Looks like it was quite a 14 hour marathon! Ben From boxbackup-dev at fluffy.co.uk Tue Dec 6 10:22:34 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Tue, 06 Dec 2005 10:22:34 +0000 Subject: [Box Backup-dev] Re: [Box Backup] Win32 port In-Reply-To: <41FC4711-0F1B-40A1-8D8D-EC16EC2070D6@fluffy.co.uk> References: <8BEF076B-5313-4241-827A-5237EE68B6DC@fluffy.co.uk> <663C956E-A67D-4BE4-8B49-2F04FF2E2790@fluffy.co.uk> <41FC4711-0F1B-40A1-8D8D-EC16EC2070D6@fluffy.co.uk> Message-ID: <20051206102234.iextq3b9wosk8sw0@ebourne.me.uk> Ben Summers wrote: > In general, we should avoid using threads. It's a bit of a nightmare > on many UNIX platforms, especially when you have C++ in the mix. > (although this may have changed.) I personally would make sure that > my UNIX daemons forked rather than used threads just to avoid any > potential portability hassles. > > So if others agree this is a fair strategy, then threading is only > there for Win32. So no need to abstract it. I feel this is unnecessarily restrictive. On platforms with pthreads (which is most now), they're perfectly alright. While I don't think we should make box require threads for normal operation, it seems entirely reasonable to make use of them if it can provide enhanced functionality on platforms that support them. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Tue Dec 6 10:53:01 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Tue, 6 Dec 2005 10:53:01 +0000 (GMT) Subject: [Box Backup-dev] Re: [Box Backup] Win32 port In-Reply-To: <41FC4711-0F1B-40A1-8D8D-EC16EC2070D6@fluffy.co.uk> References: <8BEF076B-5313-4241-827A-5237EE68B6DC@fluffy.co.uk> <663C956E-A67D-4BE4-8B49-2F04FF2E2790@fluffy.co.uk> <41FC4711-0F1B-40A1-8D8D-EC16EC2070D6@fluffy.co.uk> Message-ID: Hi Ben, On Tue, 6 Dec 2005, Ben Summers wrote: >> > > 6. Nick's BackupDaemon.cpp has a separate Windows thread for >> > > monitoring the named pipe for bbackupd control. [...] >> > > My own patch set (for Boxi) does this in a different way - >> > > no extra thread is created, but instead the main thread polls the >> > > command socket more often. Any suggestions on which approach is >> > > preferred? The thread stuff looks harder to make cross-platform >> > > compatible. >> > >> > It's usually best to wait using the OS' provided API, rather than to >> > poll. >> >> Any suggestions on how to use threads in a cross-platform way to achieve >> this? I know wxWidgets has a cross-platform thread library, but it may be >> a bit too heavyweight a dependency for your taste. > > In general, we should avoid using threads. It's a bit of a nightmare on many > UNIX platforms, especially when you have C++ in the mix. (although this may > have changed.) I personally would make sure that my UNIX daemons forked > rather than used threads just to avoid any potential portability hassles. What I want to do (but not as part of the win32 port :-) is improve responsiveness of the bbackupd on Linux and Windows, the two platforms I care about. I want to be able to stop an in-progress backup, or restart bbackupd, quickly and cleanly. At the moment, I could send it a signal, but I don't trust signals (and I can't find the pid on cygwin yet, probably not on win32 native either). Or I could write to the control socket, but then I have to wait for an age before bbackupd notices. I don't think this can be used to terminate an in-process backup; bbackupd doesn't check the command socket until it's idle again. Nick's written this code which uses a separate thread on Windows to check the command socket all the time. I've written some code that polls the command socket more often during the backup, and doesn't require an extra thread. I'm OK with including the thread on win32, but I'd like a solution that works on Linux and Cygwin as well. Perhaps forking a process to monitor the command socket and send signals to bbackupd? Forking doesn't work on win32, so this would have to be an alternative to the thread above. > Well yes and no. I personally would just #ifndef WIN32 it, but maybe I'm > being lazy rather than strictly correct. Me too, I'd prefer the compiler to check that I don't call something I shouldn't. Unfortunately gcc isn't smart enough to identify unreachable code :-( > Normally I would say a compile time failure would be better. However, those > calls should never actually be used in this particular application, so it > simply make it easier to code. Ok, I'll buy that (and make them throw exceptions) if I can't find any way for them to be called on win32 (outside of the tests). > Incidentally, I'm a little concerned about the uncertainty of the starting > version for the Win32 code. But I think we're (you're!) going through it > carefully enough to make this not a big worry. Looks like it was quite a 14 > hour marathon! Yeah, it was. I've been over the entire patch (8,900 lines) at least three times, and five times for the changes to existing code. I found a load of stuff that Nick had backported from 0.09 and removed it all, so that it doesn't show up in the diff against 0.08 and it should merge OK into 0.09. As far as I know, I've got it all out now. The remaining changes fall into the following categories (roughly in order of decreasing size) * Newly added files * #ifdef WIN32 (new code inside) * #ifdef BERKELY_V4 (which is never compiled: #undef BERKELY_V4) * #ifndef WIN32 (around existing code) * #ifndef BERKELY_V4 (around existing code) * Code formatting and spelling misteaks The only things that might be left over from older versions are the code inside the WIN32 and BERKELY_V4 sections. This will cause a conflict on merge, and I'll do my best to resolve it in favour of the newer code, porting that to Win32 where necessary. The code is actually much easier to review, if you're not too worried about correctness on Win32, since almost all of it is #ifdef WIN32 or BERKELY_V4. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Tue Dec 6 14:43:08 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Tue, 6 Dec 2005 14:43:08 +0000 (GMT) Subject: [Box Backup-dev] Win32 port In-Reply-To: References: <8BEF076B-5313-4241-827A-5237EE68B6DC@fluffy.co.uk> <663C956E-A67D-4BE4-8B49-2F04FF2E2790@fluffy.co.uk> Message-ID: Hi all, > Anyway, I hope to complete a trial merge against Martin's autoconf > branch tomorrow. OK, done. You can find it at: [http://bbdev.fluffy.co.uk/svn/box/chris/win32/merge/01-apply-win32-patch-11/] - Applied win32 patch 11, with some caveats: - DB4 support is broken: - BERKELY_V4 never defined - not sure if DB_HEADER == db_cxx.h - not sure about the win32 headers in lib/common/BoxPlatform.h It compiles on Linux and all tests pass (except for 'Condition [block != b2] failed at testcommon.cpp(142)'). My Thinkpad's power supply blew up on Sunday night (too much compiling, I guess ;-) so I'm temporarily without a Windows environment. I'm getting a new vm running on my desktop box so that I can try compiling on Windows again. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Tue Dec 6 17:36:33 2005 From: boxbackup-dev at fluffy.co.uk (Gary) Date: Tue, 6 Dec 2005 09:36:33 -0800 (PST) Subject: [Box Backup-dev] Re: [Box Backup] Win32 port In-Reply-To: Message-ID: <20051206173633.22739.qmail@web36712.mail.mud.yahoo.com> Chris, > 2. Nick's BackupClientContext.cpp also includes a bunch of > stuff related to maximum diffing time and SSL keepalives > (BackupClientContext::SetMaximumDiffingTime). Is this already > included in someone else's patches (perhaps Gary's?), and > should I consider it part of the Win32 port or break it out? > It's also only enabled on Win32 > if this is important then perhaps we should make it > cross-platform? The stuff you mention is completely independent of the Win32 branch, and is a part of my own mod. It is enabled in Win32 only (and not vanilla 0.9) since Nick was running into the very same problem I did, and we both needed a QFE ;) to make boxbackup usable in our environments. Note that I was unable to find a reliable and cross-platform way to set a timeout for the SLL layer, hence the codebase-invasive interruption of the diffing process, and subsequent execution of a client/server KeepAlive() command (to have some packets move over the SLL link). As to importance... it depends on the environment that you run boxbackup in. For me (large files, slow upload links) is crucial to the point of boxbackup being unusable... Gary __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From boxbackup-dev at fluffy.co.uk Tue Dec 6 17:43:04 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Tue, 6 Dec 2005 17:43:04 +0000 (GMT) Subject: [Box Backup-dev] Re: [Box Backup] Win32 port In-Reply-To: <20051206173633.22739.qmail@web36712.mail.mud.yahoo.com> References: <20051206173633.22739.qmail@web36712.mail.mud.yahoo.com> Message-ID: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1044231485-1169583228-1133890984=:347 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Hi Gary, > The stuff you mention is completely independent of the Win32 branch, > and is a part of my own mod. It is enabled in Win32 only (and not > vanilla 0.9) since Nick was running into the very same problem I did, > and we both needed a QFE ;) to make boxbackup usable in our > environments. Thanks, I did find that out, and unmerged it from the win32 port. Nick made some win32 changes to your code, which I've collected as a small patch, attached. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | ---1044231485-1169583228-1133890984=:347 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=bb-mod-win32.patch Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=bb-mod-win32.patch LS0tIGJiLTAuMDgvYmluL2JiYWNrdXBkL0JhY2t1cENsaWVudENvbnRleHQu Y3BwCTIwMDUtMDQtMjQgMTE6MTQ6NDQuMDAwMDAwMDAwICswMTAwDQorKysg YmItMC4wOC13aW4zMi9iaW4vYmJhY2t1cGQvQmFja3VwQ2xpZW50Q29udGV4 dC5jcHAJMjAwNS0xMi0wNSAxOTo0MzozNS40NjMyMTExMjggKzAwMDANCkBA IC01MCw3ICsxMSwxMSBAQA0KIA0KICNpbmNsdWRlIDxzeXNsb2cuaD4NCiAj aW5jbHVkZSA8c2lnbmFsLmg+DQorI2lmZGVmIFdJTjMyDQorI2luY2x1ZGUg PHRpbWUuaD4NCisjZWxzZQ0KICNpbmNsdWRlIDxzeXMvdGltZS5oPg0KKyNl bmRpZg0KIA0KICNpbmNsdWRlICJCb3hQb3J0c0FuZEZpbGVzLmgiDQogI2lu Y2x1ZGUgIkJveFRpbWUuaCINCkBAIC01NjEsMTEgKzUyNCwxNSBAQA0KIAlB U1NFUlQocFRoaXNDdHhJbnN0ID09IE5VTEwpOw0KIAlBU1NFUlQoc1RpbWVN Z210RXBvY2ggPT0gMCk7DQogDQorI2lmZGVmIFdJTjMyDQorCTo6c2V0VGlt ZXJIYW5kbGVyKFRpbWVyU2lnSGFuZGxlcik7DQorI2Vsc2UNCiAjaWZkZWYg UExBVEZPUk1fQ1lHV0lODQogCTo6c2lnbmFsKFNJR0FMUk0sIFRpbWVyU2ln SGFuZGxlcik7DQogI2Vsc2UNCiAJOjpzaWduYWwoU0lHVlRBTFJNLCBUaW1l clNpZ0hhbmRsZXIpOw0KICNlbmRpZiAvLyBQTEFURk9STV9DWUdXSU4NCisj ZW5kaWYgLy8gV0lOMzINCiANCiAJc3RydWN0IGl0aW1lcnZhbCB0aW1lb3V0 Ow0KIAltZW1zZXQoJnRpbWVvdXQsIDAsIHNpemVvZih0aW1lb3V0KSk7DQot LS0gYmItMC4wOC9saWIvYmFja3VwY2xpZW50L0JhY2t1cFN0b3JlRmlsZURp ZmYuY3BwCTIwMDUtMTItMDUgMTM6NTg6MDYuMDAwMDAwMDAwICswMDAwDQor KysgYmItMC4wOC13aW4zMi9saWIvYmFja3VwY2xpZW50L0JhY2t1cFN0b3Jl RmlsZURpZmYuY3BwCTIwMDUtMTItMDUgMTk6NDM6MzUuNTE3MjAyOTIwICsw MDAwDQpAQCAtMTIsNyArMTIsMTEgQEANCiAjaW5jbHVkZSA8bmV3Pg0KICNp bmNsdWRlIDxtYXA+DQogI2luY2x1ZGUgPHNpZ25hbC5oPg0KKyNpZmRlZiBX SU4zMg0KKyNpbmNsdWRlIDx0aW1lLmg+DQorI2Vsc2UNCiAjaW5jbHVkZSA8 c3lzL3RpbWUuaD4NCisjZW5kaWYNCiANCiAjaW5jbHVkZSAiQmFja3VwU3Rv cmVGaWxlLmgiDQogI2luY2x1ZGUgIkJhY2t1cFN0b3JlRmlsZVdpcmUuaCIN Cg== ---1044231485-1169583228-1133890984=:347-- From boxbackup-dev at fluffy.co.uk Tue Dec 6 18:02:08 2005 From: boxbackup-dev at fluffy.co.uk (Gary) Date: Tue, 6 Dec 2005 10:02:08 -0800 (PST) Subject: [Box Backup-dev] Re: [Box Backup] Win32 port In-Reply-To: Message-ID: <20051206180208.13895.qmail@web36710.mail.mud.yahoo.com> Chris, Ben, Nick, > Nick made some win32 changes to your code, which I've > collected as a small patch, attached. Oh, I see now, so the change pathway would be as follows: 0.9 >> [Nick]: Win32 patches >> 0.9-win32 0.9 >> [Gary]: KeepAlive patches >> 0.9-mod 0.9-win32 >> [Nick]: KeepAlive patches >> 0.9-win32-mod 0.9-win32-mod >> [Nick]: KeepAlive port >> 0.9-win32-mod-2 Considering the nature of 0.9-win32-mod-2 and the overall code, I think it would be best to unmerge the 0.9-win32-mod2 changes completely. The question now is what to do with them. I have to admit here that the 0.9-mod was more of a QFE than a non-codebase intrusive change, but, on the other hand, if you look at the 0.9 MaximumDiffingTime implementation (based on a static flag and signal), it is not too pretty either, since it was not designed with multiple interruption intervals (in other words, multiple diffing process "observers") in mind. I would be sad if the future version of BoxBackup did not include the KeepAlive time/command - it would make the product unusable for me (even with the excellent 0.9-chromi, KeepAlive is still needed for diffing 4GB files, otherwise you diff for only 300 seconds and upload 1GB+ each time over possibly a slow upload link). I think the way to go would be to: 1.) Modify vanilla 0.9 to better structure the observer code. 2.) Re-apply the KeepAlive >>command<< 0.9-mod parts. 3.) Manually add the KeepAlive >>observer<< to the (improved) 0.9 code. This way we would be getting both the KeepAlive command and a clean solution to the observer problem, which I am relatively sure will be needed in the future anyway (think, say, diffing progress notifications every once in a while). Gary __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From boxbackup-dev at fluffy.co.uk Tue Dec 6 23:10:38 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Tue, 06 Dec 2005 23:10:38 +0000 Subject: [Box Backup-dev] Re: [Box Backup] Win32 port In-Reply-To: <20051206180208.13895.qmail@web36710.mail.mud.yahoo.com> References: <20051206180208.13895.qmail@web36710.mail.mud.yahoo.com> Message-ID: <1133910638.28417.4.camel@avenin.ebourne.me.uk> On Tue, 2005-12-06 at 10:02 -0800, Gary wrote: > I would be sad if the future version of BoxBackup did not include the > KeepAlive time/command - it would make the product unusable for me > (even with the excellent 0.9-chromi, KeepAlive is still needed for > diffing 4GB files, otherwise you diff for only 300 seconds and upload > 1GB+ each time over possibly a slow upload link). > > I think the way to go would be to: > > 1.) Modify vanilla 0.9 to better structure the observer code. > 2.) Re-apply the KeepAlive >>command<< 0.9-mod parts. > 3.) Manually add the KeepAlive >>observer<< to the (improved) 0.9 code. I think it's important to get these changes in. But I wouldn't recommend working off vanilla 0.9 for anything now, so many already parallel codepaths we're still trying to merge. Hopefully in a couple of weeks we'll have those collapsed down onto trunk, then would be the time to dive in and code up the proper fix on a branch. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Wed Dec 7 01:36:31 2005 From: boxbackup-dev at fluffy.co.uk (Jonathan Morton) Date: Wed, 7 Dec 2005 01:36:31 +0000 Subject: [Box Backup-dev] Re: [Box Backup] Win32 port In-Reply-To: <1133910638.28417.4.camel@avenin.ebourne.me.uk> References: <20051206180208.13895.qmail@web36710.mail.mud.yahoo.com> <1133910638.28417.4.camel@avenin.ebourne.me.uk> Message-ID: <28478B76-C78C-4305-9265-D3502D9E7942@chromatix.uklinux.net> This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-1-993369044 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed >> I would be sad if the future version of BoxBackup did not include the >> KeepAlive time/command - it would make the product unusable for me >> (even with the excellent 0.9-chromi, KeepAlive is still needed for >> diffing 4GB files, otherwise you diff for only 300 seconds and upload >> 1GB+ each time over possibly a slow upload link). I've mentioned the "right" fix before. It is rather more code- intrusive than my present patch, but avoids the need for keep-alives and also fixes one or two other problems at the same time. But until that goes in, the only way to deal with very large files is to use a faster CPU or insert keep-alives. >> I think the way to go would be to: >> >> 1.) Modify vanilla 0.9 to better structure the observer code. >> 2.) Re-apply the KeepAlive >>command<< 0.9-mod parts. >> 3.) Manually add the KeepAlive >>observer<< to the (improved) 0.9 >> code. > > I think it's important to get these changes in. But I wouldn't > recommend > working off vanilla 0.9 for anything now, so many already parallel > codepaths we're still trying to merge. Hopefully in a couple of weeks > we'll have those collapsed down onto trunk, then would be the time to > dive in and code up the proper fix on a branch. I've cleaned up my code in SVN, so it is probably ready to be merged. -------------------------------------------------------------- from: Jonathan "Chromatix" Morton mail: chromi at chromatix.org.uk website: http://www.chromatix.uklinux.net/ tagline: The key to knowledge is not to rely on people to teach you it. --Apple-Mail-1-993369044 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iEYEARECAAYFAkOWPJ8ACgkQ6xAxI1ofIwrMYwCaA/USrZPaRS9KkxPR1f8QRVLm 6ywAniIkXoYML/CoUGJ0POYV0Eh60NZ6 =ucc9 -----END PGP SIGNATURE----- --Apple-Mail-1-993369044-- From boxbackup-dev at fluffy.co.uk Wed Dec 7 02:15:21 2005 From: boxbackup-dev at fluffy.co.uk (Gary) Date: Tue, 6 Dec 2005 18:15:21 -0800 (PST) Subject: [Box Backup-dev] Re: [Box Backup] Win32 port In-Reply-To: <28478B76-C78C-4305-9265-D3502D9E7942@chromatix.uklinux.net> Message-ID: <20051207021521.8366.qmail@web36703.mail.mud.yahoo.com> Jon, > I've mentioned the "right" fix before. It is rather more code- > intrusive than my present patch, but avoids the need for keep- > alives Ahhhh, that's right, I remember now - to diff and upload at the same time. Yeah, that would do the trick as well, as the SLL link would be active all the time. > I've cleaned up my code in SVN, so it is probably ready to > be merged. Going over the code, I am under the impression that it would actually be way easier to add the KeepAlive to your version (or to the main development trunk), than re-develop your patch for simultaneous diff/upload. Either way works for me, given it makes it into the next BoxBackup version :)... Gary __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From boxbackup-dev at fluffy.co.uk Wed Dec 7 11:12:03 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Wed, 7 Dec 2005 11:12:03 +0000 Subject: [Box Backup-dev] Reviewing code -- help! Message-ID: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> Hi I sat down to start reviewing the code, and I'm now a bit confused. I'm not entirely sure which bits are what, and what should be reviewed. I would help me enormously if the contributors could post a list of svn diff commands which will show the proposed changes in the most easily reviewed way. I should have quite a bit of time today to review it. Much of it is going to be spent installing and compiling Linux then making it do stuff, which is always uncomfortable for *BSD types getting to grips with the myriad versions of kernels and distributions. BTW, am I right in thinking that the aim to get all the Win32 stuff merged into trunk in a way which doesn't break POSIX, but may or may not work properly under Win32. Then fix Win32? Ben From boxbackup-dev at fluffy.co.uk Wed Dec 7 11:44:29 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Wed, 07 Dec 2005 11:44:29 +0000 Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> Message-ID: <1133955869.28417.25.camel@avenin.ebourne.me.uk> On Wed, 2005-12-07 at 11:12 +0000, Ben Summers wrote: > I sat down to start reviewing the code, and I'm now a bit confused. > I'm not entirely sure which bits are what, and what should be reviewed. > > I would help me enormously if the contributors could post a list of > svn diff commands which will show the proposed changes in the most > easily reviewed way. In order I think we have agreed to merge: chromi's optimised diffing: svn diff http://bbdev.fluffy.co.uk/svn/box/trunk http://bbdev.fluffy.co.uk/svn/box/chromi/diffopt My autoconf: svn diff http://bbdev.fluffy.co.uk/svn/box/trunk http://bbdev.fluffy.co.uk/svn/box/martin/autoconf I am planning on reviewing Jonathan's fixes and then merging his branch then my autoconf into trunk this afternoon, unless someone objects. Then all my fixes and Johnathan's will be in, leaving win32 and maybe Gary's stuff. As I understand it the win32 branch to be merged is: svn diff http://bbdev.fluffy.co.uk/svn/box/trunk http://bbdev.fluffy.co.uk/svn/box/chris/win32/11-code-cleanups/ I reviewed this one yesterday, and feel there's still a few things that could be improved before merging it. However, I was generally impressed with it, seems to be getting pretty close. The biggest issue I had with the win32 patch was a whole load of #ifdefs for (s)printf. This is really an issue with the box code - we really need to convert from printf to streams because printf is a portability disaster. I'm not sure at which stage it would be best to do this, maybe after the win32 merge. There were a few other minor points, but I don't have the list to hand. After this the outstanding patches I'm aware of are: Gary's various fixes: - maxdiffingtime - keepalive - decrypting filenames for compare Nick's non-win32 changes: - adding -i to bbackupquery - change to BackupClientRestore's handling when a file already exists I don't believe any of those really exist on a branch in svn in a way suitable for merging. Apologies to anyone I've mis-attributed or forgotten anything. And please correct any mistakes I've made. > BTW, am I right in thinking that the aim to get all the Win32 stuff > merged into trunk in a way which doesn't break POSIX, but may or may > not work properly under Win32. Then fix Win32? This is one for Chris, but I'd be happy with that plan. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Wed Dec 7 12:19:44 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Wed, 07 Dec 2005 12:19:44 +0000 Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: <1133955869.28417.25.camel@avenin.ebourne.me.uk> References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> Message-ID: <1133957984.32364.10.camel@avenin.ebourne.me.uk> Sorry, those diff commands are rubbish - I'd forgotten there's stuff already merged on trunk, so these diffs end up with those changes reversed. Use the following ones below: chromi's optimised diffing: svn diff -r1:HEAD http://bbdev.fluffy.co.uk/svn/box/chromi/diffopt My autoconf: svn diff -r11:HEAD http://bbdev.fluffy.co.uk/svn/box/martin/autoconf As I understand it the win32 branch to be merged is: svn diff http://bbdev.fluffy.co.uk/svn/box/chris/win32/merge/00-martins-original-autoconf http://bbdev.fluffy.co.uk/svn/box/chris/win32/merge/01-apply-win32-patch-11/ Chris also has subsequent compile fixes for cygwin and mingw in merge/02-compile-on-cygwin merge/03-compile-with-mingw-on-win32 Cheers, Martin. From boxbackup-dev at fluffy.co.uk Wed Dec 7 12:39:59 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Wed, 7 Dec 2005 12:39:59 +0000 (GMT) Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> Message-ID: Hi Ben, > I sat down to start reviewing the code, and I'm now a bit confused. I'm not > entirely sure which bits are what, and what should be reviewed. > > I would help me enormously if the contributors could post a list of svn diff > commands which will show the proposed changes in the most easily reviewed > way. Martin beat me to it :-) > I should have quite a bit of time today to review it. Much of it is going to > be spent installing and compiling Linux then making it do stuff, which is > always uncomfortable for *BSD types getting to grips with the myriad versions > of kernels and distributions. I'd recommend a default install of Fedora Core 4. It's easy and Box should work out of the box - if ti doesn't, then it needs to be fixed. However, I'm developing on Fedora Core 2. > BTW, am I right in thinking that the aim to get all the Win32 stuff merged > into trunk in a way which doesn't break POSIX, but may or may not work > properly under Win32. Then fix Win32? I'd be very happy with that plan. My 02-compile-on-cygwin branch [http://bbdev.fluffy.co.uk/svn/box/chris/win32/merge/02-compile-on-cygwin/] should compile on any *nix as far as I know. For diffs, compare with [http://bbdev.fluffy.co.uk/svn/box/chris/win32/merge/00-martins-original-autoconf/] Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Wed Dec 7 12:48:19 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Wed, 7 Dec 2005 12:48:19 +0000 (GMT) Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: <1133955869.28417.25.camel@avenin.ebourne.me.uk> References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> Message-ID: Hi all, > svn diff http://bbdev.fluffy.co.uk/svn/box/trunk http://bbdev.fluffy.co.uk/svn/box/martin/autoconf > > I am planning on reviewing Jonathan's fixes and then merging his branch > then my autoconf into trunk this afternoon, unless someone objects. Fine by me. Please let me know when you're done, and I'll create a new win32 merge branch based off your new code. > As I understand it the win32 branch to be merged is: > > svn diff http://bbdev.fluffy.co.uk/svn/box/trunk > http://bbdev.fluffy.co.uk/svn/box/chris/win32/11-code-cleanups/ As you pointed out in your next email, this is not a good idea - it undoes all changes in the trunk since 0.08. If you want the raw win32 patch for 0.08, then run: svn diff http://bbdev.fluffy.co.uk/svn/box/chris/win32/0-bens-original-0.08/ http://bbdev.fluffy.co.uk/svn/box/chris/win32/11-code-cleanups/ This is the patch for win32 without the other stuff (although it does still include BERKELY_V4), against 0.08. It's what I merged onto the trunk, resulting in [http://bbdev.fluffy.co.uk/svn/box/chris/win32/merge/01-apply-win32-patch-11/] > I reviewed this one yesterday, and feel there's still a few things that > could be improved before merging it. However, I was generally impressed > with it, seems to be getting pretty close. Thanks :-) Please do send any comments - feel free to drop me a private email for any small comment or question as it comes to mind, if you don't want to bother the list. > The biggest issue I had with the win32 patch was a whole load of #ifdefs > for (s)printf. This is really an issue with the box code - we really > need to convert from printf to streams because printf is a portability > disaster. I'm not sure at which stage it would be best to do this, maybe > after the win32 merge. I'd go with that too. > Nick's non-win32 changes: > - adding -i to bbackupquery > - change to BackupClientRestore's handling when a file already exists I think these are already in the trunk. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Wed Dec 7 13:59:48 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Wed, 07 Dec 2005 13:59:48 +0000 Subject: [Box Backup-dev] Re: [Box Backup] Win32 port In-Reply-To: <28478B76-C78C-4305-9265-D3502D9E7942@chromatix.uklinux.net> References: <20051206180208.13895.qmail@web36710.mail.mud.yahoo.com> <1133910638.28417.4.camel@avenin.ebourne.me.uk> <28478B76-C78C-4305-9265-D3502D9E7942@chromatix.uklinux.net> Message-ID: <1133963989.32364.16.camel@avenin.ebourne.me.uk> On Wed, 2005-12-07 at 01:36 +0000, Jonathan Morton wrote: > I've cleaned up my code in SVN, so it is probably ready to be merged. Just had a look at this. The const is all fixed now, but the incorrect use of goto is still there. Guess it's up to Ben whether he wants to merge it now so that can be fixed later, or hold off until that is fixed as well. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Wed Dec 7 15:56:51 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Wed, 7 Dec 2005 15:56:51 +0000 Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: <1133957984.32364.10.camel@avenin.ebourne.me.uk> References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> Message-ID: <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> On 7 Dec 2005, at 12:19, Martin Ebourne wrote: > Sorry, those diff commands are rubbish - I'd forgotten there's stuff > already merged on trunk, so these diffs end up with those changes > reversed. Use the following ones below: > > chromi's optimised diffing: > > svn diff -r1:HEAD http://bbdev.fluffy.co.uk/svn/box/chromi/diffopt That can be merged. The controversial use of goto isn't too bad in this case, but let's address that later after we've got all the code in truck. > > My autoconf: > > svn diff -r11:HEAD http://bbdev.fluffy.co.uk/svn/box/martin/autoconf That's good to go too. > > As I understand it the win32 branch to be merged is: > > svn diff http://bbdev.fluffy.co.uk/svn/box/chris/win32/merge/00- > martins-original-autoconf http://bbdev.fluffy.co.uk/svn/box/chris/ > win32/merge/01-apply-win32-patch-11/ WinNamedPipe should be an IOStream derived class, then use IOStreamGetLine not PipeGetLine. WinNamedPipe::Write may not work in edge cases where it doesn't write all the bytes given. The .bat, config and installer files should not be in lib/win32 as they're not generic win32 stuff. I suggest bin/bbackupd/win32 If any code is copied and pasted from sources, can there be a note of where it came from? I know Nick did it from some BSD licensed code, though. Not keen on the global and member function names beginning with lower case letters (and other style "violations"). But really, I think it better to get it in the tree and fix it up later, rather than delay any longer. But it would be nice if the first three could be address beforehand. > > Chris also has subsequent compile fixes for cygwin and mingw in > merge/02-compile-on-cygwin svn diff http://bbdev.fluffy.co.uk/svn/box/chris/win32/merge/01-apply- win32-patch-11/ http://bbdev.fluffy.co.uk/svn/box/chris/win32/merge/ 02-compile-on-cygwin/ this change: -AX_CHECK_MOUNT_POINT(, [AC_MSG_ERROR([[cannot work out how to discover mount points on your platform]])]) +AX_CHECK_MOUNT_POINT([],[]) I'm not an autoconf sort of person, but that looks worrying to me? But otherwise there's only minor things. > merge/03-compile-with-mingw-on-win32 svn diff http://bbdev.fluffy.co.uk/svn/box/chris/win32/merge/02- compile-on-cygwin/ http://bbdev.fluffy.co.uk/svn/box/chris/win32/ merge/03-compile-with-mingw-on-win32/ I'm not convinced about this one, mainly because it has a load of GPL code in there. The other changes seem minor though. Does everyone else agree with these? If so, can Martin (seeing as he's good at SVN and I'm afraid of merging) merge chromi/diffopt and martin/autoconf into trunk? Thanks! Ben From boxbackup-dev at fluffy.co.uk Wed Dec 7 15:57:34 2005 From: boxbackup-dev at fluffy.co.uk (Gary) Date: Wed, 7 Dec 2005 07:57:34 -0800 (PST) Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: <1133955869.28417.25.camel@avenin.ebourne.me.uk> Message-ID: <20051207155734.56568.qmail@web36703.mail.mud.yahoo.com> Martin, > Gary's various fixes: > - maxdiffingtime > - keepalive ... and StoreObjectInfoFile. All of them optional. > - decrypting filenames for compare No, this one is, I think, Nick's. > I don't believe any of those really exist on a branch in svn > in a way suitable for merging. I am not sure if all of those changes (and in what form) and going into BoxBackup, so I did not setup a branch yet. Gary __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From boxbackup-dev at fluffy.co.uk Wed Dec 7 16:03:37 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Wed, 7 Dec 2005 16:03:37 +0000 Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: <20051207155734.56568.qmail@web36703.mail.mud.yahoo.com> References: <20051207155734.56568.qmail@web36703.mail.mud.yahoo.com> Message-ID: <6D726947-0BD7-42EC-92BB-E9DD1FD9E57C@fluffy.co.uk> On 7 Dec 2005, at 15:57, Gary wrote: > Martin, > >> Gary's various fixes: >> - maxdiffingtime >> - keepalive > > ... and StoreObjectInfoFile. All of them optional. > >> - decrypting filenames for compare > > No, this one is, I think, Nick's. I believe that was resolved anyway, and we're just putting it in. > >> I don't believe any of those really exist on a branch in svn >> in a way suitable for merging. > > I am not sure if all of those changes (and in what form) and going > into > BoxBackup, so I did not setup a branch yet. If the first three can be easily got into a form where the changes can be shown with a simple diff, then they'd all be very useful to have. Especially StoreObjectInfoFile. However, whether or not it's best to wait until trunk has settled down is another question. Ben From boxbackup-dev at fluffy.co.uk Wed Dec 7 16:13:53 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Wed, 7 Dec 2005 16:13:53 +0000 (GMT) Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> Message-ID: Hi Ben, > The controversial use of goto isn't too bad in this case, but let's address > that later after we've got all the code in truck. But whose truck? :-) > WinNamedPipe should be an IOStream derived class, then use IOStreamGetLine > not PipeGetLine. > > WinNamedPipe::Write may not work in edge cases where it doesn't write all the > bytes given. OK, will do as soon as I can. > The .bat, config and installer files should not be in lib/win32 as they're > not generic win32 stuff. I suggest bin/bbackupd/win32 Sure, that should be easy. Although people might not find it easily down there. Perhaps docs/win32? > If any code is copied and pasted from sources, can there be a note of where > it came from? I know Nick did it from some BSD licensed code, though. I always do this - the only things I can think of are the customised m4 templates (where I left the original copyright notice in) and TemporaryDirectory, where I provided a link to the MSDN article that it came from. > Not keen on the global and member function names beginning with lower case > letters (and other style "violations"). Lower case members should go away when WinNamedPipe and PipeGetLine are merged with the Unix versions, SocketStream and IOStreamGetLine. Lower case global functions - do you mean the emulated ones? If so, should I make them CamelCase and #define the originals to the replacements? > But really, I think it better to get it in the tree and fix it up later, > rather than delay any longer. But it would be nice if the first three > could be address beforehand. I'll do my best. I'm really pleased that people have been generally positive about getting the port merged sooner rather than later. > this change: > > -AX_CHECK_MOUNT_POINT(, [AC_MSG_ERROR([[cannot work out how to discover mount > points on your platform]])]) > +AX_CHECK_MOUNT_POINT([],[]) > > I'm not an autoconf sort of person, but that looks worrying to me? But > otherwise there's only minor things. If you mean the fact that I disabled the fatal error - Win32 has no mount points, as far as I know, so if autoconf bombs out then you can't build. I couldn't see an easy way at the time to disable this check just for Win32, although I'm learning and I have some ideas now. If you mean the empty strings [], then I don't know. I thought it looked better than entirely missing arguments. However, I don't know much about Autoconf's quoting rules, perhaps someone can correct me. > svn diff http://bbdev.fluffy.co.uk/svn/box/chris/win32/merge/02- > compile-on-cygwin/ http://bbdev.fluffy.co.uk/svn/box/chris/win32/ > merge/03-compile-with-mingw-on-win32/ > > I'm not convinced about this one, mainly because it has a load of GPL > code in there. The other changes seem minor though. The GPL code being [config.guess], [config.sub] and [infrastructure/m4/ax_check_libs_prototype.m4]? [config.guess] and [config.sub] are from Automake 1.8. They are needed to guess the platform type. If we don't include them ourselves then we'll have to find a way to copy them from the user's automake installation, or rewrite them from scratch. [infrastructure/m4/ax_check_libs_prototype.m4] is needed to detect functions on Win32. I could just make the test that calls nanosleep call Sleep instead on WIN32, and remove this. Since these are quite small blocks of code, perhaps we can apply to the authors for a license exemption? Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Wed Dec 7 16:18:49 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Wed, 7 Dec 2005 16:18:49 +0000 (GMT) Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: <6D726947-0BD7-42EC-92BB-E9DD1FD9E57C@fluffy.co.uk> References: <20051207155734.56568.qmail@web36703.mail.mud.yahoo.com> <6D726947-0BD7-42EC-92BB-E9DD1FD9E57C@fluffy.co.uk> Message-ID: Hi Ben, >> > - decrypting filenames for compare > > I believe that was resolved anyway, and we're just putting it in. Do you mean this one? svn diff 'http://bbdev.fluffy.co.uk/svn/box/chris/win32/4-removed-decrypt-filenames/' 'http://bbdev.fluffy.co.uk/svn/box/chris/win32/3-removed-garys-patch/' It isn't in my merged branch, but I can easily merge it if you want. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Wed Dec 7 16:24:05 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Wed, 7 Dec 2005 16:24:05 +0000 Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> Message-ID: <9E4EE16C-FF57-4E56-80B3-8F05119BCBF7@fluffy.co.uk> On 7 Dec 2005, at 16:13, Chris Wilson wrote: > >> WinNamedPipe should be an IOStream derived class, then use >> IOStreamGetLine not PipeGetLine. >> >> WinNamedPipe::Write may not work in edge cases where it doesn't >> write all the bytes given. > > OK, will do as soon as I can. Thanks. > >> The .bat, config and installer files should not be in lib/win32 as >> they're not generic win32 stuff. I suggest bin/bbackupd/win32 > > Sure, that should be easy. Although people might not find it easily > down there. Perhaps docs/win32? They're not really documents either. Surely the build system will be packaging them up? Perhaps they could be included in the parcel making script? > >> If any code is copied and pasted from sources, can there be a note >> of where it came from? I know Nick did it from some BSD licensed >> code, though. > > I always do this - the only things I can think of are the > customised m4 templates (where I left the original copyright notice > in) and TemporaryDirectory, where I provided a link to the MSDN > article that it came from. I think some of the structure definitions in emu.h must have come from somewhere. > >> Not keen on the global and member function names beginning with >> lower case letters (and other style "violations"). > > Lower case members should go away when WinNamedPipe and PipeGetLine > are merged with the Unix versions, SocketStream and IOStreamGetLine. Yes. > > Lower case global functions - do you mean the emulated ones? No, obviously those are fine. > If so, should I make them CamelCase and #define the originals to > the replacements? I think this was in the threading code. Maybe I was imagining it, there's a lot there. > >> But really, I think it better to get it in the tree and fix it up >> later, rather than delay any longer. But it would be nice if the >> first three could be address beforehand. > > I'll do my best. I'm really pleased that people have been generally > positive about getting the port merged sooner rather than later. As long as it only breaks Win32, not POSIX... :-) > >> this change: >> >> -AX_CHECK_MOUNT_POINT(, [AC_MSG_ERROR([[cannot work out how to >> discover mount points on your platform]])]) >> +AX_CHECK_MOUNT_POINT([],[]) >> >> I'm not an autoconf sort of person, but that looks worrying to me? >> But otherwise there's only minor things. > > If you mean the fact that I disabled the fatal error - Win32 has no > mount points, as far as I know, so if autoconf bombs out then you > can't build. But doesn't that break other platforms? > > I couldn't see an easy way at the time to disable this check just > for Win32, although I'm learning and I have some ideas now. > > If you mean the empty strings [], then I don't know. I thought it > looked better than entirely missing arguments. However, I don't > know much about Autoconf's quoting rules, perhaps someone can > correct me. I hope Martin will come up with the answer. > >> svn diff http://bbdev.fluffy.co.uk/svn/box/chris/win32/merge/02- >> compile-on-cygwin/ http://bbdev.fluffy.co.uk/svn/box/chris/win32/ >> merge/03-compile-with-mingw-on-win32/ >> >> I'm not convinced about this one, mainly because it has a load of >> GPL code in there. The other changes seem minor though. > > The GPL code being [config.guess], [config.sub] and [infrastructure/ > m4/ax_check_libs_prototype.m4]? > > [config.guess] and [config.sub] are from Automake 1.8. They are > needed to guess the platform type. If we don't include them > ourselves then we'll have to find a way to copy them from the > user's automake installation, or rewrite them from scratch. If they're part of the base install, surely you don't need to include a copy in the project? > > [infrastructure/m4/ax_check_libs_prototype.m4] is needed to detect > functions on Win32. I could just make the test that calls nanosleep > call Sleep instead on WIN32, and remove this. Sounds sensible. > > Since these are quite small blocks of code, perhaps we can apply to > the authors for a license exemption? I think Martin will come up with a good plan. (I hope.) Ben From boxbackup-dev at fluffy.co.uk Wed Dec 7 16:25:36 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Wed, 7 Dec 2005 16:25:36 +0000 Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: References: <20051207155734.56568.qmail@web36703.mail.mud.yahoo.com> <6D726947-0BD7-42EC-92BB-E9DD1FD9E57C@fluffy.co.uk> Message-ID: On 7 Dec 2005, at 16:18, Chris Wilson wrote: > Hi Ben, > >>> > - decrypting filenames for compare >> >> I believe that was resolved anyway, and we're just putting it in. > > Do you mean this one? > > svn diff 'http://bbdev.fluffy.co.uk/svn/box/chris/win32/4-removed- > decrypt-filenames/' 'http://bbdev.fluffy.co.uk/svn/box/chris/ > win32/3-removed-garys-patch/' > > It isn't in my merged branch, but I can easily merge it if you want. Just remind me, why is that necessary? Ben From boxbackup-dev at fluffy.co.uk Wed Dec 7 16:33:07 2005 From: boxbackup-dev at fluffy.co.uk (Charles Lecklider) Date: Wed, 07 Dec 2005 16:33:07 +0000 Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> Message-ID: <43970EC3.6050802@invis.net> Chris Wilson wrote: > .... Win32 has no mount points, as far as I know Yes it does: http://support.microsoft.com/kb/205524/EN-US/ At some point they'll have to be dealt with, but I think they can safely be ignored for now. -C From boxbackup-dev at fluffy.co.uk Wed Dec 7 16:41:41 2005 From: boxbackup-dev at fluffy.co.uk (Gary) Date: Wed, 7 Dec 2005 08:41:41 -0800 (PST) Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: <6D726947-0BD7-42EC-92BB-E9DD1FD9E57C@fluffy.co.uk> Message-ID: <20051207164141.54916.qmail@web36701.mail.mud.yahoo.com> Ben, > If the first three can be easily got into a form where the > changes can be shown with a simple diff, then they'd all be > very useful to have. Especially StoreObjectInfoFile. I think there is an SVN path with my 0.9-mod changes already, so I will not complicate matters further (for now) by creating yet another branch. Let's wait for the trunk to settle, decide the fate of StoreObjectInfoFile, Unlimited MaximumDiffingTime, and KeepAliveTime (the "observer problem" for the diffing process vs. 0.9-chromi simultaneous diff and upload), and I can then re-add my changes from the new trunk. Let me know if you need a diff off 0.9 for any of my stuff, or perhaps any code rework (I was going to take off operator overloading stuff from StoreObjectInfoFile, etc.) Gary __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From boxbackup-dev at fluffy.co.uk Wed Dec 7 16:45:21 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Wed, 7 Dec 2005 16:45:21 +0000 Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: <20051207164141.54916.qmail@web36701.mail.mud.yahoo.com> References: <20051207164141.54916.qmail@web36701.mail.mud.yahoo.com> Message-ID: On 7 Dec 2005, at 16:41, Gary wrote: > Ben, > >> If the first three can be easily got into a form where the >> changes can be shown with a simple diff, then they'd all be >> very useful to have. Especially StoreObjectInfoFile. > > I think there is an SVN path with my 0.9-mod changes already, so I > will > not complicate matters further (for now) by creating yet another > branch. > > Let's wait for the trunk to settle, decide the fate of > StoreObjectInfoFile, Unlimited MaximumDiffingTime, and KeepAliveTime > (the "observer problem" for the diffing process vs. 0.9-chromi > simultaneous diff and upload), and I can then re-add my changes from > the new trunk. OK, let's wait for that. > > > Let me know if you need a diff off 0.9 for any of my stuff, I think it's best to work through SVN rather than patches. > or perhaps > any code rework (I was going to take off operator overloading stuff > from StoreObjectInfoFile, etc.) That would be nice! :-) Thanks. Ben From boxbackup-dev at fluffy.co.uk Wed Dec 7 16:51:35 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Wed, 7 Dec 2005 16:51:35 +0000 (GMT) Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: References: <20051207155734.56568.qmail@web36703.mail.mud.yahoo.com> <6D726947-0BD7-42EC-92BB-E9DD1FD9E57C@fluffy.co.uk> Message-ID: Hi Ben, >> svn diff 'http://bbdev.fluffy.co.uk/svn/box/chris/win32/4-removed- >> decrypt-filenames/' 'http://bbdev.fluffy.co.uk/svn/box/chris/ >> win32/3-removed-garys-patch/' >> >> It isn't in my merged branch, but I can easily merge it if you want. > > Just remind me, why is that necessary? It's not what I thought it was at all. And it's already in the trunk. Sorry. Was there another filename encryption patch you were thinking of? Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Wed Dec 7 17:09:45 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Wed, 07 Dec 2005 17:09:45 +0000 Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: References: <20051207155734.56568.qmail@web36703.mail.mud.yahoo.com> <6D726947-0BD7-42EC-92BB-E9DD1FD9E57C@fluffy.co.uk> Message-ID: <1133975385.1259.1.camel@avenin.ebourne.me.uk> On Wed, 2005-12-07 at 16:51 +0000, Chris Wilson wrote: > Hi Ben, > > >> svn diff 'http://bbdev.fluffy.co.uk/svn/box/chris/win32/4-removed- > >> decrypt-filenames/' 'http://bbdev.fluffy.co.uk/svn/box/chris/ > >> win32/3-removed-garys-patch/' > >> > >> It isn't in my merged branch, but I can easily merge it if you want. > > > > Just remind me, why is that necessary? > > It's not what I thought it was at all. And it's already in the trunk. > Sorry. > > Was there another filename encryption patch you were thinking of? I think I may have started the confusion here. I think I listed that in my 'outstanding patches' email, not realising it was already in trunk, sorry. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Wed Dec 7 17:11:51 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Wed, 7 Dec 2005 17:11:51 +0000 (GMT) Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: <1133975385.1259.1.camel@avenin.ebourne.me.uk> References: <20051207155734.56568.qmail@web36703.mail.mud.yahoo.com> <6D726947-0BD7-42EC-92BB-E9DD1FD9E57C@fluffy.co.uk> <1133975385.1259.1.camel@avenin.ebourne.me.uk> Message-ID: Hi Martin, > I think I may have started the confusion here. I think I listed that in > my 'outstanding patches' email, not realising it was already in trunk, > sorry. I think it was partly my fault, it was in my list of outstanding questions, but I can't find the code I was referring to at all, so I think I must have imagined it. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Wed Dec 7 17:44:32 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Wed, 07 Dec 2005 17:44:32 +0000 Subject: trunk is now autoconf'd (was Re: [Box Backup-dev] Reviewing code -- help!) In-Reply-To: <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> Message-ID: <1133977472.1352.14.camel@avenin.ebourne.me.uk> On Wed, 2005-12-07 at 15:56 +0000, Ben Summers wrote: > If so, can Martin (seeing as he's good at SVN and I'm afraid of > merging) merge chromi/diffopt and martin/autoconf into trunk? Done. There's nothing magic about this, honest! This is a full list of svn commands I typed to do the two merges (you'll see they look a lot like the diff commands we used before): svn merge -r1:116 chromi/diffopt trunk svn ci -m "Merged chromi/diffopt at r116 to trunk" svn merge -r11:35 martin/autoconf trunk svn ci -m "Merged martin/autoconf at r35 to trunk" I did a bit of checking diffs etc before checking in, but that covers the full merge. trunk is now fully autoconf'd. In order to compile it from now on, you need the following installed: autoconf automake (for aclocal, autoheader) The commands you need to type are: ./bootstrap ./configure Then use make in the normal way. If you want to link in GNU readline (eg. on Linux), you'll need to use: ./configure --enable-gnu-readline But beware if you do this, you can't distribute the binaries because it will violate the licence conditions on readline. When it comes to making a tarball release the process is just to run ./bootstrap before tarring up. This makes all the generated configure related files so the user just needs to do ./configure && make in the normal way. I need to add some documentation about this at some point. Note that once ./bootstrap is run there is no further use of autoconf or automake, so normal installers do not need these. Some projects check these generated file in so people can check out svn and run it without needing autoconf installed. I'm not convinced on the merits of this, but am open to discussion etc. Just run the merged trunk through the tests. raidfile has failed entirely. Have to look into why. Everyone please test trunk now, especially on any unusual platforms you can, there's bound to be some more autoconf fixes needed. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Wed Dec 7 17:58:08 2005 From: boxbackup-dev at fluffy.co.uk (Charles Lecklider) Date: Wed, 07 Dec 2005 17:58:08 +0000 Subject: trunk is now autoconf'd (was Re: [Box Backup-dev] Reviewing code -- help!) In-Reply-To: <1133977472.1352.14.camel@avenin.ebourne.me.uk> References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> <1133977472.1352.14.camel@avenin.ebourne.me.uk> Message-ID: <439722B0.1000707@invis.net> Martin Ebourne wrote: > Some projects check these generated file in so people can check out > svn and run it without needing autoconf installed. I'm not convinced > on the merits of this, but am open to discussion etc. This is essential for Win32. -C From boxbackup-dev at fluffy.co.uk Wed Dec 7 18:18:23 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Wed, 07 Dec 2005 18:18:23 +0000 Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: <9E4EE16C-FF57-4E56-80B3-8F05119BCBF7@fluffy.co.uk> References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> <9E4EE16C-FF57-4E56-80B3-8F05119BCBF7@fluffy.co.uk> Message-ID: <1133979503.1352.33.camel@avenin.ebourne.me.uk> On Wed, 2005-12-07 at 16:24 +0000, Ben Summers wrote: > >> -AX_CHECK_MOUNT_POINT(, [AC_MSG_ERROR([[cannot work out how to > >> discover mount points on your platform]])]) > >> +AX_CHECK_MOUNT_POINT([],[]) > >> > >> I'm not an autoconf sort of person, but that looks worrying to me? > >> But otherwise there's only minor things. > > > > If you mean the fact that I disabled the fatal error - Win32 has no > > mount points, as far as I know, so if autoconf bombs out then you > > can't build. > > But doesn't that break other platforms? Only platforms for which the mount point checking fails, essentially Chris has removed an assert. Clearly not the right change long term, but perfectly fine as a quick hack for him to compile on windows. We'll need to work out how mount points do work on windows at some point, but we can add a better autoconf workaround in the meantime. > > If you mean the empty strings [], then I don't know. I thought it > > looked better than entirely missing arguments. However, I don't > > know much about Autoconf's quoting rules, perhaps someone can > > correct me. Makes no difference. I prefer to leave them out myself, find there's more than enough square brackets in this M4 stuff anyway. > > [config.guess] and [config.sub] are from Automake 1.8. They are > > needed to guess the platform type. If we don't include them > > ourselves then we'll have to find a way to copy them from the > > user's automake installation, or rewrite them from scratch. > > If they're part of the base install, surely you don't need to include > a copy in the project? There should be no need to check these files in. Probably they should be copied into place by running ./bootstrap. I'll look into fixing that. > > [infrastructure/m4/ax_check_libs_prototype.m4] is needed to detect > > functions on Win32. I could just make the test that calls nanosleep > > call Sleep instead on WIN32, and remove this. > > Sounds sensible. > > > Since these are quite small blocks of code, perhaps we can apply to > > the authors for a license exemption? > > I think Martin will come up with a good plan. (I hope.) There's no problem with either of these. Although the GPL is 'viral', people make much more out of this than they should. What the 'viral' means is that if you link your code against GPL code and then distribute it, you have to make your code available under the GPL too. That does not apply here. These autoconf scripts are being used as tools to manufacture build scripts. In addition they have what is called the 'autoconf exception', which means that any chunks of them that appear in ./configure due to expansion by autoconf do not come under the GPL. This puts it much more on the same footing as flex/bison, and other tools which generate files & include boilerplate code. They are entirely safe to use because there is no GPL violation caused by using them in this way. What does apply is that Chris has made modifications to the AC_SEARCH_LIBS function. Since that is GPL (with autoconf exception), the changes he has made to that file itself have to be released under the GPL. As far as I can see, he's already done that by checking it in to svn. What is less clear is why the file is called ax_check_libs_prototype but the function it defines is called AC_SEARCH_LIBS_PROTO! Cheers, Martin. From boxbackup-dev at fluffy.co.uk Thu Dec 8 08:52:02 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Thu, 08 Dec 2005 08:52:02 +0000 Subject: [Box Backup-dev] Commit emails Message-ID: <1134031922.2815.8.camel@avenin.ebourne.me.uk> Ben, I think it would be a good idea to set up svn to send commit emails to this list. Help people keep on top of what is happening as we go forwards, and help encourage peer review. Should be pretty easy. An example script comes with svn and on fedora is located here: /usr/share/doc/subversion-1.2.3/tools/hook-scripts/commit-email.pl In the 'hooks' subdirectory in the repository location there should be a post-commit.tmpl file. This needs renaming to 'post-commit', making sure it is executable, and editing to give the right options to commit-email.pl (with path). There are also a couple of options which may want changing at the top of commit-email.pl itself. If you only wanted to send emails for trunk commits and not branches then you can do that with the -m option to commit-email.pl. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Thu Dec 8 17:41:53 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Thu, 8 Dec 2005 17:41:53 +0000 (GMT) Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: <9E4EE16C-FF57-4E56-80B3-8F05119BCBF7@fluffy.co.uk> References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> <9E4EE16C-FF57-4E56-80B3-8F05119BCBF7@fluffy.co.uk> Message-ID: Hi Ben, >> > WinNamedPipe should be an IOStream derived class, then use >> > IOStreamGetLine not PipeGetLine. Now done. At least, it compiles with MinGW, not tested yet (and still compiles on Linux). >> > WinNamedPipe::Write may not work in edge cases where it doesn't write >> > all the bytes given. According to MSDN, if I read it correctly, WriteFile will not do partial writes, but block until it's written everything (or an error occurs). There's no way to get the number of bytes written back from it. [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/writefile.asp] >> > The .bat, config and installer files should not be in lib/win32 as >> > they're not generic win32 stuff. I suggest bin/bbackupd/win32 Ok, done. > They're not really documents either. Surely the build system will be > packaging them up? Perhaps they could be included in the parcel making > script? Done as well, with some small changes to makeparcels.pl to allow including files ONLY on some platforms. > I think some of the structure definitions in emu.h must have come from > somewhere. Sorry, not my department. You need to go to Information Retrieval. >> > Not keen on the global and member function names beginning with lower >> > case letters (and other style "violations"). OK, I think I've taken care of the thread method in BackupDaemon and the WinNamedPipe (now called WinNamedPipeStream). > I think this was in the threading code. Maybe I was imagining it, there's a > lot there. There were quite a few global functions and variables in emu.cpp, bbwinservice.cpp and ServiceBackupDaemon.cpp with such names. I've fixed all of those that I can see and which I don't think are emulations of system library functions. I don't know of any others, but please point them out if you want me to fix them. >> > -AX_CHECK_MOUNT_POINT(, [AC_MSG_ERROR([[cannot work out how to discover >> > mount points on your platform]])]) >> > +AX_CHECK_MOUNT_POINT([],[]) >> > >> > I'm not an autoconf sort of person, but that looks worrying to me? But >> > otherwise there's only minor things. >> >> If you mean the fact that I disabled the fatal error - Win32 has no mount >> points, as far as I know, so if autoconf bombs out then you can't build. > > But doesn't that break other platforms? As Martin pointed out, all it means (I think) is that Box now configures on platforms where statfs does not return a f_mntonname. With the latest changes in 06-code-cleanups, Win32 now uses Nick's statfs function again, and platforms without f_mntonname will try to work it out from mtab. >> I couldn't see an easy way at the time to disable this check just for >> Win32, although I'm learning and I have some ideas now. >> >> If you mean the empty strings [], then I don't know. I thought it looked >> better than entirely missing arguments. However, I don't know much about >> Autoconf's quoting rules, perhaps someone can correct me. > > I hope Martin will come up with the answer. I've disabled the check and removed the GPL code from SVN. Now I just don't even check for nanosleep on Win32, as we never call it or even compile the code that uses it. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Thu Dec 8 17:55:50 2005 From: boxbackup-dev at fluffy.co.uk (Charles Lecklider) Date: Thu, 08 Dec 2005 17:55:50 +0000 Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> <9E4EE16C-FF57-4E56-80B3-8F05119BCBF7@fluffy.co.uk> Message-ID: <439873A6.5020009@invis.net> Chris Wilson wrote: >>> > WinNamedPipe::Write may not work in edge cases where it doesn't >>> write > all the bytes given. > > According to MSDN, if I read it correctly, WriteFile will not do partial > writes, but block until it's written everything (or an error occurs). > There's no way to get the number of bytes written back from it. > > [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/writefile.asp] lpNumberOfBytesWritten [out] Pointer to the variable that receives the number of bytes written. WriteFile sets this value to zero before doing any work or error checking. How it behaves with partial sends depends on the mode the pipe is in. I strongly suggest using message mode; as long as your sends are within the buffer size, you can be sure both ends are in the same state. -C From boxbackup-dev at fluffy.co.uk Fri Dec 9 08:30:21 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Fri, 9 Dec 2005 08:30:21 +0000 Subject: [Box Backup-dev] Commit emails In-Reply-To: <1134031922.2815.8.camel@avenin.ebourne.me.uk> References: <1134031922.2815.8.camel@avenin.ebourne.me.uk> Message-ID: <3992EA09-18E9-4871-BFC4-B8448FD8C512@fluffy.co.uk> On 8 Dec 2005, at 08:52, Martin Ebourne wrote: > Ben, > > I think it would be a good idea to set up svn to send commit emails to > this list. Help people keep on top of what is happening as we go > forwards, and help encourage peer review. That is now done, but it won't be tested until someone commits something. Ben From boxbackup-dev at fluffy.co.uk Fri Dec 9 12:55:54 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Fri, 9 Dec 2005 12:55:54 +0000 (GMT) Subject: [Box Backup-dev] Build system Message-ID: Hi Ben, I have a question about the Box build system. All the libraries (common.a, etc.) have make targets that depend on the dep_modules target, which is a phony target. As a result, make always rebuilds the library. This is quite slow on Cygwin, and I'd like to avoid it if possible. I can see why rebuilding an executable might require its dependencies to be built first, but I don't think that's true for a library. It should be possible to compile the module files and assemble the library even if its dependencies aren't built first. Could we safely remove the dep_modules dependency from library Makefiles? Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Fri Dec 9 13:03:51 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Fri, 9 Dec 2005 13:03:51 +0000 Subject: [Box Backup-dev] Build system In-Reply-To: References: Message-ID: <97E8E1A5-2E79-4FA3-9027-AEE7D6B05670@fluffy.co.uk> On 9 Dec 2005, at 12:55, Chris Wilson wrote: > Hi Ben, > > I have a question about the Box build system. All the libraries > (common.a, etc.) have make targets that depend on the dep_modules > target, which is a phony target. As a result, make always rebuilds > the library. > > This is quite slow on Cygwin, and I'd like to avoid it if possible. > I can see why rebuilding an executable might require its > dependencies to be built first, but I don't think that's true for a > library. It should be possible to compile the module files and > assemble the library even if its dependencies aren't built first. > > Could we safely remove the dep_modules dependency from library > Makefiles? Probably. You're only likely to build a bin or test executable anyway, so I suppose you don't need to do dependencies on libraries. The makefiles for GNU make are a bit of a hack. With a BSD make, it's much neater and doesn't require all that messing around. Ben From boxbackup-dev at fluffy.co.uk Fri Dec 9 13:29:26 2005 From: boxbackup-dev at fluffy.co.uk (Jonathan Morton) Date: Fri, 9 Dec 2005 13:29:26 +0000 Subject: [Box Backup-dev] Build system In-Reply-To: References: Message-ID: <4C8BD656-DD00-4C2E-9BEA-4886A9C56C6C@chromatix.uklinux.net> This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-21--938539362 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > I have a question about the Box build system. All the libraries > (common.a, etc.) have make targets that depend on the dep_modules > target, which is a phony target. As a result, make always rebuilds > the library. > > This is quite slow on Cygwin, and I'd like to avoid it if possible. > I can see why rebuilding an executable might require its > dependencies to be built first, but I don't think that's true for a > library. It should be possible to compile the module files and > assemble the library even if its dependencies aren't built first. > > Could we safely remove the dep_modules dependency from library > Makefiles? What you could do is have the dep_modules rule touch a dep_modules file as it's last act, and additionally itself depend on the files it examines. That would fix the problem sufficiently well, while keeping the dependency information up to date even for libraries. -------------------------------------------------------------- from: Jonathan "Chromatix" Morton mail: chromi at chromatix.org.uk website: http://www.chromatix.uklinux.net/ tagline: The key to knowledge is not to rely on people to teach you it. --Apple-Mail-21--938539362 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iEYEARECAAYFAkOZhrYACgkQ6xAxI1ofIwq7AgCcCGoG4oNTTbawRmoMnYnzWqIc TtoAn0WNdHDAVZzXH4dYgeRjNJlqA8AS =/yq/ -----END PGP SIGNATURE----- --Apple-Mail-21--938539362-- From boxbackup-dev at fluffy.co.uk Fri Dec 9 13:42:28 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Fri, 9 Dec 2005 13:42:28 +0000 (GMT) Subject: [Box Backup-dev] Build system In-Reply-To: <4C8BD656-DD00-4C2E-9BEA-4886A9C56C6C@chromatix.uklinux.net> References: <4C8BD656-DD00-4C2E-9BEA-4886A9C56C6C@chromatix.uklinux.net> Message-ID: Hi Jonathan, > What you could do is have the dep_modules rule touch a dep_modules file as > it's last act, and additionally itself depend on the files it examines. That > would fix the problem sufficiently well, while keeping the dependency > information up to date even for libraries. But as far as I can tell, the only things that go into a library archive (.a file) are the compiled module files from that directory. If none of them have been rebuilt, there's no point recreating the library. And all of them are already listed as dependencies of the .a file, and each object file has appropriate dependencies on the header files it uses, so they should be recompiled (and the library rebuilt) if necessary, without the need for a dep_modules target. But please correct me if I'm wrong. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Fri Dec 9 15:40:37 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Fri, 9 Dec 2005 15:40:37 +0000 Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> <9E4EE16C-FF57-4E56-80B3-8F05119BCBF7@fluffy.co.uk> Message-ID: <3199C144-E64C-4253-9B89-7B7448860BBD@fluffy.co.uk> OK then... I hope I'm not being too picky here... basically it looks really good and I just want to have a really high quality release. svn diff http://bbdev.fluffy.co.uk/svn/box/chris/win32/merge/00- martins-original-autoconf http://bbdev.fluffy.co.uk/svn/box/chris/ win32/merge/06-code-cleanups/ config.guess, config.sub -- is this necessary? lib/win32/win32test.cpp -- wrong place, create test/win32 lib/win32/win32_build_on_linux_using_mingw.txt -- move to docs/backup ? lib/win32/win32.bat -- needs to move to bin/bbackupd/win32 lib/win32/WinNamedPipeStream.cpp -- WinNamedPipeStream::Accept(), Connect() doesn't use Name argument. -- define L"\\\\.\\pipe\\boxbackup" in BoxPortsAndFiles.h? -- WinNamedPipeStream::GetPeerCredentials() doesn't need any of the UNIX code lib/server/SocketStream.h -- mods belong in Socket.h bin/bbackupd/ServiceBackupDaemon.* -- rename to Win32ServiceBackupDaemon.* ? or move to bbackupd.cpp? bin/bbackupd/bbwinservice.* -- rename to Win32bbackupdService.* Thanks for all your hard work. Ben On 8 Dec 2005, at 17:41, Chris Wilson wrote: > Hi Ben, > >>> > WinNamedPipe should be an IOStream derived class, then use > >>> IOStreamGetLine not PipeGetLine. > > Now done. At least, it compiles with MinGW, not tested yet (and > still compiles on Linux). > >>> > WinNamedPipe::Write may not work in edge cases where it >>> doesn't write > all the bytes given. > > According to MSDN, if I read it correctly, WriteFile will not do > partial writes, but block until it's written everything (or an > error occurs). There's no way to get the number of bytes written > back from it. > > [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ > fileio/fs/writefile.asp] > >>> > The .bat, config and installer files should not be in lib/ >>> win32 as > they're not generic win32 stuff. I suggest bin/ >>> bbackupd/win32 > > Ok, done. > >> They're not really documents either. Surely the build system will >> be packaging them up? Perhaps they could be included in the parcel >> making script? > > Done as well, with some small changes to makeparcels.pl to allow > including files ONLY on some platforms. > >> I think some of the structure definitions in emu.h must have come >> from somewhere. > > Sorry, not my department. You need to go to Information Retrieval. > > >>> > Not keen on the global and member function names beginning >>> with lower > case letters (and other style "violations"). > > OK, I think I've taken care of the thread method in BackupDaemon > and the WinNamedPipe (now called WinNamedPipeStream). > >> I think this was in the threading code. Maybe I was imagining it, >> there's a lot there. > > There were quite a few global functions and variables in emu.cpp, > bbwinservice.cpp and ServiceBackupDaemon.cpp with such names. I've > fixed all of those that I can see and which I don't think are > emulations of system library functions. > > I don't know of any others, but please point them out if you want > me to fix them. > >>> > -AX_CHECK_MOUNT_POINT(, [AC_MSG_ERROR([[cannot work out how to >>> discover > mount points on your platform]])]) >>> > +AX_CHECK_MOUNT_POINT([],[]) >>> > > I'm not an autoconf sort of person, but that looks worrying >>> to me? But > otherwise there's only minor things. >>> If you mean the fact that I disabled the fatal error - Win32 has >>> no mount points, as far as I know, so if autoconf bombs out then >>> you can't build. >> >> But doesn't that break other platforms? > > As Martin pointed out, all it means (I think) is that Box now > configures on platforms where statfs does not return a f_mntonname. > With the latest changes in 06-code-cleanups, Win32 now uses Nick's > statfs function again, and platforms without f_mntonname will try > to work it out from mtab. > >>> I couldn't see an easy way at the time to disable this check >>> just for Win32, although I'm learning and I have some ideas now. >>> If you mean the empty strings [], then I don't know. I thought >>> it looked better than entirely missing arguments. However, I >>> don't know much about Autoconf's quoting rules, perhaps someone >>> can correct me. >> >> I hope Martin will come up with the answer. > > I've disabled the check and removed the GPL code from SVN. Now I > just don't even check for nanosleep on Win32, as we never call it > or even compile the code that uses it. > > Cheers, Chris. > -- > _ ___ __ _ > / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | > / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | > \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | > > _______________________________________________ > Boxbackup-dev mailing list > Boxbackup-dev at fluffy.co.uk > http://lists.warhead.org.uk/mailman/listinfo/boxbackup-dev From boxbackup-dev at fluffy.co.uk Fri Dec 9 15:56:45 2005 From: boxbackup-dev at fluffy.co.uk (James O'Gorman) Date: Fri, 09 Dec 2005 15:56:45 +0000 Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: <3199C144-E64C-4253-9B89-7B7448860BBD@fluffy.co.uk> References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> <9E4EE16C-FF57-4E56-80B3-8F05119BCBF7@fluffy.co.uk> <3199C144-E64C-4253-9B89-7B7448860BBD@fluffy.co.uk> Message-ID: <4399A93D.9030809@netinertia.co.uk> Hi all, [ I'm actually replying to one of Martin's emails, but I've only just joined the list since spotting said email on the web archives. Sorry if I'm breaking anyone's threading here by replying to Ben's email.. ] Just a quick question about the bootstrap script - is this the only way to do it? I only ask really because I maintain the FreeBSD port and it's got me thinking about how I'd actually run that from the port's Makefile. I guess something like pre-build: ${SH} {WRKSRC}/bootstrap might work. Is there anyone on this list who knows about the internals of FreeBSD's ports infrastructure and whether the existing Autoconf macros in that would work better than running the bootstrap script? James From boxbackup-dev at fluffy.co.uk Fri Dec 9 15:58:54 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Fri, 9 Dec 2005 15:58:54 +0000 (GMT) Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: <3199C144-E64C-4253-9B89-7B7448860BBD@fluffy.co.uk> References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> <9E4EE16C-FF57-4E56-80B3-8F05119BCBF7@fluffy.co.uk> <3199C144-E64C-4253-9B89-7B7448860BBD@fluffy.co.uk> Message-ID: Hi Ben, > OK then... I hope I'm not being too picky here... basically it looks > really good and I just want to have a really high quality release. Thanks, I want the same too. I appreciate your taking the time to review my work. > config.guess, config.sub -- is this necessary? If we want to cross-compile (native win32 build using cygwin or mingw) then unfortunately it appears that we do need these files. Perhaps Martin can find a way to automatically copy them from the user's automake installation. > lib/win32/win32test.cpp > -- wrong place, create test/win32 I'm not sure it fits in with your test framework, are you sure? > lib/win32/win32_build_on_linux_using_mingw.txt > -- move to docs/backup ? Ok, done. > lib/win32/win32.bat > -- needs to move to bin/bbackupd/win32 Are you sure? As far as I can tell, this batch file generates the autogenerated code on Win32, it's not a way to start bbackupd and doesn't need to be distributed. lib/win32 is probably the wrong place, but bin/bbackupd/win32 doesn't look right either. Perhaps the root directory along with the .vcproj files? > lib/win32/WinNamedPipeStream.cpp > -- WinNamedPipeStream::Accept(), Connect() doesn't use Name argument. > > -- define L"\\\\.\\pipe\\boxbackup" in BoxPortsAndFiles.h? OK, will do. > -- WinNamedPipeStream::GetPeerCredentials() doesn't need any of the > UNIX code And it's commented out (I think). Will probably delete it soon. > lib/server/SocketStream.h > -- mods belong in Socket.h SocketStream.h doesn't currently include Socket.h, but would have to in order to get the typedef for tOSSocketHandle. Is that OK? Also, it feels like action at a distance. > bin/bbackupd/ServiceBackupDaemon.* > -- rename to Win32ServiceBackupDaemon.* ? or move to bbackupd.cpp? How about Win32BackupService? > bin/bbackupd/bbwinservice.* > -- rename to Win32bbackupdService.* How about Win32ServiceFunctions? By the way, it compiles and runs on Win32 using MinGW. I'm just working out some stability issues at the moment. :-) Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Fri Dec 9 16:03:35 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Fri, 9 Dec 2005 16:03:35 +0000 Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: <4399A93D.9030809@netinertia.co.uk> References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> <9E4EE16C-FF57-4E56-80B3-8F05119BCBF7@fluffy.co.uk> <3199C144-E64C-4253-9B89-7B7448860BBD@fluffy.co.uk> <4399A93D.9030809@netinertia.co.uk> Message-ID: <7AE56163-BB7A-4024-990E-E9FF40C4A838@fluffy.co.uk> On 9 Dec 2005, at 15:56, James O'Gorman wrote: > Hi all, > > [ I'm actually replying to one of Martin's emails, but I've only > just joined the list since spotting said email on the web archives. > Sorry if I'm breaking anyone's threading here by replying to Ben's > email.. ] > > Just a quick question about the bootstrap script - is this the only > way to do it? I only ask really because I maintain the FreeBSD port > and it's got me thinking about how I'd actually run that from the > port's Makefile. > > I guess something like > > pre-build: > ${SH} {WRKSRC}/bootstrap > > might work. > > Is there anyone on this list who knows about the internals of > FreeBSD's ports infrastructure and whether the existing Autoconf > macros in that would work better than running the bootstrap script? As I understand it, the distribution archive will have a configure script in it built from bootstrap. So you'll just run ./configure with autoconf style arguments, and everything will work out nicely. OpenBSD ports has special handling for autoconf configures which makes it lovely and easy to use. Perhaps FreeBSD does too? Ben From boxbackup-dev at fluffy.co.uk Fri Dec 9 16:07:55 2005 From: boxbackup-dev at fluffy.co.uk (James O'Gorman) Date: Fri, 09 Dec 2005 16:07:55 +0000 Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: <7AE56163-BB7A-4024-990E-E9FF40C4A838@fluffy.co.uk> References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> <9E4EE16C-FF57-4E56-80B3-8F05119BCBF7@fluffy.co.uk> <3199C144-E64C-4253-9B89-7B7448860BBD@fluffy.co.uk> <4399A93D.9030809@netinertia.co.uk> <7AE56163-BB7A-4024-990E-E9FF40C4A838@fluffy.co.uk> Message-ID: <4399ABDB.8090803@netinertia.co.uk> On 9/12/05 16:03, Ben Summers wrote: > As I understand it, the distribution archive will have a configure > script in it built from bootstrap. So you'll just run ./configure with > autoconf style arguments, and everything will work out nicely. Ah, right, OK. That makes my life easier then :-) > OpenBSD ports has special handling for autoconf configures which makes > it lovely and easy to use. Perhaps FreeBSD does too? Yes, there is a macro called USE_AUTOTOOLS, although I'm not entirely sure how it works. I'm not exactly an autoconf guru either. The FreeBSD project has it documented at http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/book.html#USING-AUTOCONF As it happens I'm about to submit an update to the port, but that's just a general Makefile cleanup and fixing some issues with the rc.d scripts. James From boxbackup-dev at fluffy.co.uk Fri Dec 9 16:09:50 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Fri, 9 Dec 2005 16:09:50 +0000 Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> <9E4EE16C-FF57-4E56-80B3-8F05119BCBF7@fluffy.co.uk> <3199C144-E64C-4253-9B89-7B7448860BBD@fluffy.co.uk> Message-ID: <5A7C95D6-86DE-4999-9347-F7F524251798@fluffy.co.uk> On 9 Dec 2005, at 15:58, Chris Wilson wrote: >> config.guess, config.sub -- is this necessary? > > If we want to cross-compile (native win32 build using cygwin or > mingw) then unfortunately it appears that we do need these files. > Perhaps Martin can find a way to automatically copy them from the > user's automake installation. Not terribly bothered if it's necessary, although maybe the infrastructure/makedistribution.pl script could do the copying when it's all wrapped up for release? > >> lib/win32/win32test.cpp >> -- wrong place, create test/win32 > > I'm not sure it fits in with your test framework, are you sure? Can it not be made to do so? > >> lib/win32/win32.bat >> -- needs to move to bin/bbackupd/win32 > > Are you sure? As far as I can tell, this batch file generates the > autogenerated code on Win32, it's not a way to start bbackupd and > doesn't need to be distributed. lib/win32 is probably the wrong > place, but bin/bbackupd/win32 doesn't look right either. Perhaps > the root directory along with the .vcproj files? Oooops, you're right. I suppose infrastructure/win32/ might be the logical place for it, although it's rather inconvenient. And the VS project files would be nicer there too... but on a pragmatic note, sticking it all in the root is going to be perfect for now. >> -- WinNamedPipeStream::GetPeerCredentials() doesn't need any of >> the UNIX code > > And it's commented out (I think). Will probably delete it soon. Since that file is only compiled on Win32, it's unnecessary cruft. > >> lib/server/SocketStream.h >> -- mods belong in Socket.h > > SocketStream.h doesn't currently include Socket.h, but would have > to in order to get the typedef for tOSSocketHandle. Is that OK? > Also, it feels like action at a distance. There's arguments either way. Let's leave it as it is, because SocketStream is the abstraction of a socket for this project anyway. > >> bin/bbackupd/ServiceBackupDaemon.* >> -- rename to Win32ServiceBackupDaemon.* ? or move to bbackupd.cpp? > > How about Win32BackupService? Far better! > >> bin/bbackupd/bbwinservice.* >> -- rename to Win32bbackupdService.* > > How about Win32ServiceFunctions? Lovely! > > By the way, it compiles and runs on Win32 using MinGW. I'm just > working out some stability issues at the moment. :-) Great news. I'm really glad we're progressing so well towards a unified tree and then a release from which we can move forward cleanly. Ben From boxbackup-dev at fluffy.co.uk Sun Dec 11 01:06:18 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Sun, 11 Dec 2005 01:06:18 +0000 (GMT) Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: <439873A6.5020009@invis.net> References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> <9E4EE16C-FF57-4E56-80B3-8F05119BCBF7@fluffy.co.uk> <439873A6.5020009@invis.net> Message-ID: Hi Charles, > lpNumberOfBytesWritten > [out] Pointer to the variable that receives the number of bytes > written. WriteFile sets this value to zero before doing any work or > error checking. Thanks, I'm a dunce (again). Fixed in 07-win32-fixes. > How it behaves with partial sends depends on the mode the pipe is in. I > strongly suggest using message mode; as long as your sends are within > the buffer size, you can be sure both ends are in the same state. The pipe is created using PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, is that enough? Do I need to do anything on the client side, that opens the pipe with CreateFileW? Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Sun Dec 11 01:33:19 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Sun, 11 Dec 2005 01:33:19 +0000 (GMT) Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: <5A7C95D6-86DE-4999-9347-F7F524251798@fluffy.co.uk> References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> <9E4EE16C-FF57-4E56-80B3-8F05119BCBF7@fluffy.co.uk> <3199C144-E64C-4253-9B89-7B7448860BBD@fluffy.co.uk> <5A7C95D6-86DE-4999-9347-F7F524251798@fluffy.co.uk> Message-ID: Hi Ben, >> > config.guess, config.sub -- is this necessary? >> >> If we want to cross-compile (native win32 build using cygwin or mingw) >> then unfortunately it appears that we do need these files. Perhaps Martin >> can find a way to automatically copy them from the user's automake >> installation. > > Not terribly bothered if it's necessary, although maybe the > infrastructure/makedistribution.pl script could do the copying when it's all > wrapped up for release? Same problem - how do we find the builder's automake directory? And I like the idea of these files being known quantities and versioned, rather than subject to the vagaries of the builder's machine. But I can try if you still want me to. Or we can try to rewrite these scripts ourselves to avoid the license issue. >> > lib/win32/win32test.cpp >> > -- wrong place, create test/win32 >> >> I'm not sure it fits in with your test framework, are you sure? > > Can it not be made to do so? It probably can, but the test framework doesn't work at all on win32 at the moment - it still uses Unix functions - so it's a bit difficult to test the tests. I'm still working on that. >> > lib/win32/win32.bat > > I suppose infrastructure/win32/ might be the logical place for it, although > it's rather inconvenient. And the VS project files would be nicer there > too... but on a pragmatic note, sticking it all in the root is going to be > perfect for now. Done in 07-win32-fixes. >> > -- WinNamedPipeStream::GetPeerCredentials() doesn't need any of the >> > UNIX code >> >> And it's commented out (I think). Will probably delete it soon. > > Since that file is only compiled on Win32, it's unnecessary cruft. Done in 07-win32-fixes. >> > bin/bbackupd/ServiceBackupDaemon.* >> > -- rename to Win32ServiceBackupDaemon.* ? or move to bbackupd.cpp? >> >> How about Win32BackupService? > > Far better! Done in 07-win32-fixes. >> > bin/bbackupd/bbwinservice.* >> > -- rename to Win32bbackupdService.* >> >> How about Win32ServiceFunctions? > > Lovely! Done in 07-win32-fixes. >> By the way, it compiles and runs on Win32 using MinGW. I'm just >> working out some stability issues at the moment. :-) > > Great news. I'm really glad we're progressing so well towards a unified > tree and then a release from which we can move forward cleanly. It now runs well on win2k when compiled with MinGW. I've had real problems trying to get the free VS2003 compiler to find its own libraries. I've also had problems with MinGW under emulation (both vmware and qemu) where exceptions thrown in one thread cause weird behaviour in other threads, leading to deadlocks. This is particularly problematic if one uses bbackupctl to start a sync while the main thread is blocked in a library call like connect(). I can easily and reliably reproduce this. I created a test case that shows this weird behaviour in win2k under emulation. MinGW developers have told me that my test case works fine on their Windows boxes, and that they're not aware of such problems in general. My test case also runs fine on a WinXP box. I've yet to set up a real Win2k box to test on. Unless, for some bizarre reason, the problem is really an issue with win2k and MinGW, I doubt that the mingw developers will fix it, and I don't know if qemu or vmware will help me either. I've tried to compile with other compilers (Watcom, Borland C++) but so far not been able to. Watcom's STL is broken (no std::string!) and Borland never sent me the evaluation key for C++ Builder 6. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Sun Dec 11 01:34:15 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Sun, 11 Dec 2005 01:34:15 +0000 (GMT) Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: <3199C144-E64C-4253-9B89-7B7448860BBD@fluffy.co.uk> References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> <9E4EE16C-FF57-4E56-80B3-8F05119BCBF7@fluffy.co.uk> <3199C144-E64C-4253-9B89-7B7448860BBD@fluffy.co.uk> Message-ID: Hi Ben, > lib/win32/WinNamedPipeStream.cpp > -- WinNamedPipeStream::Accept(), Connect() doesn't use Name argument. > -- define L"\\\\.\\pipe\\boxbackup" in BoxPortsAndFiles.h? > -- WinNamedPipeStream::GetPeerCredentials() doesn't need any of the > UNIX code Done in 07-win32-fixes. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Sun Dec 11 09:05:01 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Sun, 11 Dec 2005 09:05:01 +0000 Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> <9E4EE16C-FF57-4E56-80B3-8F05119BCBF7@fluffy.co.uk> <3199C144-E64C-4253-9B89-7B7448860BBD@fluffy.co.uk> <5A7C95D6-86DE-4999-9347-F7F524251798@fluffy.co.uk> Message-ID: <1134291901.3101.8.camel@avenin.ebourne.me.uk> On Sun, 2005-12-11 at 01:33 +0000, Chris Wilson wrote: > Hi Ben, > > Not terribly bothered if it's necessary, although maybe the > > infrastructure/makedistribution.pl script could do the copying when it's all > > wrapped up for release? > > Same problem - how do we find the builder's automake directory? And I like > the idea of these files being known quantities and versioned, rather than > subject to the vagaries of the builder's machine. But I can try if you > still want me to. Or we can try to rewrite these scripts ourselves to > avoid the license issue. Those files are not normally needed for configure. They are needed in this case because of the AC_CANONICAL_SYSTEM macro being used to detect windows. Ideally we wouldn't need to do a platform test because everything could be broken down into feature tests. Then these files would not be necessary. However, it doesn't really matter. We have to check them in (along with the other generated configure files). I don't like doing this, but Charles Lecklider has pointed out that people won't be able to build the windows version from svn if we don't - not unless they get all the autoconf tools installed, which we don't want. At some point I'm therefore planning to check in configure et al. As to the licence of the files, as I explained before there is no clash in licensing here, and the GPL on these files cannot apply to the rest of box. Rewriting these scripts is nonsensical. Lots of BSD and other non GPL projects use autoconf, there really are no issues. I don't want to check the configure etc files in until a few people have tried it out and generated them for themselves. I particularly want to make sure Ben can build from first principles on his system before I check this in! Cheers, Martin. From boxbackup-dev at fluffy.co.uk Sun Dec 11 17:57:33 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Sun, 11 Dec 2005 17:57:33 +0000 Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> <9E4EE16C-FF57-4E56-80B3-8F05119BCBF7@fluffy.co.uk> <3199C144-E64C-4253-9B89-7B7448860BBD@fluffy.co.uk> Message-ID: <96114A81-3A2A-4224-BAAA-840DCC4806AA@fluffy.co.uk> On 11 Dec 2005, at 01:34, Chris Wilson wrote: > > Done in 07-win32-fixes. I can't see this. Can you confirm the full URL? Ben From boxbackup-dev at fluffy.co.uk Sun Dec 11 18:51:47 2005 From: boxbackup-dev at fluffy.co.uk (Charles Lecklider) Date: Sun, 11 Dec 2005 18:51:47 +0000 Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> <9E4EE16C-FF57-4E56-80B3-8F05119BCBF7@fluffy.co.uk> <439873A6.5020009@invis.net> Message-ID: <439C7543.4000206@invis.net> Chris Wilson wrote: > The pipe is created using PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | > PIPE_WAIT, is that enough? No :-) > Do I need to do anything on the client side, that opens the pipe with CreateFileW? Yes - have a look at SetNamedPipeHandleState. A pipe client always starts in byte mode. Also, you need to think carefully about having a NULL SA on the pipe; generally, this is a potential security problem. -C From boxbackup-dev at fluffy.co.uk Sun Dec 11 19:38:47 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Sun, 11 Dec 2005 19:38:47 +0000 (GMT) Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: <96114A81-3A2A-4224-BAAA-840DCC4806AA@fluffy.co.uk> References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> <9E4EE16C-FF57-4E56-80B3-8F05119BCBF7@fluffy.co.uk> <3199C144-E64C-4253-9B89-7B7448860BBD@fluffy.co.uk> <96114A81-3A2A-4224-BAAA-840DCC4806AA@fluffy.co.uk> Message-ID: Hi Ben, > I can't see this. Can you confirm the full URL? Sure, it's [http://bbdev.fluffy.co.uk/svn/box/chris/win32/merge/07-win32-fixes/]. What's missing? Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Sun Dec 11 19:44:38 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Sun, 11 Dec 2005 19:44:38 +0000 Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> <9E4EE16C-FF57-4E56-80B3-8F05119BCBF7@fluffy.co.uk> <3199C144-E64C-4253-9B89-7B7448860BBD@fluffy.co.uk> <96114A81-3A2A-4224-BAAA-840DCC4806AA@fluffy.co.uk> Message-ID: <08B89C3B-4462-46DF-B920-8CE198BDF480@fluffy.co.uk> On 11 Dec 2005, at 19:38, Chris Wilson wrote: > Hi Ben, > >> I can't see this. Can you confirm the full URL? > > Sure, it's [http://bbdev.fluffy.co.uk/svn/box/chris/win32/merge/07- > win32-fixes/]. > > What's missing? "merge/" from the URL I was trying. Silly me. I'll look through the diffs now. Ben From boxbackup-dev at fluffy.co.uk Sun Dec 11 20:00:29 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Sun, 11 Dec 2005 20:00:29 +0000 Subject: [Box Backup-dev] 07-win32-fixes Message-ID: <4C9202DB-F6F1-4547-8878-0070D6AD8778@fluffy.co.uk> svn diff http://bbdev.fluffy.co.uk/svn/box/chris/win32/merge/00- martins-original-autoconf http://bbdev.fluffy.co.uk/svn/box/chris/ win32/merge/07-win32-fixes/ Some minor things for checking: test/basicserver/testbasicserver.cpp - is this a misplaced change -- you said tests didn't work... docs/backup/encrypt_rsync.txt - conflicts with diffopt? There are a few lines like these: Property changes on: lib/win32/WinNamedPipeStream.cpp ___________________________________________________________________ Name: svn:executable + * what's that about? Other than that, I'm happy for this to go into truck. But I'm not sure what changes (if any) are needed to respond to Charles' comments. Would Martin like to give it a sanity check and merge it in? (seeing as Martin has somehow ended up as the project merger...) Ben From boxbackup-dev at fluffy.co.uk Sun Dec 11 20:03:58 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Sun, 11 Dec 2005 20:03:58 +0000 Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> <9E4EE16C-FF57-4E56-80B3-8F05119BCBF7@fluffy.co.uk> <3199C144-E64C-4253-9B89-7B7448860BBD@fluffy.co.uk> <5A7C95D6-86DE-4999-9347-F7F524251798@fluffy.co.uk> Message-ID: <59570A99-1E0B-4298-83DB-78B140FF767C@fluffy.co.uk> On 11 Dec 2005, at 01:33, Chris Wilson wrote: > Hi Ben, > >>> > config.guess, config.sub -- is this necessary? >>> If we want to cross-compile (native win32 build using cygwin or >>> mingw) then unfortunately it appears that we do need these >>> files. Perhaps Martin can find a way to automatically copy them >>> from the user's automake installation. >> >> Not terribly bothered if it's necessary, although maybe the >> infrastructure/makedistribution.pl script could do the copying >> when it's all wrapped up for release? > > Same problem - how do we find the builder's automake directory? And > I like the idea of these files being known quantities and > versioned, rather than subject to the vagaries of the builder's > machine. But I can try if you still want me to. Or we can try to > rewrite these scripts ourselves to avoid the license issue. Since there is no GPL issue, there is no problem leaving them in. We can always deal with it later. > > >>> By the way, it compiles and runs on Win32 using MinGW. I'm just >>> working out some stability issues at the moment. :-) >> >> Great news. I'm really glad we're progressing so well towards a >> unified tree and then a release from which we can move forward >> cleanly. > > It now runs well on win2k when compiled with MinGW. I've had real > problems trying to get the free VS2003 compiler to find its own > libraries. I've also had problems with MinGW under emulation (both > vmware and qemu) where exceptions thrown in one thread cause weird > behaviour in other threads, leading to deadlocks. > > This is particularly problematic if one uses bbackupctl to start a > sync while the main thread is blocked in a library call like connect > (). I can easily and reliably reproduce this. Is MinGW's exception handler code thread-safe? I've worked with a number of compilers which didn't do this properly. (And when the vendors were contacted, they said "well, we didn't say it had thread- safe exception handling in our feature list"). Sounds like there's a single global structure holding the state of the exception handler stack, and it's being overwritten. > > I created a test case that shows this weird behaviour in win2k > under emulation. MinGW developers have told me that my test case > works fine on their Windows boxes, and that they're not aware of > such problems in general. My test case also runs fine on a WinXP > box. I've yet to set up a real Win2k box to test on. > > Unless, for some bizarre reason, the problem is really an issue > with win2k and MinGW, I doubt that the mingw developers will fix > it, and I don't know if qemu or vmware will help me either. > > I've tried to compile with other compilers (Watcom, Borland C++) > but so far not been able to. Watcom's STL is broken (no > std::string!) and Borland never sent me the evaluation key for C++ > Builder 6. This is why I have avoided threading in the project so far! Threading and portability is a nightmare. And even on a single platform it's not too fun. Ben From boxbackup-dev at fluffy.co.uk Mon Dec 12 01:00:35 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Mon, 12 Dec 2005 01:00:35 +0000 (GMT) Subject: [Box Backup-dev] 07-win32-fixes In-Reply-To: <4C9202DB-F6F1-4547-8878-0070D6AD8778@fluffy.co.uk> References: <4C9202DB-F6F1-4547-8878-0070D6AD8778@fluffy.co.uk> Message-ID: Hi Ben, > test/basicserver/testbasicserver.cpp > - is this a misplaced change -- you said tests didn't work... I intend to fix it, but it doesn't work yet. It's not plugged into the test architecture yet, I hope, so it shouldn't cause problems. > docs/backup/encrypt_rsync.txt > - conflicts with diffopt? Sorry, could you explain that for me? > There are a few lines like these: > > Property changes on: lib/win32/WinNamedPipeStream.cpp > ___________________________________________________________________ > Name: svn:executable > + * > > what's that about? It looks like a number of files were set to executable by default by svn, and I hadn't noticed before. I'll try to sort them out tomorrow. > Other than that, I'm happy for this to go into truck. But I'm not sure what > changes (if any) are needed to respond to Charles' comments. I would like to implement his suggestions about the client open mode and the security descriptor. I will try to find time tomorrow, but if not, can they be merged later? > Would Martin like to give it a sanity check and merge it in? (seeing as > Martin has somehow ended up as the project merger...) That would be great! :-) Martin, please let me know when you are done, and I'll take a cut from your new trunk. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Mon Dec 12 00:28:20 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Mon, 12 Dec 2005 00:28:20 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r201 - box/chris/win32/crash-test-pipes/bin/bbackupd Message-ID: <20051212002820.DF2F793@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-12 00:27:50 +0000 (Mon, 12 Dec 2005) New Revision: 201 Modified: box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp Log: Disabled more code, still crashes Modified: box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp =================================================================== --- box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp 2005-12-11 15:53:46 UTC (rev 200) +++ box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp 2005-12-12 00:27:50 UTC (rev 201) @@ -20,10 +20,12 @@ #include "ServerException.h" #include "BackupDaemon.h" -#include "Socket.h" +// #include "Socket.h" +#include "emu.h" + #define BOX_NAMED_PIPE_NAME L"\\\\.\\pipe\\boxbackup" - + // -------------------------------------------------------------------------- // // Function @@ -206,13 +208,22 @@ // -------------------------------------------------------------------------- void BackupDaemon::Run2() { - // Setup parameters based on type, looking up names if required - int sockDomain = 0; - SocketAllAddr addr; - int addrLen = 0; - Socket::NameLookupToSockAddr(addr, sockDomain, - Socket::TypeINET, "1.2.3.4", 1234, addrLen); + int sockAddrLen = 0; + int sockDomain = AF_INET; + struct sockaddr_in addr; + // Lookup hostname + struct hostent *phost = ::gethostbyname("1.2.3.4"); + + sockAddrLen = sizeof(addr); + addr.sin_family = PF_INET; + addr.sin_port = htons(2201); + addr.sin_addr = *((in_addr*)phost->h_addr_list[0]); + for(unsigned int l = 0; l < sizeof(addr.sin_zero); ++l) + { + addr.sin_zero[l] = 0; + } + // Create the socket int handle = ::socket(sockDomain, SOCK_STREAM, 0 /* let OS choose protocol */); @@ -222,7 +233,7 @@ } // Connect it - if(::connect(handle, &addr.sa_generic, addrLen) == -1) + if(::connect(handle, (struct sockaddr*)&addr, sockAddrLen) == -1) { // Dispose of the socket ::closesocket(handle); From boxbackup-dev at fluffy.co.uk Mon Dec 12 00:34:25 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Mon, 12 Dec 2005 00:34:25 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r202 - box/chris/win32/crash-test-pipes/bin/bbackupd Message-ID: <20051212003425.29CFF93@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-12 00:34:14 +0000 (Mon, 12 Dec 2005) New Revision: 202 Modified: box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.h Log: Disabled more code, still crashes Modified: box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp =================================================================== --- box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp 2005-12-12 00:27:50 UTC (rev 201) +++ box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp 2005-12-12 00:34:14 UTC (rev 202) @@ -12,18 +12,24 @@ throw type(type::subtype); \ } -// #include "Box.h" - #include #include #include "ServerException.h" #include "BackupDaemon.h" -// #include "Socket.h" -#include "emu.h" +// #include "emu.h" +#define LOG_INFO 6 +#define LOG_WARNING 4 +#define LOG_ERR 3 + +void syslog(int loglevel, const char *fmt, ...); + +void InitTimer(void); +void FiniTimer(void); + #define BOX_NAMED_PIPE_NAME L"\\\\.\\pipe\\boxbackup" // -------------------------------------------------------------------------- Modified: box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.h =================================================================== --- box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.h 2005-12-12 00:27:50 UTC (rev 201) +++ box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.h 2005-12-12 00:34:14 UTC (rev 202) @@ -10,14 +10,6 @@ #ifndef BACKUPDAEMON__H #define BACKUPDAEMON__H -// #include -// #include -// #include - -// #include "BoxTime.h" -// #include "Socket.h" -// #include "SocketListen.h" -// #include "SocketStream.h" #include "WinNamedPipeStream.h" // -------------------------------------------------------------------------- From boxbackup-dev at fluffy.co.uk Mon Dec 12 00:40:59 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Mon, 12 Dec 2005 00:40:59 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r203 - box/chris/win32/crash-test-pipes/bin/bbackupd Message-ID: <20051212004059.B525293@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-12 00:40:53 +0000 (Mon, 12 Dec 2005) New Revision: 203 Modified: box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp Log: Disabled more code, still crashes Modified: box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp =================================================================== --- box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp 2005-12-12 00:34:14 UTC (rev 202) +++ box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp 2005-12-12 00:40:53 UTC (rev 203) @@ -16,11 +16,60 @@ #include #include "ServerException.h" +#include "WinNamedPipeStream.h" -#include "BackupDaemon.h" +class BackupDaemon +{ +public: + BackupDaemon(); + ~BackupDaemon(); +private: + BackupDaemon(const BackupDaemon &); +public: -// #include "emu.h" + void Run(); + // Allow other classes to call this too + enum + { + NotifyEvent_StoreFull = 0, + NotifyEvent_ReadError = 1, + NotifyEvent__MAX = 1 + // When adding notifications, remember to add strings to NotifySysadmin() + }; + +private: + void Run2(); + + void CloseCommandConnection(); + + /* +private: + // For the command socket + class CommandSocketInfo + { + public: + CommandSocketInfo(); + ~CommandSocketInfo(); + private: + CommandSocketInfo(const CommandSocketInfo &); // no copying + CommandSocketInfo &operator=(const CommandSocketInfo &); + public: + */ + + WinNamedPipeStream mListeningSocket; + + /* + }; + + // Using a socket? + CommandSocketInfo *mpCommandSocketInfo; + */ + + public: + void RunHelperThread(void); +}; + #define LOG_INFO 6 #define LOG_WARNING 4 #define LOG_ERR 3 @@ -41,7 +90,6 @@ // // -------------------------------------------------------------------------- BackupDaemon::BackupDaemon() - : mpCommandSocketInfo(0) { } // -------------------------------------------------------------------------- @@ -53,13 +101,7 @@ // // -------------------------------------------------------------------------- BackupDaemon::~BackupDaemon() -{ - if(mpCommandSocketInfo != 0) - { - delete mpCommandSocketInfo; - mpCommandSocketInfo = 0; - } -} +{ } void ConnectorConnectPipe() { @@ -119,15 +161,11 @@ void BackupDaemon::RunHelperThread(void) { - mpCommandSocketInfo = new CommandSocketInfo; - this->mReceivedCommandConn = false; - while (true) { try { - mpCommandSocketInfo->mListeningSocket.Accept( - BOX_NAMED_PIPE_NAME); + mListeningSocket.Accept(BOX_NAMED_PIPE_NAME); } catch (ConnectionException &e) { @@ -184,22 +222,9 @@ } catch(...) { - if(mpCommandSocketInfo != 0) - { - delete mpCommandSocketInfo; - mpCommandSocketInfo = 0; - } - - throw; + printf("Caught exception in Run()"); } - // Clean up - if(mpCommandSocketInfo != 0) - { - delete mpCommandSocketInfo; - mpCommandSocketInfo = 0; - } - // clean up windows specific stuff. FiniTimer(); } @@ -260,33 +285,10 @@ { try { - mpCommandSocketInfo->mListeningSocket.Close(); + mListeningSocket.Close(); } catch(...) { // Ignore any errors } } - -// -------------------------------------------------------------------------- -// -// Function -// Name: BackupDaemon::CommandSocketInfo::CommandSocketInfo() -// Purpose: Constructor -// Created: 18/2/04 -// -// -------------------------------------------------------------------------- -BackupDaemon::CommandSocketInfo::CommandSocketInfo() -{ } - - -// -------------------------------------------------------------------------- -// -// Function -// Name: BackupDaemon::CommandSocketInfo::~CommandSocketInfo() -// Purpose: Destructor -// Created: 18/2/04 -// -// -------------------------------------------------------------------------- -BackupDaemon::CommandSocketInfo::~CommandSocketInfo() -{ } From boxbackup-dev at fluffy.co.uk Mon Dec 12 00:49:20 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Mon, 12 Dec 2005 00:49:20 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r204 - box/chris/win32/crash-test-pipes/bin/bbackupd Message-ID: <20051212004920.A9DEE93@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-12 00:49:17 +0000 (Mon, 12 Dec 2005) New Revision: 204 Modified: box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp Log: Disabled more code, still crashes Modified: box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp =================================================================== --- box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp 2005-12-12 00:40:53 UTC (rev 203) +++ box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp 2005-12-12 00:49:17 UTC (rev 204) @@ -43,29 +43,8 @@ void CloseCommandConnection(); - /* -private: - // For the command socket - class CommandSocketInfo - { - public: - CommandSocketInfo(); - ~CommandSocketInfo(); - private: - CommandSocketInfo(const CommandSocketInfo &); // no copying - CommandSocketInfo &operator=(const CommandSocketInfo &); - public: - */ - WinNamedPipeStream mListeningSocket; - /* - }; - - // Using a socket? - CommandSocketInfo *mpCommandSocketInfo; - */ - public: void RunHelperThread(void); }; @@ -74,11 +53,9 @@ #define LOG_WARNING 4 #define LOG_ERR 3 -void syslog(int loglevel, const char *fmt, ...); +// void InitTimer(void); +// void FiniTimer(void); -void InitTimer(void); -void FiniTimer(void); - #define BOX_NAMED_PIPE_NAME L"\\\\.\\pipe\\boxbackup" // -------------------------------------------------------------------------- @@ -172,7 +149,7 @@ if (e.GetType() == ConnectionException::ExceptionType && e.GetSubType() == ConnectionException::SocketConnectError) { - ::syslog(LOG_ERR, "Impossible error in " + printf("Impossible error in " "this thread! Aborting."); exit(1); } @@ -213,7 +190,7 @@ NULL); // returns the thread identifier // init our own timer for file diff timeouts - InitTimer(); + // InitTimer(); // Handle things nicely on exceptions try @@ -226,7 +203,7 @@ } // clean up windows specific stuff. - FiniTimer(); + // FiniTimer(); } // -------------------------------------------------------------------------- @@ -268,7 +245,7 @@ { // Dispose of the socket ::closesocket(handle); - THROW_EXCEPTION(ConnectionException, Conn_SocketConnectError) + THROW_EXCEPTION(ConnectionException, SocketConnectError) } } From boxbackup-dev at fluffy.co.uk Mon Dec 12 01:00:14 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Mon, 12 Dec 2005 01:00:14 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r205 - box/chris/win32/crash-test-pipes/bin/bbackupd Message-ID: <20051212010014.3E9F793@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-12 01:00:10 +0000 (Mon, 12 Dec 2005) New Revision: 205 Modified: box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp Log: Merged WinNamedPipeStream, converted to functions, still crashes Modified: box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp =================================================================== --- box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp 2005-12-12 00:49:17 UTC (rev 204) +++ box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp 2005-12-12 01:00:10 UTC (rev 205) @@ -14,9 +14,10 @@ #include #include +#include #include "ServerException.h" -#include "WinNamedPipeStream.h" +// #include "WinNamedPipeStream.h" class BackupDaemon { @@ -41,21 +42,10 @@ private: void Run2(); - void CloseCommandConnection(); - - WinNamedPipeStream mListeningSocket; - public: void RunHelperThread(void); }; -#define LOG_INFO 6 -#define LOG_WARNING 4 -#define LOG_ERR 3 - -// void InitTimer(void); -// void FiniTimer(void); - #define BOX_NAMED_PIPE_NAME L"\\\\.\\pipe\\boxbackup" // -------------------------------------------------------------------------- @@ -136,13 +126,61 @@ return 0; } +void NamedPipeAccept(const wchar_t* pName) +{ + HANDLE handle; + + handle = CreateNamedPipeW( + pName, // pipe name + PIPE_ACCESS_DUPLEX, // read/write access + PIPE_TYPE_MESSAGE | // message type pipe + PIPE_READMODE_MESSAGE | // message-read mode + PIPE_WAIT, // blocking mode + 1, // max. instances + 4096, // output buffer size + 4096, // input buffer size + NMPWAIT_USE_DEFAULT_WAIT, // client time-out + NULL); // default security attribute + + if (handle == NULL) + { + printf("CreateNamedPipeW failed: %d\n", GetLastError()); + THROW_EXCEPTION(ServerException, SocketOpenError) + } + + bool connected = ConnectNamedPipe(handle, (LPOVERLAPPED) NULL); + + if (!connected) + { + printf("ConnectNamedPipe failed: %d\n", GetLastError()); + CloseHandle(handle); + THROW_EXCEPTION(ServerException, SocketOpenError) + } + + if (!FlushFileBuffers(handle)) + { + printf("FlushFileBuffers failed: %d\n", GetLastError()); + } + + if (!DisconnectNamedPipe(handle)) + { + printf("DisconnectNamedPipe failed: %d\n", GetLastError()); + } + + if (!CloseHandle(handle)) + { + printf("CloseHandle failed: %d\n", GetLastError()); + THROW_EXCEPTION(ServerException, SocketCloseError) + } +} + void BackupDaemon::RunHelperThread(void) { while (true) { try { - mListeningSocket.Accept(BOX_NAMED_PIPE_NAME); + NamedPipeAccept(BOX_NAMED_PIPE_NAME); } catch (ConnectionException &e) { @@ -150,12 +188,10 @@ e.GetSubType() == ConnectionException::SocketConnectError) { printf("Impossible error in " - "this thread! Aborting."); + "this thread! Aborting.\n"); exit(1); } } - - CloseCommandConnection(); } } @@ -189,9 +225,6 @@ 0, // use default creation flags NULL); // returns the thread identifier - // init our own timer for file diff timeouts - // InitTimer(); - // Handle things nicely on exceptions try { @@ -201,9 +234,6 @@ { printf("Caught exception in Run()"); } - - // clean up windows specific stuff. - // FiniTimer(); } // -------------------------------------------------------------------------- @@ -248,24 +278,3 @@ THROW_EXCEPTION(ConnectionException, SocketConnectError) } } - - -// -------------------------------------------------------------------------- -// -// Function -// Name: BackupDaemon::CloseCommandConnection() -// Purpose: Close the command connection, ignoring any errors -// Created: 18/2/04 -// -// -------------------------------------------------------------------------- -void BackupDaemon::CloseCommandConnection() -{ - try - { - mListeningSocket.Close(); - } - catch(...) - { - // Ignore any errors - } -} From boxbackup-dev at fluffy.co.uk Mon Dec 12 01:07:52 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Mon, 12 Dec 2005 01:07:52 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r206 - box/chris/win32/crash-test-pipes/bin/bbackupd Message-ID: <20051212010752.0A4C593@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-12 01:07:45 +0000 (Mon, 12 Dec 2005) New Revision: 206 Modified: box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp Log: Removed custom exceptions, still crashes Modified: box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp =================================================================== --- box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp 2005-12-12 01:00:10 UTC (rev 205) +++ box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp 2005-12-12 01:07:45 UTC (rev 206) @@ -7,27 +7,20 @@ // // -------------------------------------------------------------------------- -#define THROW_EXCEPTION(type, subtype) \ - { \ - throw type(type::subtype); \ - } - #include #include #include -#include "ServerException.h" -// #include "WinNamedPipeStream.h" - class BackupDaemon { public: BackupDaemon(); ~BackupDaemon(); + private: - BackupDaemon(const BackupDaemon &); -public: + BackupDaemon(const BackupDaemon &) { /* do not call */ } +public: void Run(); // Allow other classes to call this too @@ -48,28 +41,9 @@ #define BOX_NAMED_PIPE_NAME L"\\\\.\\pipe\\boxbackup" -// -------------------------------------------------------------------------- -// -// Function -// Name: BackupDaemon::BackupDaemon() -// Purpose: constructor -// Created: 2003/10/08 -// -// -------------------------------------------------------------------------- -BackupDaemon::BackupDaemon() -{ } +BackupDaemon::BackupDaemon() { } +BackupDaemon::~BackupDaemon() { } -// -------------------------------------------------------------------------- -// -// Function -// Name: BackupDaemon::~BackupDaemon() -// Purpose: Destructor -// Created: 2003/10/08 -// -// -------------------------------------------------------------------------- -BackupDaemon::~BackupDaemon() -{ } - void ConnectorConnectPipe() { HANDLE SocketHandle = CreateFileW( @@ -145,7 +119,7 @@ if (handle == NULL) { printf("CreateNamedPipeW failed: %d\n", GetLastError()); - THROW_EXCEPTION(ServerException, SocketOpenError) + throw 1; } bool connected = ConnectNamedPipe(handle, (LPOVERLAPPED) NULL); @@ -154,7 +128,7 @@ { printf("ConnectNamedPipe failed: %d\n", GetLastError()); CloseHandle(handle); - THROW_EXCEPTION(ServerException, SocketOpenError) + throw 1; } if (!FlushFileBuffers(handle)) @@ -170,7 +144,7 @@ if (!CloseHandle(handle)) { printf("CloseHandle failed: %d\n", GetLastError()); - THROW_EXCEPTION(ServerException, SocketCloseError) + throw 1; } } @@ -182,10 +156,9 @@ { NamedPipeAccept(BOX_NAMED_PIPE_NAME); } - catch (ConnectionException &e) + catch (int i) { - if (e.GetType() == ConnectionException::ExceptionType && - e.GetSubType() == ConnectionException::SocketConnectError) + if (i == 2) { printf("Impossible error in " "this thread! Aborting.\n"); @@ -267,7 +240,7 @@ 0 /* let OS choose protocol */); if(handle == -1) { - THROW_EXCEPTION(ServerException, SocketOpenError) + throw 2; } // Connect it @@ -275,6 +248,6 @@ { // Dispose of the socket ::closesocket(handle); - THROW_EXCEPTION(ConnectionException, SocketConnectError) + throw 2; } } From boxbackup-dev at fluffy.co.uk Mon Dec 12 01:13:51 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Mon, 12 Dec 2005 01:13:51 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r207 - box/chris/win32/crash-test-pipes/bin/bbackupd Message-ID: <20051212011351.85EAA93@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-12 01:13:47 +0000 (Mon, 12 Dec 2005) New Revision: 207 Modified: box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp Log: Made pipe acceptor method into a function, still crashes Modified: box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp =================================================================== --- box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp 2005-12-12 01:07:45 UTC (rev 206) +++ box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp 2005-12-12 01:13:47 UTC (rev 207) @@ -34,9 +34,6 @@ private: void Run2(); - - public: - void RunHelperThread(void); }; #define BOX_NAMED_PIPE_NAME L"\\\\.\\pipe\\boxbackup" @@ -82,26 +79,10 @@ return 0; } -// -------------------------------------------------------------------------- -// -// Function -// Name: HelperThread() -// Purpose: Background thread function, called by Windows, -// calls the BackupDaemon's RunHelperThread method -// to listen for and act on control communications -// Created: 18/2/04 -// -// -------------------------------------------------------------------------- -unsigned int WINAPI HelperThread( LPVOID lpParam ) -{ - printf( "Parameter = %lu.\n", *(DWORD*)lpParam ); - ((BackupDaemon *)lpParam)->RunHelperThread(); - - return 0; -} - -void NamedPipeAccept(const wchar_t* pName) +void AcceptorAcceptPipe(const wchar_t* pName) { + printf("."); + HANDLE handle; handle = CreateNamedPipeW( @@ -148,13 +129,13 @@ } } -void BackupDaemon::RunHelperThread(void) -{ +unsigned int WINAPI AcceptorThread( LPVOID lpParam ) +{ while (true) { try { - NamedPipeAccept(BOX_NAMED_PIPE_NAME); + AcceptorAcceptPipe(BOX_NAMED_PIPE_NAME); } catch (int i) { @@ -166,16 +147,10 @@ } } } -} -// -------------------------------------------------------------------------- -// -// Function -// Name: BackupDaemon::Run() -// Purpose: Run function for daemon -// Created: 18/2/04 -// -// -------------------------------------------------------------------------- + return 0; +} + void BackupDaemon::Run() { // Create a thread to handle the named pipe @@ -185,7 +160,7 @@ hThread = (HANDLE) _beginthreadex( NULL, // default security attributes 0, // use default stack size - HelperThread, // thread function + AcceptorThread, // thread function this, // argument to thread function 0, // use default creation flags &dwThreadId); // returns the thread identifier From boxbackup-dev at fluffy.co.uk Mon Dec 12 01:21:27 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Mon, 12 Dec 2005 01:21:27 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r208 - box/chris/win32/crash-test-pipes/bin/bbackupd Message-ID: <20051212012127.5216A93@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-12 01:21:17 +0000 (Mon, 12 Dec 2005) New Revision: 208 Modified: box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp box/chris/win32/crash-test-pipes/bin/bbackupd/bbackupd.cpp Log: Made stand-alone, still crashes Modified: box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp =================================================================== --- box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp 2005-12-12 01:13:47 UTC (rev 207) +++ box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp 2005-12-12 01:21:17 UTC (rev 208) @@ -226,3 +226,28 @@ throw 2; } } + +int main(int argc, const char *argv[]) +{ + // Under win32 we must initialise the Winsock library + // before using sockets + + WSADATA info; + + if (WSAStartup(MAKELONG(1, 1), &info) == SOCKET_ERROR) + { + // box backup will not run without sockets + printf("Failed to initialise Windows Sockets\n"); + exit(1); + } + + // EnableBackupRights(); + + BackupDaemon Daemon; + Daemon.Run(); + + // Clean up our sockets + WSACleanup(); + + return 0; +} Modified: box/chris/win32/crash-test-pipes/bin/bbackupd/bbackupd.cpp =================================================================== --- box/chris/win32/crash-test-pipes/bin/bbackupd/bbackupd.cpp 2005-12-12 01:13:47 UTC (rev 207) +++ box/chris/win32/crash-test-pipes/bin/bbackupd/bbackupd.cpp 2005-12-12 01:21:17 UTC (rev 208) @@ -1,81 +0,0 @@ -// -------------------------------------------------------------------------- -// -// File -// Name: bbackupd.cpp -// Purpose: main file for backup daemon -// Created: 2003/10/11 -// -// -------------------------------------------------------------------------- - -#include "Box.h" -#include "BackupDaemon.h" -#include "MainHelper.h" -#include "BoxPortsAndFiles.h" -#include "BackupStoreException.h" - -#include "MemLeakFindOn.h" - -#ifdef WIN32 - #include "Win32ServiceFunctions.h" - #include "Win32BackupService.h" - - extern Win32BackupService gDaemonService; -#endif - -int main(int argc, const char *argv[]) -{ - MAINHELPER_START - - ::openlog("Box Backup (bbackupd)", 0, 0); - - if(argc == 2 && - (::strcmp(argv[1], "--help") == 0 || - ::strcmp(argv[1], "-h") == 0)) - { - printf("-h help, -i install service, -r remove service,\n" - "-c start daemon now"); - return 2; - } - if(argc == 2 && ::strcmp(argv[1], "-r") == 0) - { - RemoveService(); - return 0; - } - if(argc == 2 && ::strcmp(argv[1], "-i") == 0) - { - InstallService(); - return 0; - } - - // Under win32 we must initialise the Winsock library - // before using sockets - - WSADATA info; - - if (WSAStartup(MAKELONG(1, 1), &info) == SOCKET_ERROR) - { - // box backup will not run without sockets - ::syslog(LOG_ERR, "Failed to initialise Windows Sockets"); - THROW_EXCEPTION(BackupStoreException, Internal) - } - - EnableBackupRights(); - - if (argc == 2 && ::strcmp(argv[1], "--service") == 0) - { - syslog(LOG_INFO,"Starting Box Backup Service"); - OurService(); - } - else - { - gDaemonService.Run(); - } - - // Clean up our sockets - WSACleanup(); - ::closelog(); - - return 0; - - MAINHELPER_END -} From boxbackup-dev at fluffy.co.uk Mon Dec 12 02:00:34 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Mon, 12 Dec 2005 02:00:34 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r209 - box/chris/win32/merge/07-win32-fixes/docs/backup Message-ID: <20051212020034.9512D93@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-12 02:00:24 +0000 (Mon, 12 Dec 2005) New Revision: 209 Modified: box/chris/win32/merge/07-win32-fixes/docs/backup/win32_build_on_cygwin_using_mingw.txt box/chris/win32/merge/07-win32-fixes/docs/backup/win32_build_on_linux_using_mingw.txt Log: * backup/win32_build_on_linux_using_mingw.txt * backup/win32_build_on_cygwin_using_mingw.txt - Updated docs to show that -mthreads must be used when building (otherwise weird crashes will result where exceptions from one thread end up being processed in another thread) Modified: box/chris/win32/merge/07-win32-fixes/docs/backup/win32_build_on_cygwin_using_mingw.txt =================================================================== --- box/chris/win32/merge/07-win32-fixes/docs/backup/win32_build_on_cygwin_using_mingw.txt 2005-12-12 01:21:17 UTC (rev 208) +++ box/chris/win32/merge/07-win32-fixes/docs/backup/win32_build_on_cygwin_using_mingw.txt 2005-12-12 02:00:24 UTC (rev 209) @@ -27,10 +27,10 @@ export CXX="g++ -mno-cygwin" export LD="g++ -mno-cygwin" - export CFLAGS="-mno-cygwin" - export CXXFLAGS="-mno-cygwin" - export LDFLAGS="-mno-cygwin" - export LIBS="-lws2_32 -lgdi32 -lcrypto" + export CFLAGS="-mno-cygwin -mthreads" + export CXXFLAGS="-mno-cygwin -mthreads" + export LDFLAGS="-mno-cygwin -mthreads" + export LIBS="-lcrypto -lws2_32 -lgdi32" (if you don't have a "configure" file, run "./bootstrap") ./configure --target=i686-pc-mingw32 make Modified: box/chris/win32/merge/07-win32-fixes/docs/backup/win32_build_on_linux_using_mingw.txt =================================================================== --- box/chris/win32/merge/07-win32-fixes/docs/backup/win32_build_on_linux_using_mingw.txt 2005-12-12 01:21:17 UTC (rev 208) +++ box/chris/win32/merge/07-win32-fixes/docs/backup/win32_build_on_linux_using_mingw.txt 2005-12-12 02:00:24 UTC (rev 209) @@ -23,7 +23,9 @@ export CXX="i386-mingw32-g++" export AR=i386-mingw32-ar export RANLIB=i386-mingw32-ranlib - export CFLAGS=-mno-cygwin - export LIBS="-lws2_32 -lgdi32 -lcrypto" + export CFLAGS="-mno-cygwin -mthreads" + export CXXFLAGS="-mno-cygwin -mthreads" + export LDFLAGS="-mno-cygwin -mthreads" + export LIBS="-lcrypto -lws2_32 -lgdi32" ./configure --target=i386-mingw32 make CXX="$CXX" AR="$AR" RANLIB="$RANLIB" From boxbackup-dev at fluffy.co.uk Mon Dec 12 02:03:46 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Mon, 12 Dec 2005 02:03:46 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r210 - box/chris/win32/merge/07-win32-fixes/docs/backup Message-ID: <20051212020346.50F8E93@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-12 02:03:39 +0000 (Mon, 12 Dec 2005) New Revision: 210 Modified: box/chris/win32/merge/07-win32-fixes/docs/backup/win32_build_on_linux_using_mingw.txt Log: * win32_build_on_linux_using_mingw.txt - Removed references to -mno-cygwin flags from Linux MinGW build docs Modified: box/chris/win32/merge/07-win32-fixes/docs/backup/win32_build_on_linux_using_mingw.txt =================================================================== --- box/chris/win32/merge/07-win32-fixes/docs/backup/win32_build_on_linux_using_mingw.txt 2005-12-12 02:00:24 UTC (rev 209) +++ box/chris/win32/merge/07-win32-fixes/docs/backup/win32_build_on_linux_using_mingw.txt 2005-12-12 02:03:39 UTC (rev 210) @@ -23,9 +23,9 @@ export CXX="i386-mingw32-g++" export AR=i386-mingw32-ar export RANLIB=i386-mingw32-ranlib - export CFLAGS="-mno-cygwin -mthreads" - export CXXFLAGS="-mno-cygwin -mthreads" - export LDFLAGS="-mno-cygwin -mthreads" + export CFLAGS="-mthreads" + export CXXFLAGS="-mthreads" + export LDFLAGS="-mthreads" export LIBS="-lcrypto -lws2_32 -lgdi32" ./configure --target=i386-mingw32 make CXX="$CXX" AR="$AR" RANLIB="$RANLIB" From boxbackup-dev at fluffy.co.uk Mon Dec 12 02:14:45 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Mon, 12 Dec 2005 02:14:45 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r211 - box/chris/win32/crash-test-pipes/bin/bbackupd Message-ID: <20051212021445.7683593@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-12 02:14:41 +0000 (Mon, 12 Dec 2005) New Revision: 211 Modified: box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp Log: * BackupDaemon.cpp - Final version of test case (show OK: and BAD:). Need to compile with -mthreads. Modified: box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp =================================================================== --- box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp 2005-12-12 02:03:39 UTC (rev 210) +++ box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp 2005-12-12 02:14:41 UTC (rev 211) @@ -141,7 +141,7 @@ { if (i == 2) { - printf("Impossible error in " + printf("BAD: Impossible error in " "this thread! Aborting.\n"); exit(1); } @@ -180,7 +180,7 @@ } catch(...) { - printf("Caught exception in Run()"); + printf("OK: Caught exception in Run()"); } } From boxbackup-dev at fluffy.co.uk Mon Dec 12 03:13:16 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Mon, 12 Dec 2005 03:13:16 +0000 (GMT) Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: <59570A99-1E0B-4298-83DB-78B140FF767C@fluffy.co.uk> References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> <9E4EE16C-FF57-4E56-80B3-8F05119BCBF7@fluffy.co.uk> <3199C144-E64C-4253-9B89-7B7448860BBD@fluffy.co.uk> <5A7C95D6-86DE-4999-9347-F7F524251798@fluffy.co.uk> <59570A99-1E0B-4298-83DB-78B140FF767C@fluffy.co.uk> Message-ID: Hi Ben, >> I've also had problems with MinGW under emulation (both vmware and >> qemu) where exceptions thrown in one thread cause weird behaviour in >> other threads, leading to deadlocks. >> >> This is particularly problematic if one uses bbackupctl to start a sync >> while the main thread is blocked in a library call like connect(). I can >> easily and reliably reproduce this. > > Is MinGW's exception handler code thread-safe? I've worked with a number of > compilers which didn't do this properly. (And when the vendors were > contacted, they said "well, we didn't say it had thread-safe exception > handling in our feature list"). > > Sounds like there's a single global structure holding the state of the > exception handler stack, and it's being overwritten. It would appear that this is indeed the problem. I was compiling without the -mthreads option, and when an exception was thrown in one thread, it would end up jumping to the code of another thread that had an exception handler installed, and end up executing that thread's code. So you would have two threads trying to run the command socket manager, and none running actual backups. > This is why I have avoided threading in the project so far! Threading > and portability is a nightmare. And even on a single platform it's not > too fun. Tell me about it. I've spent three days debugging this :-( At least it's fixed now: just compile with -mthreads. I've updated the MinGW build docs. I also have a test case that I can try to integrate with the test framework if you like. [http://bbdev.fluffy.co.uk/svn/box/chris/win32/crash-test-pipes/bin/bbackupd/BackupDaemon.cpp] Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Mon Dec 12 08:26:59 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Mon, 12 Dec 2005 08:26:59 +0000 Subject: [Box Backup-dev] 07-win32-fixes In-Reply-To: References: <4C9202DB-F6F1-4547-8878-0070D6AD8778@fluffy.co.uk> Message-ID: On 12 Dec 2005, at 01:00, Chris Wilson wrote: > Hi Ben, > >> test/basicserver/testbasicserver.cpp >> - is this a misplaced change -- you said tests didn't work... > > I intend to fix it, but it doesn't work yet. It's not plugged into > the test architecture yet, I hope, so it shouldn't cause problems. OK, it just seemed a minor change which didn't have much to do with win32. > >> docs/backup/encrypt_rsync.txt >> - conflicts with diffopt? > > Sorry, could you explain that for me? The diffopt patch (which has been applied to trunk) also modifies that file -- does this patch overwrite those changes, losing the notes on the optimised code? [snip] > >> Other than that, I'm happy for this to go into truck. But I'm not >> sure what changes (if any) are needed to respond to Charles' >> comments. > > I would like to implement his suggestions about the client open > mode and the security descriptor. I will try to find time tomorrow, > but if not, can they be merged later? Of course. The most important thing is to get everything into trunk. > >> Would Martin like to give it a sanity check and merge it in? >> (seeing as Martin has somehow ended up as the project merger...) > > That would be great! :-) Martin, please let me know when you are > done, and I'll take a cut from your new trunk. Thanks for all your hard work. Sounds like the threading thing was a bit of a nightmare. Tip to compiler writers: If you have a mode where a certain set of functions will cause the program to crash, you might want to consider detecting this and outputting warnings. Especially if that mode is the default. Ben From boxbackup-dev at fluffy.co.uk Mon Dec 12 17:46:34 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Mon, 12 Dec 2005 17:46:34 +0000 Subject: [Box Backup-dev] 07-win32-fixes In-Reply-To: References: <4C9202DB-F6F1-4547-8878-0070D6AD8778@fluffy.co.uk> Message-ID: <20051212174634.nw7nsrjfokk8woog@ebourne.me.uk> Chris Wilson wrote: > Hi Ben, >> Would Martin like to give it a sanity check and merge it in? (seeing >> as Martin has somehow ended up as the project merger...) I'm still not sure why I'm project merger, and I'm not all that keen to keep the position! I've ended up being the release manager at work as well, and I don't want that position either! > That would be great! :-) Martin, please let me know when you are > done, and I'll take a cut from your new trunk. I've had another look over the diffs: In BackupClientFileAttributes::ReadAttributes there is a new section of code which says "this is to catch those problems with invalid time stamps stored". Is this a windows only problem, or could this happen also on Unix? Should the check be cross platform? I would like to try to remove most of the WIN32 uses by having proper feature tests in configure.ac rather than using the platform define. There are several which are type based, eg. in BoxPlatform.h: typedef __int8 int8_t; typedef __int16 int16_t; typedef __int32 int32_t; typedef __int64 int64_t; and typedef ino_t InodeRefType; These could all be using the type checking macro in configure.ac. Also there are a lot of #includes conditional on WIN32 where really they should be conditional on the include itself. Between those two it would reduce a lot. Later on we can try and do the same for the conditional code sections. In a couple of cases I think we can make them more generic and remove conditionality. I'm happy to merge as is and fix this up later, but will need Chris's help for this. I'm planning to merge with the following command: svn merge -r111:187 chris/win32/merge/08-file-renames trunk This should be the same as the diff between 00-martins-original-autoconf and 08-file-renames. I've done a test merge and it is conflict free. I'd also like to request that in future we don't proliferate so many branches. I checked out a working copy of the whole repository and it takes 2.5GB of disk! That is split as: 24M ben 24M chromi 27M trunk 109M martin 592M nick 1.8G chris We want to make big changes on a branch, and occasionally it is useful to create a new branch, but I don't think it helps to create a new branch for each cumulative change to a tree. In SVN each checkin is referred to by a single number so unlike CVS it is always easy to cherry pick complete changes out of the history. With a suitable log comment each point in time is just as accessible on a single branch line as it is by branching at each stage. It would probably help to remove some of the branches after the dust has settled. They wouldn't be lost of course, just no longer in the latest version. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Mon Dec 12 18:44:48 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Mon, 12 Dec 2005 18:44:48 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r212 - box/chris/win32/merge Message-ID: <20051212184448.A3F1293@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-12 18:44:44 +0000 (Mon, 12 Dec 2005) New Revision: 212 Removed: box/chris/win32/merge/08-file-renames/ Log: * http://bbdev.fluffy.co.uk/svn/box/chris/win32/merge/08-file-renames - Removed as I didn't use it and it's out of date From boxbackup-dev at fluffy.co.uk Mon Dec 12 19:42:49 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Mon, 12 Dec 2005 19:42:49 +0000 (GMT) Subject: [Box Backup-dev] 07-win32-fixes In-Reply-To: <20051212174634.nw7nsrjfokk8woog@ebourne.me.uk> References: <4C9202DB-F6F1-4547-8878-0070D6AD8778@fluffy.co.uk> <20051212174634.nw7nsrjfokk8woog@ebourne.me.uk> Message-ID: Hi all, On Mon, 12 Dec 2005, Martin Ebourne wrote: > I'm still not sure why I'm project merger, and I'm not all that keen to > keep the position! I've ended up being the release manager at work as > well, and I don't want that position either! I'm happy to volunteer for this role if you don't want it, but I appreciate your help in reviewing the changes and your advice in general. > In BackupClientFileAttributes::ReadAttributes there is a new section of > code which says "this is to catch those problems with invalid time > stamps stored". Is this a windows only problem, or could this happen > also on Unix? Should the check be cross platform? Better ask Nick about that. I don't know why it would be necessary, but if it is, I agree that it should be cross-platform. > I would like to try to remove most of the WIN32 uses by having proper feature > tests in configure.ac rather than using the platform define. Seems like a good idea to me. Please go ahead, or I can try my hand if you prefer. > Later on we can try and do the same for the conditional code sections. > In a couple of cases I think we can make them more generic and remove > conditionality. I agree in general, but which cases? > I'm happy to merge as is and fix this up later, but will need Chris's help > for this. Of course, I'm happy to help with whatever you ask. > I'm planning to merge with the following command: > > svn merge -r111:187 chris/win32/merge/08-file-renames trunk Sorry, 08-file-renames is obsolete - I never used it, and it's out of date compared to 07-win32-fixes. > I'd also like to request that in future we don't proliferate so many > branches. I checked out a working copy of the whole repository and it takes > 2.5GB of disk! But copying is free (on the server) and making a copy is supposed to be a standard (only?) way of creating a tag or branch with SVN, as far as I know. I don't think you're supposed to check out the whole repository :-). > We want to make big changes on a branch, and occasionally it is useful > to create a new branch, but I don't think it helps to create a new > branch for each cumulative change to a tree. In SVN each checkin is > referred to by a single number so unlike CVS it is always easy to cherry > pick complete changes out of the history. With a suitable log comment > each point in time is just as accessible on a single branch line as it > is by branching at each stage. But searching through log comments is much harder than looking through a directory tree. Nevertheless, if people don't want me to create so many tags, I will refrain. > It would probably help to remove some of the branches after the dust has > settled. They wouldn't be lost of course, just no longer in the latest > version. Sure, that's fine with me, they will be obsolete anyway after the merge. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Mon Dec 12 20:11:08 2005 From: boxbackup-dev at fluffy.co.uk (Jonathan Morton) Date: Mon, 12 Dec 2005 20:11:08 +0000 Subject: [Box Backup-dev] 07-win32-fixes In-Reply-To: References: <4C9202DB-F6F1-4547-8878-0070D6AD8778@fluffy.co.uk> <20051212174634.nw7nsrjfokk8woog@ebourne.me.uk> Message-ID: <5D4D8815-E5E1-436A-AC7E-2AFC4A0B56CC@chromatix.uklinux.net> This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-5--655237838 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed >> I'd also like to request that in future we don't proliferate so >> many branches. I checked out a working copy of the whole >> repository and it takes 2.5GB of disk! > > But copying is free (on the server) and making a copy is supposed > to be a standard (only?) way of creating a tag or branch with SVN, > as far as I know. I don't think you're supposed to check out the > whole repository :-). Whether you're supposed to do it or not, people do. Especially the people who are supposed to merge it all. Anyway, copying is free on the *server*, but can be very expensive on the client, which doesn't have the luxury of making hard-links all over the place. Most of the problem seems to be that the Win32 port branch contains an entire copy of the Boost library for each sub-branch - presumably only the XML features of Boost were actually required, and in any case Boost should be installed separately from the application on a developer's machine. Boost itself is not modified for use in BB, so why include it in version control? >> We want to make big changes on a branch, and occasionally it is >> useful to create a new branch, but I don't think it helps to >> create a new branch for each cumulative change to a tree. In SVN >> each checkin is referred to by a single number so unlike CVS it is >> always easy to cherry pick complete changes out of the history. >> With a suitable log comment each point in time is just as >> accessible on a single branch line as it is by branching at each >> stage. > > But searching through log comments is much harder than looking > through a directory tree. Nevertheless, if people don't want me to > create so many tags, I will refrain. "Much harder" should not be confused with "not familiar". It is quite easy to retrieve the commit log for any given directory, and produce an individual diff covering each individually or any combination. -------------------------------------------------------------- from: Jonathan "Chromatix" Morton mail: chromi at chromatix.org.uk website: http://www.chromatix.uklinux.net/ tagline: The key to knowledge is not to rely on people to teach you it. --Apple-Mail-5--655237838 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iEYEARECAAYFAkOd2VwACgkQ6xAxI1ofIwo/XACePXEtJheHYWjdyeuvWiXI/j47 nqwAnRJJHjYNKZk4sb2VISEOtpfWOTT2 =7/6o -----END PGP SIGNATURE----- --Apple-Mail-5--655237838-- From boxbackup-dev at fluffy.co.uk Mon Dec 12 20:57:37 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Mon, 12 Dec 2005 20:57:37 +0000 (GMT) Subject: [Box Backup-dev] 07-win32-fixes In-Reply-To: <5D4D8815-E5E1-436A-AC7E-2AFC4A0B56CC@chromatix.uklinux.net> References: <4C9202DB-F6F1-4547-8878-0070D6AD8778@fluffy.co.uk> <20051212174634.nw7nsrjfokk8woog@ebourne.me.uk> <5D4D8815-E5E1-436A-AC7E-2AFC4A0B56CC@chromatix.uklinux.net> Message-ID: Hi Jonathan, >> But copying is free (on the server) and making a copy is supposed to >> be a standard (only?) way of creating a tag or branch with SVN, as far >> as I know. I don't think you're supposed to check out the whole >> repository :-). > > Whether you're supposed to do it or not, people do. Especially the > people who are supposed to merge it all. I never asked anybody to merge every single branch I ever made :-) But I'm quite happy to delete the old tags now that I don't need them anymore. I'm also quite happy to do the merging if people want me to (and I promise not to check out the entire repository :-) > Most of the problem seems to be that the Win32 port branch contains an > entire copy of the Boost library for each sub-branch - presumably only > the XML features of Boost were actually required, and in any case Boost > should be installed separately from the application on a developer's > machine. Boost itself is not modified for use in BB, so why include it > in version control? I didn't check in Boost, and it was one of the first things that Martin and I removed from our working copies. It's only there in the old, obsolete branches (some belonging to other people, that I didn't want to touch). > "Much harder" should not be confused with "not familiar". It is quite > easy to retrieve the commit log for any given directory, and produce an > individual diff covering each individually or any combination. Well, it's not how I was taught to use SVN by the book. But I'm happy to do it that way if people prefer. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Mon Dec 12 21:29:47 2005 From: boxbackup-dev at fluffy.co.uk (Jonathan Morton) Date: Mon, 12 Dec 2005 21:29:47 +0000 (GMT) Subject: [Box Backup-dev] 07-win32-fixes In-Reply-To: References: <4C9202DB-F6F1-4547-8878-0070D6AD8778@fluffy.co.uk> <20051212174634.nw7nsrjfokk8woog@ebourne.me.uk> <5D4D8815-E5E1-436A-AC7E-2AFC4A0B56CC@chromatix.uklinux.net> Message-ID: >> > But copying is free (on the server) and making a copy is supposed to be >> > a standard (only?) way of creating a tag or branch with SVN, as far as >> > I know. I don't think you're supposed to check out the whole repository >> > :-). >> >> Whether you're supposed to do it or not, people do. Especially the people >> who are supposed to merge it all. > > I never asked anybody to merge every single branch I ever made :-) But I'm > quite happy to delete the old tags now that I don't need them anymore. I'm > also quite happy to do the merging if people want me to (and I promise not to > check out the entire repository :-) >> Most of the problem seems to be that the Win32 port branch contains an >> entire copy of the Boost library for each sub-branch - presumably only the >> XML features of Boost were actually required, and in any case Boost should >> be installed separately from the application on a developer's machine. >> Boost itself is not modified for use in BB, so why include it in version >> control? > > I didn't check in Boost, and it was one of the first things that Martin and I > removed from our working copies. It's only there in the old, obsolete > branches (some belonging to other people, that I didn't want to touch). Fair enough - and I saw that just now when I updated my copy of the tree. It was still worth noting for others. >> "Much harder" should not be confused with "not familiar". It is quite >> easy to retrieve the commit log for any given directory, and produce an >> individual diff covering each individually or any combination. > > Well, it's not how I was taught to use SVN by the book. But I'm happy to do > it that way if people prefer. As with many other things, "the book" is not always right. I think there's a distinction to be made between chronological refinements and lines of enquiry. The latter case is an appropriate time to make branches. The former is not, because SVN's internal systems already take care of it much more efficiently. I suppose the ambiguity came in when you have a big patch, like the Win32 stuff, that needs to be merged, but not all of the changes are appropriate for merging. The patch can be split into sections as normal, but I think these sections should be applied and committed sequentially to a single tree - or at most to two parallel trees (one for review and experimentation, the other for finalisation). Partial changes can be backed out at any time with minimal fuss, as long as you can work out the revision numbers from the commit log (which you should be able to do anyway for merging). Making half a dozen closely-related branches, one for each patch fragment, doesn't seem appropriate. Instead, apply each patch fragment in turn to the single tree, weeding out the inappropriate ones as you find them. This would at least have reduced the impact of the Boost incursion. :-) From boxbackup-dev at fluffy.co.uk Mon Dec 12 21:10:52 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Mon, 12 Dec 2005 21:10:52 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r215 - box/trunk/test/bbackupd/testfiles Message-ID: <20051212211052.EF2B693@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-12 21:10:51 +0000 (Mon, 12 Dec 2005) New Revision: 215 Modified: box/trunk/test/bbackupd/testfiles/spacetest1.tgz box/trunk/test/bbackupd/testfiles/spacetest2.tgz box/trunk/test/bbackupd/testfiles/test2.tgz box/trunk/test/bbackupd/testfiles/test3.tgz box/trunk/test/bbackupd/testfiles/test_base.tgz box/trunk/test/bbackupd/testfiles/testexclude.tgz Log: Setting svn:mime-type for *.tgz Property changes on: box/trunk/test/bbackupd/testfiles/spacetest1.tgz ___________________________________________________________________ Name: svn:mime-type - application/octet-stream + application/x-gzip Property changes on: box/trunk/test/bbackupd/testfiles/spacetest2.tgz ___________________________________________________________________ Name: svn:mime-type - application/octet-stream + application/x-gzip Property changes on: box/trunk/test/bbackupd/testfiles/test2.tgz ___________________________________________________________________ Name: svn:mime-type - application/octet-stream + application/x-gzip Property changes on: box/trunk/test/bbackupd/testfiles/test3.tgz ___________________________________________________________________ Name: svn:mime-type - application/octet-stream + application/x-gzip Property changes on: box/trunk/test/bbackupd/testfiles/test_base.tgz ___________________________________________________________________ Name: svn:mime-type - application/octet-stream + application/x-gzip Property changes on: box/trunk/test/bbackupd/testfiles/testexclude.tgz ___________________________________________________________________ Name: svn:mime-type - application/octet-stream + application/x-gzip From boxbackup-dev at fluffy.co.uk Mon Dec 12 21:47:04 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Mon, 12 Dec 2005 21:47:04 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r216 - in box/chris/win32/merge/07-win32-fixes: . infrastructure lib/common lib/win32 test/common Message-ID: <20051212214704.A244D93@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-12 21:46:48 +0000 (Mon, 12 Dec 2005) New Revision: 216 Modified: box/chris/win32/merge/07-win32-fixes/infrastructure/buildenv-testmain-template.cpp box/chris/win32/merge/07-win32-fixes/infrastructure/makebuildenv.pl box/chris/win32/merge/07-win32-fixes/lib/common/DebugAssertFailed.cpp box/chris/win32/merge/07-win32-fixes/lib/common/DebugPrintf.cpp box/chris/win32/merge/07-win32-fixes/lib/common/FileStream.cpp box/chris/win32/merge/07-win32-fixes/lib/common/Test.h box/chris/win32/merge/07-win32-fixes/lib/win32/WinNamedPipeStream.cpp box/chris/win32/merge/07-win32-fixes/modules.txt box/chris/win32/merge/07-win32-fixes/test/common/testcommon.cpp Log: * modules.txt * test/common/testcommon.cpp * infrastructure/makebuildenv.pl * infrastructure/buildenv-testmain-template.cpp * lib/win32/WinNamedPipeStream.cpp * lib/common/DebugAssertFailed.cpp * lib/common/Test.h * lib/common/FileStream.cpp * lib/common/DebugPrintf.cpp - Made test/common work on Win32 Modified: box/chris/win32/merge/07-win32-fixes/infrastructure/buildenv-testmain-template.cpp =================================================================== --- box/chris/win32/merge/07-win32-fixes/infrastructure/buildenv-testmain-template.cpp 2005-12-12 21:10:51 UTC (rev 215) +++ box/chris/win32/merge/07-win32-fixes/infrastructure/buildenv-testmain-template.cpp 2005-12-12 21:46:48 UTC (rev 216) @@ -20,11 +20,16 @@ #include #include #include -#include #include #include #include +#ifdef WIN32 + #include "emu.h" +#else + #include +#endif + #include "MemLeakFindOn.h" int test(int argc, const char *argv[]); @@ -39,6 +44,14 @@ int filedes_open_at_beginning = -1; +#ifdef WIN32 + +// any way to check for open file descriptors on Win32? +inline int count_filedes() { return 0; } +inline bool checkfilesleftopen() { return false; } + +#else // !WIN32 + int count_filedes() { int c = 0; @@ -71,6 +84,8 @@ return filedes_open_at_beginning != count_filedes(); } +#endif + int main(int argc, const char *argv[]) { // Start memory leak testing Modified: box/chris/win32/merge/07-win32-fixes/infrastructure/makebuildenv.pl =================================================================== --- box/chris/win32/merge/07-win32-fixes/infrastructure/makebuildenv.pl 2005-12-12 21:10:51 UTC (rev 215) +++ box/chris/win32/merge/07-win32-fixes/infrastructure/makebuildenv.pl 2005-12-12 21:46:48 UTC (rev 216) @@ -408,9 +408,9 @@ } writetestfile("$mod/_t", - './test${platform_exe_ext} $1 $2 $3 $4 $5', $mod); + './test' . $platform_exe_ext . '$1 $2 $3 $4 $5', $mod); writetestfile("$mod/_t-gdb", - 'gdb ./test${platform_exe_ext}', $mod); + 'gdb ./test ' . $platform_exe_ext, $mod); } Modified: box/chris/win32/merge/07-win32-fixes/lib/common/DebugAssertFailed.cpp =================================================================== --- box/chris/win32/merge/07-win32-fixes/lib/common/DebugAssertFailed.cpp 2005-12-12 21:10:51 UTC (rev 215) +++ box/chris/win32/merge/07-win32-fixes/lib/common/DebugAssertFailed.cpp 2005-12-12 21:46:48 UTC (rev 216) @@ -12,8 +12,13 @@ #include "Box.h" #include -#include +#ifdef WIN32 + #include "emu.h" +#else + #include +#endif + #include "MemLeakFindOn.h" bool AssertFailuresToSyslog = false; Modified: box/chris/win32/merge/07-win32-fixes/lib/common/DebugPrintf.cpp =================================================================== --- box/chris/win32/merge/07-win32-fixes/lib/common/DebugPrintf.cpp 2005-12-12 21:10:51 UTC (rev 215) +++ box/chris/win32/merge/07-win32-fixes/lib/common/DebugPrintf.cpp 2005-12-12 21:46:48 UTC (rev 216) @@ -13,8 +13,13 @@ #include #include -#include +#ifdef WIN32 + #include "emu.h" +#else + #include +#endif + #include "MemLeakFindOn.h" // Use this apparently superflous printf function to avoid having to Modified: box/chris/win32/merge/07-win32-fixes/lib/common/FileStream.cpp =================================================================== --- box/chris/win32/merge/07-win32-fixes/lib/common/FileStream.cpp 2005-12-12 21:10:51 UTC (rev 215) +++ box/chris/win32/merge/07-win32-fixes/lib/common/FileStream.cpp 2005-12-12 21:46:48 UTC (rev 216) @@ -197,11 +197,9 @@ if ( (res == 0) || (numBytesWritten != NBytes)) { - DWORD err = GetLastError(); + // DWORD err = GetLastError(); THROW_EXCEPTION(CommonException, OSFileWriteError) } - - #else if(::write(mOSFileHandle, pBuffer, NBytes) != NBytes) { Modified: box/chris/win32/merge/07-win32-fixes/lib/common/Test.h =================================================================== --- box/chris/win32/merge/07-win32-fixes/lib/common/Test.h 2005-12-12 21:10:51 UTC (rev 215) +++ box/chris/win32/merge/07-win32-fixes/lib/common/Test.h 2005-12-12 21:46:48 UTC (rev 216) @@ -108,6 +108,116 @@ return pid; } +#ifdef WIN32 + +#include "WinNamedPipeStream.h" +#include "IOStreamGetLine.h" +#include "BoxPortsAndFiles.h" + +bool SendCommands(const std::string& rCmd) +{ + WinNamedPipeStream connection; + + try + { + connection.Connect(BOX_NAMED_PIPE_NAME); + } + catch(...) + { + printf("Failed to connect to daemon control socket.\n"); + return false; + } + + // For receiving data + IOStreamGetLine getLine(connection); + + // Wait for the configuration summary + std::string configSummary; + if(!getLine.GetLine(configSummary)) + { + printf("Failed to receive configuration summary from daemon\n"); + return false; + } + + // Was the connection rejected by the server? + if(getLine.IsEOF()) + { + printf("Server rejected the connection.\n"); + return false; + } + + // Decode it + int autoBackup, updateStoreInterval, minimumFileAge, maxUploadWait; + if(::sscanf(configSummary.c_str(), "bbackupd: %d %d %d %d", + &autoBackup, &updateStoreInterval, + &minimumFileAge, &maxUploadWait) != 4) + { + printf("Config summary didn't decode\n"); + return false; + } + + std::string cmds; + bool expectResponse; + + if (rCmd != "") + { + cmds = rCmd; + cmds += "\nquit\n"; + expectResponse = true; + } + else + { + cmds = "quit\n"; + expectResponse = false; + } + + connection.Write(cmds.c_str(), cmds.size()); + + // Read the response + std::string line; + bool statusOk = !expectResponse; + + while (expectResponse && !getLine.IsEOF() && getLine.GetLine(line)) + { + // Is this an OK or error line? + if (line == "ok") + { + statusOk = true; + } + else if (line == "error") + { + printf("ERROR (%s)\n", rCmd.c_str()); + break; + } + else + { + printf("WARNING: Unexpected response to command '%s': " + "%s", rCmd.c_str(), line.c_str()); + } + } + + return statusOk; +} + +inline bool ServerIsAlive() +{ + return SendCommands(""); +} + +inline bool HUPServer(int pid) +{ + return SendCommands("reload"); +} + +inline bool KillServer(int pid) +{ + TEST_THAT(SendCommands("terminate")); + ::sleep(1); + return !ServerIsAlive(); +} + +#else // !WIN32 + inline bool ServerIsAlive(int pid) { if(pid == 0) return false; @@ -129,6 +239,8 @@ return !ServerIsAlive(pid); } +#endif // WIN32 + inline void TestRemoteProcessMemLeaks(const char *filename) { #ifdef BOX_MEMORY_LEAK_TESTING Property changes on: box/chris/win32/merge/07-win32-fixes/lib/win32/WinNamedPipeStream.cpp ___________________________________________________________________ Name: svn:executable - * Modified: box/chris/win32/merge/07-win32-fixes/modules.txt =================================================================== --- box/chris/win32/merge/07-win32-fixes/modules.txt 2005-12-12 21:10:51 UTC (rev 215) +++ box/chris/win32/merge/07-win32-fixes/modules.txt 2005-12-12 21:46:48 UTC (rev 216) @@ -18,8 +18,8 @@ lib/server lib/win32 lib/server lib/compress -test/common -test/crypto lib/crypto +test/common lib/win32 +test/crypto lib/crypto test/compress lib/compress test/basicserver lib/server Modified: box/chris/win32/merge/07-win32-fixes/test/common/testcommon.cpp =================================================================== --- box/chris/win32/merge/07-win32-fixes/test/common/testcommon.cpp 2005-12-12 21:10:51 UTC (rev 215) +++ box/chris/win32/merge/07-win32-fixes/test/common/testcommon.cpp 2005-12-12 21:46:48 UTC (rev 216) @@ -182,7 +182,8 @@ // First, test the FdGetLine class -- rather important this works! { - FileHandleGuard file("testfiles/fdgetlinetest.txt"); + FileHandleGuard file("testfiles" + DIRECTORY_SEPARATOR "fdgetlinetest.txt"); FdGetLine getline(file); int l = 0; @@ -199,8 +200,10 @@ } // and again without pre-processing { - FileHandleGuard file("testfiles/fdgetlinetest.txt"); - FILE *file2 = fopen("testfiles/fdgetlinetest.txt", "r"); + FileHandleGuard file("testfiles" + DIRECTORY_SEPARATOR "fdgetlinetest.txt"); + FILE *file2 = fopen("testfiles" DIRECTORY_SEPARATOR + "fdgetlinetest.txt", "r"); TEST_THAT_ABORTONFAIL(file2 != 0); FdGetLine getline(file); char ll[512]; @@ -228,7 +231,8 @@ // Then the IOStream version of get line, seeing as we're here... { - FileStream file("testfiles/fdgetlinetest.txt", O_RDONLY); + FileStream file("testfiles" DIRECTORY_SEPARATOR + "fdgetlinetest.txt", O_RDONLY); IOStreamGetLine getline(file); int l = 0; @@ -248,10 +252,12 @@ } // and again without pre-processing { - FileStream file("testfiles/fdgetlinetest.txt", O_RDONLY); + FileStream file("testfiles" DIRECTORY_SEPARATOR + "fdgetlinetest.txt", O_RDONLY); IOStreamGetLine getline(file); - FILE *file2 = fopen("testfiles/fdgetlinetest.txt", "r"); + FILE *file2 = fopen("testfiles" DIRECTORY_SEPARATOR + "fdgetlinetest.txt", "r"); TEST_THAT_ABORTONFAIL(file2 != 0); char ll[512]; @@ -282,13 +288,20 @@ // Doesn't exist { std::string errMsg; - TEST_CHECK_THROWS(std::auto_ptr pconfig(Configuration::LoadAndVerify("testfiles/DOESNTEXIST", &verify, errMsg)), CommonException, OSFileOpenError); + TEST_CHECK_THROWS(std::auto_ptr pconfig( + Configuration::LoadAndVerify( + "testfiles" DIRECTORY_SEPARATOR "DOESNTEXIST", + &verify, errMsg)), + CommonException, OSFileOpenError); } // Basic configuration test { std::string errMsg; - std::auto_ptr pconfig(Configuration::LoadAndVerify("testfiles/config1.txt", &verify, errMsg)); + std::auto_ptr pconfig( + Configuration::LoadAndVerify( + "testfiles" DIRECTORY_SEPARATOR "config1.txt", + &verify, errMsg)); if(!errMsg.empty()) { printf("UNEXPECTED error msg is:\n------\n%s------\n", errMsg.c_str()); @@ -333,22 +346,38 @@ static const char *file[] = { - "testfiles/config2.txt", // Value missing from root - "testfiles/config3.txt", // Unexpected { - "testfiles/config4.txt", // Missing } - "testfiles/config5.txt", // { expected, but wasn't there - "testfiles/config6.txt", // Duplicate key - "testfiles/config7.txt", // Invalid key (no name) - "testfiles/config8.txt", // Not all sub blocks terminated - "testfiles/config9.txt", // Not valid integer - "testfiles/config9b.txt", // Not valid integer - "testfiles/config9c.txt", // Not valid integer - "testfiles/config9d.txt", // Not valid integer - "testfiles/config10.txt", // Missing key (in subblock) - "testfiles/config11.txt", // Unknown key - "testfiles/config12.txt", // Missing block - "testfiles/config13.txt", // Subconfig (wildcarded) should exist, but missing (ie nothing present) - "testfiles/config16.txt", // bad boolean value + "testfiles" DIRECTORY_SEPARATOR "config2.txt", + // Value missing from root + "testfiles" DIRECTORY_SEPARATOR "config3.txt", + // Unexpected { + "testfiles" DIRECTORY_SEPARATOR "config4.txt", + // Missing } + "testfiles" DIRECTORY_SEPARATOR "config5.txt", + // { expected, but wasn't there + "testfiles" DIRECTORY_SEPARATOR "config6.txt", + // Duplicate key + "testfiles" DIRECTORY_SEPARATOR "config7.txt", + // Invalid key (no name) + "testfiles" DIRECTORY_SEPARATOR "config8.txt", + // Not all sub blocks terminated + "testfiles" DIRECTORY_SEPARATOR "config9.txt", + // Not valid integer + "testfiles" DIRECTORY_SEPARATOR "config9b.txt", + // Not valid integer + "testfiles" DIRECTORY_SEPARATOR "config9c.txt", + // Not valid integer + "testfiles" DIRECTORY_SEPARATOR "config9d.txt", + // Not valid integer + "testfiles" DIRECTORY_SEPARATOR "config10.txt", + // Missing key (in subblock) + "testfiles" DIRECTORY_SEPARATOR "config11.txt", + // Unknown key + "testfiles" DIRECTORY_SEPARATOR "config12.txt", + // Missing block + "testfiles" DIRECTORY_SEPARATOR "config13.txt", + // Subconfig (wildcarded) should exist, but missing (ie nothing present) + "testfiles" DIRECTORY_SEPARATOR "config16.txt", + // bad boolean value 0 }; @@ -365,7 +394,10 @@ // (single value in a multivalue already checked) { std::string errMsg; - std::auto_ptr pconfig(Configuration::LoadAndVerify("testfiles/config14.txt", &verify, errMsg)); + std::auto_ptr pconfig( + Configuration::LoadAndVerify( + "testfiles" DIRECTORY_SEPARATOR "config14.txt", + &verify, errMsg)); TEST_THAT(pconfig.get() != 0); TEST_THAT(errMsg.empty()); TEST_THAT(pconfig->KeyExists("MultiValue")); @@ -379,7 +411,10 @@ // Check boolean values { std::string errMsg; - std::auto_ptr pconfig(Configuration::LoadAndVerify("testfiles/config15.txt", &verify, errMsg)); + std::auto_ptr pconfig( + Configuration::LoadAndVerify( + "testfiles" DIRECTORY_SEPARATOR "config15.txt", + &verify, errMsg)); TEST_THAT(pconfig.get() != 0); TEST_THAT(errMsg.empty()); TEST_THAT(pconfig->GetKeyValueBool("BoolTrue1") == true); @@ -392,32 +427,50 @@ { NamedLock lock1; // Try and get a lock on a name in a directory which doesn't exist - TEST_CHECK_THROWS(lock1.TryAndGetLock("testfiles/non-exist/lock"), CommonException, OSFileError); + TEST_CHECK_THROWS(lock1.TryAndGetLock( + "testfiles" + DIRECTORY_SEPARATOR "non-exist" + DIRECTORY_SEPARATOR "lock"), + CommonException, OSFileError); + // And a more resonable request - TEST_THAT(lock1.TryAndGetLock("testfiles/lock1") == true); + TEST_THAT(lock1.TryAndGetLock( + "testfiles" DIRECTORY_SEPARATOR "lock1") == true); + // Try to lock something using the same lock - TEST_CHECK_THROWS(lock1.TryAndGetLock("testfiles/non-exist/lock2"), CommonException, NamedLockAlreadyLockingSomething); + TEST_CHECK_THROWS( + lock1.TryAndGetLock( + "testfiles" + DIRECTORY_SEPARATOR "non-exist" + DIRECTORY_SEPARATOR "lock2"), + CommonException, NamedLockAlreadyLockingSomething); #if defined(HAVE_FLOCK) || HAVE_DECL_O_EXLOCK // And again on that name NamedLock lock2; - TEST_THAT(lock2.TryAndGetLock("testfiles/lock1") == false); + TEST_THAT(lock2.TryAndGetLock( + "testfiles" DIRECTORY_SEPARATOR "lock1") == false); #endif } { // Check that it unlocked when it went out of scope NamedLock lock3; - TEST_THAT(lock3.TryAndGetLock("testfiles/lock1") == true); + TEST_THAT(lock3.TryAndGetLock( + "testfiles" DIRECTORY_SEPARATOR "lock1") == true); } { // And unlocking works NamedLock lock4; - TEST_CHECK_THROWS(lock4.ReleaseLock(), CommonException, NamedLockNotHeld); - TEST_THAT(lock4.TryAndGetLock("testfiles/lock4") == true); + TEST_CHECK_THROWS(lock4.ReleaseLock(), CommonException, + NamedLockNotHeld); + TEST_THAT(lock4.TryAndGetLock( + "testfiles" DIRECTORY_SEPARATOR "lock4") == true); lock4.ReleaseLock(); NamedLock lock5; - TEST_THAT(lock5.TryAndGetLock("testfiles/lock4") == true); + TEST_THAT(lock5.TryAndGetLock( + "testfiles" DIRECTORY_SEPARATOR "lock4") == true); // And can reuse it - TEST_THAT(lock4.TryAndGetLock("testfiles/lock5") == true); + TEST_THAT(lock4.TryAndGetLock( + "testfiles" DIRECTORY_SEPARATOR "lock5") == true); } // Test the ReadGatherStream From boxbackup-dev at fluffy.co.uk Mon Dec 12 22:50:37 2005 From: boxbackup-dev at fluffy.co.uk (Jonathan Morton) Date: Mon, 12 Dec 2005 22:50:37 +0000 (GMT) Subject: [Box Backup-dev] Testing on Gentoo/PPC64 Message-ID: This is probably one of the more unusual platforms going - even most G5 owners run Gentoo/PPC32 userspace with a 64-bit kernel - but I suspect the problems I encountered are universal. 1) Autoconf failed to locate the Berkeley DB that was installed. 2) Building failed with an incorrect package setup. I suspect that this is because version.txt (or similar) is missing from SVN. 3) Raidfile tests failed. Everything else passed. From boxbackup-dev at fluffy.co.uk Mon Dec 12 23:04:40 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Mon, 12 Dec 2005 23:04:40 +0000 Subject: [Box Backup-dev] COMMIT r216 - in box/chris/win32/merge/07-win32-fixes: . infrastructure lib/common lib/win32 test/common In-Reply-To: <20051212214704.A244D93@s0g0.pems.testserver.co.uk> References: <20051212214704.A244D93@s0g0.pems.testserver.co.uk> Message-ID: <1134428680.27021.4.camel@avenin.ebourne.me.uk> On Mon, 2005-12-12 at 21:47 +0000, subversion at fluffy.co.uk wrote: > Author: chris > Date: 2005-12-12 21:46:48 +0000 (Mon, 12 Dec 2005) > New Revision: 216 > > Modified: > box/chris/win32/merge/07-win32-fixes/infrastructure/buildenv-testmain-template.cpp > box/chris/win32/merge/07-win32-fixes/infrastructure/makebuildenv.pl > box/chris/win32/merge/07-win32-fixes/lib/common/DebugAssertFailed.cpp > box/chris/win32/merge/07-win32-fixes/lib/common/DebugPrintf.cpp > box/chris/win32/merge/07-win32-fixes/lib/common/FileStream.cpp > box/chris/win32/merge/07-win32-fixes/lib/common/Test.h > box/chris/win32/merge/07-win32-fixes/lib/win32/WinNamedPipeStream.cpp > box/chris/win32/merge/07-win32-fixes/modules.txt > box/chris/win32/merge/07-win32-fixes/test/common/testcommon.cpp The commit emails don't appear to be working properly - I'm missing at least half the revisions by the looks of it. Just to let you know Chris, I merged 07-win32-fixes at r210 into trunk earlier. Didn't see a commit message though. If these fixes should go in too, let me know. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Mon Dec 12 23:10:38 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Mon, 12 Dec 2005 23:10:38 +0000 Subject: [Box Backup-dev] COMMIT r216 - in box/chris/win32/merge/07-win32-fixes: . infrastructure lib/common lib/win32 test/common In-Reply-To: <1134428680.27021.4.camel@avenin.ebourne.me.uk> References: <20051212214704.A244D93@s0g0.pems.testserver.co.uk> <1134428680.27021.4.camel@avenin.ebourne.me.uk> Message-ID: <32B3DAEF-BF3F-4267-BC10-EBAD092AC5D1@fluffy.co.uk> On 12 Dec 2005, at 23:04, Martin Ebourne wrote: > On Mon, 2005-12-12 at 21:47 +0000, subversion at fluffy.co.uk wrote: >> Author: chris >> Date: 2005-12-12 21:46:48 +0000 (Mon, 12 Dec 2005) >> New Revision: 216 >> >> Modified: >> box/chris/win32/merge/07-win32-fixes/infrastructure/buildenv- >> testmain-template.cpp >> box/chris/win32/merge/07-win32-fixes/infrastructure/ >> makebuildenv.pl >> box/chris/win32/merge/07-win32-fixes/lib/common/ >> DebugAssertFailed.cpp >> box/chris/win32/merge/07-win32-fixes/lib/common/DebugPrintf.cpp >> box/chris/win32/merge/07-win32-fixes/lib/common/FileStream.cpp >> box/chris/win32/merge/07-win32-fixes/lib/common/Test.h >> box/chris/win32/merge/07-win32-fixes/lib/win32/ >> WinNamedPipeStream.cpp >> box/chris/win32/merge/07-win32-fixes/modules.txt >> box/chris/win32/merge/07-win32-fixes/test/common/testcommon.cpp > > The commit emails don't appear to be working properly - I'm missing at > least half the revisions by the looks of it. They're too big and are getting blocked by the mailing list software. Ben From boxbackup-dev at fluffy.co.uk Mon Dec 12 23:30:54 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Mon, 12 Dec 2005 23:30:54 +0000 Subject: [Box Backup-dev] COMMIT r216 - in box/chris/win32/merge/07-win32-fixes: . infrastructure lib/common lib/win32 test/common In-Reply-To: <32B3DAEF-BF3F-4267-BC10-EBAD092AC5D1@fluffy.co.uk> References: <20051212214704.A244D93@s0g0.pems.testserver.co.uk> <1134428680.27021.4.camel@avenin.ebourne.me.uk> <32B3DAEF-BF3F-4267-BC10-EBAD092AC5D1@fluffy.co.uk> Message-ID: <1134430254.27021.9.camel@avenin.ebourne.me.uk> On Mon, 2005-12-12 at 23:10 +0000, Ben Summers wrote: > On 12 Dec 2005, at 23:04, Martin Ebourne wrote: > > The commit emails don't appear to be working properly - I'm missing at > > least half the revisions by the looks of it. > > They're too big and are getting blocked by the mailing list software. Ach. Limit seems to be set fairly low then, because some of the changes aren't that big. I don't know if you're already on to this, but 3 solutions spring to mind: 1. If possible let the list have an exception for messages from svn. 2. Set up a boxbackup-commits list which can only be posted to by svn (with reply-to set to boxbackup-dev) and has no limit. Quite a few projects do this. 3. Hack the perl commit hook to only include the diff if not too big, otherwise just a file list. I can probably help with the third one if you like, obviously not the other two though. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Mon Dec 12 23:56:25 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Mon, 12 Dec 2005 23:56:25 +0000 Subject: [Box Backup-dev] line endings Message-ID: <1134431785.27021.12.camel@avenin.ebourne.me.uk> I've set svn:eol-style in trunk for all files as per the below. Cheers, Martin. boxbackup.suo test/backupstore/testfiles/bbackupd.keys test/bbackupd/testfiles/bbackupd.keys test/bbackupd/testfiles/spacetest1.tgz test/bbackupd/testfiles/spacetest2.tgz test/bbackupd/testfiles/test2.tgz test/bbackupd/testfiles/test3.tgz test/bbackupd/testfiles/test_base.tgz test/bbackupd/testfiles/testexclude.tgz CRLF bbackupctl.vcproj CRLF bbackupd.vcproj CRLF bin/bbackupd/win32/installer.iss CRLF boxbackup.sln CRLF boxquery.vcproj CRLF common.vcproj CRLF win32.bat CRLF win32test.vcproj LF distribution/boxbackup/contrib/redhat/bbackupd LF distribution/boxbackup/contrib/redhat/bbstored LF distribution/boxbackup/contrib/rpm/boxbackup.spec LF distribution/boxbackup/contrib/suse/bbackupd LF distribution/boxbackup/contrib/suse/bbstored native bin/bbackupctl/bbackupctl.cpp native bin/bbackupd/BackupClientContext.cpp native bin/bbackupd/BackupClientContext.h native bin/bbackupd/BackupClientDeleteList.cpp native bin/bbackupd/BackupClientDeleteList.h native bin/bbackupd/BackupClientDirectoryRecord.cpp native bin/bbackupd/BackupClientDirectoryRecord.h native bin/bbackupd/BackupClientInodeToIDMap.cpp native bin/bbackupd/BackupClientInodeToIDMap.h native bin/bbackupd/BackupDaemon.cpp native bin/bbackupd/BackupDaemon.h native bin/bbackupd/bbackupd-config native bin/bbackupd/bbackupd.cpp native bin/bbackupd/Win32BackupService.cpp native bin/bbackupd/Win32BackupService.h native bin/bbackupd/win32/bbackupd.conf native bin/bbackupd/win32/ReadMe.txt native bin/bbackupd/Win32ServiceFunctions.cpp native bin/bbackupd/Win32ServiceFunctions.h native bin/bbackupobjdump/bbackupobjdump.cpp native bin/bbackupquery/BackupQueries.cpp native bin/bbackupquery/BackupQueries.h native bin/bbackupquery/bbackupquery.cpp native bin/bbackupquery/documentation.txt native bin/bbackupquery/makedocumentation.pl native bin/bbackupquery/Makefile.extra native bin/bbstoreaccounts/bbstoreaccounts.cpp native bin/bbstored/BackupCommands.cpp native bin/bbstored/BackupConstants.h native bin/bbstored/BackupContext.cpp native bin/bbstored/BackupContext.h native bin/bbstored/backupprotocol.txt native bin/bbstored/BackupStoreDaemon.cpp native bin/bbstored/BackupStoreDaemon.h native bin/bbstored/bbstored-certs native bin/bbstored/bbstored-config native bin/bbstored/bbstored.cpp native bin/bbstored/BBStoreDHousekeeping.cpp native bin/bbstored/HousekeepStoreAccount.cpp native bin/bbstored/HousekeepStoreAccount.h native bin/bbstored/Makefile.extra native bootstrap native BUGS.txt native cleanupforcvs.pl native config.guess native config.sub native configure.ac native distribution/boxbackup/CONTACT.txt native distribution/boxbackup/contrib/cygwin/install-cygwin-service.pl native distribution/boxbackup/contrib/cygwin/README.txt native distribution/boxbackup/contrib/cygwin/remove-cygwin-service.sh native distribution/boxbackup/contrib/redhat/README.txt native distribution/boxbackup/contrib/rpm/README.txt native distribution/boxbackup/contrib/suse/README.txt native distribution/boxbackup/DISTRIBUTION-MANIFEST.txt native distribution/boxbackup/DOCUMENTATION.txt native distribution/boxbackup/LICENSE.txt native distribution/boxbackup/LINUX.txt native distribution/boxbackup/NETBSD.txt native distribution/boxbackup/THANKS.txt native distribution/boxbackup/VERSION.txt native distribution/COMMON-MANIFEST.txt native docs/backup/backup_encryption.txt native docs/backup/bin_bbackupd.txt native docs/backup/bin_bbstored.txt native docs/backup/encrypt_rsync.txt native docs/backup/INDEX.txt native docs/backup/lib_backupclient.txt native docs/backup/lib_backupstore.txt native docs/backup/win32_build_on_cygwin_using_mingw.txt native docs/backup/win32_build_on_linux_using_mingw.txt native docs/backup/Win32_Clients.txt native docs/backup/windows_porting.txt native docs/common/lib_common/BoxTime.txt native docs/common/lib_common/CollectInBufferStream.txt native docs/common/lib_common/Configuration.txt native docs/common/lib_common/Conversion.txt native docs/common/lib_common/ExcludeList.txt native docs/common/lib_common/FdGetLine.txt native docs/common/lib_common/Guards.txt native docs/common/lib_common/IOStreamGetLine.txt native docs/common/lib_common/IOStream.txt native docs/common/lib_common/MainHelper.txt native docs/common/lib_common.txt native docs/common/lib_common/WaitForEvent.txt native docs/common/lib_common/xStream.txt native docs/common/lib_compress/CompressStream.txt native docs/common/lib_compress.txt native docs/common/lib_crypto/CipherContext.txt native docs/common/lib_crypto/RollingChecksum.txt native docs/common/lib_crypto.txt native docs/common/lib_server/Daemon.txt native docs/common/lib_server/Protocol.txt native docs/common/lib_server/ServerStream.txt native docs/common/lib_server/ServerTLS.txt native docs/common/lib_server/SocketStreamTLS.txt native docs/common/lib_server/SocketStream.txt native docs/common/lib_server/TLSContext.txt native docs/common/lib_server.txt native docs/common/memory_leaks.txt native docs/raidfile/lib_raidfile/RaidFileRead.txt native docs/raidfile/lib_raidfile/RaidFileWrite.txt native docs/raidfile/lib_raidfile.txt native infrastructure/BoxPlatform.pm.in native infrastructure/buildenv-testmain-template.cpp native infrastructure/m4/ac_cxx_exceptions.m4 native infrastructure/m4/ac_cxx_namespaces.m4 native infrastructure/m4/ax_check_bdb_v1.m4 native infrastructure/m4/ax_check_define_pragma.m4 native infrastructure/m4/ax_check_dirent_d_type.m4 native infrastructure/m4/ax_check_llong_minmax.m4 native infrastructure/m4/ax_check_malloc_workaround.m4 native infrastructure/m4/ax_check_mount_point.m4 native infrastructure/m4/ax_check_nonaligned_access.m4 native infrastructure/m4/ax_check_ssl.m4 native infrastructure/m4/ax_check_syscall_lseek.m4 native infrastructure/m4/ax_func_syscall.m4 native infrastructure/m4/ax_random_device.m4 native infrastructure/m4/vl_lib_readline.m4 native infrastructure/makebuildenv.pl native infrastructure/makedistribution.pl native infrastructure/makeparcels.pl native infrastructure/setupexternal.pl native infrastructure/tests/common_tests.pl native lib/backupclient/BackupClientCryptoKeys.cpp native lib/backupclient/BackupClientCryptoKeys.h native lib/backupclient/BackupClientFileAttributes.cpp native lib/backupclient/BackupClientFileAttributes.h native lib/backupclient/BackupClientMakeExcludeList.cpp native lib/backupclient/BackupClientMakeExcludeList.h native lib/backupclient/BackupClientRestore.cpp native lib/backupclient/BackupClientRestore.h native lib/backupclient/BackupDaemonConfigVerify.cpp native lib/backupclient/BackupDaemonConfigVerify.h native lib/backupclient/BackupStoreConstants.h native lib/backupclient/BackupStoreDirectory.cpp native lib/backupclient/BackupStoreDirectory.h native lib/backupclient/BackupStoreException.h native lib/backupclient/BackupStoreException.txt native lib/backupclient/BackupStoreFileCmbDiff.cpp native lib/backupclient/BackupStoreFileCmbIdx.cpp native lib/backupclient/BackupStoreFileCombine.cpp native lib/backupclient/BackupStoreFile.cpp native lib/backupclient/BackupStoreFileCryptVar.cpp native lib/backupclient/BackupStoreFileCryptVar.h native lib/backupclient/BackupStoreFileDiff.cpp native lib/backupclient/BackupStoreFileEncodeStream.cpp native lib/backupclient/BackupStoreFileEncodeStream.h native lib/backupclient/BackupStoreFile.h native lib/backupclient/BackupStoreFilenameClear.cpp native lib/backupclient/BackupStoreFilenameClear.h native lib/backupclient/BackupStoreFilename.cpp native lib/backupclient/BackupStoreFilename.h native lib/backupclient/BackupStoreFileRevDiff.cpp native lib/backupclient/BackupStoreFileWire.h native lib/backupclient/BackupStoreObjectDump.cpp native lib/backupclient/BackupStoreObjectMagic.h native lib/backupclient/Makefile.extra native lib/backupstore/BackupStoreAccountDatabase.cpp native lib/backupstore/BackupStoreAccountDatabase.h native lib/backupstore/BackupStoreAccounts.cpp native lib/backupstore/BackupStoreAccounts.h native lib/backupstore/BackupStoreCheck2.cpp native lib/backupstore/BackupStoreCheck.cpp native lib/backupstore/BackupStoreCheckData.cpp native lib/backupstore/BackupStoreCheck.h native lib/backupstore/BackupStoreConfigVerify.cpp native lib/backupstore/BackupStoreConfigVerify.h native lib/backupstore/BackupStoreInfo.cpp native lib/backupstore/BackupStoreInfo.h native lib/backupstore/StoreStructure.cpp native lib/backupstore/StoreStructure.h native lib/common/BannerText.h native lib/common/BeginStructPackForWire.h native lib/common/BoxException.cpp native lib/common/BoxException.h native lib/common/Box.h native lib/common/BoxPlatform.h native lib/common/BoxPortsAndFiles.h native lib/common/BoxTime.cpp native lib/common/BoxTime.h native lib/common/BoxTimeToText.cpp native lib/common/BoxTimeToText.h native lib/common/BoxTimeToUnix.h native lib/common/CollectInBufferStream.cpp native lib/common/CollectInBufferStream.h native lib/common/CommonException.h native lib/common/CommonException.txt native lib/common/Configuration.cpp native lib/common/Configuration.h native lib/common/ConversionException.txt native lib/common/Conversion.h native lib/common/ConversionString.cpp native lib/common/DebugAssertFailed.cpp native lib/common/DebugMemLeakFinder.cpp native lib/common/DebugPrintf.cpp native lib/common/EndStructPackForWire.h native lib/common/EventWatchFilesystemObject.cpp native lib/common/EventWatchFilesystemObject.h native lib/common/ExcludeList.cpp native lib/common/ExcludeList.h native lib/common/FdGetLine.cpp native lib/common/FdGetLine.h native lib/common/FileModificationTime.h native lib/common/FileStream.cpp native lib/common/FileStream.h native lib/common/Guards.h native lib/common/IOStream.cpp native lib/common/IOStreamGetLine.cpp native lib/common/IOStreamGetLine.h native lib/common/IOStream.h native lib/common/MainHelper.h native lib/common/makeexception.pl native lib/common/Makefile.extra native lib/common/MemBlockStream.cpp native lib/common/MemBlockStream.h native lib/common/MemLeakFinder.h native lib/common/MemLeakFindOff.h native lib/common/MemLeakFindOn.h native lib/common/NamedLock.cpp native lib/common/NamedLock.h native lib/common/PartialReadStream.cpp native lib/common/PartialReadStream.h native lib/common/ReadGatherStream.cpp native lib/common/ReadGatherStream.h native lib/common/StreamableMemBlock.cpp native lib/common/StreamableMemBlock.h native lib/common/TemporaryDirectory.h native lib/common/Test.h native lib/common/UnixUser.cpp native lib/common/UnixUser.h native lib/common/Utils.cpp native lib/common/Utils.h native lib/common/WaitForEvent.cpp native lib/common/WaitForEvent.h native lib/compress/CompressException.h native lib/compress/CompressException.txt native lib/compress/Compress.h native lib/compress/CompressStream.cpp native lib/compress/CompressStream.h native lib/compress/Makefile.extra native lib/crypto/CipherAES.cpp native lib/crypto/CipherAES.h native lib/crypto/CipherBlowfish.cpp native lib/crypto/CipherBlowfish.h native lib/crypto/CipherContext.cpp native lib/crypto/CipherContext.h native lib/crypto/CipherDescription.cpp native lib/crypto/CipherDescription.h native lib/crypto/CipherException.h native lib/crypto/CipherException.txt native lib/crypto/Makefile.extra native lib/crypto/MD5Digest.cpp native lib/crypto/MD5Digest.h native lib/crypto/Random.cpp native lib/crypto/Random.h native lib/crypto/RollingChecksum.cpp native lib/crypto/RollingChecksum.h native lib/raidfile/Makefile.extra native lib/raidfile/raidfile-config native lib/raidfile/RaidFileController.cpp native lib/raidfile/RaidFileController.h native lib/raidfile/RaidFileException.h native lib/raidfile/RaidFileException.txt native lib/raidfile/RaidFileRead.cpp native lib/raidfile/RaidFileRead.h native lib/raidfile/RaidFileUtil.cpp native lib/raidfile/RaidFileUtil.h native lib/raidfile/RaidFileWrite.cpp native lib/raidfile/RaidFileWrite.h native lib/server/ConnectionException.txt native lib/server/Daemon.cpp native lib/server/Daemon.h native lib/server/LocalProcessStream.cpp native lib/server/LocalProcessStream.h native lib/server/Makefile.extra native lib/server/makeprotocol.pl native lib/server/Protocol.cpp native lib/server/Protocol.h native lib/server/ProtocolObject.cpp native lib/server/ProtocolObject.h native lib/server/ProtocolUncertainStream.cpp native lib/server/ProtocolUncertainStream.h native lib/server/ProtocolWire.h native lib/server/ServerException.h native lib/server/ServerException.txt native lib/server/ServerStream.h native lib/server/ServerTLS.h native lib/server/Socket.cpp native lib/server/Socket.h native lib/server/SocketListen.h native lib/server/SocketStream.cpp native lib/server/SocketStream.h native lib/server/SocketStreamTLS.cpp native lib/server/SocketStreamTLS.h native lib/server/SSLLib.cpp native lib/server/SSLLib.h native lib/server/TLSContext.cpp native lib/server/TLSContext.h native lib/win32/emu.cpp native lib/win32/emu.h native lib/win32/WinNamedPipeStream.cpp native lib/win32/WinNamedPipeStream.h native LICENSE.txt native modules.txt native parcels.txt native runtest.pl native test/backupdiff/difftestfiles.cpp native test/backupdiff/testbackupdiff.cpp native test/backupdiff/testextra native test/backupstorefix/testbackupstorefix.cpp native test/backupstorefix/testextra native test/backupstorefix/testfiles/testbackupstorefix.pl native test/backupstorepatch/testbackupstorepatch.cpp native test/backupstorepatch/testextra native test/backupstore/testbackupstore.cpp native test/backupstore/testextra native test/backupstore/testfiles/accounts.txt native test/backupstore/testfiles/bbstored.conf native test/backupstore/testfiles/bbstored_multi.conf native test/backupstore/testfiles/clientCerts.pem native test/backupstore/testfiles/clientPrivKey.pem native test/backupstore/testfiles/clientReq.pem native test/backupstore/testfiles/clientTrustedCAs.pem native test/backupstore/testfiles/query.conf native test/backupstore/testfiles/raidfile.conf native test/backupstore/testfiles/rootcert.pem native test/backupstore/testfiles/rootkey.pem native test/backupstore/testfiles/root.pem native test/backupstore/testfiles/rootreq.pem native test/backupstore/testfiles/root.srl native test/backupstore/testfiles/serverCerts.pem native test/backupstore/testfiles/serverPrivKey.pem native test/backupstore/testfiles/serverReq.pem native test/backupstore/testfiles/serverTrustedCAs.pem native test/basicserver/Makefile.extra native test/basicserver/testbasicserver.cpp native test/basicserver/TestCommands.cpp native test/basicserver/TestContext.cpp native test/basicserver/TestContext.h native test/basicserver/testfiles/clientCerts.pem native test/basicserver/testfiles/clientPrivKey.pem native test/basicserver/testfiles/clientReq.pem native test/basicserver/testfiles/clientTrustedCAs.pem native test/basicserver/testfiles/key-creation.txt native test/basicserver/testfiles/rootcert.pem native test/basicserver/testfiles/rootkey.pem native test/basicserver/testfiles/root.pem native test/basicserver/testfiles/rootreq.pem native test/basicserver/testfiles/root.srl native test/basicserver/testfiles/serverCerts.pem native test/basicserver/testfiles/serverPrivKey.pem native test/basicserver/testfiles/serverReq.pem native test/basicserver/testfiles/serverTrustedCAs.pem native test/basicserver/testfiles/srv1b.conf native test/basicserver/testfiles/srv1.conf native test/basicserver/testfiles/srv2.conf native test/basicserver/testfiles/srv3.conf native test/basicserver/testfiles/srv4.conf native test/basicserver/testprotocol.txt native test/bbackupd/testbbackupd.cpp native test/bbackupd/testextra native test/bbackupd/testfiles/accounts.txt native test/bbackupd/testfiles/bbackupd.conf native test/bbackupd/testfiles/bbstored.conf native test/bbackupd/testfiles/clientCerts.pem native test/bbackupd/testfiles/clientPrivKey.pem native test/bbackupd/testfiles/clientTrustedCAs.pem native test/bbackupd/testfiles/extcheck1.pl native test/bbackupd/testfiles/extcheck2.pl native test/bbackupd/testfiles/notifyscript.pl native test/bbackupd/testfiles/raidfile.conf native test/bbackupd/testfiles/serverCerts.pem native test/bbackupd/testfiles/serverPrivKey.pem native test/bbackupd/testfiles/serverTrustedCAs.pem native test/common/testcommon.cpp native test/common/testfiles/config10.txt native test/common/testfiles/config11.txt native test/common/testfiles/config12.txt native test/common/testfiles/config13.txt native test/common/testfiles/config14.txt native test/common/testfiles/config15.txt native test/common/testfiles/config16.txt native test/common/testfiles/config1.txt native test/common/testfiles/config2.txt native test/common/testfiles/config3.txt native test/common/testfiles/config4.txt native test/common/testfiles/config5.txt native test/common/testfiles/config6.txt native test/common/testfiles/config7.txt native test/common/testfiles/config8.txt native test/common/testfiles/config9b.txt native test/common/testfiles/config9c.txt native test/common/testfiles/config9d.txt native test/common/testfiles/config9.txt native test/common/testfiles/fdgetlinetest.txt native test/compress/testcompress.cpp native test/crypto/testcrypto.cpp native test/raidfile/Darwin-SYS.h native test/raidfile/intercept.cpp native test/raidfile/make-darwin-intercepts.pl native test/raidfile/Makefile.extra.Darwin native test/raidfile/testextra native test/raidfile/testfiles/raidfile.conf native test/raidfile/testraidfile.cpp native test/win32/testlibwin32.cpp native VERSION.txt From boxbackup-dev at fluffy.co.uk Tue Dec 13 00:03:25 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Tue, 13 Dec 2005 00:03:25 +0000 Subject: [Box Backup-dev] Testing on Gentoo/PPC64 In-Reply-To: References: Message-ID: <1134432205.27021.18.camel@avenin.ebourne.me.uk> On Mon, 2005-12-12 at 22:50 +0000, Jonathan Morton wrote: > This is probably one of the more unusual platforms going - even most G5 > owners run Gentoo/PPC32 userspace with a 64-bit kernel - but I suspect the > problems I encountered are universal. > > 1) Autoconf failed to locate the Berkeley DB that was installed. Do you have BDB 1.85 compatibility installed? eg. You should have db_185.h somewhere. Also you should have libdb-1.so installed, or alternatively libdb4-x.so or libdb.so should define __db185_open. If you can work out where it should have found BDB then I can fix it. Now that the BDB 4 support is in trunk I plan to modify configure to use that in preference of 185 anyhow. > 2) Building failed with an incorrect package setup. I suspect that this > is because version.txt (or similar) is missing from SVN. > > 3) Raidfile tests failed. Everything else passed. Sounds the same as I had before merging the win32 code. Probably a bug in one of the earlier patches somewhere. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Mon Dec 12 23:40:55 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Mon, 12 Dec 2005 23:40:55 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r218 - in box/chris/win32/merge/07-win32-fixes: . test/crypto Message-ID: <20051212234055.8CDE493@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-12 23:40:49 +0000 (Mon, 12 Dec 2005) New Revision: 218 Modified: box/chris/win32/merge/07-win32-fixes/modules.txt box/chris/win32/merge/07-win32-fixes/runtest.pl box/chris/win32/merge/07-win32-fixes/test/crypto/testcrypto.cpp Log: * modules.txt - Disabled test/basicserver on mingw32 (requires fork() and signals) * runtest.pl - Properly skip tests for cross-compiled targets * test/crypto/testcrypto.cpp - Use memset instead of non-portable bzero Modified: box/chris/win32/merge/07-win32-fixes/modules.txt =================================================================== --- box/chris/win32/merge/07-win32-fixes/modules.txt 2005-12-12 23:03:11 UTC (rev 217) +++ box/chris/win32/merge/07-win32-fixes/modules.txt 2005-12-12 23:40:49 UTC (rev 218) @@ -19,11 +19,11 @@ lib/win32 lib/server lib/compress test/common lib/win32 -test/crypto lib/crypto -test/compress lib/compress -test/basicserver lib/server +test/crypto lib/crypto lib/win32 +test/compress lib/compress lib/win32 OMIT:mingw32 +test/basicserver lib/server lib/win32 OMIT:CYGWIN test/raidfile lib/raidfile END-OMIT Modified: box/chris/win32/merge/07-win32-fixes/runtest.pl =================================================================== --- box/chris/win32/merge/07-win32-fixes/runtest.pl 2005-12-12 23:03:11 UTC (rev 217) +++ box/chris/win32/merge/07-win32-fixes/runtest.pl 2005-12-12 23:40:49 UTC (rev 218) @@ -38,7 +38,7 @@ next if m/\AEND-OMIT/; if(m/\AOMIT:(.+)/) { - if($1 eq $build_os) + if($1 eq $build_os or $1 eq $target_os) { while() { Modified: box/chris/win32/merge/07-win32-fixes/test/crypto/testcrypto.cpp =================================================================== --- box/chris/win32/merge/07-win32-fixes/test/crypto/testcrypto.cpp 2005-12-12 23:03:11 UTC (rev 217) +++ box/chris/win32/merge/07-win32-fixes/test/crypto/testcrypto.cpp 2005-12-12 23:40:49 UTC (rev 218) @@ -43,7 +43,7 @@ } } -#define ZERO_BUFFER(x) ::bzero(x, sizeof(x)); +#define ZERO_BUFFER(x) ::memset(x, 0, sizeof(x)); template void test_cipher() From boxbackup-dev at fluffy.co.uk Tue Dec 13 00:33:12 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Tue, 13 Dec 2005 00:33:12 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r216 - in box/chris/win32/merge/07-win32-fixes: . infrastructure lib/common lib/win32 test/common In-Reply-To: <1134428680.27021.4.camel@avenin.ebourne.me.uk> References: <20051212214704.A244D93@s0g0.pems.testserver.co.uk> <1134428680.27021.4.camel@avenin.ebourne.me.uk> Message-ID: Hi Martin, > Just to let you know Chris, I merged 07-win32-fixes at r210 into trunk > earlier. Didn't see a commit message though. If these fixes should go in > too, let me know. Yes please. With the extra fixes I just committed to 07-win32-fixes, common, crypto and compress tests pass, and the others are not run on win32, so the test suite passes. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Mon Dec 12 23:56:46 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Mon, 12 Dec 2005 23:56:46 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r219 - in box/trunk: . infrastructure lib/common test/common test/crypto Message-ID: <20051212235646.77ABD93@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-12 23:56:44 +0000 (Mon, 12 Dec 2005) New Revision: 219 Modified: box/trunk/infrastructure/buildenv-testmain-template.cpp box/trunk/infrastructure/makebuildenv.pl box/trunk/lib/common/DebugAssertFailed.cpp box/trunk/lib/common/DebugPrintf.cpp box/trunk/lib/common/FileStream.cpp box/trunk/lib/common/Test.h box/trunk/modules.txt box/trunk/runtest.pl box/trunk/test/common/testcommon.cpp box/trunk/test/crypto/testcrypto.cpp Log: Merged 210:218 from chris/win32/merge/07-win32-fixes to trunk Modified: box/trunk/infrastructure/buildenv-testmain-template.cpp =================================================================== --- box/trunk/infrastructure/buildenv-testmain-template.cpp 2005-12-12 23:40:49 UTC (rev 218) +++ box/trunk/infrastructure/buildenv-testmain-template.cpp 2005-12-12 23:56:44 UTC (rev 219) @@ -20,11 +20,16 @@ #include #include #include -#include #include #include #include +#ifdef WIN32 + #include "emu.h" +#else + #include +#endif + #include "MemLeakFindOn.h" int test(int argc, const char *argv[]); @@ -39,6 +44,14 @@ int filedes_open_at_beginning = -1; +#ifdef WIN32 + +// any way to check for open file descriptors on Win32? +inline int count_filedes() { return 0; } +inline bool checkfilesleftopen() { return false; } + +#else // !WIN32 + int count_filedes() { int c = 0; @@ -71,6 +84,8 @@ return filedes_open_at_beginning != count_filedes(); } +#endif + int main(int argc, const char *argv[]) { // Start memory leak testing Modified: box/trunk/infrastructure/makebuildenv.pl =================================================================== --- box/trunk/infrastructure/makebuildenv.pl 2005-12-12 23:40:49 UTC (rev 218) +++ box/trunk/infrastructure/makebuildenv.pl 2005-12-12 23:56:44 UTC (rev 219) @@ -408,9 +408,9 @@ } writetestfile("$mod/_t", - './test${platform_exe_ext} $1 $2 $3 $4 $5', $mod); + './test' . $platform_exe_ext . '$1 $2 $3 $4 $5', $mod); writetestfile("$mod/_t-gdb", - 'gdb ./test${platform_exe_ext}', $mod); + 'gdb ./test ' . $platform_exe_ext, $mod); } Modified: box/trunk/lib/common/DebugAssertFailed.cpp =================================================================== --- box/trunk/lib/common/DebugAssertFailed.cpp 2005-12-12 23:40:49 UTC (rev 218) +++ box/trunk/lib/common/DebugAssertFailed.cpp 2005-12-12 23:56:44 UTC (rev 219) @@ -12,8 +12,13 @@ #include "Box.h" #include -#include +#ifdef WIN32 + #include "emu.h" +#else + #include +#endif + #include "MemLeakFindOn.h" bool AssertFailuresToSyslog = false; Modified: box/trunk/lib/common/DebugPrintf.cpp =================================================================== --- box/trunk/lib/common/DebugPrintf.cpp 2005-12-12 23:40:49 UTC (rev 218) +++ box/trunk/lib/common/DebugPrintf.cpp 2005-12-12 23:56:44 UTC (rev 219) @@ -13,8 +13,13 @@ #include #include -#include +#ifdef WIN32 + #include "emu.h" +#else + #include +#endif + #include "MemLeakFindOn.h" // Use this apparently superflous printf function to avoid having to Modified: box/trunk/lib/common/FileStream.cpp =================================================================== --- box/trunk/lib/common/FileStream.cpp 2005-12-12 23:40:49 UTC (rev 218) +++ box/trunk/lib/common/FileStream.cpp 2005-12-12 23:56:44 UTC (rev 219) @@ -197,11 +197,9 @@ if ( (res == 0) || (numBytesWritten != NBytes)) { - DWORD err = GetLastError(); + // DWORD err = GetLastError(); THROW_EXCEPTION(CommonException, OSFileWriteError) } - - #else if(::write(mOSFileHandle, pBuffer, NBytes) != NBytes) { Modified: box/trunk/lib/common/Test.h =================================================================== --- box/trunk/lib/common/Test.h 2005-12-12 23:40:49 UTC (rev 218) +++ box/trunk/lib/common/Test.h 2005-12-12 23:56:44 UTC (rev 219) @@ -108,6 +108,116 @@ return pid; } +#ifdef WIN32 + +#include "WinNamedPipeStream.h" +#include "IOStreamGetLine.h" +#include "BoxPortsAndFiles.h" + +bool SendCommands(const std::string& rCmd) +{ + WinNamedPipeStream connection; + + try + { + connection.Connect(BOX_NAMED_PIPE_NAME); + } + catch(...) + { + printf("Failed to connect to daemon control socket.\n"); + return false; + } + + // For receiving data + IOStreamGetLine getLine(connection); + + // Wait for the configuration summary + std::string configSummary; + if(!getLine.GetLine(configSummary)) + { + printf("Failed to receive configuration summary from daemon\n"); + return false; + } + + // Was the connection rejected by the server? + if(getLine.IsEOF()) + { + printf("Server rejected the connection.\n"); + return false; + } + + // Decode it + int autoBackup, updateStoreInterval, minimumFileAge, maxUploadWait; + if(::sscanf(configSummary.c_str(), "bbackupd: %d %d %d %d", + &autoBackup, &updateStoreInterval, + &minimumFileAge, &maxUploadWait) != 4) + { + printf("Config summary didn't decode\n"); + return false; + } + + std::string cmds; + bool expectResponse; + + if (rCmd != "") + { + cmds = rCmd; + cmds += "\nquit\n"; + expectResponse = true; + } + else + { + cmds = "quit\n"; + expectResponse = false; + } + + connection.Write(cmds.c_str(), cmds.size()); + + // Read the response + std::string line; + bool statusOk = !expectResponse; + + while (expectResponse && !getLine.IsEOF() && getLine.GetLine(line)) + { + // Is this an OK or error line? + if (line == "ok") + { + statusOk = true; + } + else if (line == "error") + { + printf("ERROR (%s)\n", rCmd.c_str()); + break; + } + else + { + printf("WARNING: Unexpected response to command '%s': " + "%s", rCmd.c_str(), line.c_str()); + } + } + + return statusOk; +} + +inline bool ServerIsAlive() +{ + return SendCommands(""); +} + +inline bool HUPServer(int pid) +{ + return SendCommands("reload"); +} + +inline bool KillServer(int pid) +{ + TEST_THAT(SendCommands("terminate")); + ::sleep(1); + return !ServerIsAlive(); +} + +#else // !WIN32 + inline bool ServerIsAlive(int pid) { if(pid == 0) return false; @@ -129,6 +239,8 @@ return !ServerIsAlive(pid); } +#endif // WIN32 + inline void TestRemoteProcessMemLeaks(const char *filename) { #ifdef BOX_MEMORY_LEAK_TESTING Modified: box/trunk/modules.txt =================================================================== --- box/trunk/modules.txt 2005-12-12 23:40:49 UTC (rev 218) +++ box/trunk/modules.txt 2005-12-12 23:56:44 UTC (rev 219) @@ -18,12 +18,12 @@ lib/server lib/win32 lib/server lib/compress -test/common -test/crypto lib/crypto -test/compress lib/compress -test/basicserver lib/server +test/common lib/win32 +test/crypto lib/crypto lib/win32 +test/compress lib/compress lib/win32 OMIT:mingw32 +test/basicserver lib/server lib/win32 OMIT:CYGWIN test/raidfile lib/raidfile END-OMIT Modified: box/trunk/runtest.pl =================================================================== --- box/trunk/runtest.pl 2005-12-12 23:40:49 UTC (rev 218) +++ box/trunk/runtest.pl 2005-12-12 23:56:44 UTC (rev 219) @@ -38,7 +38,7 @@ next if m/\AEND-OMIT/; if(m/\AOMIT:(.+)/) { - if($1 eq $build_os) + if($1 eq $build_os or $1 eq $target_os) { while() { Modified: box/trunk/test/common/testcommon.cpp =================================================================== --- box/trunk/test/common/testcommon.cpp 2005-12-12 23:40:49 UTC (rev 218) +++ box/trunk/test/common/testcommon.cpp 2005-12-12 23:56:44 UTC (rev 219) @@ -181,7 +181,8 @@ // First, test the FdGetLine class -- rather important this works! { - FileHandleGuard file("testfiles/fdgetlinetest.txt"); + FileHandleGuard file("testfiles" + DIRECTORY_SEPARATOR "fdgetlinetest.txt"); FdGetLine getline(file); int l = 0; @@ -198,8 +199,10 @@ } // and again without pre-processing { - FileHandleGuard file("testfiles/fdgetlinetest.txt"); - FILE *file2 = fopen("testfiles/fdgetlinetest.txt", "r"); + FileHandleGuard file("testfiles" + DIRECTORY_SEPARATOR "fdgetlinetest.txt"); + FILE *file2 = fopen("testfiles" DIRECTORY_SEPARATOR + "fdgetlinetest.txt", "r"); TEST_THAT_ABORTONFAIL(file2 != 0); FdGetLine getline(file); char ll[512]; @@ -227,7 +230,8 @@ // Then the IOStream version of get line, seeing as we're here... { - FileStream file("testfiles/fdgetlinetest.txt", O_RDONLY); + FileStream file("testfiles" DIRECTORY_SEPARATOR + "fdgetlinetest.txt", O_RDONLY); IOStreamGetLine getline(file); int l = 0; @@ -247,10 +251,12 @@ } // and again without pre-processing { - FileStream file("testfiles/fdgetlinetest.txt", O_RDONLY); + FileStream file("testfiles" DIRECTORY_SEPARATOR + "fdgetlinetest.txt", O_RDONLY); IOStreamGetLine getline(file); - FILE *file2 = fopen("testfiles/fdgetlinetest.txt", "r"); + FILE *file2 = fopen("testfiles" DIRECTORY_SEPARATOR + "fdgetlinetest.txt", "r"); TEST_THAT_ABORTONFAIL(file2 != 0); char ll[512]; @@ -281,13 +287,20 @@ // Doesn't exist { std::string errMsg; - TEST_CHECK_THROWS(std::auto_ptr pconfig(Configuration::LoadAndVerify("testfiles/DOESNTEXIST", &verify, errMsg)), CommonException, OSFileOpenError); + TEST_CHECK_THROWS(std::auto_ptr pconfig( + Configuration::LoadAndVerify( + "testfiles" DIRECTORY_SEPARATOR "DOESNTEXIST", + &verify, errMsg)), + CommonException, OSFileOpenError); } // Basic configuration test { std::string errMsg; - std::auto_ptr pconfig(Configuration::LoadAndVerify("testfiles/config1.txt", &verify, errMsg)); + std::auto_ptr pconfig( + Configuration::LoadAndVerify( + "testfiles" DIRECTORY_SEPARATOR "config1.txt", + &verify, errMsg)); if(!errMsg.empty()) { printf("UNEXPECTED error msg is:\n------\n%s------\n", errMsg.c_str()); @@ -332,22 +345,38 @@ static const char *file[] = { - "testfiles/config2.txt", // Value missing from root - "testfiles/config3.txt", // Unexpected { - "testfiles/config4.txt", // Missing } - "testfiles/config5.txt", // { expected, but wasn't there - "testfiles/config6.txt", // Duplicate key - "testfiles/config7.txt", // Invalid key (no name) - "testfiles/config8.txt", // Not all sub blocks terminated - "testfiles/config9.txt", // Not valid integer - "testfiles/config9b.txt", // Not valid integer - "testfiles/config9c.txt", // Not valid integer - "testfiles/config9d.txt", // Not valid integer - "testfiles/config10.txt", // Missing key (in subblock) - "testfiles/config11.txt", // Unknown key - "testfiles/config12.txt", // Missing block - "testfiles/config13.txt", // Subconfig (wildcarded) should exist, but missing (ie nothing present) - "testfiles/config16.txt", // bad boolean value + "testfiles" DIRECTORY_SEPARATOR "config2.txt", + // Value missing from root + "testfiles" DIRECTORY_SEPARATOR "config3.txt", + // Unexpected { + "testfiles" DIRECTORY_SEPARATOR "config4.txt", + // Missing } + "testfiles" DIRECTORY_SEPARATOR "config5.txt", + // { expected, but wasn't there + "testfiles" DIRECTORY_SEPARATOR "config6.txt", + // Duplicate key + "testfiles" DIRECTORY_SEPARATOR "config7.txt", + // Invalid key (no name) + "testfiles" DIRECTORY_SEPARATOR "config8.txt", + // Not all sub blocks terminated + "testfiles" DIRECTORY_SEPARATOR "config9.txt", + // Not valid integer + "testfiles" DIRECTORY_SEPARATOR "config9b.txt", + // Not valid integer + "testfiles" DIRECTORY_SEPARATOR "config9c.txt", + // Not valid integer + "testfiles" DIRECTORY_SEPARATOR "config9d.txt", + // Not valid integer + "testfiles" DIRECTORY_SEPARATOR "config10.txt", + // Missing key (in subblock) + "testfiles" DIRECTORY_SEPARATOR "config11.txt", + // Unknown key + "testfiles" DIRECTORY_SEPARATOR "config12.txt", + // Missing block + "testfiles" DIRECTORY_SEPARATOR "config13.txt", + // Subconfig (wildcarded) should exist, but missing (ie nothing present) + "testfiles" DIRECTORY_SEPARATOR "config16.txt", + // bad boolean value 0 }; @@ -364,7 +393,10 @@ // (single value in a multivalue already checked) { std::string errMsg; - std::auto_ptr pconfig(Configuration::LoadAndVerify("testfiles/config14.txt", &verify, errMsg)); + std::auto_ptr pconfig( + Configuration::LoadAndVerify( + "testfiles" DIRECTORY_SEPARATOR "config14.txt", + &verify, errMsg)); TEST_THAT(pconfig.get() != 0); TEST_THAT(errMsg.empty()); TEST_THAT(pconfig->KeyExists("MultiValue")); @@ -378,7 +410,10 @@ // Check boolean values { std::string errMsg; - std::auto_ptr pconfig(Configuration::LoadAndVerify("testfiles/config15.txt", &verify, errMsg)); + std::auto_ptr pconfig( + Configuration::LoadAndVerify( + "testfiles" DIRECTORY_SEPARATOR "config15.txt", + &verify, errMsg)); TEST_THAT(pconfig.get() != 0); TEST_THAT(errMsg.empty()); TEST_THAT(pconfig->GetKeyValueBool("BoolTrue1") == true); @@ -391,32 +426,50 @@ { NamedLock lock1; // Try and get a lock on a name in a directory which doesn't exist - TEST_CHECK_THROWS(lock1.TryAndGetLock("testfiles/non-exist/lock"), CommonException, OSFileError); + TEST_CHECK_THROWS(lock1.TryAndGetLock( + "testfiles" + DIRECTORY_SEPARATOR "non-exist" + DIRECTORY_SEPARATOR "lock"), + CommonException, OSFileError); + // And a more resonable request - TEST_THAT(lock1.TryAndGetLock("testfiles/lock1") == true); + TEST_THAT(lock1.TryAndGetLock( + "testfiles" DIRECTORY_SEPARATOR "lock1") == true); + // Try to lock something using the same lock - TEST_CHECK_THROWS(lock1.TryAndGetLock("testfiles/non-exist/lock2"), CommonException, NamedLockAlreadyLockingSomething); + TEST_CHECK_THROWS( + lock1.TryAndGetLock( + "testfiles" + DIRECTORY_SEPARATOR "non-exist" + DIRECTORY_SEPARATOR "lock2"), + CommonException, NamedLockAlreadyLockingSomething); #if defined(HAVE_FLOCK) || HAVE_DECL_O_EXLOCK // And again on that name NamedLock lock2; - TEST_THAT(lock2.TryAndGetLock("testfiles/lock1") == false); + TEST_THAT(lock2.TryAndGetLock( + "testfiles" DIRECTORY_SEPARATOR "lock1") == false); #endif } { // Check that it unlocked when it went out of scope NamedLock lock3; - TEST_THAT(lock3.TryAndGetLock("testfiles/lock1") == true); + TEST_THAT(lock3.TryAndGetLock( + "testfiles" DIRECTORY_SEPARATOR "lock1") == true); } { // And unlocking works NamedLock lock4; - TEST_CHECK_THROWS(lock4.ReleaseLock(), CommonException, NamedLockNotHeld); - TEST_THAT(lock4.TryAndGetLock("testfiles/lock4") == true); + TEST_CHECK_THROWS(lock4.ReleaseLock(), CommonException, + NamedLockNotHeld); + TEST_THAT(lock4.TryAndGetLock( + "testfiles" DIRECTORY_SEPARATOR "lock4") == true); lock4.ReleaseLock(); NamedLock lock5; - TEST_THAT(lock5.TryAndGetLock("testfiles/lock4") == true); + TEST_THAT(lock5.TryAndGetLock( + "testfiles" DIRECTORY_SEPARATOR "lock4") == true); // And can reuse it - TEST_THAT(lock4.TryAndGetLock("testfiles/lock5") == true); + TEST_THAT(lock4.TryAndGetLock( + "testfiles" DIRECTORY_SEPARATOR "lock5") == true); } // Test the ReadGatherStream Modified: box/trunk/test/crypto/testcrypto.cpp =================================================================== --- box/trunk/test/crypto/testcrypto.cpp 2005-12-12 23:40:49 UTC (rev 218) +++ box/trunk/test/crypto/testcrypto.cpp 2005-12-12 23:56:44 UTC (rev 219) @@ -43,7 +43,7 @@ } } -#define ZERO_BUFFER(x) ::bzero(x, sizeof(x)); +#define ZERO_BUFFER(x) ::memset(x, 0, sizeof(x)); template void test_cipher() From boxbackup-dev at fluffy.co.uk Tue Dec 13 00:54:10 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Tue, 13 Dec 2005 00:54:10 +0000 Subject: [Box Backup-dev] COMMIT r216 - in box/chris/win32/merge/07-win32-fixes: . infrastructure lib/common lib/win32 test/common In-Reply-To: References: <20051212214704.A244D93@s0g0.pems.testserver.co.uk> <1134428680.27021.4.camel@avenin.ebourne.me.uk> Message-ID: <1134435250.12509.6.camel@avenin.ebourne.me.uk> On Tue, 2005-12-13 at 00:33 +0000, Chris Wilson wrote: > Hi Martin, > > > Just to let you know Chris, I merged 07-win32-fixes at r210 into trunk > > earlier. Didn't see a commit message though. If these fixes should go in > > too, let me know. > > Yes please. With the extra fixes I just committed to 07-win32-fixes, > common, crypto and compress tests pass, and the others are not run on > win32, so the test suite passes. > > Cheers, Chris. All looked sane, merged in r219. Suggest you re-branch off trunk if you want to do any more. (Or commit to trunk if small changes.) Ran tests before this last commit, getting two failures: common: PASSED crypto: PASSED compress: PASSED basicserver: PASSED raidfile: FAILED: 240 tests failed backupstore: PASSED backupstorefix: PASSED backupstorepatch: PASSED backupdiff: PASSED bbackupd: FAILED: 1 tests failed raidfile failed before, snippet below: FAILURE: Condition [UsageInBlocks == pread->GetDiscUsageInBlocks()] failed at testraidfile.cpp(110) FAILURE: Condition [pread->GetFileSize() == datasize] failed at testraidfile.cpp(113) FAILURE: Condition [UsageInBlocks == pread->GetDiscUsageInBlocks()] failed at testraidfile.cpp(147) FAILURE: Condition [UsageInBlocks == pread->GetDiscUsageInBlocks()] failed at testraidfile.cpp(170) FAILURE: Condition [UsageInBlocks == pread->GetDiscUsageInBlocks()] failed at testraidfile.cpp(193) FAILURE: Condition [((char*)data)[dataread+z] == testbuff[z]] failed at testraidfile.cpp(127) FAILURE: Condition [((char*)data)[dataread+z] == testbuff[z]] failed at testraidfile.cpp(127) FAILURE: Condition [((char*)data)[dataread+z] == testbuff[z]] failed at testraidfile.cpp(127) FAILURE: Condition [((char*)data)[dataread+z] == testbuff[z]] failed at testraidfile.cpp(127) FAILURE: Condition [::memcmp(((char*)data) + pos, testbuff, r) == 0] failed at testraidfile.cpp(203) That cycle repeated a lot. bbackupd: Change client store marker Check change of store marker pauses daemon waiting: .................. [ 0 (of 0) differences probably due to file modifications after the last upload ] Differences: 0 (3 dirs excluded, 4 files excluded) FAILURE: Condition [compareReturnValue == 2*256] failed at testbbackupd.cpp(708) Interrupted restore ............... FAILURE: Condition [compareReturnValue == 2*256] failed at testbbackupd.cpp(708) Interrupted restore raidfile was failing like that before win32, but bbackupd failure seems to be new. Too late to look into those now, bedtime. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Tue Dec 13 01:36:42 2005 From: boxbackup-dev at fluffy.co.uk (Jonathan Morton) Date: Tue, 13 Dec 2005 01:36:42 +0000 (GMT) Subject: [Box Backup-dev] Testing on Gentoo/PPC64 In-Reply-To: <1134432205.27021.18.camel@avenin.ebourne.me.uk> References: <1134432205.27021.18.camel@avenin.ebourne.me.uk> Message-ID: >> This is probably one of the more unusual platforms going - even most G5 >> owners run Gentoo/PPC32 userspace with a 64-bit kernel - but I suspect the >> problems I encountered are universal. >> >> 1) Autoconf failed to locate the Berkeley DB that was installed. > > Do you have BDB 1.85 compatibility installed? eg. You should have > db_185.h somewhere. Also you should have libdb-1.so installed, or > alternatively libdb4-x.so or libdb.so should define __db185_open. > > If you can work out where it should have found BDB then I can fix it. > Now that the BDB 4 support is in trunk I plan to modify configure to use > that in preference of 185 anyhow. Configure finds the header, but not the libraries. The libraries are installed in /usr/lib64/, which may be tripping it up. There are three libdb files there: libdb.so.2, libdb1.so.2, and libdb1.a. None of them contain __db185_open or anything similar. >> 2) Building failed with an incorrect package setup. I suspect that this >> is because version.txt (or similar) is missing from SVN. >> >> 3) Raidfile tests failed. Everything else passed. > > Sounds the same as I had before merging the win32 code. Probably a bug > in one of the earlier patches somewhere. Yes, these are fixed in the latest trunk. From boxbackup-dev at fluffy.co.uk Tue Dec 13 01:21:09 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Tue, 13 Dec 2005 01:21:09 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r220 - box/chromi Message-ID: <20051213012109.1722993@s0g0.pems.testserver.co.uk> Author: chromi Date: 2005-12-13 01:21:06 +0000 (Tue, 13 Dec 2005) New Revision: 220 Removed: box/chromi/diffopt/ Log: Removing branch - no longer needed because merged. From boxbackup-dev at fluffy.co.uk Tue Dec 13 01:57:08 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Tue, 13 Dec 2005 01:57:08 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r221 - box/trunk/test/backupdiff Message-ID: <20051213015708.B584993@s0g0.pems.testserver.co.uk> Author: chromi Date: 2005-12-13 01:57:07 +0000 (Tue, 13 Dec 2005) New Revision: 221 Modified: box/trunk/test/backupdiff/testbackupdiff.cpp Log: Refined BackupDiff test to delete the 220MB in temporary test files after use. Should cause much less strain on everyone's disk space. Modified: box/trunk/test/backupdiff/testbackupdiff.cpp =================================================================== --- box/trunk/test/backupdiff/testbackupdiff.cpp 2005-12-13 01:21:06 UTC (rev 220) +++ box/trunk/test/backupdiff/testbackupdiff.cpp 2005-12-13 01:57:07 UTC (rev 221) @@ -489,6 +489,9 @@ encoded->CopyStreamTo(out); TEST_THAT(time(0) < (beginTime + 20)); } + // Remove zero-files to save disk space + remove("testfiles/zero.0"); + remove("testfiles/zero.1"); #if 0 // Code for a nasty real world example! (16Mb files, won't include them in the distribution From boxbackup-dev at fluffy.co.uk Mon Dec 12 20:50:14 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Mon, 12 Dec 2005 20:50:14 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r213 - in box/trunk: . bin/bbackupctl bin/bbackupd bin/bbackupd/win32 bin/bbackupquery bin/bbstoreaccounts docs/backup infrastructure infrastructure/m4 lib lib/backupclient lib/common lib/server lib/win32 test test/basicserver test/win32 Message-ID: <20051212205014.6EFDA93@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-12 20:50:00 +0000 (Mon, 12 Dec 2005) New Revision: 213 Added: box/trunk/VERSION.txt box/trunk/bbackupctl.vcproj box/trunk/bbackupd.vcproj box/trunk/bin/bbackupd/Win32BackupService.cpp box/trunk/bin/bbackupd/Win32BackupService.h box/trunk/bin/bbackupd/Win32ServiceFunctions.cpp box/trunk/bin/bbackupd/Win32ServiceFunctions.h box/trunk/bin/bbackupd/win32/ box/trunk/bin/bbackupd/win32/ReadMe.txt box/trunk/bin/bbackupd/win32/bbackupd.conf box/trunk/bin/bbackupd/win32/installer.iss box/trunk/boxbackup.sln box/trunk/boxbackup.suo box/trunk/boxquery.vcproj box/trunk/common.vcproj box/trunk/config.guess box/trunk/config.sub box/trunk/docs/backup/Win32_Clients.txt box/trunk/docs/backup/win32_build_on_cygwin_using_mingw.txt box/trunk/docs/backup/win32_build_on_linux_using_mingw.txt box/trunk/lib/win32/ box/trunk/lib/win32/WinNamedPipeStream.cpp box/trunk/lib/win32/WinNamedPipeStream.h box/trunk/lib/win32/emu.cpp box/trunk/lib/win32/emu.h box/trunk/test/win32/ box/trunk/test/win32/testlibwin32.cpp box/trunk/win32.bat box/trunk/win32test.vcproj Removed: box/trunk/bin/bbackupd/win32/ReadMe.txt box/trunk/bin/bbackupd/win32/bbackupd.conf box/trunk/bin/bbackupd/win32/installer.iss box/trunk/lib/win32/WinNamedPipeStream.cpp box/trunk/lib/win32/WinNamedPipeStream.h box/trunk/lib/win32/emu.cpp box/trunk/lib/win32/emu.h box/trunk/test/win32/testlibwin32.cpp Modified: box/trunk/bin/bbackupctl/bbackupctl.cpp box/trunk/bin/bbackupd/BackupClientContext.cpp box/trunk/bin/bbackupd/BackupClientDirectoryRecord.cpp box/trunk/bin/bbackupd/BackupClientInodeToIDMap.cpp box/trunk/bin/bbackupd/BackupClientInodeToIDMap.h box/trunk/bin/bbackupd/BackupDaemon.cpp box/trunk/bin/bbackupd/BackupDaemon.h box/trunk/bin/bbackupd/bbackupd.cpp box/trunk/bin/bbackupquery/BackupQueries.cpp box/trunk/bin/bbackupquery/bbackupquery.cpp box/trunk/bin/bbstoreaccounts/bbstoreaccounts.cpp box/trunk/configure.ac box/trunk/infrastructure/BoxPlatform.pm.in box/trunk/infrastructure/m4/ax_check_mount_point.m4 box/trunk/infrastructure/m4/ax_check_ssl.m4 box/trunk/infrastructure/makebuildenv.pl box/trunk/infrastructure/makeparcels.pl box/trunk/lib/backupclient/BackupClientFileAttributes.cpp box/trunk/lib/backupclient/BackupClientFileAttributes.h box/trunk/lib/backupclient/BackupStoreFile.cpp box/trunk/lib/backupclient/BackupStoreFileDiff.cpp box/trunk/lib/backupclient/BackupStoreObjectDump.cpp box/trunk/lib/common/BoxPlatform.h box/trunk/lib/common/BoxPortsAndFiles.h box/trunk/lib/common/BoxTime.h box/trunk/lib/common/BoxTimeToText.cpp box/trunk/lib/common/BoxTimeToUnix.h box/trunk/lib/common/CommonException.txt box/trunk/lib/common/DebugPrintf.cpp box/trunk/lib/common/FileStream.cpp box/trunk/lib/common/FileStream.h box/trunk/lib/common/IOStream.cpp box/trunk/lib/common/NamedLock.cpp box/trunk/lib/common/TemporaryDirectory.h box/trunk/lib/common/UnixUser.cpp box/trunk/lib/common/WaitForEvent.h box/trunk/lib/server/Daemon.cpp box/trunk/lib/server/LocalProcessStream.cpp box/trunk/lib/server/SSLLib.cpp box/trunk/lib/server/ServerStream.h box/trunk/lib/server/Socket.cpp box/trunk/lib/server/Socket.h box/trunk/lib/server/SocketListen.h box/trunk/lib/server/SocketStream.cpp box/trunk/lib/server/SocketStream.h box/trunk/lib/server/SocketStreamTLS.cpp box/trunk/lib/server/makeprotocol.pl box/trunk/modules.txt box/trunk/parcels.txt box/trunk/test/basicserver/testbasicserver.cpp Log: Marged chris/win32/merge/07-win32-fixes at r210 to trunk Copied: box/trunk/VERSION.txt (from rev 210, box/chris/win32/merge/07-win32-fixes/VERSION.txt) Copied: box/trunk/bbackupctl.vcproj (from rev 210, box/chris/win32/merge/07-win32-fixes/bbackupctl.vcproj) Copied: box/trunk/bbackupd.vcproj (from rev 210, box/chris/win32/merge/07-win32-fixes/bbackupd.vcproj) Modified: box/trunk/bin/bbackupctl/bbackupctl.cpp =================================================================== --- box/trunk/bin/bbackupctl/bbackupctl.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/bin/bbackupctl/bbackupctl.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -19,6 +19,10 @@ #include "SocketStream.h" #include "IOStreamGetLine.h" +#ifdef WIN32 + #include "WinNamedPipeStream.h" +#endif + #include "MemLeakFindOn.h" void PrintUsageAndExit() @@ -26,7 +30,8 @@ printf("Usage: bbackupctl [-q] [-c config_file] \n" "Commands are:\n" " sync -- start a syncronisation run now\n" - " force-sync -- force the start of a syncronisation run, even if SyncAllowScript says no\n" + " force-sync -- force the start of a syncronisation run, " + "even if SyncAllowScript says no\n" " reload -- reload daemon configuration\n" " terminate -- terminate daemon now\n" " wait-for-sync -- wait until the next sync starts, then exit\n" @@ -38,8 +43,13 @@ { int returnCode = 0; - MAINHELPER_SETUP_MEMORY_LEAK_EXIT_REPORT("bbackupctl.memleaks", "bbackupctl") +#if defined WIN32 && ! defined NDEBUG + ::openlog("Box Backup (bbackupctl)", 0, 0); +#endif + MAINHELPER_SETUP_MEMORY_LEAK_EXIT_REPORT("bbackupctl.memleaks", + "bbackupctl") + MAINHELPER_START // Filename for configuraiton file? @@ -99,20 +109,35 @@ } // Connect to socket + +#ifndef WIN32 SocketStream connection; +#else /* WIN32 */ + WinNamedPipeStream connection; +#endif /* ! WIN32 */ + try { +#ifdef WIN32 + connection.Connect(BOX_NAMED_PIPE_NAME); +#else connection.Open(Socket::TypeUNIX, conf.GetKeyValue("CommandSocket").c_str()); +#endif } catch(...) { - printf("Failed to connect to daemon control socket.\n" \ - "Possible causes:\n" \ - " * Daemon not running\n" \ - " * Daemon busy syncing with store server\n" \ - " * Another bbackupctl process is communicating with the daemon\n" \ + printf("Failed to connect to daemon control socket.\n" + "Possible causes:\n" + " * Daemon not running\n" + " * Daemon busy syncing with store server\n" + " * Another bbackupctl process is communicating with the daemon\n" " * Daemon is waiting to recover from an error\n" ); + +#if defined WIN32 && ! defined NDEBUG + syslog(LOG_ERR,"Failed to connect to the command socket"); +#endif + return 1; } @@ -123,14 +148,29 @@ std::string configSummary; if(!getLine.GetLine(configSummary)) { +#if defined WIN32 && ! defined NDEBUG + syslog(LOG_ERR, "Failed to receive configuration summary " + "from daemon"); +#else printf("Failed to receive configuration summary from daemon\n"); +#endif + return 1; } // Was the connection rejected by the server? if(getLine.IsEOF()) { - printf("Server rejected the connection. Are you running bbackupctl as the same user as the daemon?\n"); +#if defined WIN32 && ! defined NDEBUG + syslog(LOG_ERR, "Server rejected the connection. " + "Are you running bbackupctl as the same user " + "as the daemon?"); +#else + printf("Server rejected the connection. " + "Are you running bbackupctl as the same user " + "as the daemon?\n"); +#endif + return 1; } @@ -212,6 +252,10 @@ } MAINHELPER_END + +#if defined WIN32 && ! defined NDEBUG + closelog(); +#endif return returnCode; } Modified: box/trunk/bin/bbackupd/BackupClientContext.cpp =================================================================== --- box/trunk/bin/bbackupd/BackupClientContext.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/bin/bbackupd/BackupClientContext.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -9,7 +9,9 @@ #include "Box.h" +#ifndef WIN32 #include +#endif #include "BoxPortsAndFiles.h" #include "BoxTime.h" Modified: box/trunk/bin/bbackupd/BackupClientDirectoryRecord.cpp =================================================================== --- box/trunk/bin/bbackupd/BackupClientDirectoryRecord.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/bin/bbackupd/BackupClientDirectoryRecord.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -133,7 +133,8 @@ { // The directory has probably been deleted, so just ignore this error. // In a future scan, this deletion will be noticed, deleted from server, and this object deleted. - TRACE1("Stat failed for '%s' (directory)\n", rLocalPath.c_str()); + TRACE1("Stat failed for '%s' (directory)\n", + rLocalPath.c_str()); return; } // Store inode number in map so directories are tracked in case they're renamed @@ -202,11 +203,18 @@ } // Stat file to get info - filename = rLocalPath + DIRECTORY_SEPARATOR + en->d_name; + filename = rLocalPath + DIRECTORY_SEPARATOR + + en->d_name; + if(::lstat(filename.c_str(), &st) != 0) { - TRACE1("Stat failed for '%s' (contents)\n", filename.c_str()); - THROW_EXCEPTION(CommonException, OSFileError) + // Report the error (logs and + // eventual email to administrator) + SetErrorWhenReadingFilesystemObject( + rParams, filename.c_str()); + + // Ignore this entry for now. + continue; } int type = st.st_mode & S_IFMT; @@ -506,7 +514,7 @@ box_time_t modTime = 0; uint64_t attributesHash = 0; int64_t fileSize = 0; - ino_t inodeNum = 0; + InodeRefType inodeNum = 0; bool hasMultipleHardLinks = true; // BLOCK { @@ -865,7 +873,7 @@ // Get attributes box_time_t attrModTime = 0; - ino_t inodeNum = 0; + InodeRefType inodeNum = 0; BackupClientFileAttributes attr; attr.ReadAttributes(dirname.c_str(), true /* directories have zero mod times */, 0 /* not interested in mod time */, &attrModTime, 0 /* not file size */, @@ -1109,8 +1117,12 @@ std::auto_ptr upload(BackupStoreFile::EncodeFile(rFilename.c_str(), mObjectID, rStoreFilename)); // Send to store - std::auto_ptr stored(connection.QueryStoreFile(mObjectID, ModificationTime, - AttributesHash, 0 /* no diff from file ID */, rStoreFilename, *upload)); + std::auto_ptr stored( + connection.QueryStoreFile( + mObjectID, ModificationTime, + AttributesHash, + 0 /* no diff from file ID */, + rStoreFilename, *upload)); // Get object ID from the result objID = stored->GetObjectID(); @@ -1130,7 +1142,7 @@ rParams.mrDaemon.NotifySysadmin(BackupDaemon::NotifyEvent_StoreFull); } } - + // Send the error on it's way throw; } Modified: box/trunk/bin/bbackupd/BackupClientInodeToIDMap.cpp =================================================================== --- box/trunk/bin/bbackupd/BackupClientInodeToIDMap.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/bin/bbackupd/BackupClientInodeToIDMap.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -65,7 +65,11 @@ #ifndef BACKIPCLIENTINODETOIDMAP_IN_MEMORY_IMPLEMENTATION if(dbp != 0) { +#ifdef BERKELY_V4 + dbp->close(0); +#else dbp->close(dbp); +#endif } #endif } @@ -90,7 +94,14 @@ ASSERT(!mEmpty); // Open the database file +#ifdef BERKELY_V4 + dbp = new Db(0,0); + dbp->set_pagesize(1024); /* Page size: 1K. */ + dbp->set_cachesize(0, 32 * 1024, 0); + dbp->open(NULL, Filename, NULL, DB_HASH, DB_CREATE, 0664); +#else dbp = dbopen(Filename, (CreateNew?O_CREAT:0) | (ReadOnly?O_RDONLY:O_RDWR), S_IRUSR | S_IWUSR | S_IRGRP, TABLE_DATABASE_TYPE, NULL); +#endif if(dbp == NULL) { THROW_EXCEPTION(BackupStoreException, BerkelyDBFailure); @@ -135,7 +146,11 @@ #ifndef BACKIPCLIENTINODETOIDMAP_IN_MEMORY_IMPLEMENTATION if(dbp != 0) { +#ifdef BERKELY_V4 + if(dbp->close(0) != 0) +#else if(dbp->close(dbp) != 0) +#endif { THROW_EXCEPTION(BackupStoreException, BerkelyDBFailure); } @@ -172,6 +187,15 @@ IDBRecord rec; rec.mObjectID = ObjectID; rec.mInDirectory = InDirectory; + +#ifdef BERKELY_V4 + Dbt key(&InodeRef, sizeof(InodeRef)); + Dbt data(&rec, sizeof(rec)); + + if (dbp->put(0, &key, &data, 0) != 0) { + THROW_EXCEPTION(BackupStoreException, BerkelyDBFailure); + } +#else DBT key; key.data = &InodeRef; @@ -187,6 +211,7 @@ THROW_EXCEPTION(BackupStoreException, BerkelyDBFailure); } #endif +#endif } // -------------------------------------------------------------------------- @@ -225,6 +250,11 @@ THROW_EXCEPTION(BackupStoreException, InodeMapNotOpen); } +#ifdef BERKELY_V4 + Dbt key(&InodeRef, sizeof(InodeRef)); + Dbt data(0, 0); + switch(dbp->get(NULL, &key, &data, 0)) +#else DBT key; key.data = &InodeRef; key.size = sizeof(InodeRef); @@ -234,6 +264,8 @@ data.size = 0; switch(dbp->get(dbp, &key, &data, 0)) +#endif + { case 1: // key not in file return false; @@ -248,6 +280,21 @@ } // Check for sensible return +#ifdef BERKELY_V4 + if(key.get_data() == 0 || data.get_size() != sizeof(IDBRecord)) + { + // Assert in debug version + ASSERT(key.get_data() == 0 || data.get_size() != sizeof(IDBRecord)); + + // Invalid entries mean it wasn't found + return false; + } + + // Data alignment isn't guaranteed to be on a suitable boundary + IDBRecord rec; + + ::memcpy(&rec, data.get_data(), sizeof(rec)); +#else if(key.data == 0 || data.size != sizeof(IDBRecord)) { // Assert in debug version @@ -257,9 +304,11 @@ return false; } - // Data alignment isn't guarentted to be on a suitable bounday + // Data alignment isn't guaranteed to be on a suitable boundary IDBRecord rec; + ::memcpy(&rec, data.data, sizeof(rec)); +#endif // Return data rObjectIDOut = rec.mObjectID; Modified: box/trunk/bin/bbackupd/BackupClientInodeToIDMap.h =================================================================== --- box/trunk/bin/bbackupd/BackupClientInodeToIDMap.h 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/bin/bbackupd/BackupClientInodeToIDMap.h 2005-12-12 20:50:00 UTC (rev 213) @@ -20,12 +20,14 @@ #define BACKIPCLIENTINODETOIDMAP_IN_MEMORY_IMPLEMENTATION #endif -typedef ino_t InodeRefType; - // avoid having to include the DB files when not necessary #ifndef BACKIPCLIENTINODETOIDMAP_IMPLEMENTATION +#ifdef BERKELY_V4 + class Db; +#else class DB; #endif +#endif // -------------------------------------------------------------------------- // @@ -58,8 +60,12 @@ #else bool mReadOnly; bool mEmpty; +#ifdef BERKELY_V4 + Db *dbp; // c++ style implimentation +#else DB *dbp; // C style interface, use notation from documentation -#endif +#endif // BERKELY_V4 +#endif // BACKIPCLIENTINODETOIDMAP_IN_MEMORY_IMPLEMENTATION }; #endif // BACKUPCLIENTINODETOIDMAP__H Modified: box/trunk/bin/bbackupd/BackupDaemon.cpp =================================================================== --- box/trunk/bin/bbackupd/BackupDaemon.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/bin/bbackupd/BackupDaemon.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -9,26 +9,31 @@ #include "Box.h" +#include #include -#include -#include -#include + +#ifndef WIN32 + #include + #include + #include + #include +#endif #ifdef HAVE_SYS_MOUNT_H - #include + #include #endif #ifdef HAVE_MNTENT_H - #include -#endif + #include +#endif #ifdef HAVE_SYS_MNTTAB_H #include #include #endif -#include #include "Configuration.h" #include "IOStream.h" #include "MemBlockStream.h" #include "CommonException.h" +#include "BoxPortsAndFiles.h" #include "SSLLib.h" #include "TLSContext.h" @@ -160,8 +165,9 @@ // // Function // Name: BackupDaemon::SetupInInitialProcess() -// Purpose: Platforms with non-checkable credientals on local sockets only. -// Prints a warning if the command socket is used. +// Purpose: Platforms with non-checkable credentials on +// local sockets only. +// Prints a warning if the command socket is used. // Created: 25/2/04 // // -------------------------------------------------------------------------- @@ -206,7 +212,134 @@ mIDMapMounts.clear(); } +#ifdef WIN32 +// -------------------------------------------------------------------------- +// +// Function +// Name: HelperThread() +// Purpose: Background thread function, called by Windows, +// calls the BackupDaemon's RunHelperThread method +// to listen for and act on control communications +// Created: 18/2/04 +// +// -------------------------------------------------------------------------- +unsigned int WINAPI HelperThread( LPVOID lpParam ) +{ + printf( "Parameter = %lu.\n", *(DWORD*)lpParam ); + ((BackupDaemon *)lpParam)->RunHelperThread(); + return 0; +} + +void BackupDaemon::RunHelperThread(void) +{ + mpCommandSocketInfo = new CommandSocketInfo; + this->mReceivedCommandConn = false; + + while ( !IsTerminateWanted() ) + { + try + { + mpCommandSocketInfo->mListeningSocket.Accept( + BOX_NAMED_PIPE_NAME); + + // This next section comes from Ben's original function + // Log + ::syslog(LOG_INFO, "Connection from command socket"); + + // Send a header line summarising the configuration + // and current state + const Configuration &conf(GetConfiguration()); + char summary[256]; + size_t summarySize = sprintf(summary, + "bbackupd: %d %d %d %d\nstate %d\n", + conf.GetKeyValueBool("AutomaticBackup"), + conf.GetKeyValueInt("UpdateStoreInterval"), + conf.GetKeyValueInt("MinimumFileAge"), + conf.GetKeyValueInt("MaxUploadWait"), + mState); + + mpCommandSocketInfo->mListeningSocket.Write(summary, summarySize); + mpCommandSocketInfo->mListeningSocket.Write("ping\n", 5); + + IOStreamGetLine readLine(mpCommandSocketInfo->mListeningSocket); + std::string command; + + while (mpCommandSocketInfo->mListeningSocket.IsConnected() && + readLine.GetLine(command) ) + { + TRACE1("Receiving command '%s' over " + "command socket\n", command.c_str()); + + bool sendOK = false; + bool sendResponse = true; + bool disconnect = false; + + // Command to process! + if(command == "quit" || command == "") + { + // Close the socket. + disconnect = true; + sendResponse = false; + } + else if(command == "sync") + { + // Sync now! + this->mDoSyncFlagOut = true; + this->mSyncIsForcedOut = false; + sendOK = true; + } + else if(command == "force-sync") + { + // Sync now (forced -- overrides any SyncAllowScript) + this->mDoSyncFlagOut = true; + this->mSyncIsForcedOut = true; + sendOK = true; + } + else if(command == "reload") + { + // Reload the configuration + SetReloadConfigWanted(); + sendOK = true; + } + else if(command == "terminate") + { + // Terminate the daemon cleanly + SetTerminateWanted(); + sendOK = true; + } + + // Send a response back? + if (sendResponse) + { + const char* response = sendOK ? "ok\n" : "error\n"; + mpCommandSocketInfo->mListeningSocket.Write( + response, strlen(response)); + } + + if (disconnect) + { + break; + } + + this->mReceivedCommandConn = true; + } + + mpCommandSocketInfo->mListeningSocket.Close(); + } + catch (BoxException &e) + { + ::syslog(LOG_ERR, "Communication error with " + "control client: %s", e.what()); + } + catch (...) + { + ::syslog(LOG_ERR, "Communication error with control client"); + } + } +} +#endif + // -------------------------------------------------------------------------- // // Function @@ -217,6 +350,25 @@ // -------------------------------------------------------------------------- void BackupDaemon::Run() { +#ifdef WIN32 + + // Create a thread to handle the named pipe + HANDLE hThread; + unsigned int dwThreadId; + + hThread = (HANDLE) _beginthreadex( + NULL, // default security attributes + 0, // use default stack size + HelperThread, // thread function + this, // argument to thread function + 0, // use default creation flags + &dwThreadId); // returns the thread identifier + + // init our own timer for file diff timeouts + InitTimer(); + +#else // ! WIN32 + // Ignore SIGPIPE (so that if a command connection is broken, the daemon doesn't terminate) ::signal(SIGPIPE, SIG_IGN); @@ -230,6 +382,8 @@ ::unlink(socketName); mpCommandSocketInfo->mListeningSocket.Listen(Socket::TypeUNIX, socketName); } + +#endif // WIN32 // Handle things nicely on exceptions try @@ -253,6 +407,11 @@ delete mpCommandSocketInfo; mpCommandSocketInfo = 0; } + +#ifdef WIN32 + // clean up windows specific stuff. + FiniTimer(); +#endif } // -------------------------------------------------------------------------- @@ -303,9 +462,9 @@ // When the last sync started (only updated if the store was not full when the sync ended) box_time_t lastSyncTime = 0; + + // -------------------------------------------------------------------------------------------- - // -------------------------------------------------------------------------------------------- - // And what's the current client store marker? int64_t clientStoreMarker = BackupClientContext::ClientStoreMarker_NotKnown; // haven't contacted the store yet @@ -409,6 +568,8 @@ // Do sync bool errorOccurred = false; int errorCode = 0, errorSubCode = 0; + const char* errorString = "unknown"; + try { // Set state and log start @@ -512,6 +673,7 @@ catch(BoxException &e) { errorOccurred = true; + errorString = e.what(); errorCode = e.GetType(); errorSubCode = e.GetSubType(); } @@ -555,8 +717,13 @@ { // Not restart/terminate, pause and retry SetState(State_Error); - ::syslog(LOG_ERR, "Exception caught (%d/%d), reset state and waiting to retry...", errorCode, errorSubCode); - ::sleep(100); + ::syslog(LOG_ERR, + "Exception caught (%s %d/%d), " + "reset state and waiting " + "to retry...", + errorString, errorCode, + errorSubCode); + ::sleep(10); } } @@ -665,6 +832,29 @@ // -------------------------------------------------------------------------- void BackupDaemon::WaitOnCommandSocket(box_time_t RequiredDelay, bool &DoSyncFlagOut, bool &SyncIsForcedOut) { +#ifdef WIN32 + // Really could use some interprocess protection, mutex etc + // any side effect should be too bad???? :) + DWORD timeout = BoxTimeToMilliSeconds(RequiredDelay); + + while ( this->mReceivedCommandConn == false ) + { + Sleep(1); + + if ( timeout == 0 ) + { + DoSyncFlagOut = false; + SyncIsForcedOut = false; + return; + } + timeout--; + } + this->mReceivedCommandConn = false; + DoSyncFlagOut = this->mDoSyncFlagOut; + SyncIsForcedOut = this->mSyncIsForcedOut; + + return; +#else // ! WIN32 ASSERT(mpCommandSocketInfo != 0); if(mpCommandSocketInfo == 0) {::sleep(1); return;} // failure case isn't too bad @@ -713,9 +903,9 @@ } } } -#endif +#endif // PLATFORM_CANNOT_FIND_PEER_UID_OF_UNIX_SOCKET - // Is this an acceptible connection? + // Is this an acceptable connection? if(!uidOK) { // Dump the connection @@ -833,6 +1023,7 @@ CloseCommandConnection(); } } +#endif // WIN32 } @@ -849,13 +1040,17 @@ try { TRACE0("Closing command connection\n"); - + +#ifdef WIN32 + mpCommandSocketInfo->mListeningSocket.Close(); +#else if(mpCommandSocketInfo->mpGetLine) { delete mpCommandSocketInfo->mpGetLine; mpCommandSocketInfo->mpGetLine = 0; } mpCommandSocketInfo->mpConnectedSocket.reset(); +#endif } catch(...) { @@ -875,15 +1070,27 @@ // -------------------------------------------------------------------------- void BackupDaemon::SendSyncStartOrFinish(bool SendStart) { - // The bbackupctl program can't rely on a state change, because it may never // change if the server doesn't need to be contacted. - if(mpCommandSocketInfo != 0 && mpCommandSocketInfo->mpConnectedSocket.get() != 0) + if (mpCommandSocketInfo != NULL && +#ifdef WIN32 + mpCommandSocketInfo->mListeningSocket.IsConnected() +#else + mpCommandSocketInfo->mpConnectedSocket.get() != 0 +#endif + ) { + const char* message = SendStart ? "start-sync\n" : "finish-sync\n"; try { - mpCommandSocketInfo->mpConnectedSocket->Write(SendStart?"start-sync\n":"finish-sync\n", SendStart?11:12); +#ifdef WIN32 + mpCommandSocketInfo->mListeningSocket.Write(message, + strlen(message)); +#else + mpCommandSocketInfo->mpConnectedSocket->Write(message, + strlen(message)); +#endif } catch(...) { @@ -958,6 +1165,7 @@ std::map mounts; int numIDMaps = 0; +#ifdef HAVE_MOUNTS #ifndef HAVE_STRUCT_STATFS_F_MNTONNAME // Linux and others can't tell you where a directory is mounted. So we // have to read the mount entries from /etc/mtab! Bizarre that the OS @@ -996,7 +1204,7 @@ ::endmntent(mountPointsFile); throw; } -#else +#else // ! HAVE_STRUCT_MNTENT_MNT_DIR // Open mounts file mountPointsFile = ::fopen("/etc/mnttab", "r"); if(mountPointsFile == 0) @@ -1023,7 +1231,7 @@ ::fclose(mountPointsFile); throw; } -#endif +#endif // HAVE_STRUCT_MNTENT_MNT_DIR // Check sorting and that things are as we expect ASSERT(mountPoints.size() > 0); #ifndef NDEBUG @@ -1033,6 +1241,7 @@ } #endif // n NDEBUG #endif // n HAVE_STRUCT_STATFS_F_MNTONNAME +#endif // HAVE_MOUNTS // Then... go through each of the entries in the configuration, // making sure there's a directory created for it. @@ -1054,7 +1263,9 @@ // Do a fsstat on the pathname to find out which mount it's on { -#ifdef HAVE_STRUCT_STATFS_F_MNTONNAME + +#if defined HAVE_STRUCT_STATFS_F_MNTONNAME || defined WIN32 + // BSD style statfs -- includes mount point, which is nice. struct statfs s; if(::statfs(ploc->mPath.c_str(), &s) != 0) @@ -1064,7 +1275,9 @@ // Where the filesystem is mounted std::string mountName(s.f_mntonname); -#else + +#else // !HAVE_STRUCT_STATFS_F_MNTONNAME && !WIN32 + // Warn in logs if the directory isn't absolute if(ploc->mPath[0] != '/') { @@ -1090,6 +1303,7 @@ } TRACE2("mount point chosen for %s is %s\n", ploc->mPath.c_str(), mountName.c_str()); } + #endif // Got it? @@ -1376,6 +1590,10 @@ std::string newmap(target + ".n"); // Try to rename +#ifdef WIN32 + // win32 rename doesn't overwrite existing files + ::remove(target.c_str()); +#endif if(::rename(newmap.c_str(), target.c_str()) != 0) { THROW_EXCEPTION(CommonException, OSFileError) @@ -1457,14 +1675,33 @@ // Set process title const static char *stateText[] = {"idle", "connected", "error -- waiting for retry", "over limit on server -- not backing up"}; SetProcessTitle(stateText[State]); - + // If there's a command socket connected, then inform it -- disconnecting from the // command socket if there's an error + + char newState[64]; + char newStateSize = sprintf(newState, "state %d\n", State); + +#ifdef WIN32 + #warning FIX ME: race condition + // what happens if the socket is closed by the other thread before + // we can write to it? Null pointer deref at best. + if (mpCommandSocketInfo && + mpCommandSocketInfo->mListeningSocket.IsConnected()) + { + try + { + mpCommandSocketInfo->mListeningSocket.Write(newState, newStateSize); + } + catch(...) + { + CloseCommandConnection(); + } + } +#else if(mpCommandSocketInfo != 0 && mpCommandSocketInfo->mpConnectedSocket.get() != 0) { // Something connected to the command socket, tell it about the new state - char newState[64]; - char newStateSize = sprintf(newState, "state %d\n", State); try { mpCommandSocketInfo->mpConnectedSocket->Write(newState, newStateSize); @@ -1474,6 +1711,7 @@ CloseCommandConnection(); } } +#endif } @@ -1658,4 +1896,3 @@ mpGetLine = 0; } } - Modified: box/trunk/bin/bbackupd/BackupDaemon.h =================================================================== --- box/trunk/bin/bbackupd/BackupDaemon.h 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/bin/bbackupd/BackupDaemon.h 2005-12-12 20:50:00 UTC (rev 213) @@ -19,6 +19,7 @@ #include "Socket.h" #include "SocketListen.h" #include "SocketStream.h" +#include "WinNamedPipeStream.h" class BackupClientDirectoryRecord; class BackupClientContext; @@ -146,8 +147,12 @@ CommandSocketInfo(const CommandSocketInfo &); // no copying CommandSocketInfo &operator=(const CommandSocketInfo &); public: +#ifdef WIN32 + WinNamedPipeStream mListeningSocket; +#else SocketListen mListeningSocket; std::auto_ptr mpConnectedSocket; +#endif IOStreamGetLine *mpGetLine; }; @@ -160,7 +165,14 @@ // Unused entries in the root directory wait a while before being deleted box_time_t mDeleteUnusedRootDirEntriesAfter; // time to delete them std::vector > mUnusedRootDirEntries; + +#ifdef WIN32 + public: + void RunHelperThread(void); + + private: + bool mDoSyncFlagOut, mSyncIsForcedOut, mReceivedCommandConn; +#endif }; #endif // BACKUPDAEMON__H - Copied: box/trunk/bin/bbackupd/Win32BackupService.cpp (from rev 210, box/chris/win32/merge/07-win32-fixes/bin/bbackupd/Win32BackupService.cpp) Copied: box/trunk/bin/bbackupd/Win32BackupService.h (from rev 210, box/chris/win32/merge/07-win32-fixes/bin/bbackupd/Win32BackupService.h) Copied: box/trunk/bin/bbackupd/Win32ServiceFunctions.cpp (from rev 210, box/chris/win32/merge/07-win32-fixes/bin/bbackupd/Win32ServiceFunctions.cpp) Copied: box/trunk/bin/bbackupd/Win32ServiceFunctions.h (from rev 210, box/chris/win32/merge/07-win32-fixes/bin/bbackupd/Win32ServiceFunctions.h) Modified: box/trunk/bin/bbackupd/bbackupd.cpp =================================================================== --- box/trunk/bin/bbackupd/bbackupd.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/bin/bbackupd/bbackupd.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -11,16 +11,84 @@ #include "BackupDaemon.h" #include "MainHelper.h" #include "BoxPortsAndFiles.h" +#include "BackupStoreException.h" #include "MemLeakFindOn.h" +#ifdef WIN32 + #include "Win32ServiceFunctions.h" + #include "Win32BackupService.h" + + extern Win32BackupService gDaemonService; +#endif + int main(int argc, const char *argv[]) { MAINHELPER_START +#ifdef WIN32 + + ::openlog("Box Backup (bbackupd)", 0, 0); + + if(argc == 2 && + (::strcmp(argv[1], "--help") == 0 || + ::strcmp(argv[1], "-h") == 0)) + { + printf("-h help, -i install service, -r remove service,\n" + "-c start daemon now"); + return 2; + } + if(argc == 2 && ::strcmp(argv[1], "-r") == 0) + { + RemoveService(); + return 0; + } + if(argc == 2 && ::strcmp(argv[1], "-i") == 0) + { + InstallService(); + return 0; + } + + // Under win32 we must initialise the Winsock library + // before using sockets + + WSADATA info; + + if (WSAStartup(MAKELONG(1, 1), &info) == SOCKET_ERROR) + { + // box backup will not run without sockets + ::syslog(LOG_ERR, "Failed to initialise Windows Sockets"); + THROW_EXCEPTION(BackupStoreException, Internal) + } + + EnableBackupRights(); + + int ExitCode = 0; + + if (argc == 2 && ::strcmp(argv[1], "--service") == 0) + { + syslog(LOG_INFO,"Starting Box Backup Service"); + OurService(); + } + else + { + ExitCode = gDaemonService.Main( + BOX_FILE_BBACKUPD_DEFAULT_CONFIG, argc, argv); + } + + // Clean up our sockets + WSACleanup(); + + ::closelog(); + + return ExitCode; + +#else // !WIN32 + BackupDaemon daemon; return daemon.Main(BOX_FILE_BBACKUPD_DEFAULT_CONFIG, argc, argv); - + +#endif // WIN32 + MAINHELPER_END } - Copied: box/trunk/bin/bbackupd/win32 (from rev 210, box/chris/win32/merge/07-win32-fixes/bin/bbackupd/win32) Deleted: box/trunk/bin/bbackupd/win32/ReadMe.txt =================================================================== --- box/chris/win32/merge/07-win32-fixes/bin/bbackupd/win32/ReadMe.txt 2005-12-12 02:03:39 UTC (rev 210) +++ box/trunk/bin/bbackupd/win32/ReadMe.txt 2005-12-12 20:50:00 UTC (rev 213) @@ -1,24 +0,0 @@ -Upgrade instructions - -Version 0.09g to 0.09h - -This version included patches to the server as well. The server for this -upgrade can be found at http://home.earthlink.net/~gniemcew/ but hopefully -will be merged into the core in the next release. - -New values in the bbackupd.conf can now be added: - -StoreObjectInfoFile = C:\Program Files\Box Backup\bbackupd\bbackupd.dat - -This stores the state when a backup daemon is shutdown. - -KeepAliveTime = 250 - -This is imperative if MaximumDiffingTime is larger than 300, this stops the ssl -layer timing out when a diff is performed. It is wise to set MaximumDiffingTime -long enough for the largest file you may have. If you do not wish to upgrade your -server then make KeepAliveTime greater than MaximumDiffingTime. - -Have fun - -Nick Copied: box/trunk/bin/bbackupd/win32/ReadMe.txt (from rev 210, box/chris/win32/merge/07-win32-fixes/bin/bbackupd/win32/ReadMe.txt) Deleted: box/trunk/bin/bbackupd/win32/bbackupd.conf =================================================================== --- box/chris/win32/merge/07-win32-fixes/bin/bbackupd/win32/bbackupd.conf 2005-12-12 02:03:39 UTC (rev 210) +++ box/trunk/bin/bbackupd/win32/bbackupd.conf 2005-12-12 20:50:00 UTC (rev 213) @@ -1,143 +0,0 @@ - -StoreHostname = yourhost -AccountNumber = 0x1 -KeysFile = C:\Program Files\Box Backup\1-FileEncKeys.raw - -CertificateFile = C:\Program Files\Box Backup\1-cert.pem -PrivateKeyFile = C:\Program Files\Box Backup\1-key.pem -TrustedCAsFile = C:\Program Files\Box Backup\serverCA.pem - -DataDirectory = C:\Program Files\Box Backup\bbackupd - -# If you do not install it in the default location - also do not forget to -# change the pid file location (below) - - -# This script is run whenever bbackupd encounters a problem which requires -# the system administrator to assist: -# 1) The store is full, and no more data can be uploaded. -# 2) Some files or directories were not readable. -# The default script emails the system administrator. - -# NotifyScript = NotifySysadmin.sh - - -# A scan of the local discs will be made once an hour (approximately). -# To avoid cycles of load on the server, this time is randomly adjusted by a small -# percentage as the daemon runs. - -UpdateStoreInterval = 3600 - - -# A file must have been modified at least 6 hours ago before it will be uploaded. - -MinimumFileAge = 21600 - - -# If a file is modified repeated, it won't be uploaded immediately in case it's modified again. -# However, it should be uploaded eventually. This is how long we should wait after first noticing -# a change. (1 day) - -MaxUploadWait = 86400 - - -# Files above this size (in bytes) are tracked, and if they are renamed they will simply be -# renamed on the server, rather than being uploaded again. (64k - 1) - -FileTrackingSizeThreshold = 65535 - - -# The daemon does "changes only" uploads for files above this size (in bytes). -# Files less than it are uploaded whole without this extra processing. - -DiffingUploadSizeThreshold = 8192 - - -# The limit on how much time is spent diffing files. Most files shouldn't take very long, -# but if you have really big files you can use this to limit the time spent diffing them. -# * Reduce if you are having problems with processor usage. -# * Increase if you have large files, and think the upload of changes is too large and want -# to spend more time searching for unchanged blocks. - -MaximumDiffingTime = 20 - -# KeepAliveTime requires Gary's SSL KeepAlive patches -# KeepAliveTime = 250 - -# Uncomment this line to see exactly what the daemon is going when it's connected to the server. - -# ExtendedLogging = yes - - -# Use this to temporarily stop bbackupd from syncronising or connecting to the store. -# This specifies a program or script script which is run just before each sync, and ideally -# the full path to the interpreter. It will be run as the same user bbackupd is running as, -# usually root. -# The script prints either "now" or a number to STDOUT (and a terminating newline, no quotes). -# If the result was "now", then the sync will happen. If it's a number, then the script will -# be asked again in that number of seconds. -# For example, you could use this on a laptop to only backup when on a specific network. - -# SyncAllowScript = /path/to/intepreter/or/exe script-name parameters etc - - -# Where the command socket is created in the filesystem. - -CommandSocket = pipe - - -Server -{ - PidFile = C:\Program Files\Box Backup\bbackupd\bbackupd.pid -} - -# StoreObjectInfoFile requires Gary's client marker serialisation patch -# StoreObjectInfoFile = C:\Program Files\Box Backup\bbackupd\bbackupd.dat - -# -# BackupLocations specifies which locations on disc should be backed up. Each -# directory is in the format -# -# name -# { -# Path = /path/of/directory -# (optional exclude directives) -# } -# -# 'name' is derived from the Path by the config script, but should merely be -# unique. -# -# The exclude directives are of the form -# -# [Exclude|AlwaysInclude][File|Dir][|sRegex] = regex or full pathname -# -# (The regex suffix is shown as 'sRegex' to make File or Dir plural) -# -# For example: -# -# ExcludeDir = /home/guest-user -# ExcludeFilesRegex = *.(mp3|MP3)$ -# AlwaysIncludeFile = /home/username/veryimportant.mp3 -# -# This excludes the directory /home/guest-user from the backup along with all mp3 -# files, except one MP3 file in particular. -# -# In general, Exclude excludes a file or directory, unless the directory is -# explicitly mentioned in a AlwaysInclude directive. -# -# If a directive ends in Regex, then it is a regular expression rather than a -# explicit full pathname. See -# -# man 7 re_format -# -# for the regex syntax on your platform. -# - -BackupLocations -{ - MyDocuments - { - Path = C:\Documents and Settings\ - } -} - Copied: box/trunk/bin/bbackupd/win32/bbackupd.conf (from rev 210, box/chris/win32/merge/07-win32-fixes/bin/bbackupd/win32/bbackupd.conf) Deleted: box/trunk/bin/bbackupd/win32/installer.iss =================================================================== --- box/chris/win32/merge/07-win32-fixes/bin/bbackupd/win32/installer.iss 2005-12-12 02:03:39 UTC (rev 210) +++ box/trunk/bin/bbackupd/win32/installer.iss 2005-12-12 20:50:00 UTC (rev 213) @@ -1,51 +0,0 @@ -; Script to generate output file for Box Backup client for the Windows Platform -; -; Very important - this is the release process -; -; 1/ Upgrade BOX_VERSION in the file emu.h to the current version for example 0.09eWin32 - then perform a full rebuild -; -; 2/ Upgrade the AppVerName below to reflect the version -; -; 3/ Generate the output file, then rename it to the relevent filename to reflect the version - -[Setup] -AppName=Box Backup -AppVerName=BoxWin32 0.09h -AppPublisher=Fluffy & Omniis -AppPublisherURL=http://www.omniis.com -AppSupportURL=http://www.omniis.com -AppUpdatesURL=http://www.omniis.com -DefaultDirName={pf}\Box Backup -DefaultGroupName=Box Backup -Compression=lzma -SolidCompression=yes -PrivilegesRequired=admin - -[Files] -Source: "..\..\Release\bbackupd.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace -Source: "..\..\Release\bbackupctl.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace -Source: "..\..\Release\bbackupquery.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace -Source: "..\..\ExceptionCodes.txt"; DestDir: "{app}"; Flags: ignoreversion restartreplace -Source: "icon.ico"; DestDir: "{app}\"; Flags: ignoreversion restartreplace -Source: "msvcr71.dll"; DestDir: "{app}\"; Flags: restartreplace -Source: "bbackupd.conf"; DestDir: "{app}"; Flags: confirmoverwrite -Source: "..\..\..\zlib\zlib1.dll"; DestDir: "{app}"; Flags: ignoreversion restartreplace -Source: "..\..\..\openssl\bin\libeay32.dll"; DestDir: "{app}"; Flags: ignoreversion restartreplace -Source: "..\..\..\openssl\bin\ssleay32.dll"; DestDir: "{app}"; Flags: ignoreversion restartreplace -Source: "ReadMe.txt"; DestDir: "{app}"; Flags: ignoreversion restartreplace - -; NOTE: Don't use "Flags: ignoreversion" on any shared system files - -[Icons] -Name: "{group}\Box Backup Query"; Filename: "{app}\bbackupquery.exe"; IconFilename: "{app}\icon.ico" ;Parameters: "-c bbackupd.conf"; WorkingDir: "{app}" -Name: "{group}\Service\Install Service"; Filename: "{app}\bbackupd.exe"; IconFilename: "{app}\icon.ico" ;Parameters: "-i"; WorkingDir: "{app}" -Name: "{group}\Service\Remove Service"; Filename: "{app}\bbackupd.exe"; IconFilename: "{app}\icon.ico" ;Parameters: "-r"; WorkingDir: "{app}" -Name: "{group}\Initiate Backup Now"; Filename: "{app}\bbackupctl.exe"; IconFilename: "{app}\icon.ico" ;Parameters: "-c bbackupd.conf sync"; WorkingDir: "{app}" - -[Dirs] -Name: "{app}\bbackupd" - -[Run] -Filename: "{app}\bbackupd.exe"; Description: "Install Boxbackup as service"; Parameters: "-i"; Flags: postinstall -Filename: "{app}\Readme.txt"; Description: "View upgrade notes"; Flags: postinstall shellexec skipifsilent - Copied: box/trunk/bin/bbackupd/win32/installer.iss (from rev 210, box/chris/win32/merge/07-win32-fixes/bin/bbackupd/win32/installer.iss) Modified: box/trunk/bin/bbackupquery/BackupQueries.cpp =================================================================== --- box/trunk/bin/bbackupquery/BackupQueries.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/bin/bbackupquery/BackupQueries.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -380,7 +380,11 @@ { // add object ID to line char oid[32]; +#ifdef WIN32 + sprintf(oid, "%08I64x ", en->GetObjectID()); +#else sprintf(oid, "%08llx ", en->GetObjectID()); +#endif line += oid; } @@ -404,6 +408,7 @@ } // attributes flags *(f++) = (en->HasAttributes())?'a':'-'; + // terminate *(f++) = ' '; *(f++) = '\0'; @@ -424,14 +429,22 @@ if(opts[LIST_OPTION_DISPLAY_HASH]) { char hash[64]; +#ifdef WIN32 + ::sprintf(hash, "%016I64x ", en->GetAttributesHash()); +#else ::sprintf(hash, "%016llx ", en->GetAttributesHash()); +#endif line += hash; } if(opts[LIST_OPTION_SIZEINBLOCKS]) { char num[32]; +#ifdef WIN32 + sprintf(num, "%05I64d ", en->GetSizeInBlocks()); +#else sprintf(num, "%05lld ", en->GetSizeInBlocks()); +#endif line += num; } @@ -1034,7 +1047,8 @@ } // Then get it compared - Compare(std::string("/") + rLocation, loc.GetKeyValue("Path"), rParams); + Compare(std::string(DIRECTORY_SEPARATOR) + rLocation, + loc.GetKeyValue("Path"), rParams); } catch(...) { @@ -1165,7 +1179,7 @@ #ifndef HAVE_VALID_DIRENT_D_TYPE std::string fn(rLocalDir); - fn += '/'; + fn += DIRECTORY_SEPARATOR_ASCHAR; fn += localDirEn->d_name; struct stat st; if(::lstat(fn.c_str(), &st) != 0) Modified: box/trunk/bin/bbackupquery/bbackupquery.cpp =================================================================== --- box/trunk/bin/bbackupquery/bbackupquery.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/bin/bbackupquery/bbackupquery.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -56,6 +56,19 @@ { MAINHELPER_SETUP_MEMORY_LEAK_EXIT_REPORT("bbackupquery.memleaks", "bbackupquery") +#ifdef WIN32 + WSADATA info; + + // Under Win32 we must initialise the Winsock library + // before using it. + + if (WSAStartup(MAKELONG(1, 1), &info) == SOCKET_ERROR) + { + // throw error? perhaps give it its own id in the furture + THROW_EXCEPTION(BackupStoreException, Internal) + } +#endif + // Really don't want trace statements happening, even in debug mode #ifndef NDEBUG BoxDebugTraceOn = false; @@ -253,7 +266,11 @@ MAINHELPER_END - exit(returnCode); +#ifdef WIN32 + // Clean up our sockets + WSACleanup(); +#endif + return returnCode; } Modified: box/trunk/bin/bbstoreaccounts/bbstoreaccounts.cpp =================================================================== --- box/trunk/bin/bbstoreaccounts/bbstoreaccounts.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/bin/bbstoreaccounts/bbstoreaccounts.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -70,7 +70,11 @@ double mb = (Blocks * BlockSizeOfDiscSet(DiscSet)) / (1024.0*1024.0); // Format string +#ifdef WIN32 + sprintf(string, "%I64d (%.2fMb)", Blocks, mb); +#else sprintf(string, "%lld (%.2fMb)", Blocks, mb); +#endif return string; } Copied: box/trunk/boxbackup.sln (from rev 210, box/chris/win32/merge/07-win32-fixes/boxbackup.sln) Copied: box/trunk/boxbackup.suo (from rev 210, box/chris/win32/merge/07-win32-fixes/boxbackup.suo) Copied: box/trunk/boxquery.vcproj (from rev 210, box/chris/win32/merge/07-win32-fixes/boxquery.vcproj) Copied: box/trunk/common.vcproj (from rev 210, box/chris/win32/merge/07-win32-fixes/common.vcproj) Copied: box/trunk/config.guess (from rev 210, box/chris/win32/merge/07-win32-fixes/config.guess) Copied: box/trunk/config.sub (from rev 210, box/chris/win32/merge/07-win32-fixes/config.sub) Modified: box/trunk/configure.ac =================================================================== --- box/trunk/configure.ac 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/configure.ac 2005-12-12 20:50:00 UTC (rev 213) @@ -6,6 +6,10 @@ AC_CONFIG_SRCDIR([lib/common/Box.h]) AC_CONFIG_HEADERS([lib/common/config.h]) +touch install-sh +AC_CANONICAL_SYSTEM +# echo "Build target OS: '$target_os'" +test -s install-sh || rm install-sh ### Checks for programs. @@ -26,9 +30,11 @@ ### Checks for libraries. +if test "$target_os" != "mingw32" -a "$target_os" != "winnt"; then +AC_SEARCH_LIBS([nanosleep], [rt], [ac_have_nanosleep=yes], + [AC_MSG_ERROR([[Cannot find a short sleep function (nanosleep)]])]) +fi -AC_SEARCH_LIBS([nanosleep], [rt],, - [AC_MSG_ERROR([[Cannot find library with nanosleep]])]) AC_CHECK_LIB([z], [zlibVersion],, [AC_MSG_ERROR([[Cannot find zlib]])]) AX_CHECK_BDB_V1 VL_LIB_READLINE @@ -89,8 +95,12 @@ AC_SYS_LARGEFILE AX_CHECK_LLONG_MINMAX AX_CHECK_DEFINE_PRAGMA + +if test "$target_os" != "mingw32"; then AX_RANDOM_DEVICE -AX_CHECK_MOUNT_POINT(, [AC_MSG_ERROR([[cannot work out how to discover mount points on your platform]])]) +fi + +AX_CHECK_MOUNT_POINT([],[]) AX_CHECK_MALLOC_WORKAROUND @@ -124,12 +134,6 @@ AC_CHECK_FUNCS([flock]) AC_CHECK_DECLS([O_EXLOCK],,, [[#include ]]) AC_CHECK_DECLS([F_SETLK],,, [[#include ]]) -if test "x$ac_cv_func_flock" != "xyes" && \ - test "x$ac_cv_have_decl_O_EXLOCK" != "xyes" && \ - test "x$ac_cv_have_decl_F_SETLK" != "xyes" -then - AC_MSG_ERROR([[cannot work out how to do file locking on your platform]]) -fi ## Get tmpdir temp_directory_name="/tmp" @@ -144,7 +148,7 @@ [static-bin], [AC_HELP_STRING([--enable-static-bin], [Link binaries with static libraries])]) if test "x$enable_static_bin" = "xyes"; then - AC_CHECK_LIB([ssl],[SSL_read]) + AC_CHECK_LIB([ssl],[SSL_read],[],[],[crypto]) LIBS="-Wl,-Bstatic $LIBS -Wl,-Bdynamic" fi Copied: box/trunk/docs/backup/Win32_Clients.txt (from rev 210, box/chris/win32/merge/07-win32-fixes/docs/backup/Win32_Clients.txt) Copied: box/trunk/docs/backup/win32_build_on_cygwin_using_mingw.txt (from rev 210, box/chris/win32/merge/07-win32-fixes/docs/backup/win32_build_on_cygwin_using_mingw.txt) Copied: box/trunk/docs/backup/win32_build_on_linux_using_mingw.txt (from rev 210, box/chris/win32/merge/07-win32-fixes/docs/backup/win32_build_on_linux_using_mingw.txt) Modified: box/trunk/infrastructure/BoxPlatform.pm.in =================================================================== --- box/trunk/infrastructure/BoxPlatform.pm.in 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/infrastructure/BoxPlatform.pm.in 2005-12-12 20:50:00 UTC (rev 213) @@ -1,7 +1,7 @@ package BoxPlatform; use Exporter; @ISA = qw/Exporter/; - at EXPORT = qw/$build_os $build_cpu $make_command $bsd_make $platform_define $platform_cpu $gcc_v3 $product_version $product_name $install_into_dir $sub_make_options $platform_compile_line_extra $platform_link_line_extra $platform_lib_files/; + at EXPORT = qw/$build_os $build_cpu $target_os $make_command $bsd_make $platform_define $platform_cpu $gcc_v3 $product_version $product_name $install_into_dir $sub_make_options $platform_compile_line_extra $platform_link_line_extra $platform_lib_files $platform_exe_ext/; BEGIN { @@ -23,9 +23,11 @@ $platform_compile_line_extra = '@CPPFLAGS@ @CXXFLAGS@ @CXXFLAGS_STRICT@'; $platform_link_line_extra = '@LDFLAGS@'; $platform_lib_files = '@LIBS@'; + $target_os = '@target_os@'; + $platform_exe_ext = '@EXEEXT@'; # get version - open VERSION,"VERSION.txt"; + open VERSION,"VERSION.txt" or die "VERSION.txt: $!"; $product_version = ; chomp $product_version; $product_name = ; Modified: box/trunk/infrastructure/m4/ax_check_mount_point.m4 =================================================================== --- box/trunk/infrastructure/m4/ax_check_mount_point.m4 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/infrastructure/m4/ax_check_mount_point.m4 2005-12-12 20:50:00 UTC (rev 213) @@ -3,6 +3,7 @@ dnl This macro will find out how to get mount point information if possible. dnl dnl The following defines will be set as appropriate: +dnl HAVE_MOUNTS dnl HAVE_MNTENT_H dnl HAVE_SYS_MNTTAB_H dnl HAVE_SYS_MOUNT_H @@ -35,6 +36,7 @@ test "x$ac_cv_member_struct_mntent_mnt_dir" = "xyes" || \ test "x$ac_cv_member_struct_mnttab_mnt_mountp" = "xyes" then + AC_DEFINE([HAVE_MOUNTS], [1], [Define to 1 if this platform supports mounts]) m4_ifvaln([$1],[$1],[:])dnl m4_ifvaln([$2],[else $2])dnl fi Modified: box/trunk/infrastructure/m4/ax_check_ssl.m4 =================================================================== --- box/trunk/infrastructure/m4/ax_check_ssl.m4 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/infrastructure/m4/ax_check_ssl.m4 2005-12-12 20:50:00 UTC (rev 213) @@ -27,7 +27,7 @@ ax_check_ssl_found=yes AC_CHECK_HEADERS([openssl/ssl.h],, [ax_check_ssl_found=no]) - AC_CHECK_LIB([ssl], [SSL_read],, [ax_check_ssl_found=no]) + AC_CHECK_LIB([ssl], [SSL_read],, [ax_check_ssl_found=no], [-lcrypto]) if test "x$ax_check_ssl_found" = "xyes"; then AC_DEFINE([HAVE_SSL], 1, [Define to 1 if SSL is available]) Modified: box/trunk/infrastructure/makebuildenv.pl =================================================================== --- box/trunk/infrastructure/makebuildenv.pl 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/infrastructure/makebuildenv.pl 2005-12-12 20:50:00 UTC (rev 213) @@ -182,6 +182,7 @@ print "Scanning code...\n"; my $modules_omitted = 0; +my $modules_omitting = 0; # process lines in flattened modules files for(@modules_files) @@ -191,16 +192,20 @@ next unless m/\S/; # omit bits on some platforms? - next if m/\AEND-OMIT/; + if(m/\AEND-OMIT/) + { + $modules_omitting = 0; + next; + } + + next if $modules_omitting; + if(m/\AOMIT:(.+)/) { - if($1 eq $build_os) + if($1 eq $build_os or $1 eq $target_os) { $modules_omitted = 1; - while() - { - last if m/\AEND-OMIT/; - } + $modules_omitting = 1; } next; } @@ -402,8 +407,10 @@ close TESTFILE; } - writetestfile("$mod/_t", './test $1 $2 $3 $4 $5', $mod); - writetestfile("$mod/_t-gdb", 'gdb ./test', $mod); + writetestfile("$mod/_t", + './test${platform_exe_ext} $1 $2 $3 $4 $5', $mod); + writetestfile("$mod/_t-gdb", + 'gdb ./test${platform_exe_ext}', $mod); } @@ -440,15 +447,26 @@ # make include path - my $include_paths = join(' ',map {'-I../../'.$_} @all_deps_for_module); + my $include_paths = "-I../../lib/win32 " . + join(' ',map {'-I../../'.$_} @all_deps_for_module); # is target a library? my $target_is_library = ($type ne 'bin' && $type ne 'test'); # make target name my $end_target = $name; - $end_target .= '.a' if $target_is_library; - $end_target = 'test' if $type eq 'test'; + + if ($target_is_library) + { + $end_target .= '.a'; + } + else + { + $end_target .= $platform_exe_ext; + } + + $end_target = 'test'.$platform_exe_ext if $type eq 'test'; + # adjust for outdir $end_target = '$(OUTDIR)/' . $end_target; @@ -456,6 +474,13 @@ my $mk_name_extra = ($bsd_make)?'':'X'; open MAKE,">$mod/Makefile".$mk_name_extra or die "Can't open Makefile for $mod\n"; my $debug_link_extra = ($target_is_library)?'':'../../debug/lib/debug/debug.a'; + + my $release_flags = "-O2"; + if ($target_os eq "mingw32") + { + $release_flags = "-O0 -g"; + } + print MAKE <<__E; # # AUTOMATICALLY GENERATED FILE @@ -466,7 +491,7 @@ AR = ar RANLIB = ranlib .ifdef RELEASE -CXXFLAGS = -DNDEBUG -O2 -Wall $include_paths $extra_platform_defines -DBOX_VERSION="\\"$product_version\\"" +CXXFLAGS = -DNDEBUG $release_flags -Wall $include_paths $extra_platform_defines -DBOX_VERSION="\\"$product_version\\"" OUTBASE = ../../release OUTDIR = ../../release/$mod DEPENDMAKEFLAGS = -D RELEASE @@ -567,6 +592,7 @@ my $has_deps = ($#{$module_dependency{$mod}} >= 0); # ----- # always has dependencies with debug library $has_deps = 1; + $has_deps = 0 if $target_is_library; # Depenency stuff my $deps_makeinfo; @@ -613,7 +639,7 @@ my $o_file_list = join(' ',map {'$(OUTDIR)/'.$_.'.o'} @objs); print MAKE $end_target,': ',$o_file_list; - print MAKE ' dep_modules' if !$bsd_make; + print MAKE ' dep_modules' if $has_deps and not $bsd_make; print MAKE " ",$lib_files unless $target_is_library; print MAKE "\n"; @@ -658,7 +684,7 @@ # dependency line? print MAKE "\n"; - # module dependcies for GNU make? + # module dependencies for GNU make? print MAKE $deps_makeinfo if !$bsd_make; # print the rest of the file Modified: box/trunk/infrastructure/makeparcels.pl =================================================================== --- box/trunk/infrastructure/makeparcels.pl 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/infrastructure/makeparcels.pl 2005-12-12 20:50:00 UTC (rev 213) @@ -26,7 +26,7 @@ next if m/\AEND-OMIT/; if(m/\AOMIT:(.+)/) { - if($1 eq $build_os) + if($1 eq $build_os or $1 eq $target_os) { while() { @@ -35,6 +35,21 @@ } next; } + + if (m'\AONLY:(.+)') + { + my @only_targets = split m'\,', $1; + + if (not grep {$_ eq $build_os or $_ eq $target_os} + @only_targets) + { + while () + { + last if m'\AEND-ONLY'; + } + next; + } + } # new parcel, or a new parcel definition? if(m/\A\s+(.+)\Z/) @@ -100,7 +115,7 @@ if($type eq 'bin') { - my $exeext = ($build_os eq 'CYGWIN')?'.exe':''; + my $exeext = $platform_exe_ext; print MAKE "\t(cd bin/$name; \$(MAKE) $release_flag)\n"; print MAKE "\tcp release/bin/$name/$name$exeext $dir\n"; } Modified: box/trunk/lib/backupclient/BackupClientFileAttributes.cpp =================================================================== --- box/trunk/lib/backupclient/BackupClientFileAttributes.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/backupclient/BackupClientFileAttributes.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -287,7 +287,7 @@ // // -------------------------------------------------------------------------- void BackupClientFileAttributes::ReadAttributes(const char *Filename, bool ZeroModificationTimes, box_time_t *pModTime, - box_time_t *pAttrModTime, int64_t *pFileSize, ino_t *pInodeNumber, bool *pHasMultipleLinks) + box_time_t *pAttrModTime, int64_t *pFileSize, InodeRefType *pInodeNumber, bool *pHasMultipleLinks) { StreamableMemBlock *pnewAttr = 0; try @@ -309,14 +309,46 @@ FillAttributes(*pnewAttr, Filename, st, ZeroModificationTimes); +#ifndef WIN32 // Is it a link? if((st.st_mode & S_IFMT) == S_IFLNK) { FillAttributesLink(*pnewAttr, Filename, st); } +#endif FillExtendedAttr(*pnewAttr, Filename); +#ifdef WIN32 + //this is to catch those problems with invalid time stamps stored... + //need to find out the reason why - but also a catch as well. + + attr_StreamFormat *pattr = + (attr_StreamFormat*)pnewAttr->GetBuffer(); + ASSERT(pattr != 0); + + // __time64_t winTime = BoxTimeToSeconds( + // pnewAttr->ModificationTime); + + box_time_t bob = BoxTimeToSeconds(pattr->ModificationTime); + __time64_t winTime = bob; + if (_gmtime64(&winTime) == 0 ) + { + ::syslog(LOG_ERR, "Corrupt value in store " + "Modification Time in file %s", Filename); + pattr->ModificationTime = 0; + } + + bob = BoxTimeToSeconds(pattr->AttrModificationTime); + winTime = bob; + if (_gmtime64(&winTime) == 0 ) + { + ::syslog(LOG_ERR, "Corrupt value in store " + "Attr Modification Time in file %s", Filename); + pattr->AttrModificationTime = 0; + } +#endif + // Attributes ready. Encrypt into this block EncryptAttr(*pnewAttr); @@ -372,7 +404,7 @@ pattr->FileGenerationNumber = htonl(st.st_gen); #endif } - +#ifndef WIN32 // -------------------------------------------------------------------------- // // Function @@ -402,6 +434,7 @@ std::memcpy(buffer+oldSize, linkedTo, linkedToSize); buffer[oldSize+linkedToSize] = '\0'; } +#endif // -------------------------------------------------------------------------- // @@ -574,12 +607,18 @@ THROW_EXCEPTION(BackupStoreException, AttributesNotLoaded); } +#ifdef WIN32 + ::syslog(LOG_WARNING, + "Cannot create symbolic links on Windows: %s", + Filename); +#else // Make a symlink, first deleting anything in the way ::unlink(Filename); if(::symlink((char*)(pattr + 1), Filename) != 0) { THROW_EXCEPTION(CommonException, OSFileError) } +#endif xattrOffset += std::strlen(reinterpret_cast(pattr+1))+1; } @@ -943,6 +982,3 @@ uint64_t result = *((uint64_t *)(digest.DigestAsData())); return result; } - - - Modified: box/trunk/lib/backupclient/BackupClientFileAttributes.h =================================================================== --- box/trunk/lib/backupclient/BackupClientFileAttributes.h 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/backupclient/BackupClientFileAttributes.h 2005-12-12 20:50:00 UTC (rev 213) @@ -44,7 +44,7 @@ void ReadAttributes(const char *Filename, bool ZeroModificationTimes = false, box_time_t *pModTime = 0, box_time_t *pAttrModTime = 0, int64_t *pFileSize = 0, - ino_t *pInodeNumber = 0, bool *pHasMultipleLinks = 0); + InodeRefType *pInodeNumber = 0, bool *pHasMultipleLinks = 0); void WriteAttributes(const char *Filename) const; bool IsSymLink() const; Modified: box/trunk/lib/backupclient/BackupStoreFile.cpp =================================================================== --- box/trunk/lib/backupclient/BackupStoreFile.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/backupclient/BackupStoreFile.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -15,7 +15,9 @@ #include #include #ifndef BOX_DISABLE_BACKWARDS_COMPATIBILITY_BACKUPSTOREFILE - #include + #ifndef WIN32 + #include + #endif #include #endif Modified: box/trunk/lib/backupclient/BackupStoreFileDiff.cpp =================================================================== --- box/trunk/lib/backupclient/BackupStoreFileDiff.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/backupclient/BackupStoreFileDiff.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -12,7 +12,11 @@ #include #include #include +#ifdef WIN32 +#include +#else #include +#endif #include "BackupStoreFile.h" #include "BackupStoreFileWire.h" @@ -989,7 +993,11 @@ for(unsigned int e = 0; e < rRecipe.size(); ++e) { char b[64]; +#ifdef WIN32 + sprintf(b, "%8I64d", (int64_t)(rRecipe[e].mpStartBlock - pIndex)); +#else sprintf(b, "%8lld", (int64_t)(rRecipe[e].mpStartBlock - pIndex)); +#endif TRACE3("%8lld %s %8lld\n", rRecipe[e].mSpaceBefore, (rRecipe[e].mpStartBlock == 0)?" -":b, (int64_t)rRecipe[e].mBlocks); } } Modified: box/trunk/lib/backupclient/BackupStoreObjectDump.cpp =================================================================== --- box/trunk/lib/backupclient/BackupStoreObjectDump.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/backupclient/BackupStoreObjectDump.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -96,11 +96,19 @@ int depends_l = 0; if((*i)->GetDependsNewer() != 0) { +#ifdef WIN32 + depends_l += ::sprintf(depends + depends_l, " depNew(%I64x)", (*i)->GetDependsNewer()); +#else depends_l += ::sprintf(depends + depends_l, " depNew(%llx)", (*i)->GetDependsNewer()); +#endif } if((*i)->GetDependsOlder() != 0) { +#ifdef WIN32 + depends_l += ::sprintf(depends + depends_l, " depOld(%I64x)", (*i)->GetDependsOlder()); +#else depends_l += ::sprintf(depends + depends_l, " depOld(%llx)", (*i)->GetDependsOlder()); +#endif } // Output item Modified: box/trunk/lib/common/BoxPlatform.h =================================================================== --- box/trunk/lib/common/BoxPlatform.h 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/common/BoxPlatform.h 2005-12-12 20:50:00 UTC (rev 213) @@ -11,13 +11,24 @@ #ifndef BOXPLATFORM__H #define BOXPLATFORM__H +#ifdef WIN32 +#define DIRECTORY_SEPARATOR "\\" +#define DIRECTORY_SEPARATOR_ASCHAR '\\' +#else #define DIRECTORY_SEPARATOR "/" -#define DIRECTORY_SEPARATOR_ASCHAR '/' +#define DIRECTORY_SEPARATOR_ASCHAR '/' +#endif #define PLATFORM_DEV_NULL "/dev/null" #include "config.h" +#ifdef WIN32 + // need msvcrt version 6.1 or higher for _gmtime64() + // must define this before importing + #define __MSVCRT_VERSION__ 0x0601 +#endif + #ifdef HAVE_SYS_TYPES_H #include #endif @@ -51,6 +62,27 @@ #define STRUCTURE_PACKING_FOR_WIRE_USE_HEADERS #endif +#if defined WIN32 && !defined __MINGW32__ + typedef __int8 int8_t; + typedef __int16 int16_t; + typedef __int32 int32_t; + typedef __int64 int64_t; + + typedef unsigned __int8 u_int8_t; + typedef unsigned __int16 u_int16_t; + typedef unsigned __int32 u_int32_t; + typedef unsigned __int64 u_int64_t; + + #define HAVE_UINT8_T + #define HAVE_UINT16_T + #define HAVE_UINT32_T + #define HAVE_UINT64_T + + typedef unsigned int uid_t; + typedef unsigned int gid_t; + typedef int pid_t; +#endif // WIN32 && !__MINGW32__ + // Define missing types #ifndef HAVE_UINT8_T typedef u_int8_t uint8_t; @@ -88,4 +120,15 @@ #define INFTIM -1 #endif +#ifdef WIN32 + typedef u_int64_t InodeRefType; +#else + typedef ino_t InodeRefType; +#endif + +#ifdef WIN32 + #define WIN32_LEAN_AND_MEAN + #include "emu.h" +#endif + #endif // BOXPLATFORM__H Modified: box/trunk/lib/common/BoxPortsAndFiles.h =================================================================== --- box/trunk/lib/common/BoxPortsAndFiles.h 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/common/BoxPortsAndFiles.h 2005-12-12 20:50:00 UTC (rev 213) @@ -20,12 +20,17 @@ #define BOX_RAIDFILE_ROOT_BBSTORED "backup" // Backup client daemon +#ifdef WIN32 +#define BOX_FILE_BBACKUPD_DEFAULT_CONFIG "C:\\Program Files\\Box Backup\\bbackupd.conf" +#else #define BOX_FILE_BBACKUPD_DEFAULT_CONFIG "/etc/box/bbackupd.conf" +#endif - -// RaidFile conf location efault +// RaidFile conf location default #define BOX_FILE_RAIDFILE_DEFAULT_CONFIG "/etc/box/raidfile.conf" +// Default name of the named pipe +#define BOX_NAMED_PIPE_NAME L"\\\\.\\pipe\\boxbackup" #endif // BOXPORTSANDFILES__H Modified: box/trunk/lib/common/BoxTime.h =================================================================== --- box/trunk/lib/common/BoxTime.h 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/common/BoxTime.h 2005-12-12 20:50:00 UTC (rev 213) @@ -31,11 +31,11 @@ { return ((box_time_t)Seconds * MICRO_SEC_IN_SEC_LL); } -inline int64_t BoxTimeToSeconds(box_time_t Time) +inline box_time_t BoxTimeToSeconds(box_time_t Time) { return Time / MICRO_SEC_IN_SEC_LL; } -inline int64_t BoxTimeToMilliSeconds(box_time_t Time) +inline box_time_t BoxTimeToMilliSeconds(box_time_t Time) { return Time / MILLI_SEC_IN_NANO_SEC_LL; } Modified: box/trunk/lib/common/BoxTimeToText.cpp =================================================================== --- box/trunk/lib/common/BoxTimeToText.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/common/BoxTimeToText.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -27,14 +27,35 @@ // -------------------------------------------------------------------------- std::string BoxTimeToISO8601String(box_time_t Time) { +#ifdef WIN32 + struct tm *time; + box_time_t bob = BoxTimeToSeconds(Time); + + __time64_t winTime = bob; + + time = _gmtime64(&winTime); + char str[128]; // more than enough space + + if ( time == NULL ) + { + // ::sprintf(str, "%016I64x ", bob); + return std::string("unable to convert time"); + } + + sprintf(str, "%04d-%02d-%02dT%02d:%02d:%02d", time->tm_year + 1900, + time->tm_mon + 1, time->tm_mday, time->tm_hour, + time->tm_min, time->tm_sec); +#else // ! WIN32 time_t timeInSecs = (time_t)BoxTimeToSeconds(Time); struct tm time; gmtime_r(&timeInSecs, &time); char str[128]; // more than enough space sprintf(str, "%04d-%02d-%02dT%02d:%02d:%02d", time.tm_year + 1900, - time.tm_mon + 1, time.tm_mday, time.tm_hour, time.tm_min, time.tm_sec); - + time.tm_mon + 1, time.tm_mday, time.tm_hour, + time.tm_min, time.tm_sec); +#endif // WIN32 + return std::string(str); } Modified: box/trunk/lib/common/BoxTimeToUnix.h =================================================================== --- box/trunk/lib/common/BoxTimeToUnix.h 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/common/BoxTimeToUnix.h 2005-12-12 20:50:00 UTC (rev 213) @@ -10,7 +10,11 @@ #ifndef FILEMODIFICATIONTIMETOTIMEVAL__H #define FILEMODIFICATIONTIMETOTIMEVAL__H +#ifdef WIN32 +#include +#else #include +#endif #include "BoxTime.h" Modified: box/trunk/lib/common/CommonException.txt =================================================================== --- box/trunk/lib/common/CommonException.txt 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/common/CommonException.txt 2005-12-12 20:50:00 UTC (rev 213) @@ -42,3 +42,4 @@ KEventErrorRemove 35 KQueueNotSupportedOnThisPlatform 36 IOStreamGetLineNotEnoughDataToIgnore 37 Bad value passed to IOStreamGetLine::IgnoreBufferedData() +TempDirPathTooLong 38 Your temporary directory path is too long. Check the TMP and TEMP environment variables. Modified: box/trunk/lib/common/DebugPrintf.cpp =================================================================== --- box/trunk/lib/common/DebugPrintf.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/common/DebugPrintf.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -55,10 +55,16 @@ // But tracing to syslog is independent of tracing being on or not if(BoxDebugTraceToSyslog) { +#ifdef WIN32 // Remove trailing '\n', if it's there + if(r > 0 && text[r-1] == '\n') + { + text[r-1] = '\0'; +#else if(r > 0 && text[r] == '\n') { text[r] = '\0'; +#endif --r; } // Log it Modified: box/trunk/lib/common/FileStream.cpp =================================================================== --- box/trunk/lib/common/FileStream.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/common/FileStream.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -22,14 +22,25 @@ // // -------------------------------------------------------------------------- FileStream::FileStream(const char *Filename, int flags, int mode) +#ifdef WIN32 + : mOSFileHandle(::openfile(Filename, flags, mode)), +#else : mOSFileHandle(::open(Filename, flags, mode)), +#endif mIsEOF(false) { +#ifdef WIN32 + if(mOSFileHandle == 0) +#else if(mOSFileHandle < 0) +#endif { MEMLEAKFINDER_NOT_A_LEAK(this); THROW_EXCEPTION(CommonException, OSFileOpenError) } +#ifdef WIN32 + this->fileName = Filename; +#endif } @@ -41,7 +52,7 @@ // Created: 2003/08/28 // // -------------------------------------------------------------------------- -FileStream::FileStream(int FileDescriptor) +FileStream::FileStream(tOSFileHandle FileDescriptor) : mOSFileHandle(FileDescriptor), mIsEOF(false) { @@ -52,7 +63,7 @@ } } - +#if 0 // -------------------------------------------------------------------------- // // Function @@ -71,6 +82,7 @@ THROW_EXCEPTION(CommonException, OSFileOpenError) } } +#endif // 0 // -------------------------------------------------------------------------- // @@ -82,7 +94,7 @@ // -------------------------------------------------------------------------- FileStream::~FileStream() { - if(mOSFileHandle >= 0) + if(mOSFileHandle != INVALID_FILE) { Close(); } @@ -98,8 +110,33 @@ // -------------------------------------------------------------------------- int FileStream::Read(void *pBuffer, int NBytes, int Timeout) { - if(mOSFileHandle == -1) {THROW_EXCEPTION(CommonException, FileClosed)} + if(mOSFileHandle == INVALID_FILE) + { + THROW_EXCEPTION(CommonException, FileClosed) + } + +#ifdef WIN32 + int r; + DWORD numBytesRead = 0; + BOOL valid = ReadFile( + this->mOSFileHandle, + pBuffer, + NBytes, + &numBytesRead, + NULL + ); + + if ( valid ) + { + r = numBytesRead; + } + else + { + r = -1; + } +#else int r = ::read(mOSFileHandle, pBuffer, NBytes); +#endif if(r == -1) { THROW_EXCEPTION(CommonException, OSFileReadError) @@ -143,11 +180,34 @@ // -------------------------------------------------------------------------- void FileStream::Write(const void *pBuffer, int NBytes) { - if(mOSFileHandle == -1) {THROW_EXCEPTION(CommonException, FileClosed)} + if(mOSFileHandle == INVALID_FILE) + { + THROW_EXCEPTION(CommonException, FileClosed) + } + +#ifdef WIN32 + DWORD numBytesWritten = 0; + BOOL res = WriteFile( + this->mOSFileHandle, + pBuffer, + NBytes, + &numBytesWritten, + NULL + ); + + if ( (res == 0) || (numBytesWritten != NBytes)) + { + DWORD err = GetLastError(); + THROW_EXCEPTION(CommonException, OSFileWriteError) + } + + +#else if(::write(mOSFileHandle, pBuffer, NBytes) != NBytes) { THROW_EXCEPTION(CommonException, OSFileWriteError) } +#endif } @@ -161,7 +221,21 @@ // -------------------------------------------------------------------------- IOStream::pos_type FileStream::GetPosition() const { - if(mOSFileHandle == -1) {THROW_EXCEPTION(CommonException, FileClosed)} + if(mOSFileHandle == INVALID_FILE) + { + THROW_EXCEPTION(CommonException, FileClosed) + } + +#ifdef WIN32 + LARGE_INTEGER conv; + + conv.HighPart = 0; + conv.LowPart = 0; + + conv.LowPart = SetFilePointer(this->mOSFileHandle, 0, &conv.HighPart, FILE_CURRENT); + + return (IOStream::pos_type)conv.QuadPart; +#else // ! WIN32 off_t p = ::lseek(mOSFileHandle, 0, SEEK_CUR); if(p == -1) { @@ -169,6 +243,7 @@ } return (IOStream::pos_type)p; +#endif // WIN32 } @@ -182,12 +257,28 @@ // -------------------------------------------------------------------------- void FileStream::Seek(IOStream::pos_type Offset, int SeekType) { - if(mOSFileHandle == -1) {THROW_EXCEPTION(CommonException, FileClosed)} + if(mOSFileHandle == INVALID_FILE) + { + THROW_EXCEPTION(CommonException, FileClosed) + } + +#ifdef WIN32 + LARGE_INTEGER conv; + + conv.QuadPart = Offset; + DWORD retVal = SetFilePointer(this->mOSFileHandle, conv.LowPart, &conv.HighPart, ConvertSeekTypeToOSWhence(SeekType)); + + if ( retVal == INVALID_SET_FILE_POINTER && (GetLastError() != NO_ERROR) ) + { + THROW_EXCEPTION(CommonException, OSFileError) + } +#else // ! WIN32 if(::lseek(mOSFileHandle, Offset, ConvertSeekTypeToOSWhence(SeekType)) == -1) { THROW_EXCEPTION(CommonException, OSFileError) } - +#endif // WIN32 + // Not end of file any more! mIsEOF = false; } @@ -207,12 +298,21 @@ { THROW_EXCEPTION(CommonException, FileAlreadyClosed) } +#ifdef WIN32 + if(::CloseHandle(mOSFileHandle) == 0) + { + THROW_EXCEPTION(CommonException, OSFileCloseError) + } + mOSFileHandle = NULL; + mIsEOF = true; +#else if(::close(mOSFileHandle) != 0) { THROW_EXCEPTION(CommonException, OSFileCloseError) } mOSFileHandle = -1; mIsEOF = true; +#endif } Modified: box/trunk/lib/common/FileStream.h =================================================================== --- box/trunk/lib/common/FileStream.h 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/common/FileStream.h 2005-12-12 20:50:00 UTC (rev 213) @@ -17,12 +17,26 @@ #include #include +#ifdef WIN32 + #define INVALID_FILE NULL + typedef HANDLE tOSFileHandle; +#else + #define INVALID_FILE -1 + typedef int tOSFileHandle; +#endif + class FileStream : public IOStream { public: - FileStream(const char *Filename, int flags = O_RDONLY, int mode = (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)); - FileStream(int FileDescriptor); - FileStream(const FileStream &rToCopy); + FileStream(const char *Filename, +#ifdef WIN32 + int flags = (O_RDONLY | O_BINARY), +#else + int flags = O_RDONLY, +#endif + int mode = (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)); + FileStream(tOSFileHandle FileDescriptor); + virtual ~FileStream(); virtual int Read(void *pBuffer, int NBytes, int Timeout = IOStream::TimeOutInfinite); @@ -36,8 +50,14 @@ virtual bool StreamClosed(); private: - int mOSFileHandle; + tOSFileHandle mOSFileHandle; bool mIsEOF; + FileStream(const FileStream &rToCopy) { /* do not call */ } + +#ifdef WIN32 + // for debugging.. + std::string fileName; +#endif }; Modified: box/trunk/lib/common/IOStream.cpp =================================================================== --- box/trunk/lib/common/IOStream.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/common/IOStream.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -105,7 +105,18 @@ int ostype = SEEK_SET; switch(SeekType) { +#ifdef WIN32 case SeekType_Absolute: + ostype = FILE_BEGIN; + break; + case SeekType_Relative: + ostype = FILE_CURRENT; + break; + case SeekType_End: + ostype = FILE_END; + break; +#else // ! WIN32 + case SeekType_Absolute: ostype = SEEK_SET; break; case SeekType_Relative: @@ -114,6 +125,7 @@ case SeekType_End: ostype = SEEK_END; break; +#endif // WIN32 default: THROW_EXCEPTION(CommonException, IOStreamBadSeekType) Modified: box/trunk/lib/common/NamedLock.cpp =================================================================== --- box/trunk/lib/common/NamedLock.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/common/NamedLock.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -105,7 +105,7 @@ THROW_EXCEPTION(CommonException, OSFileError) } } -#else +#elif HAVE_DECL_F_SETLK struct flock desc; desc.l_type = F_WRLCK; desc.l_whence = SEEK_SET; Modified: box/trunk/lib/common/TemporaryDirectory.h =================================================================== --- box/trunk/lib/common/TemporaryDirectory.h 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/common/TemporaryDirectory.h 2005-12-12 20:50:00 UTC (rev 213) @@ -12,15 +12,35 @@ #include -#ifdef TEMP_DIRECTORY_NAME - // Prefix name with Box to avoid clashing with OS API names - inline std::string BoxGetTemporaryDirectoryName() +#ifdef WIN32 + #include +#endif + +// Prefix name with Box to avoid clashing with OS API names +std::string BoxGetTemporaryDirectoryName() +{ +#ifdef WIN32 + // http://msdn.microsoft.com/library/default.asp? + // url=/library/en-us/fileio/fs/creating_and_using_a_temporary_file.asp + + DWORD dwRetVal; + char lpPathBuffer[1024]; + DWORD dwBufSize = sizeof(lpPathBuffer); + + // Get the temp path. + dwRetVal = GetTempPath(dwBufSize, // length of the buffer + lpPathBuffer); // buffer for path + if (dwRetVal > dwBufSize) { - return std::string(TEMP_DIRECTORY_NAME); + THROW_EXCEPTION(CommonException, TempDirPathTooLong) } -#else - non-static temporary directory names not supported yet + + return std::string(lpPathBuffer); +#elif defined TEMP_DIRECTORY_NAME + return std::string(TEMP_DIRECTORY_NAME); +#else + #error non-static temporary directory names not supported yet #endif +} #endif // TEMPORARYDIRECTORY__H - Modified: box/trunk/lib/common/UnixUser.cpp =================================================================== --- box/trunk/lib/common/UnixUser.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/common/UnixUser.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -9,7 +9,10 @@ #include "Box.h" +#ifndef WIN32 #include +#endif + #include #include "UnixUser.h" Modified: box/trunk/lib/common/WaitForEvent.h =================================================================== --- box/trunk/lib/common/WaitForEvent.h 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/common/WaitForEvent.h 2005-12-12 20:50:00 UTC (rev 213) @@ -15,7 +15,9 @@ #include #else #include - #include + #ifndef WIN32 + #include + #endif #endif #include "CommonException.h" Modified: box/trunk/lib/server/Daemon.cpp =================================================================== --- box/trunk/lib/server/Daemon.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/server/Daemon.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -11,11 +11,14 @@ #include #include -#include #include #include #include +#ifndef WIN32 +#include +#endif + #include "Daemon.h" #include "Configuration.h" #include "ServerException.h" @@ -140,6 +143,7 @@ // Let the derived class have a go at setting up stuff in the initial process SetupInInitialProcess(); +#ifndef WIN32 // Set signal handler struct sigaction sa; sa.sa_handler = SignalHandler; @@ -219,12 +223,14 @@ break; } } +#endif // ! WIN32 // open the log ::openlog(DaemonName(), LOG_PID, LOG_LOCAL6); // Log the start message ::syslog(LOG_INFO, "Starting daemon (config: %s) (version " BOX_VERSION ")", configfile); +#ifndef WIN32 // Write PID to file char pid[32]; int pidsize = sprintf(pid, "%d", (int)getpid()); @@ -233,6 +239,7 @@ ::syslog(LOG_ERR, "can't write pid file"); THROW_EXCEPTION(ServerException, DaemoniseFailed) } +#endif // Set up memory leak reporting #ifdef BOX_MEMORY_LEAK_TESTING @@ -245,6 +252,7 @@ if(asDaemon) { +#ifndef WIN32 // Close standard streams ::close(0); ::close(1); @@ -265,8 +273,9 @@ { ::close(devnull); } - - // And definately don't try and send anything to those file descriptors +#endif // ! WIN32 + + // And definitely don't try and send anything to those file descriptors // -- this has in the past sent text to something which isn't expecting it. TRACE_TO_STDOUT(false); } @@ -357,6 +366,7 @@ // -------------------------------------------------------------------------- void Daemon::EnterChild() { +#ifndef WIN32 // Unset signal handlers struct sigaction sa; sa.sa_handler = SIG_DFL; @@ -364,6 +374,7 @@ sigemptyset(&sa.sa_mask); // macro ::sigaction(SIGHUP, &sa, NULL); ::sigaction(SIGTERM, &sa, NULL); +#endif } @@ -377,6 +388,7 @@ // -------------------------------------------------------------------------- void Daemon::SignalHandler(int sigraised) { +#ifndef WIN32 if(spDaemon != 0) { switch(sigraised) @@ -393,6 +405,7 @@ break; } } +#endif } // -------------------------------------------------------------------------- @@ -534,5 +547,3 @@ #endif // HAVE_SETPROCTITLE } - - Modified: box/trunk/lib/server/LocalProcessStream.cpp =================================================================== --- box/trunk/lib/server/LocalProcessStream.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/server/LocalProcessStream.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -9,7 +9,9 @@ #include "Box.h" +#ifndef WIN32 #include +#endif #include #include "LocalProcessStream.h" @@ -36,6 +38,8 @@ // Split up command std::vector command; SplitString(std::string(CommandLine), ' ', command); + +#ifndef WIN32 // Build arguments char *args[MAX_ARGUMENTS + 4]; { @@ -94,6 +98,11 @@ // Return the stream object and PID rPidOut = pid; return stream; +#else // WIN32 + ::syslog(LOG_ERR, "vfork not implemented - LocalProcessStream.cpp"); + std::auto_ptr stream; + return stream; +#endif // ! WIN32 } Modified: box/trunk/lib/server/SSLLib.cpp =================================================================== --- box/trunk/lib/server/SSLLib.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/server/SSLLib.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -14,7 +14,9 @@ #include #include +#ifndef WIN32 #include +#endif #include "SSLLib.h" #include "ServerException.h" Modified: box/trunk/lib/server/ServerStream.h =================================================================== --- box/trunk/lib/server/ServerStream.h 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/server/ServerStream.h 2005-12-12 20:50:00 UTC (rev 213) @@ -10,11 +10,14 @@ #ifndef SERVERSTREAM__H #define SERVERSTREAM__H -#include #include #include -#include +#ifndef WIN32 + #include + #include +#endif + #include "Daemon.h" #include "SocketListen.h" #include "Utils.h" Modified: box/trunk/lib/server/Socket.cpp =================================================================== --- box/trunk/lib/server/Socket.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/server/Socket.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -11,11 +11,13 @@ #include #include +#ifndef WIN32 #include #include #include #include #include +#endif #include #include @@ -72,6 +74,7 @@ } break; +#ifndef WIN32 case TypeUNIX: sockDomain = AF_UNIX; { @@ -89,7 +92,8 @@ ::strcpy(addr.sa_unix.sun_path, Name); } break; - +#endif + default: THROW_EXCEPTION(CommonException, BadArguments) break; Modified: box/trunk/lib/server/Socket.h =================================================================== --- box/trunk/lib/server/Socket.h 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/server/Socket.h 2005-12-12 20:50:00 UTC (rev 213) @@ -10,16 +10,23 @@ #ifndef SOCKET__H #define SOCKET__H +#ifdef WIN32 +#include "emu.h" +typedef int socklen_t; +#else #include #include #include +#endif #include typedef union { struct sockaddr sa_generic; struct sockaddr_in sa_inet; +#ifndef WIN32 struct sockaddr_un sa_unix; +#endif } SocketAllAddr; // -------------------------------------------------------------------------- Modified: box/trunk/lib/server/SocketListen.h =================================================================== --- box/trunk/lib/server/SocketListen.h 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/server/SocketListen.h 2005-12-12 20:50:00 UTC (rev 213) @@ -12,15 +12,20 @@ #include #include -#include -#include -#include -#include + #ifdef HAVE_KQUEUE #include #include #endif +#ifndef WIN32 + #include +#endif + +#include +#include +#include + #include "Socket.h" #include "ServerException.h" @@ -94,7 +99,11 @@ { if(mSocketHandle != -1) { +#ifdef WIN32 + if(::closesocket(mSocketHandle) == -1) +#else if(::close(mSocketHandle) == -1) +#endif { THROW_EXCEPTION(ServerException, SocketCloseError) } @@ -128,8 +137,12 @@ } // Set an option to allow reuse (useful for -HUP situations!) +#ifdef WIN32 + if(::setsockopt(mSocketHandle, SOL_SOCKET, SO_REUSEADDR, "", 0) == -1) +#else int option = true; if(::setsockopt(mSocketHandle, SOL_SOCKET, SO_REUSEADDR, &option, sizeof(option)) == -1) +#endif { THROW_EXCEPTION(ServerException, SocketOpenError) } Modified: box/trunk/lib/server/SocketStream.cpp =================================================================== --- box/trunk/lib/server/SocketStream.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/server/SocketStream.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -11,9 +11,12 @@ #include #include -#include #include +#ifndef WIN32 +#include +#endif + #include "SocketStream.h" #include "ServerException.h" #include "CommonException.h" @@ -140,7 +143,11 @@ if(::connect(mSocketHandle, &addr.sa_generic, addrLen) == -1) { // Dispose of the socket +#ifdef WIN32 + ::closesocket(mSocketHandle); +#else ::close(mSocketHandle); +#endif mSocketHandle = -1; THROW_EXCEPTION(ConnectionException, Conn_SocketConnectError) } @@ -191,7 +198,11 @@ } } +#ifdef WIN32 + int r = ::recv(mSocketHandle, (char*)pBuffer, NBytes, 0); +#else int r = ::read(mSocketHandle, pBuffer, NBytes); +#endif if(r == -1) { if(errno == EINTR) @@ -236,7 +247,11 @@ while(bytesLeft > 0) { // Try to send. +#ifdef WIN32 + int sent = ::send(mSocketHandle, buffer, bytesLeft, 0); +#else int sent = ::write(mSocketHandle, buffer, bytesLeft); +#endif if(sent == -1) { // Error. @@ -283,8 +298,11 @@ void SocketStream::Close() { if(mSocketHandle == -1) {THROW_EXCEPTION(ServerException, BadSocketHandle)} - +#ifdef WIN32 + if(::closesocket(mSocketHandle) == -1) +#else if(::close(mSocketHandle) == -1) +#endif { THROW_EXCEPTION(ServerException, SocketCloseError) } @@ -354,7 +372,7 @@ // Created: 2003/08/06 // // -------------------------------------------------------------------------- -int SocketStream::GetSocketHandle() +tOSSocketHandle SocketStream::GetSocketHandle() { if(mSocketHandle == -1) {THROW_EXCEPTION(ServerException, BadSocketHandle)} return mSocketHandle; Modified: box/trunk/lib/server/SocketStream.h =================================================================== --- box/trunk/lib/server/SocketStream.h 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/server/SocketStream.h 2005-12-12 20:50:00 UTC (rev 213) @@ -12,6 +12,12 @@ #include "IOStream.h" +#ifdef WIN32 + typedef SOCKET tOSSocketHandle; +#else + typedef int tOSSocketHandle; +#endif + // -------------------------------------------------------------------------- // // Class @@ -42,12 +48,12 @@ virtual bool GetPeerCredentials(uid_t &rUidOut, gid_t &rGidOut); protected: - int GetSocketHandle(); + tOSSocketHandle GetSocketHandle(); void MarkAsReadClosed() {mReadClosed = true;} void MarkAsWriteClosed() {mWriteClosed = true;} private: - int mSocketHandle; + tOSSocketHandle mSocketHandle; bool mReadClosed; bool mWriteClosed; }; Modified: box/trunk/lib/server/SocketStreamTLS.cpp =================================================================== --- box/trunk/lib/server/SocketStreamTLS.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/server/SocketStreamTLS.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -12,10 +12,13 @@ #define TLS_CLASS_IMPLEMENTATION_CPP #include #include -#include #include #include +#ifndef WIN32 +#include +#endif + #include "SocketStreamTLS.h" #include "SSLLib.h" #include "ServerException.h" @@ -120,7 +123,8 @@ SSLLib::LogError("Create socket bio"); THROW_EXCEPTION(ServerException, TLSAllocationFailed) } - int socket = GetSocketHandle(); + + tOSSocketHandle socket = GetSocketHandle(); BIO_set_fd(mpBIO, socket, BIO_NOCLOSE); // Then the SSL object @@ -131,6 +135,7 @@ THROW_EXCEPTION(ServerException, TLSAllocationFailed) } +#ifndef WIN32 // Make the socket non-blocking so timeouts on Read work // This is more portable than using ioctl with FIONBIO int statusFlags = 0; @@ -139,6 +144,7 @@ { THROW_EXCEPTION(ServerException, SocketSetNonBlockingFailed) } +#endif // FIXME: This is less portable than the above. However, it MAY be needed // for cygwin, which has/had bugs with fcntl @@ -464,5 +470,3 @@ // Done. return std::string(commonName); } - - Modified: box/trunk/lib/server/makeprotocol.pl =================================================================== --- box/trunk/lib/server/makeprotocol.pl 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/lib/server/makeprotocol.pl 2005-12-12 20:50:00 UTC (rev 213) @@ -182,7 +182,11 @@ if($implement_syslog) { - print H qq~#include \n~; + print H < +#endif +EOF } Copied: box/trunk/lib/win32 (from rev 210, box/chris/win32/merge/07-win32-fixes/lib/win32) Deleted: box/trunk/lib/win32/WinNamedPipeStream.cpp =================================================================== --- box/chris/win32/merge/07-win32-fixes/lib/win32/WinNamedPipeStream.cpp 2005-12-12 02:03:39 UTC (rev 210) +++ box/trunk/lib/win32/WinNamedPipeStream.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -1,301 +0,0 @@ -// -------------------------------------------------------------------------- -// -// File -// Name: WinNamedPipeStream.cpp -// Purpose: I/O stream interface for Win32 named pipes -// Created: 2005/12/07 -// -// -------------------------------------------------------------------------- - -#include "Box.h" - -#ifdef WIN32 - -#include -#include -#include -#include - -#include "WinNamedPipeStream.h" -#include "ServerException.h" -#include "CommonException.h" -#include "Socket.h" - -#include "MemLeakFindOn.h" - -// -------------------------------------------------------------------------- -// -// Function -// Name: WinNamedPipeStream::WinNamedPipeStream() -// Purpose: Constructor (create stream ready for Open() call) -// Created: 2005/12/07 -// -// -------------------------------------------------------------------------- -WinNamedPipeStream::WinNamedPipeStream() - : mSocketHandle(NULL), - mReadClosed(false), - mWriteClosed(false), - mIsServer(false), - mIsConnected(false) -{ -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: WinNamedPipeStream::~WinNamedPipeStream() -// Purpose: Destructor, closes stream if open -// Created: 2005/12/07 -// -// -------------------------------------------------------------------------- -WinNamedPipeStream::~WinNamedPipeStream() -{ - if (mSocketHandle != NULL) - { - Close(); - } -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: WinNamedPipeStream::Accept(const char* Name) -// Purpose: Creates a new named pipe with the given name, -// and wait for a connection on it -// Created: 2005/12/07 -// -// -------------------------------------------------------------------------- -void WinNamedPipeStream::Accept(const wchar_t* pName) -{ - if (mSocketHandle != NULL || mIsConnected) - { - THROW_EXCEPTION(ServerException, SocketAlreadyOpen) - } - - mSocketHandle = CreateNamedPipeW( - pName, // pipe name - PIPE_ACCESS_DUPLEX, // read/write access - PIPE_TYPE_MESSAGE | // message type pipe - PIPE_READMODE_MESSAGE | // message-read mode - PIPE_WAIT, // blocking mode - 1, // max. instances - 4096, // output buffer size - 4096, // input buffer size - NMPWAIT_USE_DEFAULT_WAIT, // client time-out - NULL); // default security attribute - - if (mSocketHandle == NULL) - { - ::syslog(LOG_ERR, "CreateNamedPipeW failed: %d", - GetLastError()); - THROW_EXCEPTION(ServerException, SocketOpenError) - } - - bool connected = ConnectNamedPipe(mSocketHandle, (LPOVERLAPPED) NULL); - - if (!connected) - { - ::syslog(LOG_ERR, "ConnectNamedPipe failed: %d", - GetLastError()); - CloseHandle(mSocketHandle); - mSocketHandle = NULL; - THROW_EXCEPTION(ServerException, SocketOpenError) - } - - mReadClosed = FALSE; - mWriteClosed = FALSE; - mIsServer = TRUE; // must flush and disconnect before closing - mIsConnected = TRUE; -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: WinNamedPipeStream::Connect(const char* Name) -// Purpose: Opens a connection to a listening named pipe -// Created: 2005/12/07 -// -// -------------------------------------------------------------------------- -void WinNamedPipeStream::Connect(const wchar_t* pName) -{ - if (mSocketHandle != NULL || mIsConnected) - { - THROW_EXCEPTION(ServerException, SocketAlreadyOpen) - } - - mSocketHandle = CreateFileW( - pName, // pipe name - GENERIC_READ | // read and write access - GENERIC_WRITE, - 0, // no sharing - NULL, // default security attributes - OPEN_EXISTING, - 0, // default attributes - NULL); // no template file - - if (mSocketHandle == INVALID_HANDLE_VALUE) - { - ::syslog(LOG_ERR, "Failed to connect to server's named pipe: " - "error %d", GetLastError()); - THROW_EXCEPTION(ServerException, SocketOpenError) - } - - mReadClosed = FALSE; - mWriteClosed = FALSE; - mIsServer = FALSE; // just close the socket - mIsConnected = TRUE; -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: WinNamedPipeStream::Read(void *pBuffer, int NBytes) -// Purpose: Reads data from stream. Maybe returns less than asked for. -// Created: 2003/07/31 -// -// -------------------------------------------------------------------------- -int WinNamedPipeStream::Read(void *pBuffer, int NBytes, int Timeout) -{ - // TODO no support for timeouts yet - ASSERT(Timeout == IOStream::TimeOutInfinite) - - if (mSocketHandle == NULL || !mIsConnected) - { - THROW_EXCEPTION(ServerException, BadSocketHandle) - } - - DWORD NumBytesRead; - - bool Success = ReadFile( - mSocketHandle, // pipe handle - pBuffer, // buffer to receive reply - NBytes, // size of buffer - &NumBytesRead, // number of bytes read - NULL); // not overlapped - - if (!Success) - { - THROW_EXCEPTION(ConnectionException, Conn_SocketReadError) - } - - // Closed for reading at EOF? - if (NumBytesRead == 0) - { - mReadClosed = true; - } - - return NumBytesRead; -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: WinNamedPipeStream::Write(void *pBuffer, int NBytes) -// Purpose: Writes data, blocking until it's all done. -// Created: 2003/07/31 -// -// -------------------------------------------------------------------------- -void WinNamedPipeStream::Write(const void *pBuffer, int NBytes) -{ - if (mSocketHandle == NULL || !mIsConnected) - { - THROW_EXCEPTION(ServerException, BadSocketHandle) - } - - // Buffer in byte sized type. - ASSERT(sizeof(char) == 1); - const char *pByteBuffer = (char *)pBuffer; - - int NumBytesWrittenTotal = 0; - - while (NumBytesWrittenTotal < NBytes) - { - DWORD NumBytesWrittenThisTime = 0; - - bool Success = WriteFile( - mSocketHandle, // pipe handle - pByteBuffer + NumBytesWrittenTotal, // message - NBytes - NumBytesWrittenTotal, // message length - &NumBytesWrittenThisTime, // bytes written this time - NULL); // not overlapped - - if (!Success) - { - mWriteClosed = true; // assume can't write again - THROW_EXCEPTION(ConnectionException, - Conn_SocketWriteError) - } - - NumBytesWrittenTotal += NumBytesWrittenThisTime; - } -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: WinNamedPipeStream::Close() -// Purpose: Closes connection to remote socket -// Created: 2003/07/31 -// -// -------------------------------------------------------------------------- -void WinNamedPipeStream::Close() -{ - if (mSocketHandle == NULL || !mIsConnected) - { - THROW_EXCEPTION(ServerException, BadSocketHandle) - } - - if (mIsServer) - { - if (!FlushFileBuffers(mSocketHandle)) - { - ::syslog(LOG_INFO, "FlushFileBuffers failed: %d", - GetLastError()); - } - - if (!DisconnectNamedPipe(mSocketHandle)) - { - ::syslog(LOG_ERR, "DisconnectNamedPipe failed: %d", - GetLastError()); - } - - mIsServer = false; - } - - if (!CloseHandle(mSocketHandle)) - { - ::syslog(LOG_ERR, "CloseHandle failed: %d", GetLastError()); - THROW_EXCEPTION(ServerException, SocketCloseError) - } - - mSocketHandle = NULL; - mIsConnected = FALSE; -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: WinNamedPipeStream::StreamDataLeft() -// Purpose: Still capable of reading data? -// Created: 2003/08/02 -// -// -------------------------------------------------------------------------- -bool WinNamedPipeStream::StreamDataLeft() -{ - return !mReadClosed; -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: WinNamedPipeStream::StreamClosed() -// Purpose: Connection been closed? -// Created: 2003/08/02 -// -// -------------------------------------------------------------------------- -bool WinNamedPipeStream::StreamClosed() -{ - return mWriteClosed; -} - -#endif // WIN32 Copied: box/trunk/lib/win32/WinNamedPipeStream.cpp (from rev 210, box/chris/win32/merge/07-win32-fixes/lib/win32/WinNamedPipeStream.cpp) Deleted: box/trunk/lib/win32/WinNamedPipeStream.h =================================================================== --- box/chris/win32/merge/07-win32-fixes/lib/win32/WinNamedPipeStream.h 2005-12-12 02:03:39 UTC (rev 210) +++ box/trunk/lib/win32/WinNamedPipeStream.h 2005-12-12 20:50:00 UTC (rev 213) @@ -1,60 +0,0 @@ -// -------------------------------------------------------------------------- -// -// File -// Name: WinNamedPipeStream.h -// Purpose: I/O stream interface for Win32 named pipes -// Created: 2005/12/07 -// -// -------------------------------------------------------------------------- - -#if ! defined WINNAMEDPIPESTREAM__H && defined WIN32 -#define WINNAMEDPIPESTREAM__H - -#include "IOStream.h" - -// -------------------------------------------------------------------------- -// -// Class -// Name: WinNamedPipeStream -// Purpose: I/O stream interface for Win32 named pipes -// Created: 2003/07/31 -// -// -------------------------------------------------------------------------- -class WinNamedPipeStream : public IOStream -{ -public: - WinNamedPipeStream(); - ~WinNamedPipeStream(); - - // server side - create the named pipe and listen for connections - void Accept(const wchar_t* Name); - - // client side - connect to a waiting server - void Connect(const wchar_t* Name); - - // both sides - virtual int Read(void *pBuffer, int NBytes, - int Timeout = IOStream::TimeOutInfinite); - virtual void Write(const void *pBuffer, int NBytes); - virtual void Close(); - virtual bool StreamDataLeft(); - virtual bool StreamClosed(); - bool IsConnected() { return mIsConnected; } - -protected: - HANDLE GetSocketHandle(); - void MarkAsReadClosed() {mReadClosed = true;} - void MarkAsWriteClosed() {mWriteClosed = true;} - -private: - WinNamedPipeStream(const WinNamedPipeStream &rToCopy) - { /* do not call */ } - - HANDLE mSocketHandle; - bool mReadClosed; - bool mWriteClosed; - bool mIsServer; - bool mIsConnected; -}; - -#endif // WINNAMEDPIPESTREAM__H Copied: box/trunk/lib/win32/WinNamedPipeStream.h (from rev 210, box/chris/win32/merge/07-win32-fixes/lib/win32/WinNamedPipeStream.h) Deleted: box/trunk/lib/win32/emu.cpp =================================================================== --- box/chris/win32/merge/07-win32-fixes/lib/win32/emu.cpp 2005-12-12 02:03:39 UTC (rev 210) +++ box/trunk/lib/win32/emu.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -1,978 +0,0 @@ -// Box Backup Win32 native port by Nick Knight - -// Need at least 0x0500 to use GetFileSizeEx on Cygwin/MinGW -#define WINVER 0x0500 - -#include "Box.h" - -#ifdef WIN32 - -// #include "emu.h" - -#include -#include -// #include -#include - -#include -#include - -//our implimentation for a timer -//based on a simple thread which sleeps for a -//period of time -static bool gFinishTimer; -static CRITICAL_SECTION gLock; - -typedef struct -{ - int countDown; - int interval; -} -tTimer; - -std::list gTimerList; -static void (__cdecl *gTimerFunc) (int) = NULL; - -int setitimer(int type , struct itimerval *timeout, int) -{ - if ( SIGVTALRM == type || ITIMER_VIRTUAL == type ) - { - EnterCriticalSection(&gLock); - // we only need seconds for the mo! - if (timeout->it_value.tv_sec == 0 && - timeout->it_value.tv_usec == 0) - { - gTimerList.clear(); - } - else - { - tTimer ourTimer; - ourTimer.countDown = timeout->it_value.tv_sec; - ourTimer.interval = timeout->it_interval.tv_sec; - gTimerList.push_back(ourTimer); - } - LeaveCriticalSection(&gLock); - } - - // indicate success - return 0; -} - -static unsigned int WINAPI RunTimer(LPVOID lpParameter) -{ - gFinishTimer = false; - - while (!gFinishTimer) - { - std::list::iterator it; - EnterCriticalSection(&gLock); - - for (it = gTimerList.begin(); it != gTimerList.end(); it++) - { - tTimer& rTimer(*it); - - rTimer.countDown --; - if (rTimer.countDown == 0) - { - if (gTimerFunc != NULL) - { - gTimerFunc(0); - } - if (rTimer.interval) - { - rTimer.countDown = rTimer.interval; - } - else - { - // mark for deletion - rTimer.countDown = -1; - } - } - } - - for (it = gTimerList.begin(); it != gTimerList.end(); it++) - { - tTimer& rTimer(*it); - - if (rTimer.countDown == -1) - { - gTimerList.erase(it); - //if we don't do this the search is on a corrupt list - it = gTimerList.begin(); - } - } - - LeaveCriticalSection(&gLock); - // we only need to have a 1 second resolution - Sleep(1000); - } - - return 0; -} - -int SetTimerHandler(void (__cdecl *func ) (int)) -{ - gTimerFunc = func; - return 0; -} - -void InitTimer(void) -{ - InitializeCriticalSection(&gLock); - - // create our thread - HANDLE ourThread = (HANDLE)_beginthreadex(NULL, 0, RunTimer, 0, - CREATE_SUSPENDED, NULL); - SetThreadPriority(ourThread, THREAD_PRIORITY_LOWEST); - ResumeThread(ourThread); -} - -void FiniTimer(void) -{ - gFinishTimer = true; - EnterCriticalSection(&gLock); - DeleteCriticalSection(&gLock); -} - -//Our constants we need to keep track of -//globals -struct passwd gTempPasswd; - -bool EnableBackupRights( void ) -{ - HANDLE hToken; - TOKEN_PRIVILEGES token_priv; - - //open current process to adjust privileges - if( !OpenProcessToken( GetCurrentProcess( ), - TOKEN_ADJUST_PRIVILEGES, - &hToken )) - { - printf( "Cannot open process token - err = %d\n", GetLastError( ) ); - return false; - } - - //let's build the token privilege struct - - //first, look up the LUID for the backup privilege - - if( !LookupPrivilegeValue( NULL, //this system - SE_BACKUP_NAME, //the name of the privilege - &( token_priv.Privileges[0].Luid )) ) //result - { - printf( "Cannot lookup backup privilege - err = %d\n", GetLastError( ) ); - return false; - } - - token_priv.PrivilegeCount = 1; - token_priv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; - - // now set the privilege - // because we're going exit right after dumping the streams, there isn't - // any need to save current state - - if( !AdjustTokenPrivileges( hToken, //our process token - false, //we're not disabling everything - &token_priv, //address of structure - sizeof( token_priv ), //size of structure - NULL, NULL )) //don't save current state - { - //this function is a little tricky - if we were adjusting - //more than one privilege, it could return success but not - //adjust them all - in the general case, you need to trap this - printf( "Could not enable backup privileges - err = %d\n", GetLastError( ) ); - return false; - - } - else - { - return true; - } -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: openfile -// Purpose: replacement for any open calls - handles unicode filenames - supplied in utf8 -// Created: 25th October 2004 -// -// -------------------------------------------------------------------------- -HANDLE openfile(const char *filename, int flags, int mode) -{ - try{ - - wchar_t *buffer; - std::string fileN(filename); - - std::string tmpStr("\\\\?\\"); - //is the path relative or otherwise - if ( fileN[1] != ':' ) - { - //we need to get the current directory - char wd[PATH_MAX]; - if(::getcwd(wd, PATH_MAX) == 0) - { - return NULL; - } - tmpStr += wd; - if (tmpStr[tmpStr.length()] != '\\') - { - tmpStr += '\\'; - } - } - tmpStr += filename; - - int strlen = MultiByteToWideChar( - CP_UTF8, // code page - 0, // character-type options - tmpStr.c_str(), // string to map - (int)tmpStr.length(), // number of bytes in string - NULL, // wide-character buffer - 0 // size of buffer - work out how much space we need - ); - - buffer = new wchar_t[strlen+1]; - if ( buffer == NULL ) - { - return NULL; - } - - strlen = MultiByteToWideChar( - CP_UTF8, // code page - 0, // character-type options - tmpStr.c_str(), // string to map - (int)tmpStr.length(), // number of bytes in string - buffer, // wide-character buffer - strlen // size of buffer - ); - - if ( strlen == 0 ) - { - delete [] buffer; - return NULL; - } - - buffer[strlen] = L'\0'; - - //flags could be O_WRONLY | O_CREAT | O_RDONLY - DWORD createDisposition = OPEN_EXISTING; - DWORD shareMode = FILE_SHARE_READ; - DWORD accessRights = FILE_READ_ATTRIBUTES | FILE_LIST_DIRECTORY | FILE_READ_EA; - - if ( flags & O_WRONLY ) - { - createDisposition = OPEN_EXISTING; - shareMode |= FILE_SHARE_READ ;//| FILE_SHARE_WRITE; - } - if ( flags & O_CREAT ) - { - createDisposition = OPEN_ALWAYS; - shareMode |= FILE_SHARE_READ ;//| FILE_SHARE_WRITE; - accessRights |= FILE_WRITE_ATTRIBUTES | FILE_WRITE_DATA | FILE_WRITE_EA | FILE_ALL_ACCESS; - } - if ( flags & O_TRUNC ) - { - createDisposition = OPEN_ALWAYS; - } - - HANDLE hdir = CreateFileW(buffer, - accessRights, - shareMode, - NULL, - createDisposition, - FILE_FLAG_BACKUP_SEMANTICS, - NULL); - - if ( hdir == INVALID_HANDLE_VALUE ) - { - // DWORD err = GetLastError(); - // syslog(EVENTLOG_WARNING_TYPE, "Couldn't open file %s, err %i\n", filename, err); - delete [] buffer; - return NULL; - } - - delete [] buffer; - return hdir; - - } - catch(...) - { - printf("Caught openfile:%s\r\n", filename); - } - return NULL; - -} - -// MinGW provides a getopt implementation -#ifndef __MINGW32__ -//works with getopt -char *optarg; -//optind looks like an index into the string - how far we have moved along -int optind = 1; -char nextchar = -1; -#endif - -// -------------------------------------------------------------------------- -// -// Function -// Name: ourfstat -// Purpose: replacement for fstat supply a windows handle -// Created: 25th October 2004 -// -// -------------------------------------------------------------------------- -int ourfstat(HANDLE hdir, struct stat * st) -{ - ULARGE_INTEGER conv; - - if (hdir == INVALID_HANDLE_VALUE) - { - ::syslog(LOG_ERR, "Error: invalid file handle in ourfstat()"); - errno = EBADF; - return -1; - } - - BY_HANDLE_FILE_INFORMATION fi; - if (!GetFileInformationByHandle(hdir, &fi)) - { - ::syslog(LOG_WARNING, "Failed to read file information: " - "error %d", GetLastError()); - errno = EACCES; - return -1; - } - - // This next example is how we get our INODE (equivalent) information - conv.HighPart = fi.nFileIndexHigh; - conv.LowPart = fi.nFileIndexLow; - st->st_ino = conv.QuadPart; - - // get the time information - st->st_ctime = ConvertFileTimeToTime_t(&fi.ftCreationTime); - st->st_atime = ConvertFileTimeToTime_t(&fi.ftLastAccessTime); - st->st_mtime = ConvertFileTimeToTime_t(&fi.ftLastWriteTime); - - // size of the file - LARGE_INTEGER st_size; - if (!GetFileSizeEx(hdir, &st_size)) - { - ::syslog(LOG_WARNING, "Failed to get file size: error %d", - GetLastError()); - errno = EACCES; - return -1; - } - - conv.HighPart = st_size.HighPart; - conv.LowPart = st_size.LowPart; - st->st_size = conv.QuadPart; - - //the mode of the file - st->st_mode = 0; - //DWORD res = GetFileAttributes((LPCSTR)tmpStr.c_str()); - - if (INVALID_FILE_ATTRIBUTES != fi.dwFileAttributes) - { - if (fi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - { - st->st_mode |= S_IFDIR; - } - else - { - st->st_mode |= S_IFREG; - } - } - else - { - ::syslog(LOG_WARNING, "Failed to get file attributes: " - "error %d", GetLastError()); - errno = EACCES; - return -1; - } - - return 0; -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: OpenFileByNameUtf8 -// Purpose: Converts filename to Unicode and returns -// a handle to it. In case of error, sets errno, -// logs the error and returns NULL. -// Created: 10th December 2004 -// -// -------------------------------------------------------------------------- -HANDLE OpenFileByNameUtf8(const char* pName) -{ - //some string thing - required by ms to indicate long/unicode filename - std::string tmpStr("\\\\?\\"); - - // is the path relative or otherwise - std::string fileN(pName); - if (fileN[1] != ':') - { - // we need to get the current directory - char wd[PATH_MAX]; - if(::getcwd(wd, PATH_MAX) == 0) - { - ::syslog(LOG_WARNING, - "Failed to open '%s': path too long", pName); - errno = ENAMETOOLONG; - return NULL; - } - - tmpStr += wd; - if (tmpStr[tmpStr.length()] != '\\') - { - tmpStr += '\\'; - } - } - - tmpStr += fileN; - - int strlen = MultiByteToWideChar( - CP_UTF8, // code page - 0, // character-type options - tmpStr.c_str(), // string to map - (int)tmpStr.length(), // number of bytes in string - NULL, // wide-character buffer - 0 // size of buffer - work out - // how much space we need - ); - - wchar_t* buffer = new wchar_t[strlen+1]; - - if (buffer == NULL) - { - ::syslog(LOG_WARNING, - "Failed to open '%s': out of memory", pName); - errno = ENOMEM; - return NULL; - } - - strlen = MultiByteToWideChar( - CP_UTF8, // code page - 0, // character-type options - tmpStr.c_str(), // string to map - (int)tmpStr.length(), // number of bytes in string - buffer, // wide-character buffer - strlen // size of buffer - ); - - if (strlen == 0) - { - ::syslog(LOG_WARNING, - "Failed to open '%s': could not convert " - "file name to Unicode", pName); - errno = EACCES; - delete [] buffer; - return NULL; - } - - buffer[strlen] = L'\0'; - - HANDLE handle = CreateFileW(buffer, - FILE_READ_ATTRIBUTES | FILE_LIST_DIRECTORY | FILE_READ_EA, - FILE_SHARE_READ | FILE_SHARE_DELETE | FILE_SHARE_WRITE, - NULL, - OPEN_EXISTING, - FILE_FLAG_BACKUP_SEMANTICS, - NULL); - - if (handle == INVALID_HANDLE_VALUE) - { - // if our open fails we should always be able to - // open in this mode - to get the inode information - // at least one process must have the file open - - // in this case someone else does. - handle = CreateFileW(buffer, - 0, - FILE_SHARE_READ, - NULL, - OPEN_EXISTING, - FILE_FLAG_BACKUP_SEMANTICS, - NULL); - } - - delete [] buffer; - - if (handle == INVALID_HANDLE_VALUE) - { - DWORD err = GetLastError(); - - if (err == ERROR_FILE_NOT_FOUND) - { - ::syslog(LOG_WARNING, - "Failed to open '%s': file not found", pName); - errno = ENOENT; - } - else - { - ::syslog(LOG_WARNING, - "Failed to open '%s': error %d", pName); - errno = EACCES; - } - - return NULL; - } - - return handle; -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: ourstat -// Purpose: replacement for the lstat and stat functions, -// works with unicode filenames supplied in utf8 format -// Created: 25th October 2004 -// -// -------------------------------------------------------------------------- -int ourstat(const char * pName, struct stat * st) -{ - // at the mo - st->st_uid = 0; - st->st_gid = 0; - st->st_nlink = 1; - - HANDLE handle = OpenFileByNameUtf8(pName); - - if (handle == NULL) - { - // errno already set and error logged by OpenFileByNameUtf8() - return -1; - } - - int retVal = ourfstat(handle, st); - if (retVal != 0) - { - // error logged, but without filename - ::syslog(LOG_WARNING, "Failed to get file information " - "for '%s'", pName); - } - - // close the handle - CloseHandle(handle); - - return retVal; -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: statfs -// Purpose: returns the mount point of where a file is located - -// in this case the volume serial number -// Created: 25th October 2004 -// -// -------------------------------------------------------------------------- -int statfs(const char * pName, struct statfs * s) -{ - HANDLE handle = OpenFileByNameUtf8(pName); - - if (handle == NULL) - { - // errno already set and error logged by OpenFileByNameUtf8() - return -1; - } - - BY_HANDLE_FILE_INFORMATION fi; - if (!GetFileInformationByHandle(handle, &fi)) - { - ::syslog(LOG_WARNING, "Failed to get file information " - "for '%s': error %d", pName, GetLastError()); - CloseHandle(handle); - errno = EACCES; - return -1; - } - - // convert volume serial number to a string - _ui64toa(fi.dwVolumeSerialNumber, s->f_mntonname + 1, 16); - - // pseudo unix mount point - s->f_mntonname[0] = DIRECTORY_SEPARATOR_ASCHAR; - - CloseHandle(handle); // close the handle - - return 0; -} - - - - - -// MinGW provides opendir(), etc. via -// MSVC does not provide these, so emulation is needed - -#ifndef __MINGW32__ -// -------------------------------------------------------------------------- -// -// Function -// Name: opendir -// Purpose: replacement for unix function, uses win32 findfirst routines -// Created: 25th October 2004 -// -// -------------------------------------------------------------------------- -DIR *opendir(const char *name) -{ - try - { - DIR *dir = 0; - std::string dirName(name); - - //append a '\' win32 findfirst is sensitive to this - if ( dirName[dirName.size()] != '\\' || dirName[dirName.size()] != '/' ) - { - dirName += '\\'; - } - - //what is the search string? - everything - dirName += '*'; - - if(name && name[0]) - { - if ( ( dir = new DIR ) != 0 ) - { - //mbstowcs(dir->name, dirName.c_str(),100); - //wcscpy((wchar_t*)dir->name, (const wchar_t*)dirName.c_str()); - //mbstowcs(dir->name, dirName.c_str(), dirName.size()+1); - //wchar_t *buffer; - - int strlen = MultiByteToWideChar( - CP_UTF8, // code page - 0, // character-type options - dirName.c_str(), // string to map - (int)dirName.length(), // number of bytes in string - NULL, // wide-character buffer - 0 // size of buffer - work out how much space we need - ); - - dir->name = new wchar_t[strlen+1]; - - if (dir->name == NULL) - { - delete dir; - dir = 0; - errno = ENOMEM; - return NULL; - } - - strlen = MultiByteToWideChar( - CP_UTF8, // code page - 0, // character-type options - dirName.c_str(), // string to map - (int)dirName.length(), // number of bytes in string - dir->name, // wide-character buffer - strlen // size of buffer - ); - - if (strlen == 0) - { - delete dir->name; - delete dir; - dir = 0; - errno = ENOMEM; - return NULL; - } - - dir->name[strlen] = L'\0'; - - - dir->fd = _wfindfirst( - (const wchar_t*)dir->name, - &dir->info); - - if (dir->fd != -1) - { - dir->result.d_name = 0; - } - else // go back - { - delete [] dir->name; - delete dir; - dir = 0; - } - } - else // backwards again - { - delete dir; - dir = 0; - errno = ENOMEM; - } - } - else - { - errno = EINVAL; - } - - return dir; - - } - catch(...) - { - printf("Caught opendir"); - } - - return NULL; -} - -//this kinda makes it not thread friendly! -//but I don't think it needs to be. -char tempbuff[MAX_PATH]; -// -------------------------------------------------------------------------- -// -// Function -// Name: readdir -// Purpose: as function above -// Created: 25th October 2004 -// -// -------------------------------------------------------------------------- -struct dirent *readdir(DIR *dp) -{ - try - { - struct dirent *den = NULL; - - if (dp && dp->fd != -1) - { - if (!dp->result.d_name || - _wfindnext(dp->fd, &dp->info) != -1) - { - den = &dp->result; - std::wstring input(dp->info.name); - memset(tempbuff, 0, sizeof(tempbuff)); - WideCharToMultiByte(CP_UTF8, 0, dp->info.name, - -1, &tempbuff[0], sizeof (tempbuff), - NULL, NULL); - //den->d_name = (char *)dp->info.name; - den->d_name = &tempbuff[0]; - } - } - else - { - errno = EBADF; - } - return den; - } - catch (...) - { - printf("Caught readdir"); - } - return NULL; -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: closedir -// Purpose: as function above -// Created: 25th October 2004 -// -// -------------------------------------------------------------------------- -int closedir(DIR *dp) -{ - try - { - int finres = -1; - if (dp) - { - if(dp->fd != -1) - { - finres = _findclose(dp->fd); - } - - delete [] dp->name; - delete dp; - } - - if (finres == -1) // errors go to EBADF - { - errno = EBADF; - } - - return finres; - } - catch (...) - { - printf("Caught closedir"); - } - return -1; -} -#endif // !__MINGW32__ - -// -------------------------------------------------------------------------- -// -// Function -// Name: poll -// Purpose: a weak implimentation (just enough for box) -// of the unix poll for winsock2 -// Created: 25th October 2004 -// -// -------------------------------------------------------------------------- -int poll (struct pollfd *ufds, unsigned long nfds, int timeout) -{ - try - { - fd_set readfd; - fd_set writefd; - - readfd.fd_count = 0; - writefd.fd_count = 0; - - struct pollfd *ufdsTmp = ufds; - - timeval timOut; - timeval *tmpptr; - - if (timeout == INFTIM) - tmpptr = NULL; - else - tmpptr = &timOut; - - timOut.tv_sec = timeout / 1000; - timOut.tv_usec = timeout * 1000; - - if (ufds->events & POLLIN) - { - for (unsigned long i = 0; i < nfds; i++) - { - readfd.fd_array[i] = ufdsTmp->fd; - readfd.fd_count++; - } - } - - if (ufds->events & POLLOUT) - { - for (unsigned long i = 0; i < nfds; i++) - { - - writefd.fd_array[i]=ufdsTmp->fd; - writefd.fd_count++; - } - } - - int noffds = select(0, &readfd, &writefd, 0, tmpptr); - - if (noffds == SOCKET_ERROR) - { - // int errval = WSAGetLastError(); - - ufdsTmp = ufds; - for (unsigned long i = 0; i < nfds; i++) - { - ufdsTmp->revents = POLLERR; - ufdsTmp++; - } - return (-1); - } - - return noffds; - } - catch (...) - { - printf("Caught poll"); - } - - return -1; -} - -HANDLE gSyslogH = 0; - -void syslog(int loglevel, const char *frmt, ...) -{ - DWORD errinfo; - char* buffer; - std::string sixfour(frmt); - - switch (loglevel) - { - case LOG_INFO: - errinfo = EVENTLOG_INFORMATION_TYPE; - break; - case LOG_ERR: - errinfo = EVENTLOG_ERROR_TYPE; - break; - case LOG_WARNING: - errinfo = EVENTLOG_WARNING_TYPE; - break; - default: - errinfo = EVENTLOG_WARNING_TYPE; - break; - } - - - //taken from MSDN - try - { - - - int sixfourpos; - while ( ( sixfourpos = sixfour.find("%ll")) != -1 ) - { - //maintain portability - change the 64 bit formater... - std::string temp = sixfour.substr(0,sixfourpos); - temp += "%I64"; - temp += sixfour.substr(sixfourpos+3, sixfour.length()); - sixfour = temp; - } - - //printf("parsed string is:%s\r\n", sixfour.c_str()); - - va_list args; - va_start(args, frmt); - -#ifdef __MINGW32__ - // no _vscprintf, use a fixed size buffer - buffer = new char[1024]; - int len = 1023; -#else - int len = _vscprintf( sixfour.c_str(), args ); - ASSERT(len > 0) - - len = len + 1; - char* buffer = new char[len]; -#endif - - ASSERT(buffer) - memset(buffer, 0, len); - - int len2 = vsnprintf(buffer, len, sixfour.c_str(), args); - ASSERT(len2 <= len); - - va_end(args); - } - catch (...) - { - printf("Caught syslog: %s", sixfour.c_str()); - return; - } - - try - { - - if (!ReportEvent(gSyslogH, // event log handle - errinfo, // event type - 0, // category zero - MSG_ERR_EXIST, // event identifier - - // we will call them all the same - NULL, // no user security identifier - 1, // one substitution string - 0, // no data - (LPCSTR*)&buffer, // pointer to string array - NULL)) // pointer to data - - { - DWORD err = GetLastError(); - printf("Unable to send message to Event Log " - "(error %i):\r\n", err); - } - - printf("%s\r\n", buffer); - - if (buffer) delete [] buffer; - } - catch (...) - { - printf("Caught syslog ReportEvent"); - } -} - -#endif // WIN32 Copied: box/trunk/lib/win32/emu.cpp (from rev 210, box/chris/win32/merge/07-win32-fixes/lib/win32/emu.cpp) Deleted: box/trunk/lib/win32/emu.h =================================================================== --- box/chris/win32/merge/07-win32-fixes/lib/win32/emu.h 2005-12-12 02:03:39 UTC (rev 210) +++ box/trunk/lib/win32/emu.h 2005-12-12 20:50:00 UTC (rev 213) @@ -1,426 +0,0 @@ -// emulates unix syscalls to win32 functions - -#if ! defined EMU_INCLUDE && defined WIN32 -#define EMU_INCLUDE - -#define _STAT_DEFINED -#define _INO_T_DEFINED - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -//#include -//#include -//#include - -#include - -#define gmtime_r( _clock, _result ) \ - ( *(_result) = *gmtime( (_clock) ), \ - (_result) ) - - -//signal in unix SIGVTALRM does not exist in win32 - but looking at the -#define SIGVTALRM 254 -#define SIGALRM SIGVTALRM -#define ITIMER_VIRTUAL 0 - -int setitimer(int type , struct itimerval *timeout, int); -void InitTimer(void); -void FiniTimer(void); - -inline int geteuid(void) -{ - //lets pretend to be root! - return 0; -} - -struct passwd { - char *pw_name; - char *pw_passwd; - uid_t pw_uid; - gid_t pw_gid; - time_t pw_change; - char *pw_class; - char *pw_gecos; - char *pw_dir; - char *pw_shell; - time_t pw_expire; -}; - -extern passwd gTempPasswd; -inline struct passwd * getpwnam(const char * name) -{ - //for the mo pretend to be root - gTempPasswd.pw_uid = 0; - gTempPasswd.pw_gid = 0; - - return &gTempPasswd; -} - -#define S_IRWXG 1 -#define S_IRWXO 2 -#define S_ISUID 4 -#define S_ISGID 8 -#define S_ISVTX 16 - -#ifndef __MINGW32__ - //not sure if these are correct - //S_IWRITE - writing permitted - //_S_IREAD - reading permitted - //_S_IREAD | _S_IWRITE - - #define S_IRUSR S_IWRITE - #define S_IWUSR S_IREAD - #define S_IRWXU (S_IREAD|S_IWRITE|S_IEXEC) - - #define S_ISREG(x) (S_IFREG & x) - #define S_ISDIR(x) (S_IFDIR & x) -#endif - -inline int utimes(const char * Filename, timeval[]) -{ - //again I am guessing this is quite important to - //be functioning, as large restores would be a problem - - //indicate success - return 0; -} -inline int chown(const char * Filename, u_int32_t uid, u_int32_t gid) -{ - //important - this needs implementing - //If a large restore is required then - //it needs to restore files AND permissions - //reference AdjustTokenPrivileges - //GetAccountSid - //InitializeSecurityDescriptor - //SetSecurityDescriptorOwner - //The next function looks like the guy to use... - //SetFileSecurity - - //indicate success - return 0; -} - -inline int chmod(const char * Filename, int uid) -{ - //indicate sucsess - return 0; -} - -//I do not perceive a need to change the user or group on a backup client -//at any rate the owner of a service can be set in the service settings -inline int setegid(int) -{ - return true; -} -inline int seteuid(int) -{ - return true; -} -inline int setgid(int) -{ - return true; -} -inline int setuid(int) -{ - return true; -} -inline int getgid(void) -{ - return 0; -} -inline int getuid(void) -{ - return 0; -} - -#ifndef PATH_MAX -#define PATH_MAX MAX_PATH -#endif - -// MinGW provides a getopt implementation -#ifndef __MINGW32__ - -//this will need to be implimented if we see fit that command line -//options are going to be used! (probably then:) -//where the calling function looks for the parsed parameter -extern char *optarg; -//optind looks like an index into the string - how far we have moved along -extern int optind; -extern char nextchar; - -inline int getopt(int count, char * const * args, char * tolookfor) -{ - if ( optind >= count ) return -1; - - std::string str((const char *)args[optind]); - std::string interestin(tolookfor); - int opttolookfor = 0; - int index = -1; - //just initialize the string - just in case it is used. - //optarg[0] = 0; - std::string opt; - - if ( count == 0 ) return -1; - - do - { - if ( index != -1 ) - { - str = str.substr(index+1, str.size()); - } - - index = str.find('-'); - - if ( index == -1 ) return -1; - - opt = str[1]; - - optind ++; - str = args[optind]; - } - while ( ( opttolookfor = interestin.find(opt)) == -1 ); - - if ( interestin[opttolookfor+1] == ':' ) - { - - //strcpy(optarg, str.c_str()); - optarg = args[optind]; - optind ++; - } - - //indicate we have finished - return opt[0]; -} -#endif // !__MINGW32__ - -#define timespec timeval - -//not available in win32 -struct itimerval -{ - timeval it_interval; - timeval it_value; -}; - -//win32 deals in usec not nsec - so need to ensure this follows through -#define tv_nsec tv_usec - -#ifndef __MINGW32__ - typedef unsigned __int64 u_int64_t; - typedef unsigned __int64 uint64_t; - typedef __int64 int64_t; - typedef unsigned __int32 uint32_t; - typedef unsigned __int32 u_int32_t; - typedef __int32 int32_t; - typedef unsigned __int16 uint16_t; - typedef __int16 int16_t; - typedef unsigned __int8 uint8_t; - typedef __int8 int8_t; - - typedef int socklen_t; -#endif - -// I (re-)defined here for the moment; has to be removed later !!! -#ifndef BOX_VERSION -#define BOX_VERSION "0.09hWin32" -#endif - -#define S_IRGRP S_IWRITE -#define S_IWGRP S_IREAD -#define S_IROTH S_IWRITE | S_IREAD -#define S_IWOTH S_IREAD | S_IREAD - -//again need to verify these -#define S_IFLNK 1 - -#define S_ISLNK(x) ( false ) - -// nasty implementation to get working - TODO get the win32 equiv -#ifdef _DEBUG -#define getpid() 1 -#endif - -#define vsnprintf _vsnprintf - -#ifndef __MINGW32__ -typedef unsigned int mode_t; -#endif - -inline int mkdir(const char *pathname, mode_t mode) -{ - return mkdir(pathname); -} - -#ifdef __MINGW32__ - #include -#else - inline int strcasecmp(const char *s1, const char *s2) - { - return _stricmp(s1,s2); - } - - struct dirent - { - char *d_name; - }; - - struct DIR - { - intptr_t fd; // filedescriptor - // struct _finddata_t info; - struct _wfinddata_t info; - // struct _finddata_t info; - struct dirent result; // d_name (first time null) - wchar_t *name; // null-terminated byte string - }; - - DIR *opendir(const char *name); - struct dirent *readdir(DIR *dp); - int closedir(DIR *dp); -#endif - -HANDLE openfile(const char *filename, int flags, int mode); - -#define LOG_INFO 6 -#define LOG_WARNING 4 -#define LOG_ERR 3 -#define LOG_PID 0 -#define LOG_LOCAL6 0 - -extern HANDLE gSyslogH; -void MyReportEvent(LPCTSTR *szMsg, DWORD errinfo); -inline void openlog(const char * daemonName, int, int) -{ - gSyslogH = RegisterEventSource( - NULL, // uses local computer - daemonName); // source name - if (gSyslogH == NULL) - { - } -} - -inline void closelog(void) -{ - DeregisterEventSource(gSyslogH); -} - -void syslog(int loglevel, const char *fmt, ...); - -#ifndef __MINGW32__ -#define strtoll _strtoi64 -#endif - -inline unsigned int sleep(unsigned int secs) -{ - Sleep(secs*1000); - return(ERROR_SUCCESS); -} - -#define INFTIM -1 -#define POLLIN 0x1 -#define POLLERR 0x8 -#define POLLOUT 0x4 - -#define SHUT_RDWR SD_BOTH -#define SHUT_RD SD_RECEIVE -#define SHUT_WR SD_SEND - -struct pollfd -{ - SOCKET fd; - short int events; - short int revents; -}; - -inline int ioctl(SOCKET sock, int flag, int * something) -{ - //indicate success - return 0; -} - -inline int waitpid(pid_t pid, int *status, int) -{ - return 0; -} - -//this shouldn't be needed. -struct statfs -{ - TCHAR f_mntonname[MAX_PATH]; -}; - -// I think this should get us going -// Although there is a warning about -// mount points in win32 can now exists - which means inode number can be -// duplicated, so potential of a problem - perhaps this needs to be -// implemented with a little more thought... TODO - -struct stat { - //_dev_t st_dev; - u_int64_t st_ino; - DWORD st_mode; - short st_nlink; - short st_uid; - short st_gid; - //_dev_t st_rdev; - u_int64_t st_size; - time_t st_atime; - time_t st_mtime; - time_t st_ctime; -}; - -#ifndef __MINGW32__ -typedef u_int64_t _ino_t; -#endif - -int ourstat(const char * name, struct stat * st); -int ourfstat(HANDLE file, struct stat * st); -int statfs(const char * name, struct statfs * s); - -//need this for converstions -inline time_t ConvertFileTimeToTime_t(FILETIME *fileTime) -{ - SYSTEMTIME stUTC; - struct tm timeinfo; - - // Convert the last-write time to local time. - FileTimeToSystemTime(fileTime, &stUTC); - // SystemTimeToTzSpecificLocalTime(NULL, &stUTC, &stLocal); - - timeinfo.tm_sec = stUTC.wSecond; - timeinfo.tm_min = stUTC.wMinute; - timeinfo.tm_hour = stUTC.wHour; - timeinfo.tm_mday = stUTC.wDay; - timeinfo.tm_wday = stUTC.wDayOfWeek; - timeinfo.tm_mon = stUTC.wMonth - 1; - // timeinfo.tm_yday = ...; - timeinfo.tm_year = stUTC.wYear - 1900; - - time_t retVal = mktime(&timeinfo); - return retVal; -} - -#define stat(x,y) ourstat(x,y) -#define fstat(x,y) ourfstat(x,y) -#define lstat(x,y) ourstat(x,y) - -int poll (struct pollfd *ufds, unsigned long nfds, int timeout); -bool EnableBackupRights( void ); - -// -// MessageId: MSG_ERR_EXIST -// MessageText: -// Box Backup. -// -#define MSG_ERR_EXIST ((DWORD)0xC0000004L) - -#endif // !EMU_INCLUDE && WIN32 Copied: box/trunk/lib/win32/emu.h (from rev 210, box/chris/win32/merge/07-win32-fixes/lib/win32/emu.h) Modified: box/trunk/modules.txt =================================================================== --- box/trunk/modules.txt 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/modules.txt 2005-12-12 20:50:00 UTC (rev 213) @@ -9,16 +9,21 @@ # Generic support code and modules +OMIT:mingw32 OMIT:CYGWIN lib/raidfile END-OMIT + lib/crypto lib/server +lib/win32 lib/server lib/compress test/common test/crypto lib/crypto test/compress lib/compress test/basicserver lib/server + +OMIT:mingw32 OMIT:CYGWIN test/raidfile lib/raidfile END-OMIT @@ -28,15 +33,20 @@ # Backup system lib/backupclient lib/server lib/crypto lib/compress + +OMIT:mingw32 OMIT:CYGWIN lib/backupstore lib/server lib/raidfile lib/backupclient -bin/bbstored lib/raidfile lib/server lib/backupstore lib/backupclient -bin/bbstoreaccounts lib/raidfile lib/backupstore -bin/bbackupobjdump lib/backupclient lib/backupstore +bin/bbstored lib/raidfile lib/server lib/backupstore lib/backupclient lib/win32 +bin/bbstoreaccounts lib/raidfile lib/backupstore lib/win32 +bin/bbackupobjdump lib/backupclient lib/backupstore lib/win32 END-OMIT -bin/bbackupd lib/server lib/backupclient -bin/bbackupquery lib/server lib/backupclient -bin/bbackupctl lib/server lib/backupclient + +bin/bbackupd lib/server lib/backupclient lib/win32 +bin/bbackupquery lib/server lib/backupclient lib/win32 +bin/bbackupctl lib/server lib/backupclient lib/win32 + +OMIT:mingw32 OMIT:CYGWIN test/backupstore bin/bbstored bin/bbstoreaccounts lib/server lib/backupstore lib/backupclient lib/raidfile test/backupstorefix bin/bbstored bin/bbstoreaccounts lib/backupstore lib/raidfile bin/bbackupquery bin/bbackupd Modified: box/trunk/parcels.txt =================================================================== --- box/trunk/parcels.txt 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/parcels.txt 2005-12-12 20:50:00 UTC (rev 213) @@ -8,7 +8,11 @@ bin bbackupquery bin bbackupctl script bin/bbackupd/bbackupd-config + script bin/bbackupd/win32/installer.iss + script bin/bbackupd/win32/ReadMe.txt + script bin/bbackupd/win32/bbackupd.conf +OMIT:mingw32 OMIT:CYGWIN backup-server Modified: box/trunk/test/basicserver/testbasicserver.cpp =================================================================== --- box/trunk/test/basicserver/testbasicserver.cpp 2005-12-12 18:44:44 UTC (rev 212) +++ box/trunk/test/basicserver/testbasicserver.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -349,9 +349,11 @@ for(unsigned int c = 0; c < conns.size(); ++c) { - delete getline[c]; + if ( getline[c] ) delete getline[c]; + getline[c] = 0; } - delete [] getline; + if ( getline ) delete [] getline; + getline = 0; } void TestStreamReceive(TestProtocolClient &protocol, int value, bool uncertainstream) Copied: box/trunk/test/win32 (from rev 210, box/chris/win32/merge/07-win32-fixes/test/win32) Deleted: box/trunk/test/win32/testlibwin32.cpp =================================================================== --- box/chris/win32/merge/07-win32-fixes/test/win32/testlibwin32.cpp 2005-12-12 02:03:39 UTC (rev 210) +++ box/trunk/test/win32/testlibwin32.cpp 2005-12-12 20:50:00 UTC (rev 213) @@ -1,120 +0,0 @@ -// win32test.cpp : Defines the entry point for the console application. -// - -//#include -#include "Box.h" - -#ifdef WIN32 - -#include "../../bin/bbackupd/BackupDaemon.h" -#include "BoxPortsAndFiles.h" - - -int main(int argc, char* argv[]) -{ - chdir("c:\\tmp"); - openfile("test", O_CREAT, 0); - struct stat ourfs; - //test our opendir, readdir and closedir - //functions - DIR *ourDir = opendir("C:"); - - if ( ourDir != NULL ) - { - struct dirent *info; - do - { - info = readdir(ourDir); - if ( info ) printf("File/Dir name is : %s\r\n", info->d_name); - - }while ( info != NULL ); - - closedir(ourDir); - - } - - std::string diry("C:\\Projects\\boxbuild\\testfiles\\"); - ourDir = opendir(diry.c_str()); - if ( ourDir != NULL ) - { - struct dirent *info; - do - { - info = readdir(ourDir); - if ( info == NULL ) break; - std::string file(diry + info->d_name); - stat(file.c_str(), &ourfs); - if ( info ) printf("File/Dir name is : %s\r\n", info->d_name); - - }while ( info != NULL ); - - closedir(ourDir); - - } - - stat("c:\\windows", &ourfs); - stat("c:\\autoexec.bat", &ourfs); - printf("Finished dir read"); -#if 0 - //remove - sleepycat include a version of getopt - mine never REALLY worked ! - //test our getopt function - std::string commline("-q -c fgfgfg -f -l hello"); - - int c; - while((c = getopt(commline.size(), (char * const *)commline.c_str(), "qwc:l:")) != -1) - { - printf("switch = %c, param is %s\r\n", c, optarg); - } -#endif - //end of getopt test - - //now test our statfs funct - stat("c:\\cert.cer", &ourfs); - - - - char *timee; - - timee = ctime(&ourfs.st_mtime); - - if ( S_ISREG(ourfs.st_mode)) - { - printf("is a normal file"); - } - else - { - printf("is a directory?"); - } - - lstat("c:\\windows", &ourfs); - - if ( S_ISDIR(ourfs.st_mode)) - { - printf("is a directory"); - } - else - { - printf("is a file?"); - } - - //test the syslog functions - openlog("Box Backup", 0,0); - //the old ones are the best... - syslog(LOG_ERR, "Hello World"); - syslog(LOG_ERR, "Value of int is: %i", 6); - - closelog(); - - //first off get the path name for the default - char buf[MAX_PATH]; - - GetModuleFileName(NULL, buf, sizeof(buf)); - std::string buffer(buf); - std::string conf("-c " + buffer.substr(0,(buffer.find("win32test.exe"))) + "bbackupd.conf"); - //std::string conf( "-c " + buffer.substr(0,(buffer.find("bbackupd.exe"))) + "bbackupd.conf"); - - - return 0; -} - -#endif // WIN32 Copied: box/trunk/test/win32/testlibwin32.cpp (from rev 210, box/chris/win32/merge/07-win32-fixes/test/win32/testlibwin32.cpp) Copied: box/trunk/win32.bat (from rev 210, box/chris/win32/merge/07-win32-fixes/win32.bat) Copied: box/trunk/win32test.vcproj (from rev 210, box/chris/win32/merge/07-win32-fixes/win32test.vcproj) From boxbackup-dev at fluffy.co.uk Mon Dec 12 21:04:06 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Mon, 12 Dec 2005 21:04:06 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r214 - in box/trunk: . bin/bbackupctl bin/bbackupd bin/bbackupquery bin/bbstoreaccounts bin/bbstored distribution/boxbackup docs/backup docs/common docs/common/lib_common infrastructure lib/backupclient lib/backupstore lib/common lib/compress lib/crypto lib/raidfile lib/server lib/win32 test/backupdiff test/backupstore test/backupstore/testfiles test/basicserver test/basicserver/testfiles test/bbackupd test/bbackupd/testfiles test/common test/common/testfiles test/compress test/crypto test/raidfile test/raidfile/testfiles Message-ID: <20051212210406.74B3193@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-12 21:03:38 +0000 (Mon, 12 Dec 2005) New Revision: 214 Modified: box/trunk/bin/bbackupctl/bbackupctl.cpp box/trunk/bin/bbackupd/BackupClientContext.cpp box/trunk/bin/bbackupd/BackupClientContext.h box/trunk/bin/bbackupd/BackupClientDeleteList.cpp box/trunk/bin/bbackupd/BackupClientDeleteList.h box/trunk/bin/bbackupd/BackupClientDirectoryRecord.cpp box/trunk/bin/bbackupd/BackupClientDirectoryRecord.h box/trunk/bin/bbackupd/BackupClientInodeToIDMap.cpp box/trunk/bin/bbackupd/BackupClientInodeToIDMap.h box/trunk/bin/bbackupd/BackupDaemon.cpp box/trunk/bin/bbackupd/BackupDaemon.h box/trunk/bin/bbackupd/bbackupd.cpp box/trunk/bin/bbackupquery/BackupQueries.cpp box/trunk/bin/bbackupquery/BackupQueries.h box/trunk/bin/bbackupquery/Makefile.extra box/trunk/bin/bbackupquery/bbackupquery.cpp box/trunk/bin/bbackupquery/documentation.txt box/trunk/bin/bbstoreaccounts/bbstoreaccounts.cpp box/trunk/bin/bbstored/BBStoreDHousekeeping.cpp box/trunk/bin/bbstored/BackupCommands.cpp box/trunk/bin/bbstored/BackupConstants.h box/trunk/bin/bbstored/BackupContext.cpp box/trunk/bin/bbstored/BackupContext.h box/trunk/bin/bbstored/BackupStoreDaemon.cpp box/trunk/bin/bbstored/BackupStoreDaemon.h box/trunk/bin/bbstored/HousekeepStoreAccount.cpp box/trunk/bin/bbstored/HousekeepStoreAccount.h box/trunk/bin/bbstored/Makefile.extra box/trunk/bin/bbstored/backupprotocol.txt box/trunk/bin/bbstored/bbstored.cpp box/trunk/config.sub box/trunk/distribution/boxbackup/LINUX.txt box/trunk/docs/backup/win32_build_on_cygwin_using_mingw.txt box/trunk/docs/common/lib_common/ExcludeList.txt box/trunk/docs/common/memory_leaks.txt box/trunk/infrastructure/buildenv-testmain-template.cpp box/trunk/lib/backupclient/BackupClientCryptoKeys.cpp box/trunk/lib/backupclient/BackupClientCryptoKeys.h box/trunk/lib/backupclient/BackupClientFileAttributes.cpp box/trunk/lib/backupclient/BackupClientFileAttributes.h box/trunk/lib/backupclient/BackupClientMakeExcludeList.cpp box/trunk/lib/backupclient/BackupClientMakeExcludeList.h box/trunk/lib/backupclient/BackupClientRestore.cpp box/trunk/lib/backupclient/BackupClientRestore.h box/trunk/lib/backupclient/BackupDaemonConfigVerify.cpp box/trunk/lib/backupclient/BackupDaemonConfigVerify.h box/trunk/lib/backupclient/BackupStoreConstants.h box/trunk/lib/backupclient/BackupStoreDirectory.cpp box/trunk/lib/backupclient/BackupStoreDirectory.h box/trunk/lib/backupclient/BackupStoreException.h box/trunk/lib/backupclient/BackupStoreFile.cpp box/trunk/lib/backupclient/BackupStoreFile.h box/trunk/lib/backupclient/BackupStoreFileCombine.cpp box/trunk/lib/backupclient/BackupStoreFileCryptVar.cpp box/trunk/lib/backupclient/BackupStoreFileCryptVar.h box/trunk/lib/backupclient/BackupStoreFileDiff.cpp box/trunk/lib/backupclient/BackupStoreFileEncodeStream.cpp box/trunk/lib/backupclient/BackupStoreFileEncodeStream.h box/trunk/lib/backupclient/BackupStoreFileWire.h box/trunk/lib/backupclient/BackupStoreFilename.cpp box/trunk/lib/backupclient/BackupStoreFilename.h box/trunk/lib/backupclient/BackupStoreFilenameClear.cpp box/trunk/lib/backupclient/BackupStoreFilenameClear.h box/trunk/lib/backupclient/BackupStoreObjectMagic.h box/trunk/lib/backupclient/Makefile.extra box/trunk/lib/backupstore/BackupStoreAccountDatabase.cpp box/trunk/lib/backupstore/BackupStoreAccountDatabase.h box/trunk/lib/backupstore/BackupStoreAccounts.cpp box/trunk/lib/backupstore/BackupStoreAccounts.h box/trunk/lib/backupstore/BackupStoreConfigVerify.cpp box/trunk/lib/backupstore/BackupStoreConfigVerify.h box/trunk/lib/backupstore/BackupStoreInfo.cpp box/trunk/lib/backupstore/BackupStoreInfo.h box/trunk/lib/backupstore/StoreStructure.cpp box/trunk/lib/backupstore/StoreStructure.h box/trunk/lib/common/BannerText.h box/trunk/lib/common/Box.h box/trunk/lib/common/BoxException.cpp box/trunk/lib/common/BoxException.h box/trunk/lib/common/BoxPlatform.h box/trunk/lib/common/BoxPortsAndFiles.h box/trunk/lib/common/BoxTime.cpp box/trunk/lib/common/BoxTime.h box/trunk/lib/common/BoxTimeToText.cpp box/trunk/lib/common/BoxTimeToText.h box/trunk/lib/common/BoxTimeToUnix.h box/trunk/lib/common/CollectInBufferStream.cpp box/trunk/lib/common/CollectInBufferStream.h box/trunk/lib/common/CommonException.h box/trunk/lib/common/Configuration.cpp box/trunk/lib/common/Configuration.h box/trunk/lib/common/DebugAssertFailed.cpp box/trunk/lib/common/DebugMemLeakFinder.cpp box/trunk/lib/common/DebugPrintf.cpp box/trunk/lib/common/ExcludeList.cpp box/trunk/lib/common/ExcludeList.h box/trunk/lib/common/FdGetLine.cpp box/trunk/lib/common/FdGetLine.h box/trunk/lib/common/FileModificationTime.h box/trunk/lib/common/FileStream.cpp box/trunk/lib/common/FileStream.h box/trunk/lib/common/Guards.h box/trunk/lib/common/IOStream.cpp box/trunk/lib/common/IOStream.h box/trunk/lib/common/IOStreamGetLine.cpp box/trunk/lib/common/IOStreamGetLine.h box/trunk/lib/common/MainHelper.h box/trunk/lib/common/Makefile.extra box/trunk/lib/common/MemBlockStream.cpp box/trunk/lib/common/MemBlockStream.h box/trunk/lib/common/MemLeakFindOff.h box/trunk/lib/common/MemLeakFindOn.h box/trunk/lib/common/MemLeakFinder.h box/trunk/lib/common/NamedLock.cpp box/trunk/lib/common/NamedLock.h box/trunk/lib/common/PartialReadStream.cpp box/trunk/lib/common/PartialReadStream.h box/trunk/lib/common/ReadGatherStream.cpp box/trunk/lib/common/ReadGatherStream.h box/trunk/lib/common/StreamableMemBlock.cpp box/trunk/lib/common/StreamableMemBlock.h box/trunk/lib/common/TemporaryDirectory.h box/trunk/lib/common/Test.h box/trunk/lib/common/UnixUser.cpp box/trunk/lib/common/UnixUser.h box/trunk/lib/common/Utils.cpp box/trunk/lib/common/Utils.h box/trunk/lib/compress/Compress.h box/trunk/lib/compress/CompressException.h box/trunk/lib/compress/Makefile.extra box/trunk/lib/crypto/CipherBlowfish.cpp box/trunk/lib/crypto/CipherBlowfish.h box/trunk/lib/crypto/CipherContext.cpp box/trunk/lib/crypto/CipherContext.h box/trunk/lib/crypto/CipherDescription.cpp box/trunk/lib/crypto/CipherDescription.h box/trunk/lib/crypto/CipherException.h box/trunk/lib/crypto/MD5Digest.cpp box/trunk/lib/crypto/MD5Digest.h box/trunk/lib/crypto/Makefile.extra box/trunk/lib/crypto/Random.cpp box/trunk/lib/crypto/Random.h box/trunk/lib/crypto/RollingChecksum.cpp box/trunk/lib/crypto/RollingChecksum.h box/trunk/lib/raidfile/Makefile.extra box/trunk/lib/raidfile/RaidFileController.cpp box/trunk/lib/raidfile/RaidFileController.h box/trunk/lib/raidfile/RaidFileException.h box/trunk/lib/raidfile/RaidFileRead.cpp box/trunk/lib/raidfile/RaidFileRead.h box/trunk/lib/raidfile/RaidFileUtil.cpp box/trunk/lib/raidfile/RaidFileUtil.h box/trunk/lib/raidfile/RaidFileWrite.cpp box/trunk/lib/raidfile/RaidFileWrite.h box/trunk/lib/server/Daemon.cpp box/trunk/lib/server/Daemon.h box/trunk/lib/server/Makefile.extra box/trunk/lib/server/Protocol.cpp box/trunk/lib/server/Protocol.h box/trunk/lib/server/ProtocolObject.cpp box/trunk/lib/server/ProtocolObject.h box/trunk/lib/server/ProtocolUncertainStream.cpp box/trunk/lib/server/ProtocolUncertainStream.h box/trunk/lib/server/ProtocolWire.h box/trunk/lib/server/SSLLib.cpp box/trunk/lib/server/SSLLib.h box/trunk/lib/server/ServerException.h box/trunk/lib/server/ServerStream.h box/trunk/lib/server/ServerTLS.h box/trunk/lib/server/Socket.cpp box/trunk/lib/server/Socket.h box/trunk/lib/server/SocketListen.h box/trunk/lib/server/SocketStream.cpp box/trunk/lib/server/SocketStream.h box/trunk/lib/server/SocketStreamTLS.cpp box/trunk/lib/server/SocketStreamTLS.h box/trunk/lib/server/TLSContext.cpp box/trunk/lib/server/TLSContext.h box/trunk/lib/win32/WinNamedPipeStream.cpp box/trunk/lib/win32/WinNamedPipeStream.h box/trunk/modules.txt box/trunk/test/backupdiff/difftestfiles.cpp box/trunk/test/backupdiff/testbackupdiff.cpp box/trunk/test/backupstore/testbackupstore.cpp box/trunk/test/backupstore/testextra box/trunk/test/backupstore/testfiles/accounts.txt box/trunk/test/backupstore/testfiles/bbstored.conf box/trunk/test/backupstore/testfiles/bbstored_multi.conf box/trunk/test/backupstore/testfiles/query.conf box/trunk/test/backupstore/testfiles/raidfile.conf box/trunk/test/basicserver/Makefile.extra box/trunk/test/basicserver/TestCommands.cpp box/trunk/test/basicserver/TestContext.cpp box/trunk/test/basicserver/TestContext.h box/trunk/test/basicserver/testbasicserver.cpp box/trunk/test/basicserver/testfiles/key-creation.txt box/trunk/test/basicserver/testfiles/srv1.conf box/trunk/test/basicserver/testfiles/srv1b.conf box/trunk/test/basicserver/testfiles/srv2.conf box/trunk/test/basicserver/testfiles/srv3.conf box/trunk/test/basicserver/testfiles/srv4.conf box/trunk/test/basicserver/testprotocol.txt box/trunk/test/bbackupd/testbbackupd.cpp box/trunk/test/bbackupd/testextra box/trunk/test/bbackupd/testfiles/accounts.txt box/trunk/test/bbackupd/testfiles/bbackupd.conf box/trunk/test/bbackupd/testfiles/bbstored.conf box/trunk/test/bbackupd/testfiles/clientCerts.pem box/trunk/test/bbackupd/testfiles/clientPrivKey.pem box/trunk/test/bbackupd/testfiles/clientTrustedCAs.pem box/trunk/test/bbackupd/testfiles/raidfile.conf box/trunk/test/bbackupd/testfiles/serverCerts.pem box/trunk/test/bbackupd/testfiles/serverPrivKey.pem box/trunk/test/bbackupd/testfiles/serverTrustedCAs.pem box/trunk/test/bbackupd/testfiles/test2.tgz box/trunk/test/bbackupd/testfiles/test3.tgz box/trunk/test/bbackupd/testfiles/test_base.tgz box/trunk/test/common/testcommon.cpp box/trunk/test/common/testfiles/config1.txt box/trunk/test/common/testfiles/config10.txt box/trunk/test/common/testfiles/config11.txt box/trunk/test/common/testfiles/config12.txt box/trunk/test/common/testfiles/config13.txt box/trunk/test/common/testfiles/config14.txt box/trunk/test/common/testfiles/config15.txt box/trunk/test/common/testfiles/config16.txt box/trunk/test/common/testfiles/config2.txt box/trunk/test/common/testfiles/config3.txt box/trunk/test/common/testfiles/config4.txt box/trunk/test/common/testfiles/config5.txt box/trunk/test/common/testfiles/config6.txt box/trunk/test/common/testfiles/config7.txt box/trunk/test/common/testfiles/config8.txt box/trunk/test/common/testfiles/config9.txt box/trunk/test/common/testfiles/config9b.txt box/trunk/test/common/testfiles/config9c.txt box/trunk/test/common/testfiles/config9d.txt box/trunk/test/common/testfiles/fdgetlinetest.txt box/trunk/test/compress/testcompress.cpp box/trunk/test/crypto/testcrypto.cpp box/trunk/test/raidfile/Darwin-SYS.h box/trunk/test/raidfile/Makefile.extra.Darwin box/trunk/test/raidfile/intercept.cpp box/trunk/test/raidfile/testextra box/trunk/test/raidfile/testfiles/raidfile.conf box/trunk/test/raidfile/testraidfile.cpp Log: Fixing up svn:executable properties. You may need a new checkout to see this. Property changes on: box/trunk/bin/bbackupctl/bbackupctl.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbackupd/BackupClientContext.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbackupd/BackupClientContext.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbackupd/BackupClientDeleteList.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbackupd/BackupClientDeleteList.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbackupd/BackupClientDirectoryRecord.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbackupd/BackupClientDirectoryRecord.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbackupd/BackupClientInodeToIDMap.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbackupd/BackupClientInodeToIDMap.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbackupd/BackupDaemon.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbackupd/BackupDaemon.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbackupd/bbackupd.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbackupquery/BackupQueries.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbackupquery/BackupQueries.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbackupquery/Makefile.extra ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbackupquery/bbackupquery.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbackupquery/documentation.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbstoreaccounts/bbstoreaccounts.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbstored/BBStoreDHousekeeping.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbstored/BackupCommands.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbstored/BackupConstants.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbstored/BackupContext.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbstored/BackupContext.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbstored/BackupStoreDaemon.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbstored/BackupStoreDaemon.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbstored/HousekeepStoreAccount.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbstored/HousekeepStoreAccount.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbstored/Makefile.extra ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbstored/backupprotocol.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/bin/bbstored/bbstored.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/config.sub ___________________________________________________________________ Name: svn:executable + * Property changes on: box/trunk/distribution/boxbackup/LINUX.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/docs/backup/win32_build_on_cygwin_using_mingw.txt ___________________________________________________________________ Name: svn:executable - * Property changes on: box/trunk/docs/common/lib_common/ExcludeList.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/docs/common/memory_leaks.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/infrastructure/buildenv-testmain-template.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupClientCryptoKeys.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupClientCryptoKeys.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupClientFileAttributes.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupClientFileAttributes.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupClientMakeExcludeList.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupClientMakeExcludeList.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupClientRestore.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupClientRestore.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupDaemonConfigVerify.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupDaemonConfigVerify.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupStoreConstants.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupStoreDirectory.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupStoreDirectory.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupStoreException.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupStoreFile.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupStoreFile.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupStoreFileCombine.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupStoreFileCryptVar.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupStoreFileCryptVar.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupStoreFileDiff.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupStoreFileEncodeStream.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupStoreFileEncodeStream.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupStoreFileWire.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupStoreFilename.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupStoreFilename.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupStoreFilenameClear.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupStoreFilenameClear.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/BackupStoreObjectMagic.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupclient/Makefile.extra ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupstore/BackupStoreAccountDatabase.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupstore/BackupStoreAccountDatabase.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupstore/BackupStoreAccounts.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupstore/BackupStoreAccounts.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupstore/BackupStoreConfigVerify.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupstore/BackupStoreConfigVerify.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupstore/BackupStoreInfo.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupstore/BackupStoreInfo.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupstore/StoreStructure.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/backupstore/StoreStructure.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/BannerText.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/Box.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/BoxException.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/BoxException.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/BoxPlatform.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/BoxPortsAndFiles.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/BoxTime.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/BoxTime.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/BoxTimeToText.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/BoxTimeToText.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/BoxTimeToUnix.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/CollectInBufferStream.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/CollectInBufferStream.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/CommonException.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/Configuration.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/Configuration.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/DebugAssertFailed.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/DebugMemLeakFinder.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/DebugPrintf.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/ExcludeList.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/ExcludeList.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/FdGetLine.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/FdGetLine.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/FileModificationTime.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/FileStream.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/FileStream.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/Guards.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/IOStream.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/IOStream.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/IOStreamGetLine.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/IOStreamGetLine.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/MainHelper.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/Makefile.extra ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/MemBlockStream.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/MemBlockStream.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/MemLeakFindOff.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/MemLeakFindOn.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/MemLeakFinder.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/NamedLock.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/NamedLock.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/PartialReadStream.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/PartialReadStream.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/ReadGatherStream.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/ReadGatherStream.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/StreamableMemBlock.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/StreamableMemBlock.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/TemporaryDirectory.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/Test.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/UnixUser.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/UnixUser.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/Utils.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/common/Utils.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/compress/Compress.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/compress/CompressException.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/compress/Makefile.extra ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/crypto/CipherBlowfish.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/crypto/CipherBlowfish.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/crypto/CipherContext.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/crypto/CipherContext.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/crypto/CipherDescription.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/crypto/CipherDescription.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/crypto/CipherException.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/crypto/MD5Digest.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/crypto/MD5Digest.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/crypto/Makefile.extra ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/crypto/Random.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/crypto/Random.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/crypto/RollingChecksum.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/crypto/RollingChecksum.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/raidfile/Makefile.extra ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/raidfile/RaidFileController.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/raidfile/RaidFileController.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/raidfile/RaidFileException.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/raidfile/RaidFileRead.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/raidfile/RaidFileRead.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/raidfile/RaidFileUtil.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/raidfile/RaidFileUtil.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/raidfile/RaidFileWrite.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/raidfile/RaidFileWrite.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/server/Daemon.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/server/Daemon.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/server/Makefile.extra ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/server/Protocol.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/server/Protocol.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/server/ProtocolObject.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/server/ProtocolObject.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/server/ProtocolUncertainStream.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/server/ProtocolUncertainStream.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/server/ProtocolWire.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/server/SSLLib.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/server/SSLLib.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/server/ServerException.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/server/ServerStream.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/server/ServerTLS.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/server/Socket.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/server/Socket.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/server/SocketListen.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/server/SocketStream.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/server/SocketStream.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/server/SocketStreamTLS.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/server/SocketStreamTLS.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/server/TLSContext.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/server/TLSContext.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/lib/win32/WinNamedPipeStream.cpp ___________________________________________________________________ Name: svn:executable - * Property changes on: box/trunk/lib/win32/WinNamedPipeStream.h ___________________________________________________________________ Name: svn:executable - * Property changes on: box/trunk/modules.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/backupdiff/difftestfiles.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/backupdiff/testbackupdiff.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/backupstore/testbackupstore.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/backupstore/testextra ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/backupstore/testfiles/accounts.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/backupstore/testfiles/bbstored.conf ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/backupstore/testfiles/bbstored_multi.conf ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/backupstore/testfiles/query.conf ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/backupstore/testfiles/raidfile.conf ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/basicserver/Makefile.extra ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/basicserver/TestCommands.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/basicserver/TestContext.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/basicserver/TestContext.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/basicserver/testbasicserver.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/basicserver/testfiles/key-creation.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/basicserver/testfiles/srv1.conf ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/basicserver/testfiles/srv1b.conf ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/basicserver/testfiles/srv2.conf ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/basicserver/testfiles/srv3.conf ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/basicserver/testfiles/srv4.conf ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/basicserver/testprotocol.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/bbackupd/testbbackupd.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/bbackupd/testextra ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/bbackupd/testfiles/accounts.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/bbackupd/testfiles/bbackupd.conf ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/bbackupd/testfiles/bbstored.conf ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/bbackupd/testfiles/clientCerts.pem ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/bbackupd/testfiles/clientPrivKey.pem ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/bbackupd/testfiles/clientTrustedCAs.pem ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/bbackupd/testfiles/raidfile.conf ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/bbackupd/testfiles/serverCerts.pem ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/bbackupd/testfiles/serverPrivKey.pem ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/bbackupd/testfiles/serverTrustedCAs.pem ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/bbackupd/testfiles/test2.tgz ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/bbackupd/testfiles/test3.tgz ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/bbackupd/testfiles/test_base.tgz ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/common/testcommon.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/common/testfiles/config1.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/common/testfiles/config10.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/common/testfiles/config11.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/common/testfiles/config12.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/common/testfiles/config13.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/common/testfiles/config14.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/common/testfiles/config15.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/common/testfiles/config16.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/common/testfiles/config2.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/common/testfiles/config3.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/common/testfiles/config4.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/common/testfiles/config5.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/common/testfiles/config6.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/common/testfiles/config7.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/common/testfiles/config8.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/common/testfiles/config9.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/common/testfiles/config9b.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/common/testfiles/config9c.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/common/testfiles/config9d.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/common/testfiles/fdgetlinetest.txt ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/compress/testcompress.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/crypto/testcrypto.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/raidfile/Darwin-SYS.h ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/raidfile/Makefile.extra.Darwin ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/raidfile/intercept.cpp ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/raidfile/testextra ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/raidfile/testfiles/raidfile.conf ___________________________________________________________________ Name: svn:executable - Property changes on: box/trunk/test/raidfile/testraidfile.cpp ___________________________________________________________________ Name: svn:executable - From boxbackup-dev at fluffy.co.uk Mon Dec 12 23:04:02 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Mon, 12 Dec 2005 23:04:02 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r217 - in box/trunk: . bin/bbackupctl bin/bbackupd bin/bbackupd/win32 bin/bbackupobjdump bin/bbackupquery bin/bbstoreaccounts bin/bbstored distribution distribution/boxbackup distribution/boxbackup/contrib/cygwin distribution/boxbackup/contrib/redhat distribution/boxbackup/contrib/rpm distribution/boxbackup/contrib/suse docs/backup docs/common docs/common/lib_common docs/common/lib_compress docs/common/lib_crypto docs/common/lib_server docs/raidfile docs/raidfile/lib_raidfile infrastructure infrastructure/m4 infrastructure/tests lib/backupclient lib/backupstore lib/common lib/compress lib/crypto lib/raidfile lib/server lib/win32 test/backupdiff test/backupstore test/backupstore/testfiles test/backupstorefix test/backupstorefix/testfiles test/backupstorepatch test/basicserver test/basicserver/testfiles test/bbackupd test/bbackupd/testfiles test/common test/common/testfiles test/compress test/crypto test/raidfile test/raidfile/testfiles test/win32 Message-ID: <20051212230402.22A9793@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-12 23:03:11 +0000 (Mon, 12 Dec 2005) New Revision: 217 Modified: box/trunk/BUGS.txt box/trunk/LICENSE.txt box/trunk/VERSION.txt box/trunk/bbackupctl.vcproj box/trunk/bbackupd.vcproj box/trunk/bin/bbackupctl/bbackupctl.cpp box/trunk/bin/bbackupd/BackupClientContext.cpp box/trunk/bin/bbackupd/BackupClientContext.h box/trunk/bin/bbackupd/BackupClientDeleteList.cpp box/trunk/bin/bbackupd/BackupClientDeleteList.h box/trunk/bin/bbackupd/BackupClientDirectoryRecord.cpp box/trunk/bin/bbackupd/BackupClientDirectoryRecord.h box/trunk/bin/bbackupd/BackupClientInodeToIDMap.cpp box/trunk/bin/bbackupd/BackupClientInodeToIDMap.h box/trunk/bin/bbackupd/BackupDaemon.cpp box/trunk/bin/bbackupd/BackupDaemon.h box/trunk/bin/bbackupd/Win32BackupService.cpp box/trunk/bin/bbackupd/Win32BackupService.h box/trunk/bin/bbackupd/Win32ServiceFunctions.cpp box/trunk/bin/bbackupd/Win32ServiceFunctions.h box/trunk/bin/bbackupd/bbackupd-config box/trunk/bin/bbackupd/bbackupd.cpp box/trunk/bin/bbackupd/win32/ReadMe.txt box/trunk/bin/bbackupd/win32/bbackupd.conf box/trunk/bin/bbackupd/win32/installer.iss box/trunk/bin/bbackupobjdump/bbackupobjdump.cpp box/trunk/bin/bbackupquery/BackupQueries.cpp box/trunk/bin/bbackupquery/BackupQueries.h box/trunk/bin/bbackupquery/Makefile.extra box/trunk/bin/bbackupquery/bbackupquery.cpp box/trunk/bin/bbackupquery/documentation.txt box/trunk/bin/bbackupquery/makedocumentation.pl box/trunk/bin/bbstoreaccounts/bbstoreaccounts.cpp box/trunk/bin/bbstored/BBStoreDHousekeeping.cpp box/trunk/bin/bbstored/BackupCommands.cpp box/trunk/bin/bbstored/BackupConstants.h box/trunk/bin/bbstored/BackupContext.cpp box/trunk/bin/bbstored/BackupContext.h box/trunk/bin/bbstored/BackupStoreDaemon.cpp box/trunk/bin/bbstored/BackupStoreDaemon.h box/trunk/bin/bbstored/HousekeepStoreAccount.cpp box/trunk/bin/bbstored/HousekeepStoreAccount.h box/trunk/bin/bbstored/Makefile.extra box/trunk/bin/bbstored/backupprotocol.txt box/trunk/bin/bbstored/bbstored-certs box/trunk/bin/bbstored/bbstored-config box/trunk/bin/bbstored/bbstored.cpp box/trunk/bootstrap box/trunk/boxbackup.sln box/trunk/boxquery.vcproj box/trunk/cleanupforcvs.pl box/trunk/common.vcproj box/trunk/config.guess box/trunk/config.sub box/trunk/configure.ac box/trunk/distribution/COMMON-MANIFEST.txt box/trunk/distribution/boxbackup/CONTACT.txt box/trunk/distribution/boxbackup/DISTRIBUTION-MANIFEST.txt box/trunk/distribution/boxbackup/DOCUMENTATION.txt box/trunk/distribution/boxbackup/LICENSE.txt box/trunk/distribution/boxbackup/LINUX.txt box/trunk/distribution/boxbackup/NETBSD.txt box/trunk/distribution/boxbackup/THANKS.txt box/trunk/distribution/boxbackup/VERSION.txt box/trunk/distribution/boxbackup/contrib/cygwin/README.txt box/trunk/distribution/boxbackup/contrib/cygwin/install-cygwin-service.pl box/trunk/distribution/boxbackup/contrib/cygwin/remove-cygwin-service.sh box/trunk/distribution/boxbackup/contrib/redhat/README.txt box/trunk/distribution/boxbackup/contrib/redhat/bbackupd box/trunk/distribution/boxbackup/contrib/redhat/bbstored box/trunk/distribution/boxbackup/contrib/rpm/README.txt box/trunk/distribution/boxbackup/contrib/rpm/boxbackup.spec box/trunk/distribution/boxbackup/contrib/suse/README.txt box/trunk/distribution/boxbackup/contrib/suse/bbackupd box/trunk/distribution/boxbackup/contrib/suse/bbstored box/trunk/docs/backup/INDEX.txt box/trunk/docs/backup/Win32_Clients.txt box/trunk/docs/backup/backup_encryption.txt box/trunk/docs/backup/bin_bbackupd.txt box/trunk/docs/backup/bin_bbstored.txt box/trunk/docs/backup/encrypt_rsync.txt box/trunk/docs/backup/lib_backupclient.txt box/trunk/docs/backup/lib_backupstore.txt box/trunk/docs/backup/win32_build_on_cygwin_using_mingw.txt box/trunk/docs/backup/win32_build_on_linux_using_mingw.txt box/trunk/docs/backup/windows_porting.txt box/trunk/docs/common/lib_common.txt box/trunk/docs/common/lib_common/BoxTime.txt box/trunk/docs/common/lib_common/CollectInBufferStream.txt box/trunk/docs/common/lib_common/Configuration.txt box/trunk/docs/common/lib_common/Conversion.txt box/trunk/docs/common/lib_common/ExcludeList.txt box/trunk/docs/common/lib_common/FdGetLine.txt box/trunk/docs/common/lib_common/Guards.txt box/trunk/docs/common/lib_common/IOStream.txt box/trunk/docs/common/lib_common/IOStreamGetLine.txt box/trunk/docs/common/lib_common/MainHelper.txt box/trunk/docs/common/lib_common/WaitForEvent.txt box/trunk/docs/common/lib_common/xStream.txt box/trunk/docs/common/lib_compress.txt box/trunk/docs/common/lib_compress/CompressStream.txt box/trunk/docs/common/lib_crypto.txt box/trunk/docs/common/lib_crypto/CipherContext.txt box/trunk/docs/common/lib_crypto/RollingChecksum.txt box/trunk/docs/common/lib_server.txt box/trunk/docs/common/lib_server/Daemon.txt box/trunk/docs/common/lib_server/Protocol.txt box/trunk/docs/common/lib_server/ServerStream.txt box/trunk/docs/common/lib_server/ServerTLS.txt box/trunk/docs/common/lib_server/SocketStream.txt box/trunk/docs/common/lib_server/SocketStreamTLS.txt box/trunk/docs/common/lib_server/TLSContext.txt box/trunk/docs/common/memory_leaks.txt box/trunk/docs/raidfile/lib_raidfile.txt box/trunk/docs/raidfile/lib_raidfile/RaidFileRead.txt box/trunk/docs/raidfile/lib_raidfile/RaidFileWrite.txt box/trunk/infrastructure/BoxPlatform.pm.in box/trunk/infrastructure/buildenv-testmain-template.cpp box/trunk/infrastructure/m4/ac_cxx_exceptions.m4 box/trunk/infrastructure/m4/ac_cxx_namespaces.m4 box/trunk/infrastructure/m4/ax_check_bdb_v1.m4 box/trunk/infrastructure/m4/ax_check_define_pragma.m4 box/trunk/infrastructure/m4/ax_check_dirent_d_type.m4 box/trunk/infrastructure/m4/ax_check_llong_minmax.m4 box/trunk/infrastructure/m4/ax_check_malloc_workaround.m4 box/trunk/infrastructure/m4/ax_check_mount_point.m4 box/trunk/infrastructure/m4/ax_check_nonaligned_access.m4 box/trunk/infrastructure/m4/ax_check_ssl.m4 box/trunk/infrastructure/m4/ax_check_syscall_lseek.m4 box/trunk/infrastructure/m4/ax_func_syscall.m4 box/trunk/infrastructure/m4/ax_random_device.m4 box/trunk/infrastructure/m4/vl_lib_readline.m4 box/trunk/infrastructure/makebuildenv.pl box/trunk/infrastructure/makedistribution.pl box/trunk/infrastructure/makeparcels.pl box/trunk/infrastructure/setupexternal.pl box/trunk/infrastructure/tests/common_tests.pl box/trunk/lib/backupclient/BackupClientCryptoKeys.cpp box/trunk/lib/backupclient/BackupClientCryptoKeys.h box/trunk/lib/backupclient/BackupClientFileAttributes.cpp box/trunk/lib/backupclient/BackupClientFileAttributes.h box/trunk/lib/backupclient/BackupClientMakeExcludeList.cpp box/trunk/lib/backupclient/BackupClientMakeExcludeList.h box/trunk/lib/backupclient/BackupClientRestore.cpp box/trunk/lib/backupclient/BackupClientRestore.h box/trunk/lib/backupclient/BackupDaemonConfigVerify.cpp box/trunk/lib/backupclient/BackupDaemonConfigVerify.h box/trunk/lib/backupclient/BackupStoreConstants.h box/trunk/lib/backupclient/BackupStoreDirectory.cpp box/trunk/lib/backupclient/BackupStoreDirectory.h box/trunk/lib/backupclient/BackupStoreException.h box/trunk/lib/backupclient/BackupStoreException.txt box/trunk/lib/backupclient/BackupStoreFile.cpp box/trunk/lib/backupclient/BackupStoreFile.h box/trunk/lib/backupclient/BackupStoreFileCmbDiff.cpp box/trunk/lib/backupclient/BackupStoreFileCmbIdx.cpp box/trunk/lib/backupclient/BackupStoreFileCombine.cpp box/trunk/lib/backupclient/BackupStoreFileCryptVar.cpp box/trunk/lib/backupclient/BackupStoreFileCryptVar.h box/trunk/lib/backupclient/BackupStoreFileDiff.cpp box/trunk/lib/backupclient/BackupStoreFileEncodeStream.cpp box/trunk/lib/backupclient/BackupStoreFileEncodeStream.h box/trunk/lib/backupclient/BackupStoreFileRevDiff.cpp box/trunk/lib/backupclient/BackupStoreFileWire.h box/trunk/lib/backupclient/BackupStoreFilename.cpp box/trunk/lib/backupclient/BackupStoreFilename.h box/trunk/lib/backupclient/BackupStoreFilenameClear.cpp box/trunk/lib/backupclient/BackupStoreFilenameClear.h box/trunk/lib/backupclient/BackupStoreObjectDump.cpp box/trunk/lib/backupclient/BackupStoreObjectMagic.h box/trunk/lib/backupclient/Makefile.extra box/trunk/lib/backupstore/BackupStoreAccountDatabase.cpp box/trunk/lib/backupstore/BackupStoreAccountDatabase.h box/trunk/lib/backupstore/BackupStoreAccounts.cpp box/trunk/lib/backupstore/BackupStoreAccounts.h box/trunk/lib/backupstore/BackupStoreCheck.cpp box/trunk/lib/backupstore/BackupStoreCheck.h box/trunk/lib/backupstore/BackupStoreCheck2.cpp box/trunk/lib/backupstore/BackupStoreCheckData.cpp box/trunk/lib/backupstore/BackupStoreConfigVerify.cpp box/trunk/lib/backupstore/BackupStoreConfigVerify.h box/trunk/lib/backupstore/BackupStoreInfo.cpp box/trunk/lib/backupstore/BackupStoreInfo.h box/trunk/lib/backupstore/StoreStructure.cpp box/trunk/lib/backupstore/StoreStructure.h box/trunk/lib/common/BannerText.h box/trunk/lib/common/BeginStructPackForWire.h box/trunk/lib/common/Box.h box/trunk/lib/common/BoxException.cpp box/trunk/lib/common/BoxException.h box/trunk/lib/common/BoxPlatform.h box/trunk/lib/common/BoxPortsAndFiles.h box/trunk/lib/common/BoxTime.cpp box/trunk/lib/common/BoxTime.h box/trunk/lib/common/BoxTimeToText.cpp box/trunk/lib/common/BoxTimeToText.h box/trunk/lib/common/BoxTimeToUnix.h box/trunk/lib/common/CollectInBufferStream.cpp box/trunk/lib/common/CollectInBufferStream.h box/trunk/lib/common/CommonException.h box/trunk/lib/common/CommonException.txt box/trunk/lib/common/Configuration.cpp box/trunk/lib/common/Configuration.h box/trunk/lib/common/Conversion.h box/trunk/lib/common/ConversionException.txt box/trunk/lib/common/ConversionString.cpp box/trunk/lib/common/DebugAssertFailed.cpp box/trunk/lib/common/DebugMemLeakFinder.cpp box/trunk/lib/common/DebugPrintf.cpp box/trunk/lib/common/EndStructPackForWire.h box/trunk/lib/common/EventWatchFilesystemObject.cpp box/trunk/lib/common/EventWatchFilesystemObject.h box/trunk/lib/common/ExcludeList.cpp box/trunk/lib/common/ExcludeList.h box/trunk/lib/common/FdGetLine.cpp box/trunk/lib/common/FdGetLine.h box/trunk/lib/common/FileModificationTime.h box/trunk/lib/common/FileStream.cpp box/trunk/lib/common/FileStream.h box/trunk/lib/common/Guards.h box/trunk/lib/common/IOStream.cpp box/trunk/lib/common/IOStream.h box/trunk/lib/common/IOStreamGetLine.cpp box/trunk/lib/common/IOStreamGetLine.h box/trunk/lib/common/MainHelper.h box/trunk/lib/common/Makefile.extra box/trunk/lib/common/MemBlockStream.cpp box/trunk/lib/common/MemBlockStream.h box/trunk/lib/common/MemLeakFindOff.h box/trunk/lib/common/MemLeakFindOn.h box/trunk/lib/common/MemLeakFinder.h box/trunk/lib/common/NamedLock.cpp box/trunk/lib/common/NamedLock.h box/trunk/lib/common/PartialReadStream.cpp box/trunk/lib/common/PartialReadStream.h box/trunk/lib/common/ReadGatherStream.cpp box/trunk/lib/common/ReadGatherStream.h box/trunk/lib/common/StreamableMemBlock.cpp box/trunk/lib/common/StreamableMemBlock.h box/trunk/lib/common/TemporaryDirectory.h box/trunk/lib/common/Test.h box/trunk/lib/common/UnixUser.cpp box/trunk/lib/common/UnixUser.h box/trunk/lib/common/Utils.cpp box/trunk/lib/common/Utils.h box/trunk/lib/common/WaitForEvent.cpp box/trunk/lib/common/WaitForEvent.h box/trunk/lib/common/makeexception.pl box/trunk/lib/compress/Compress.h box/trunk/lib/compress/CompressException.h box/trunk/lib/compress/CompressException.txt box/trunk/lib/compress/CompressStream.cpp box/trunk/lib/compress/CompressStream.h box/trunk/lib/compress/Makefile.extra box/trunk/lib/crypto/CipherAES.cpp box/trunk/lib/crypto/CipherAES.h box/trunk/lib/crypto/CipherBlowfish.cpp box/trunk/lib/crypto/CipherBlowfish.h box/trunk/lib/crypto/CipherContext.cpp box/trunk/lib/crypto/CipherContext.h box/trunk/lib/crypto/CipherDescription.cpp box/trunk/lib/crypto/CipherDescription.h box/trunk/lib/crypto/CipherException.h box/trunk/lib/crypto/CipherException.txt box/trunk/lib/crypto/MD5Digest.cpp box/trunk/lib/crypto/MD5Digest.h box/trunk/lib/crypto/Makefile.extra box/trunk/lib/crypto/Random.cpp box/trunk/lib/crypto/Random.h box/trunk/lib/crypto/RollingChecksum.cpp box/trunk/lib/crypto/RollingChecksum.h box/trunk/lib/raidfile/Makefile.extra box/trunk/lib/raidfile/RaidFileController.cpp box/trunk/lib/raidfile/RaidFileController.h box/trunk/lib/raidfile/RaidFileException.h box/trunk/lib/raidfile/RaidFileException.txt box/trunk/lib/raidfile/RaidFileRead.cpp box/trunk/lib/raidfile/RaidFileRead.h box/trunk/lib/raidfile/RaidFileUtil.cpp box/trunk/lib/raidfile/RaidFileUtil.h box/trunk/lib/raidfile/RaidFileWrite.cpp box/trunk/lib/raidfile/RaidFileWrite.h box/trunk/lib/raidfile/raidfile-config box/trunk/lib/server/ConnectionException.txt box/trunk/lib/server/Daemon.cpp box/trunk/lib/server/Daemon.h box/trunk/lib/server/LocalProcessStream.cpp box/trunk/lib/server/LocalProcessStream.h box/trunk/lib/server/Makefile.extra box/trunk/lib/server/Protocol.cpp box/trunk/lib/server/Protocol.h box/trunk/lib/server/ProtocolObject.cpp box/trunk/lib/server/ProtocolObject.h box/trunk/lib/server/ProtocolUncertainStream.cpp box/trunk/lib/server/ProtocolUncertainStream.h box/trunk/lib/server/ProtocolWire.h box/trunk/lib/server/SSLLib.cpp box/trunk/lib/server/SSLLib.h box/trunk/lib/server/ServerException.h box/trunk/lib/server/ServerException.txt box/trunk/lib/server/ServerStream.h box/trunk/lib/server/ServerTLS.h box/trunk/lib/server/Socket.cpp box/trunk/lib/server/Socket.h box/trunk/lib/server/SocketListen.h box/trunk/lib/server/SocketStream.cpp box/trunk/lib/server/SocketStream.h box/trunk/lib/server/SocketStreamTLS.cpp box/trunk/lib/server/SocketStreamTLS.h box/trunk/lib/server/TLSContext.cpp box/trunk/lib/server/TLSContext.h box/trunk/lib/server/makeprotocol.pl box/trunk/lib/win32/WinNamedPipeStream.cpp box/trunk/lib/win32/WinNamedPipeStream.h box/trunk/lib/win32/emu.cpp box/trunk/lib/win32/emu.h box/trunk/modules.txt box/trunk/parcels.txt box/trunk/runtest.pl box/trunk/test/backupdiff/difftestfiles.cpp box/trunk/test/backupdiff/testbackupdiff.cpp box/trunk/test/backupdiff/testextra box/trunk/test/backupstore/testbackupstore.cpp box/trunk/test/backupstore/testextra box/trunk/test/backupstore/testfiles/accounts.txt box/trunk/test/backupstore/testfiles/bbstored.conf box/trunk/test/backupstore/testfiles/bbstored_multi.conf box/trunk/test/backupstore/testfiles/clientCerts.pem box/trunk/test/backupstore/testfiles/clientPrivKey.pem box/trunk/test/backupstore/testfiles/clientReq.pem box/trunk/test/backupstore/testfiles/clientTrustedCAs.pem box/trunk/test/backupstore/testfiles/query.conf box/trunk/test/backupstore/testfiles/raidfile.conf box/trunk/test/backupstore/testfiles/root.pem box/trunk/test/backupstore/testfiles/root.srl box/trunk/test/backupstore/testfiles/rootcert.pem box/trunk/test/backupstore/testfiles/rootkey.pem box/trunk/test/backupstore/testfiles/rootreq.pem box/trunk/test/backupstore/testfiles/serverCerts.pem box/trunk/test/backupstore/testfiles/serverPrivKey.pem box/trunk/test/backupstore/testfiles/serverReq.pem box/trunk/test/backupstore/testfiles/serverTrustedCAs.pem box/trunk/test/backupstorefix/testbackupstorefix.cpp box/trunk/test/backupstorefix/testextra box/trunk/test/backupstorefix/testfiles/testbackupstorefix.pl box/trunk/test/backupstorepatch/testbackupstorepatch.cpp box/trunk/test/backupstorepatch/testextra box/trunk/test/basicserver/Makefile.extra box/trunk/test/basicserver/TestCommands.cpp box/trunk/test/basicserver/TestContext.cpp box/trunk/test/basicserver/TestContext.h box/trunk/test/basicserver/testbasicserver.cpp box/trunk/test/basicserver/testfiles/clientCerts.pem box/trunk/test/basicserver/testfiles/clientPrivKey.pem box/trunk/test/basicserver/testfiles/clientReq.pem box/trunk/test/basicserver/testfiles/clientTrustedCAs.pem box/trunk/test/basicserver/testfiles/key-creation.txt box/trunk/test/basicserver/testfiles/root.pem box/trunk/test/basicserver/testfiles/root.srl box/trunk/test/basicserver/testfiles/rootcert.pem box/trunk/test/basicserver/testfiles/rootkey.pem box/trunk/test/basicserver/testfiles/rootreq.pem box/trunk/test/basicserver/testfiles/serverCerts.pem box/trunk/test/basicserver/testfiles/serverPrivKey.pem box/trunk/test/basicserver/testfiles/serverReq.pem box/trunk/test/basicserver/testfiles/serverTrustedCAs.pem box/trunk/test/basicserver/testfiles/srv1.conf box/trunk/test/basicserver/testfiles/srv1b.conf box/trunk/test/basicserver/testfiles/srv2.conf box/trunk/test/basicserver/testfiles/srv3.conf box/trunk/test/basicserver/testfiles/srv4.conf box/trunk/test/basicserver/testprotocol.txt box/trunk/test/bbackupd/testbbackupd.cpp box/trunk/test/bbackupd/testextra box/trunk/test/bbackupd/testfiles/accounts.txt box/trunk/test/bbackupd/testfiles/bbackupd.conf box/trunk/test/bbackupd/testfiles/bbstored.conf box/trunk/test/bbackupd/testfiles/clientCerts.pem box/trunk/test/bbackupd/testfiles/clientPrivKey.pem box/trunk/test/bbackupd/testfiles/clientTrustedCAs.pem box/trunk/test/bbackupd/testfiles/extcheck1.pl box/trunk/test/bbackupd/testfiles/extcheck2.pl box/trunk/test/bbackupd/testfiles/notifyscript.pl box/trunk/test/bbackupd/testfiles/raidfile.conf box/trunk/test/bbackupd/testfiles/serverCerts.pem box/trunk/test/bbackupd/testfiles/serverPrivKey.pem box/trunk/test/bbackupd/testfiles/serverTrustedCAs.pem box/trunk/test/common/testcommon.cpp box/trunk/test/common/testfiles/config1.txt box/trunk/test/common/testfiles/config10.txt box/trunk/test/common/testfiles/config11.txt box/trunk/test/common/testfiles/config12.txt box/trunk/test/common/testfiles/config13.txt box/trunk/test/common/testfiles/config14.txt box/trunk/test/common/testfiles/config15.txt box/trunk/test/common/testfiles/config16.txt box/trunk/test/common/testfiles/config2.txt box/trunk/test/common/testfiles/config3.txt box/trunk/test/common/testfiles/config4.txt box/trunk/test/common/testfiles/config5.txt box/trunk/test/common/testfiles/config6.txt box/trunk/test/common/testfiles/config7.txt box/trunk/test/common/testfiles/config8.txt box/trunk/test/common/testfiles/config9.txt box/trunk/test/common/testfiles/config9b.txt box/trunk/test/common/testfiles/config9c.txt box/trunk/test/common/testfiles/config9d.txt box/trunk/test/common/testfiles/fdgetlinetest.txt box/trunk/test/compress/testcompress.cpp box/trunk/test/crypto/testcrypto.cpp box/trunk/test/raidfile/Darwin-SYS.h box/trunk/test/raidfile/Makefile.extra.Darwin box/trunk/test/raidfile/intercept.cpp box/trunk/test/raidfile/make-darwin-intercepts.pl box/trunk/test/raidfile/testextra box/trunk/test/raidfile/testfiles/raidfile.conf box/trunk/test/raidfile/testraidfile.cpp box/trunk/test/win32/testlibwin32.cpp box/trunk/win32.bat box/trunk/win32test.vcproj Log: Set svn:eol-style as appropriate for all files Property changes on: box/trunk/BUGS.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/LICENSE.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/VERSION.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bbackupctl.vcproj ___________________________________________________________________ Name: svn:eol-style + CRLF Property changes on: box/trunk/bbackupd.vcproj ___________________________________________________________________ Name: svn:eol-style + CRLF Property changes on: box/trunk/bin/bbackupctl/bbackupctl.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupd/BackupClientContext.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupd/BackupClientContext.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupd/BackupClientDeleteList.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupd/BackupClientDeleteList.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupd/BackupClientDirectoryRecord.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupd/BackupClientDirectoryRecord.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupd/BackupClientInodeToIDMap.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupd/BackupClientInodeToIDMap.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupd/BackupDaemon.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupd/BackupDaemon.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupd/Win32BackupService.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupd/Win32BackupService.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupd/Win32ServiceFunctions.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupd/Win32ServiceFunctions.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupd/bbackupd-config ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupd/bbackupd.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupd/win32/ReadMe.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupd/win32/bbackupd.conf ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupd/win32/installer.iss ___________________________________________________________________ Name: svn:eol-style + CRLF Property changes on: box/trunk/bin/bbackupobjdump/bbackupobjdump.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupquery/BackupQueries.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupquery/BackupQueries.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupquery/Makefile.extra ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupquery/bbackupquery.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupquery/documentation.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbackupquery/makedocumentation.pl ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbstoreaccounts/bbstoreaccounts.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbstored/BBStoreDHousekeeping.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbstored/BackupCommands.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbstored/BackupConstants.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbstored/BackupContext.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbstored/BackupContext.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbstored/BackupStoreDaemon.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbstored/BackupStoreDaemon.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbstored/HousekeepStoreAccount.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbstored/HousekeepStoreAccount.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbstored/Makefile.extra ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbstored/backupprotocol.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbstored/bbstored-certs ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbstored/bbstored-config ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bin/bbstored/bbstored.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/bootstrap ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/boxbackup.sln ___________________________________________________________________ Name: svn:eol-style + CRLF Property changes on: box/trunk/boxquery.vcproj ___________________________________________________________________ Name: svn:eol-style + CRLF Property changes on: box/trunk/cleanupforcvs.pl ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/common.vcproj ___________________________________________________________________ Name: svn:eol-style + CRLF Property changes on: box/trunk/config.guess ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/config.sub ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/configure.ac ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/distribution/COMMON-MANIFEST.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/distribution/boxbackup/CONTACT.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/distribution/boxbackup/DISTRIBUTION-MANIFEST.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/distribution/boxbackup/DOCUMENTATION.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/distribution/boxbackup/LICENSE.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/distribution/boxbackup/LINUX.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/distribution/boxbackup/NETBSD.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/distribution/boxbackup/THANKS.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/distribution/boxbackup/VERSION.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/distribution/boxbackup/contrib/cygwin/README.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/distribution/boxbackup/contrib/cygwin/install-cygwin-service.pl ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/distribution/boxbackup/contrib/cygwin/remove-cygwin-service.sh ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/distribution/boxbackup/contrib/redhat/README.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/distribution/boxbackup/contrib/redhat/bbackupd ___________________________________________________________________ Name: svn:eol-style + LF Property changes on: box/trunk/distribution/boxbackup/contrib/redhat/bbstored ___________________________________________________________________ Name: svn:eol-style + LF Property changes on: box/trunk/distribution/boxbackup/contrib/rpm/README.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/distribution/boxbackup/contrib/rpm/boxbackup.spec ___________________________________________________________________ Name: svn:eol-style + LF Property changes on: box/trunk/distribution/boxbackup/contrib/suse/README.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/distribution/boxbackup/contrib/suse/bbackupd ___________________________________________________________________ Name: svn:eol-style + LF Property changes on: box/trunk/distribution/boxbackup/contrib/suse/bbstored ___________________________________________________________________ Name: svn:eol-style + LF Property changes on: box/trunk/docs/backup/INDEX.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/backup/Win32_Clients.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/backup/backup_encryption.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/backup/bin_bbackupd.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/backup/bin_bbstored.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/backup/encrypt_rsync.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/backup/lib_backupclient.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/backup/lib_backupstore.txt ___________________________________________________________________ Name: svn:eol-style + native Modified: box/trunk/docs/backup/win32_build_on_cygwin_using_mingw.txt =================================================================== --- box/trunk/docs/backup/win32_build_on_cygwin_using_mingw.txt 2005-12-12 21:46:48 UTC (rev 216) +++ box/trunk/docs/backup/win32_build_on_cygwin_using_mingw.txt 2005-12-12 23:03:11 UTC (rev 217) @@ -1,37 +1,37 @@ -How to build Box Backup on Win32 using Cygwin and MinGW -By Chris Wilson, 2005-12-07 - -Install Cygwin on your Windows box [http://www.cygwin.org] -Make sure to include the following packages: -* Devel/gcc-mingw -* Devel/gcc-mingw-core -* Devel/gcc-mingw-g++ -* Mingw/mingw-zlib - -Download OpenSSL from -[http://www.openssl.org/source/openssl-0.9.7i.tar.gz] - -Open a Cygwin shell, and unpack OpenSSL: - - tar xzvf openssl-0.9.7i.tar.gz - -Configure OpenSSL for MinGW compilation, and build and install it: - - cd openssl-0.9.7i - ./Configure --prefix=/usr/i686-pc-mingw32/ mingw - make - make install - -Now unpack the Box Backup sources, enter the source directory, -and configure like this: - - export CXX="g++ -mno-cygwin" - export LD="g++ -mno-cygwin" - export CFLAGS="-mno-cygwin -mthreads" - export CXXFLAGS="-mno-cygwin -mthreads" - export LDFLAGS="-mno-cygwin -mthreads" - export LIBS="-lcrypto -lws2_32 -lgdi32" - (if you don't have a "configure" file, run "./bootstrap") - ./configure --target=i686-pc-mingw32 - make - +How to build Box Backup on Win32 using Cygwin and MinGW +By Chris Wilson, 2005-12-07 + +Install Cygwin on your Windows box [http://www.cygwin.org] +Make sure to include the following packages: +* Devel/gcc-mingw +* Devel/gcc-mingw-core +* Devel/gcc-mingw-g++ +* Mingw/mingw-zlib + +Download OpenSSL from +[http://www.openssl.org/source/openssl-0.9.7i.tar.gz] + +Open a Cygwin shell, and unpack OpenSSL: + + tar xzvf openssl-0.9.7i.tar.gz + +Configure OpenSSL for MinGW compilation, and build and install it: + + cd openssl-0.9.7i + ./Configure --prefix=/usr/i686-pc-mingw32/ mingw + make + make install + +Now unpack the Box Backup sources, enter the source directory, +and configure like this: + + export CXX="g++ -mno-cygwin" + export LD="g++ -mno-cygwin" + export CFLAGS="-mno-cygwin -mthreads" + export CXXFLAGS="-mno-cygwin -mthreads" + export LDFLAGS="-mno-cygwin -mthreads" + export LIBS="-lcrypto -lws2_32 -lgdi32" + (if you don't have a "configure" file, run "./bootstrap") + ./configure --target=i686-pc-mingw32 + make + Property changes on: box/trunk/docs/backup/win32_build_on_cygwin_using_mingw.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/backup/win32_build_on_linux_using_mingw.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/backup/windows_porting.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_common/BoxTime.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_common/CollectInBufferStream.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_common/Configuration.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_common/Conversion.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_common/ExcludeList.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_common/FdGetLine.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_common/Guards.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_common/IOStream.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_common/IOStreamGetLine.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_common/MainHelper.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_common/WaitForEvent.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_common/xStream.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_common.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_compress/CompressStream.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_compress.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_crypto/CipherContext.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_crypto/RollingChecksum.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_crypto.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_server/Daemon.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_server/Protocol.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_server/ServerStream.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_server/ServerTLS.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_server/SocketStream.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_server/SocketStreamTLS.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_server/TLSContext.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/lib_server.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/common/memory_leaks.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/raidfile/lib_raidfile/RaidFileRead.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/raidfile/lib_raidfile/RaidFileWrite.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/docs/raidfile/lib_raidfile.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/infrastructure/BoxPlatform.pm.in ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/infrastructure/buildenv-testmain-template.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/infrastructure/m4/ac_cxx_exceptions.m4 ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/infrastructure/m4/ac_cxx_namespaces.m4 ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/infrastructure/m4/ax_check_bdb_v1.m4 ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/infrastructure/m4/ax_check_define_pragma.m4 ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/infrastructure/m4/ax_check_dirent_d_type.m4 ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/infrastructure/m4/ax_check_llong_minmax.m4 ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/infrastructure/m4/ax_check_malloc_workaround.m4 ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/infrastructure/m4/ax_check_mount_point.m4 ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/infrastructure/m4/ax_check_nonaligned_access.m4 ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/infrastructure/m4/ax_check_ssl.m4 ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/infrastructure/m4/ax_check_syscall_lseek.m4 ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/infrastructure/m4/ax_func_syscall.m4 ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/infrastructure/m4/ax_random_device.m4 ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/infrastructure/m4/vl_lib_readline.m4 ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/infrastructure/makebuildenv.pl ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/infrastructure/makedistribution.pl ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/infrastructure/makeparcels.pl ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/infrastructure/setupexternal.pl ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/infrastructure/tests/common_tests.pl ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupClientCryptoKeys.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupClientCryptoKeys.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupClientFileAttributes.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupClientFileAttributes.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupClientMakeExcludeList.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupClientMakeExcludeList.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupClientRestore.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupClientRestore.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupDaemonConfigVerify.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupDaemonConfigVerify.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupStoreConstants.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupStoreDirectory.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupStoreDirectory.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupStoreException.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupStoreException.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupStoreFile.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupStoreFile.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupStoreFileCmbDiff.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupStoreFileCmbIdx.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupStoreFileCombine.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupStoreFileCryptVar.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupStoreFileCryptVar.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupStoreFileDiff.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupStoreFileEncodeStream.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupStoreFileEncodeStream.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupStoreFileRevDiff.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupStoreFileWire.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupStoreFilename.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupStoreFilename.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupStoreFilenameClear.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupStoreFilenameClear.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupStoreObjectDump.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/BackupStoreObjectMagic.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupclient/Makefile.extra ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupstore/BackupStoreAccountDatabase.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupstore/BackupStoreAccountDatabase.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupstore/BackupStoreAccounts.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupstore/BackupStoreAccounts.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupstore/BackupStoreCheck.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupstore/BackupStoreCheck.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupstore/BackupStoreCheck2.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupstore/BackupStoreCheckData.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupstore/BackupStoreConfigVerify.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupstore/BackupStoreConfigVerify.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupstore/BackupStoreInfo.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupstore/BackupStoreInfo.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupstore/StoreStructure.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/backupstore/StoreStructure.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/BannerText.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/BeginStructPackForWire.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/Box.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/BoxException.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/BoxException.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/BoxPlatform.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/BoxPortsAndFiles.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/BoxTime.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/BoxTime.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/BoxTimeToText.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/BoxTimeToText.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/BoxTimeToUnix.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/CollectInBufferStream.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/CollectInBufferStream.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/CommonException.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/CommonException.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/Configuration.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/Configuration.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/Conversion.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/ConversionException.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/ConversionString.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/DebugAssertFailed.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/DebugMemLeakFinder.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/DebugPrintf.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/EndStructPackForWire.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/EventWatchFilesystemObject.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/EventWatchFilesystemObject.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/ExcludeList.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/ExcludeList.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/FdGetLine.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/FdGetLine.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/FileModificationTime.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/FileStream.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/FileStream.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/Guards.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/IOStream.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/IOStream.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/IOStreamGetLine.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/IOStreamGetLine.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/MainHelper.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/Makefile.extra ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/MemBlockStream.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/MemBlockStream.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/MemLeakFindOff.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/MemLeakFindOn.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/MemLeakFinder.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/NamedLock.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/NamedLock.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/PartialReadStream.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/PartialReadStream.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/ReadGatherStream.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/ReadGatherStream.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/StreamableMemBlock.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/StreamableMemBlock.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/TemporaryDirectory.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/Test.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/UnixUser.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/UnixUser.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/Utils.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/Utils.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/WaitForEvent.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/WaitForEvent.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/common/makeexception.pl ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/compress/Compress.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/compress/CompressException.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/compress/CompressException.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/compress/CompressStream.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/compress/CompressStream.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/compress/Makefile.extra ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/crypto/CipherAES.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/crypto/CipherAES.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/crypto/CipherBlowfish.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/crypto/CipherBlowfish.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/crypto/CipherContext.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/crypto/CipherContext.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/crypto/CipherDescription.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/crypto/CipherDescription.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/crypto/CipherException.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/crypto/CipherException.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/crypto/MD5Digest.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/crypto/MD5Digest.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/crypto/Makefile.extra ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/crypto/Random.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/crypto/Random.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/crypto/RollingChecksum.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/crypto/RollingChecksum.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/raidfile/Makefile.extra ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/raidfile/RaidFileController.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/raidfile/RaidFileController.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/raidfile/RaidFileException.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/raidfile/RaidFileException.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/raidfile/RaidFileRead.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/raidfile/RaidFileRead.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/raidfile/RaidFileUtil.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/raidfile/RaidFileUtil.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/raidfile/RaidFileWrite.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/raidfile/RaidFileWrite.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/raidfile/raidfile-config ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/ConnectionException.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/Daemon.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/Daemon.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/LocalProcessStream.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/LocalProcessStream.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/Makefile.extra ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/Protocol.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/Protocol.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/ProtocolObject.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/ProtocolObject.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/ProtocolUncertainStream.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/ProtocolUncertainStream.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/ProtocolWire.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/SSLLib.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/SSLLib.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/ServerException.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/ServerException.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/ServerStream.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/ServerTLS.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/Socket.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/Socket.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/SocketListen.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/SocketStream.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/SocketStream.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/SocketStreamTLS.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/SocketStreamTLS.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/TLSContext.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/TLSContext.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/server/makeprotocol.pl ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/win32/WinNamedPipeStream.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/win32/WinNamedPipeStream.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/win32/emu.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/lib/win32/emu.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/modules.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/parcels.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/runtest.pl ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupdiff/difftestfiles.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupdiff/testbackupdiff.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupdiff/testextra ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstore/testbackupstore.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstore/testextra ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstore/testfiles/accounts.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstore/testfiles/bbstored.conf ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstore/testfiles/bbstored_multi.conf ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstore/testfiles/clientCerts.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstore/testfiles/clientPrivKey.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstore/testfiles/clientReq.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstore/testfiles/clientTrustedCAs.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstore/testfiles/query.conf ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstore/testfiles/raidfile.conf ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstore/testfiles/root.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstore/testfiles/root.srl ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstore/testfiles/rootcert.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstore/testfiles/rootkey.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstore/testfiles/rootreq.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstore/testfiles/serverCerts.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstore/testfiles/serverPrivKey.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstore/testfiles/serverReq.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstore/testfiles/serverTrustedCAs.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstorefix/testbackupstorefix.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstorefix/testextra ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstorefix/testfiles/testbackupstorefix.pl ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstorepatch/testbackupstorepatch.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/backupstorepatch/testextra ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/Makefile.extra ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/TestCommands.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/TestContext.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/TestContext.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/testbasicserver.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/testfiles/clientCerts.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/testfiles/clientPrivKey.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/testfiles/clientReq.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/testfiles/clientTrustedCAs.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/testfiles/key-creation.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/testfiles/root.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/testfiles/root.srl ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/testfiles/rootcert.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/testfiles/rootkey.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/testfiles/rootreq.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/testfiles/serverCerts.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/testfiles/serverPrivKey.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/testfiles/serverReq.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/testfiles/serverTrustedCAs.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/testfiles/srv1.conf ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/testfiles/srv1b.conf ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/testfiles/srv2.conf ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/testfiles/srv3.conf ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/testfiles/srv4.conf ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/basicserver/testprotocol.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/bbackupd/testbbackupd.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/bbackupd/testextra ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/bbackupd/testfiles/accounts.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/bbackupd/testfiles/bbackupd.conf ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/bbackupd/testfiles/bbstored.conf ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/bbackupd/testfiles/clientCerts.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/bbackupd/testfiles/clientPrivKey.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/bbackupd/testfiles/clientTrustedCAs.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/bbackupd/testfiles/extcheck1.pl ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/bbackupd/testfiles/extcheck2.pl ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/bbackupd/testfiles/notifyscript.pl ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/bbackupd/testfiles/raidfile.conf ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/bbackupd/testfiles/serverCerts.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/bbackupd/testfiles/serverPrivKey.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/bbackupd/testfiles/serverTrustedCAs.pem ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/common/testcommon.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/common/testfiles/config1.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/common/testfiles/config10.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/common/testfiles/config11.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/common/testfiles/config12.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/common/testfiles/config13.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/common/testfiles/config14.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/common/testfiles/config15.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/common/testfiles/config16.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/common/testfiles/config2.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/common/testfiles/config3.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/common/testfiles/config4.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/common/testfiles/config5.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/common/testfiles/config6.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/common/testfiles/config7.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/common/testfiles/config8.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/common/testfiles/config9.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/common/testfiles/config9b.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/common/testfiles/config9c.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/common/testfiles/config9d.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/common/testfiles/fdgetlinetest.txt ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/compress/testcompress.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/crypto/testcrypto.cpp ___________________________________________________________________ Name: svn:eol-style + native Modified: box/trunk/test/raidfile/Darwin-SYS.h =================================================================== --- box/trunk/test/raidfile/Darwin-SYS.h 2005-12-12 21:46:48 UTC (rev 216) +++ box/trunk/test/raidfile/Darwin-SYS.h 2005-12-12 23:03:11 UTC (rev 217) @@ -1,167 +1,167 @@ - -/* Taken from the Darwin Libc source -*/ - -/* - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * The contents of this file constitute Original Code as defined in and - * are subject to the Apple Public Source License Version 1.1 (the - * "License"). You may not use this file except in compliance with the - * License. Please obtain a copy of the License at - * http://www.apple.com/publicsource and read it before using this file. - * - * This Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ -/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. - * - * File: SYS.h - * - * Definition of the user side of the UNIX system call interface - * for M98K. - * - * Errors are flagged by the location of the trap return (ie., which - * instruction is executed upon rfi): - * - * SC PC + 4: Error (typically branch to cerror()) - * SC PC + 8: Success - * - * HISTORY - * 18-Nov-92 Ben Fathi (benf at next.com) - * Ported to m98k. - * - * 9-Jan-92 Peter King (king at next.com) - * Created. - */ - -#define KERNEL_PRIVATE 1 -/* - * Header files. - */ -#import -#import -#import -#import - -/* From rhapsody kernel mach/ppc/syscall_sw.h */ -#define kernel_trap_args_0 -#define kernel_trap_args_1 -#define kernel_trap_args_2 -#define kernel_trap_args_3 -#define kernel_trap_args_4 -#define kernel_trap_args_5 -#define kernel_trap_args_6 -#define kernel_trap_args_7 - -/* - * simple_kernel_trap -- Mach system calls with 8 or less args - * Args are passed in a0 - a7, system call number in r0. - * Do a "sc" instruction to enter kernel. - */ -#define simple_kernel_trap(trap_name, trap_number) \ - .globl _##trap_name @\ -_##trap_name: @\ - li r0,trap_number @\ - sc @\ - blr @\ - END(trap_name) - -#define kernel_trap_0(trap_name,trap_number) \ - simple_kernel_trap(trap_name,trap_number) - -#define kernel_trap_1(trap_name,trap_number) \ - simple_kernel_trap(trap_name,trap_number) - -#define kernel_trap_2(trap_name,trap_number) \ - simple_kernel_trap(trap_name,trap_number) - -#define kernel_trap_3(trap_name,trap_number) \ - simple_kernel_trap(trap_name,trap_number) - -#define kernel_trap_4(trap_name,trap_number) \ - simple_kernel_trap(trap_name,trap_number) - -#define kernel_trap_5(trap_name,trap_number) \ - simple_kernel_trap(trap_name,trap_number) - -#define kernel_trap_6(trap_name,trap_number) \ - simple_kernel_trap(trap_name,trap_number) - -#define kernel_trap_7(trap_name,trap_number) \ - simple_kernel_trap(trap_name,trap_number) - -#define kernel_trap_8(trap_name,trap_number) \ - simple_kernel_trap(trap_name,trap_number) - -#define kernel_trap_9(trap_name,trap_number) \ - simple_kernel_trap(trap_name,trap_number) - -/* End of rhapsody kernel mach/ppc/syscall_sw.h */ - -/* - * Macros. - */ - -#define SYSCALL(name, nargs) \ - .globl cerror @\ -LEAF(_##name) @\ - kernel_trap_args_##nargs @\ - li r0,SYS_##name @\ - sc @\ - b 1f @\ - b 2f @\ -1: BRANCH_EXTERN(cerror) @\ -.text \ -2: nop - -#define SYSCALL_NONAME(name, nargs) \ - .globl cerror @\ - kernel_trap_args_##nargs @\ - li r0,SYS_##name @\ - sc @\ - b 1f @\ - b 2f @\ -1: BRANCH_EXTERN(cerror) @\ -.text \ -2: nop - -#define PSEUDO(pseudo, name, nargs) \ -LEAF(_##pseudo) @\ - SYSCALL_NONAME(name, nargs) - - -#undef END -#import - -#if !defined(SYS_getdirentriesattr) -#define SYS_getdirentriesattr 222 -#endif - -#if !defined(SYS_semsys) -#define SYS_semsys 251 -#define SYS_msgsys 252 -#define SYS_shmsys 253 -#define SYS_semctl 254 -#define SYS_semget 255 -#define SYS_semop 256 -#define SYS_semconfig 257 -#define SYS_msgctl 258 -#define SYS_msgget 259 -#define SYS_msgsnd 260 -#define SYS_msgrcv 261 -#define SYS_shmat 262 -#define SYS_shmctl 263 -#define SYS_shmdt 264 -#define SYS_shmget 265 -#endif - + +/* Taken from the Darwin Libc source +*/ + +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. + * + * File: SYS.h + * + * Definition of the user side of the UNIX system call interface + * for M98K. + * + * Errors are flagged by the location of the trap return (ie., which + * instruction is executed upon rfi): + * + * SC PC + 4: Error (typically branch to cerror()) + * SC PC + 8: Success + * + * HISTORY + * 18-Nov-92 Ben Fathi (benf at next.com) + * Ported to m98k. + * + * 9-Jan-92 Peter King (king at next.com) + * Created. + */ + +#define KERNEL_PRIVATE 1 +/* + * Header files. + */ +#import +#import +#import +#import + +/* From rhapsody kernel mach/ppc/syscall_sw.h */ +#define kernel_trap_args_0 +#define kernel_trap_args_1 +#define kernel_trap_args_2 +#define kernel_trap_args_3 +#define kernel_trap_args_4 +#define kernel_trap_args_5 +#define kernel_trap_args_6 +#define kernel_trap_args_7 + +/* + * simple_kernel_trap -- Mach system calls with 8 or less args + * Args are passed in a0 - a7, system call number in r0. + * Do a "sc" instruction to enter kernel. + */ +#define simple_kernel_trap(trap_name, trap_number) \ + .globl _##trap_name @\ +_##trap_name: @\ + li r0,trap_number @\ + sc @\ + blr @\ + END(trap_name) + +#define kernel_trap_0(trap_name,trap_number) \ + simple_kernel_trap(trap_name,trap_number) + +#define kernel_trap_1(trap_name,trap_number) \ + simple_kernel_trap(trap_name,trap_number) + +#define kernel_trap_2(trap_name,trap_number) \ + simple_kernel_trap(trap_name,trap_number) + +#define kernel_trap_3(trap_name,trap_number) \ + simple_kernel_trap(trap_name,trap_number) + +#define kernel_trap_4(trap_name,trap_number) \ + simple_kernel_trap(trap_name,trap_number) + +#define kernel_trap_5(trap_name,trap_number) \ + simple_kernel_trap(trap_name,trap_number) + +#define kernel_trap_6(trap_name,trap_number) \ + simple_kernel_trap(trap_name,trap_number) + +#define kernel_trap_7(trap_name,trap_number) \ + simple_kernel_trap(trap_name,trap_number) + +#define kernel_trap_8(trap_name,trap_number) \ + simple_kernel_trap(trap_name,trap_number) + +#define kernel_trap_9(trap_name,trap_number) \ + simple_kernel_trap(trap_name,trap_number) + +/* End of rhapsody kernel mach/ppc/syscall_sw.h */ + +/* + * Macros. + */ + +#define SYSCALL(name, nargs) \ + .globl cerror @\ +LEAF(_##name) @\ + kernel_trap_args_##nargs @\ + li r0,SYS_##name @\ + sc @\ + b 1f @\ + b 2f @\ +1: BRANCH_EXTERN(cerror) @\ +.text \ +2: nop + +#define SYSCALL_NONAME(name, nargs) \ + .globl cerror @\ + kernel_trap_args_##nargs @\ + li r0,SYS_##name @\ + sc @\ + b 1f @\ + b 2f @\ +1: BRANCH_EXTERN(cerror) @\ +.text \ +2: nop + +#define PSEUDO(pseudo, name, nargs) \ +LEAF(_##pseudo) @\ + SYSCALL_NONAME(name, nargs) + + +#undef END +#import + +#if !defined(SYS_getdirentriesattr) +#define SYS_getdirentriesattr 222 +#endif + +#if !defined(SYS_semsys) +#define SYS_semsys 251 +#define SYS_msgsys 252 +#define SYS_shmsys 253 +#define SYS_semctl 254 +#define SYS_semget 255 +#define SYS_semop 256 +#define SYS_semconfig 257 +#define SYS_msgctl 258 +#define SYS_msgget 259 +#define SYS_msgsnd 260 +#define SYS_msgrcv 261 +#define SYS_shmat 262 +#define SYS_shmctl 263 +#define SYS_shmdt 264 +#define SYS_shmget 265 +#endif + Property changes on: box/trunk/test/raidfile/Darwin-SYS.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/raidfile/Makefile.extra.Darwin ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/raidfile/intercept.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/raidfile/make-darwin-intercepts.pl ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/raidfile/testextra ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/raidfile/testfiles/raidfile.conf ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/raidfile/testraidfile.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/test/win32/testlibwin32.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: box/trunk/win32.bat ___________________________________________________________________ Name: svn:eol-style + CRLF Property changes on: box/trunk/win32test.vcproj ___________________________________________________________________ Name: svn:eol-style + CRLF From boxbackup-dev at fluffy.co.uk Tue Dec 13 20:14:56 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Tue, 13 Dec 2005 20:14:56 +0000 Subject: [Box Backup-dev] Commit messages (was: COMMIT r216 - in box/chris/win32/merge/07-win32-fixes: . infrastructure lib/common lib/win32 test/common) In-Reply-To: <1134430254.27021.9.camel@avenin.ebourne.me.uk> References: <20051212214704.A244D93@s0g0.pems.testserver.co.uk> <1134428680.27021.4.camel@avenin.ebourne.me.uk> <32B3DAEF-BF3F-4267-BC10-EBAD092AC5D1@fluffy.co.uk> <1134430254.27021.9.camel@avenin.ebourne.me.uk> Message-ID: <023BFE53-ACEB-4BFB-8BE9-3F337949E187@fluffy.co.uk> On 12 Dec 2005, at 23:30, Martin Ebourne wrote: > On Mon, 2005-12-12 at 23:10 +0000, Ben Summers wrote: >> On 12 Dec 2005, at 23:04, Martin Ebourne wrote: >>> The commit emails don't appear to be working properly - I'm >>> missing at >>> least half the revisions by the looks of it. >> >> They're too big and are getting blocked by the mailing list software. > > Ach. Limit seems to be set fairly low then, because some of the > changes > aren't that big. > > I don't know if you're already on to this, but 3 solutions spring to > mind: > > 1. If possible let the list have an exception for messages from svn. I've just set the limit to 1Mb on -dev. Let's see if that's a problem. Ben From boxbackup-dev at fluffy.co.uk Tue Dec 13 20:26:13 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Tue, 13 Dec 2005 20:26:13 +0000 Subject: [Box Backup-dev] Current status Message-ID: Right then, lots of progress has been made. I think the current state is... * All non-Win32 originating contributions are now in trunk. * Basic Win32 port in trunk. * Nick's other modifications are still to go in: keep-alive decryption of filenames * Trunk compiles on at least one POSIX platform, but raidfile and bbackupd tests fail. * Win32 client works, although isn't complete enough to be useful (ie missing those patches) Sound about right? Martin: sorry about the unwanted project merger position. I'm a little wary of merging in SVN as it looks very easy to wipe out changes, and since you have the experience your merging has been very helpful. But we'll soon be able to just work on trunk, and of course, I'll look after releases if unless someone else really wants the job. Thanks for all your hard work so far. Client disc space: Probably best to wipe out those copies when we're done with merging, but for now we just need to be careful what we check out. Ben From boxbackup-dev at fluffy.co.uk Tue Dec 13 20:37:34 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Tue, 13 Dec 2005 20:37:34 +0000 (GMT) Subject: [Box Backup-dev] Current status In-Reply-To: References: Message-ID: Hi Ben, Please correct me if I'm wrong, but: > * All non-Win32 originating contributions are now in trunk. I think Gary's patches are not in yet. > * Nick's other modifications are still to go in: > keep-alive This is one of Gary's, I think. > decryption of filenames I think this was actually a backport from 0.09, and is in trunk. > * Win32 client works, although isn't complete enough to be useful (ie missing > those patches) I think it is useful - it works for me. Gary's patches improve SSL handling when diffing large files on any platform, not just Win32. > Martin: sorry about the unwanted project merger position. I'm a little wary > of merging in SVN as it looks very easy to wipe out changes, and since you > have the experience your merging has been very helpful. But we'll soon be > able to just work on trunk, and of course, I'll look after releases if unless > someone else really wants the job. Thanks for all your hard work so far. Amen. :-) Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Tue Dec 13 21:04:41 2005 From: boxbackup-dev at fluffy.co.uk (Gary) Date: Tue, 13 Dec 2005 13:04:41 -0800 (PST) Subject: [Box Backup-dev] Current status In-Reply-To: Message-ID: <20051213210441.12266.qmail@web36713.mail.mud.yahoo.com> Ben, Chris, > > * Nick's other modifications are still to go in: > > keep-alive > > This is one of Gary's, I think. Yes, this one was mine (Nick made a modified Win32 version out of it, I think), but it depends on: 1.) Whether the -chromi fast diffing patch will include simultaneous diff/upload (in which case KeepAlive is pointless). 2.) Whether the current diffing code will include an option to add more "observers" (interruptions) in different time frames (so far MaximumDiffingTime is the only one) in the main trunk. > > * All non-Win32 originating contributions are now in trunk. > > I think Gary's patches are not in yet. We got the StoreObjectInfoFile stuff left (we can forget Unlimited MaximumDiffingTime, to keep things simple). But, I will need a fully working new trunk to produce a new clean StoreObjectInfoFile patch and test the heck out of it under RedHat/Cygwin combo. > Amen. :-) Me2 ;). Gary __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From boxbackup-dev at fluffy.co.uk Tue Dec 13 21:07:10 2005 From: boxbackup-dev at fluffy.co.uk (Gary) Date: Tue, 13 Dec 2005 13:07:10 -0800 (PST) Subject: [Box Backup-dev] Current status In-Reply-To: Message-ID: <20051213210710.97203.qmail@web36711.mail.mud.yahoo.com> Ben, Chris, > I think it is useful - it works for me. Gary's patches improve SSL > handling when diffing large files on any platform, not just Win32. That is correct, as far as I can tell Cygwin and RedHat clients have the same problem (as Win32) when it comes to diffing very large files (SSL timeouts). I am not sure whether others will concur, I seem to be the only one out there running with 4GB files. Gary __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From boxbackup-dev at fluffy.co.uk Tue Dec 13 21:13:41 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Tue, 13 Dec 2005 21:13:41 +0000 Subject: [Box Backup-dev] Current status In-Reply-To: <20051213210441.12266.qmail@web36713.mail.mud.yahoo.com> References: <20051213210441.12266.qmail@web36713.mail.mud.yahoo.com> Message-ID: <4C374A9E-E871-45C8-B55C-38FCF1CF1861@fluffy.co.uk> On 13 Dec 2005, at 21:04, Gary wrote: > Ben, Chris, > >>> * Nick's other modifications are still to go in: >>> keep-alive >> >> This is one of Gary's, I think. > > Yes, this one was mine Sorry, I got a bit confused. > (Nick made a modified Win32 version out of it, I > think), but it depends on: > > 1.) Whether the -chromi fast diffing patch will include simultaneous > diff/upload (in which case KeepAlive is pointless). It doesn't at the moment, and won't in the next release. > > 2.) Whether the current diffing code will include an option to add > more > "observers" (interruptions) in different time frames (so far > MaximumDiffingTime is the only one) in the main trunk. Could we use a signal or something to throw an exception, and avoid the whole polling thing? > >>> * All non-Win32 originating contributions are now in trunk. >> >> I think Gary's patches are not in yet. > > We got the StoreObjectInfoFile stuff left (we can forget Unlimited > MaximumDiffingTime, to keep things simple). But, I will need a fully > working new trunk to produce a new clean StoreObjectInfoFile patch and > test the heck out of it under RedHat/Cygwin combo. That would be great. Sorry to forget about all your hard work. I'd like to get both into the next release, and a nice clean diff from trunk would make things easy to review and include. Thanks. Ben From boxbackup-dev at fluffy.co.uk Tue Dec 13 21:30:40 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Tue, 13 Dec 2005 21:30:40 +0000 Subject: [Box Backup-dev] Current status In-Reply-To: <4C374A9E-E871-45C8-B55C-38FCF1CF1861@fluffy.co.uk> References: <20051213210441.12266.qmail@web36713.mail.mud.yahoo.com> <4C374A9E-E871-45C8-B55C-38FCF1CF1861@fluffy.co.uk> Message-ID: <1134509440.13883.2.camel@avenin.ebourne.me.uk> On Tue, 2005-12-13 at 21:13 +0000, Ben Summers wrote: > Could we use a signal or something to throw an exception, and avoid > the whole polling thing? C++ language exceptions are synchronous exceptions, not asynchronous. Hence throwing one from a signal handler is incorrect. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Tue Dec 13 21:34:37 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Tue, 13 Dec 2005 21:34:37 +0000 Subject: [Box Backup-dev] Current status In-Reply-To: <1134509440.13883.2.camel@avenin.ebourne.me.uk> References: <20051213210441.12266.qmail@web36713.mail.mud.yahoo.com> <4C374A9E-E871-45C8-B55C-38FCF1CF1861@fluffy.co.uk> <1134509440.13883.2.camel@avenin.ebourne.me.uk> Message-ID: <6DE256F7-8656-4C50-BE3D-10D080B1A442@fluffy.co.uk> On 13 Dec 2005, at 21:30, Martin Ebourne wrote: > On Tue, 2005-12-13 at 21:13 +0000, Ben Summers wrote: >> Could we use a signal or something to throw an exception, and avoid >> the whole polling thing? > > C++ language exceptions are synchronous exceptions, not asynchronous. > Hence throwing one from a signal handler is incorrect. Hmmm... I'm probably thinking of a Win32 feature which allows your functions to be called within the main thread as API functions return. So many OSes, so many APIs. Ben From boxbackup-dev at fluffy.co.uk Tue Dec 13 21:35:11 2005 From: boxbackup-dev at fluffy.co.uk (Gary) Date: Tue, 13 Dec 2005 13:35:11 -0800 (PST) Subject: [Box Backup-dev] Current status In-Reply-To: <4C374A9E-E871-45C8-B55C-38FCF1CF1861@fluffy.co.uk> Message-ID: <20051213213511.15524.qmail@web36711.mail.mud.yahoo.com> Ben, > > 1.) Whether the -chromi fast diffing patch will include > simultaneous > > diff/upload (in which case KeepAlive is pointless). > > It doesn't at the moment, and won't in the next release. Ok, so we have to run with the KeepAlive version, then. Which brings us to the next issue: > Could we use a signal or something to throw an exception, > and avoid the whole polling thing? With KeepAlive, we need to be able to not only interrupt the diffing process (as in MaximumDiffingTime), but also resume it after a KeepAlive command has been executed. I think the decision on how to implement this best is up to you Ben, since it invasively affects the core BoxBackup distribution. > That would be great. Sorry to forget about all your hard work. Not a problem, my stuff is miniscule compared to what others contributed. > I'd like to get both into the next release, and a nice clean > diff from trunk would make things easy to review and include. I'll get to it when you tell me the current trunk is stable for the next release and runs well under Cygwin/RedHat combo. Gary __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From boxbackup-dev at fluffy.co.uk Tue Dec 13 21:40:16 2005 From: boxbackup-dev at fluffy.co.uk (Charles Lecklider) Date: Tue, 13 Dec 2005 21:40:16 +0000 Subject: [Box Backup-dev] Current status In-Reply-To: <20051213210710.97203.qmail@web36711.mail.mud.yahoo.com> References: <20051213210710.97203.qmail@web36711.mail.mud.yahoo.com> Message-ID: <439F3FC0.90309@invis.net> Gary wrote: > Ben, Chris, > >>I think it is useful - it works for me. Gary's patches improve SSL >>handling when diffing large files on any platform, not just Win32. > > That is correct, as far as I can tell Cygwin and RedHat clients have > the same problem (as Win32) when it comes to diffing very large files > (SSL timeouts). I am not sure whether others will concur, I seem to be > the only one out there running with 4GB files. No, I've also run into similar problems. My plan for dealing with this under Win32 is to switch to a threaded overlapped IO model. I know some people are going to get all upset about the idea of threads, but like it or not, that's the way Windows works. Add a dash of completion ports, and it's pretty simple to have diffing and uploading and pretty much anything else, all at the same time, with nothing but standard socket timeouts needed. -C From boxbackup-dev at fluffy.co.uk Tue Dec 13 21:54:36 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Tue, 13 Dec 2005 21:54:36 +0000 Subject: [Box Backup-dev] Current status In-Reply-To: <20051213213511.15524.qmail@web36711.mail.mud.yahoo.com> References: <20051213213511.15524.qmail@web36711.mail.mud.yahoo.com> Message-ID: On 13 Dec 2005, at 21:35, Gary wrote: > Ben, > >>> 1.) Whether the -chromi fast diffing patch will include >> simultaneous >>> diff/upload (in which case KeepAlive is pointless). >> >> It doesn't at the moment, and won't in the next release. > > Ok, so we have to run with the KeepAlive version, then. Which > brings us > to the next issue: > >> Could we use a signal or something to throw an exception, >> and avoid the whole polling thing? > > With KeepAlive, we need to be able to not only interrupt the diffing > process (as in MaximumDiffingTime), but also resume it after a > KeepAlive command has been executed. I think the decision on how to > implement this best is up to you Ben, since it invasively affects the > core BoxBackup distribution. I think your approach is fine. We could discuss various code tidying, but where threads are undesirable setting boolean flags from timer signals and polling them in the main code is good enough. (although really you don't want to do anything more than setting a flag in the signal handler as they need to complete fast and can't call all OS functions: pThisCtxInst->DoKeepAlive(); I suspect does too much.) So... set a timer for min(timeout,keep-alive-due), then in that timer set a flag for the required action, then an activity due flag. Poll that flag during the diffing process, calling a function which does the necessary work, sets another timer, and returns an abort flag. I'm not sure anyone else will need the ability to do work within the process, so it may not be worth making a nice extensible interface with registered listeners. Charles is right about Windows. The basic low level Win32 API is much better than POSIX, and threads and I/O are handled very nicely, so it makes sense to use them there. Some UNIXes allow async IO (aio_* functions) but they're not widely supported, but if overlapped code should be written, maybe it could be used in a way which is "portable"? I would be unhappy about using threads in the POSIX versions. I know from painful experience that C++ and pthreads don't go well together on a few platforms due to non-thread-safe exception handling, although this may have been fixed now. Ben From boxbackup-dev at fluffy.co.uk Tue Dec 13 22:14:42 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Tue, 13 Dec 2005 22:14:42 +0000 Subject: [Box Backup-dev] Current status In-Reply-To: References: <20051213213511.15524.qmail@web36711.mail.mud.yahoo.com> Message-ID: <1134512082.15363.5.camel@avenin.ebourne.me.uk> On Tue, 2005-12-13 at 21:54 +0000, Ben Summers wrote: > I would be unhappy about using threads in the POSIX versions. I know > from painful experience that C++ and pthreads don't go well together > on a few platforms due to non-thread-safe exception handling, > although this may have been fixed now. C++ and pthreads work perfectly well on Linux, any recent Solaris, and I can't imagine they don't work on *BSD. There aren't many other interesting Unix variants left! As long as pthreads are only used to enhance box, and not implement core functionality, I'm in favour. No point restricting every posix platform to the lowest common denominator. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Tue Dec 13 22:18:07 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Tue, 13 Dec 2005 22:18:07 +0000 Subject: [Box Backup-dev] Current status In-Reply-To: <1134512082.15363.5.camel@avenin.ebourne.me.uk> References: <20051213213511.15524.qmail@web36711.mail.mud.yahoo.com> <1134512082.15363.5.camel@avenin.ebourne.me.uk> Message-ID: On 13 Dec 2005, at 22:14, Martin Ebourne wrote: > On Tue, 2005-12-13 at 21:54 +0000, Ben Summers wrote: >> I would be unhappy about using threads in the POSIX versions. I know >> from painful experience that C++ and pthreads don't go well together >> on a few platforms due to non-thread-safe exception handling, >> although this may have been fixed now. > > C++ and pthreads work perfectly well on Linux, any recent Solaris, > and I > can't imagine they don't work on *BSD. Used to not work on OpenBSD and NetBSD. Hopefully it's fixed now, but I think some of the archs are still dodgy. > There aren't many other > interesting Unix variants left! > > As long as pthreads are only used to enhance box, and not implement > core > functionality, I'm in favour. No point restricting every posix > platform > to the lowest common denominator. Absolutely. Note I also suggested using the aio_* functions! Ben From boxbackup-dev at fluffy.co.uk Wed Dec 14 06:58:15 2005 From: boxbackup-dev at fluffy.co.uk (Stefan Norlin) Date: Wed, 14 Dec 2005 07:58:15 +0100 Subject: [Box Backup-dev] Current status References: <20051213213511.15524.qmail@web36711.mail.mud.yahoo.com> <1134512082.15363.5.camel@avenin.ebourne.me.uk> Message-ID: <008701c6007b$c20fca70$1601060a@cs> Hi guys! >> C++ and pthreads work perfectly well on Linux, any recent Solaris, and I >> can't imagine they don't work on *BSD. > > Used to not work on OpenBSD and NetBSD. Hopefully it's fixed now, but I > think some of the archs are still dodgy. We have had big problems on *BSD with threads while in general we use pthreads heavily on Linux, Solaris and HP-UX. Check this quite interesting link out related to the topic (FreeBSD + MySQL + threads): http://jeremy.zawodny.com/blog/archives/000697.html From boxbackup-dev at fluffy.co.uk Wed Dec 14 07:19:59 2005 From: boxbackup-dev at fluffy.co.uk (Jonathan Morton) Date: Wed, 14 Dec 2005 07:19:59 +0000 Subject: [Box Backup-dev] Current status In-Reply-To: <008701c6007b$c20fca70$1601060a@cs> References: <20051213213511.15524.qmail@web36711.mail.mud.yahoo.com> <1134512082.15363.5.camel@avenin.ebourne.me.uk> <008701c6007b$c20fca70$1601060a@cs> Message-ID: <52EE80CF-D34E-4193-9803-D993A393295E@chromatix.uklinux.net> This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-4--528706681 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed >>> C++ and pthreads work perfectly well on Linux, any recent >>> Solaris, and I >>> can't imagine they don't work on *BSD. >> >> Used to not work on OpenBSD and NetBSD. Hopefully it's fixed now, >> but I think some of the archs are still dodgy. > > We have had big problems on *BSD with threads while in general we > use pthreads > heavily on Linux, Solaris and HP-UX. Worth noting is that MacOS X (a FreeBSD descendant) has very poor context-switching performance, including between threads in the same process. This shows up as a marked decrease in application performance when the number of active threads exceeds the number of CPUs. Linux is streets ahead in this matter, even without NPTL (Native POSIX Threads for Linux). However, I've seen nothing to suggest that threading is actually *broken* on any particular OS that I've had contact with, aside from Classic MacOS. -------------------------------------------------------------- from: Jonathan "Chromatix" Morton mail: chromi at chromatix.org.uk website: http://www.chromatix.uklinux.net/ tagline: The key to knowledge is not to rely on people to teach you it. --Apple-Mail-4--528706681 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iEYEARECAAYFAkOfx58ACgkQ6xAxI1ofIwqhbQCgoz0N2j1nAtZAbUtbhLSCR2tR E3YAoKS76GaZNp0bI0rCENISVcrk/KQi =umVJ -----END PGP SIGNATURE----- --Apple-Mail-4--528706681-- From boxbackup-dev at fluffy.co.uk Wed Dec 14 16:26:29 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 14 Dec 2005 16:26:29 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r222 - box/chris/win32 Message-ID: <20051214162629.0AAF393@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-14 16:26:24 +0000 (Wed, 14 Dec 2005) New Revision: 222 Added: box/chris/win32/0.08_plus_win32_final/ Removed: box/chris/win32/11-code-cleanups/ Log: * http://bbdev.fluffy.co.uk/svn/box/chris/win32/0.08_plus_win32_final - Renamed as part of tree cleanup Copied: box/chris/win32/0.08_plus_win32_final (from rev 221, box/chris/win32/11-code-cleanups) From boxbackup-dev at fluffy.co.uk Wed Dec 14 16:28:24 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 14 Dec 2005 16:28:24 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r223 - box/chris/win32 Message-ID: <20051214162824.4863693@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-14 16:28:18 +0000 (Wed, 14 Dec 2005) New Revision: 223 Removed: box/chris/win32/0-martins-original/ box/chris/win32/0-nicks-original/ box/chris/win32/09-removed-bcr-replace-file-with-dir/ box/chris/win32/1-line-endings/ box/chris/win32/10-removed-backports-from-0.09/ box/chris/win32/2-code-formatting/ box/chris/win32/3-removed-garys-patch/ box/chris/win32/4-removed-decrypt-filenames/ box/chris/win32/5-removed-housekeeping-update-from-0.09/ box/chris/win32/6-made-bbackupctl-syslogging-conditional/ box/chris/win32/7-removed-other-decrypt-filenames/ box/chris/win32/8-removed-bbackupquery-restore-i/ Log: Tree cleanup From boxbackup-dev at fluffy.co.uk Wed Dec 14 16:29:17 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 14 Dec 2005 16:29:17 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r224 - box/chris/win32 Message-ID: <20051214162917.E880993@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-14 16:29:12 +0000 (Wed, 14 Dec 2005) New Revision: 224 Added: box/chris/win32/0.08_bens_original/ Removed: box/chris/win32/0-bens-original-0.08/ Log: * http://bbdev.fluffy.co.uk/svn/box/chris/win32/0.08_bens_original - Tree cleanup Copied: box/chris/win32/0.08_bens_original (from rev 223, box/chris/win32/0-bens-original-0.08) From boxbackup-dev at fluffy.co.uk Wed Dec 14 16:30:34 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 14 Dec 2005 16:30:34 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r225 - box/chris/win32 Message-ID: <20051214163034.8316193@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-14 16:30:23 +0000 (Wed, 14 Dec 2005) New Revision: 225 Added: box/chris/win32/trunk_plus_win32_final/ Log: Tree cleanup Copied: box/chris/win32/trunk_plus_win32_final (from rev 224, box/chris/win32/merge/07-win32-fixes) From boxbackup-dev at fluffy.co.uk Wed Dec 14 16:31:04 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 14 Dec 2005 16:31:04 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r226 - box/chris/win32 Message-ID: <20051214163104.69EFF93@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-14 16:31:02 +0000 (Wed, 14 Dec 2005) New Revision: 226 Removed: box/chris/win32/merge/ Log: Tree cleanup From boxbackup-dev at fluffy.co.uk Wed Dec 14 16:34:20 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 14 Dec 2005 16:34:20 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r227 - box/chris Message-ID: <20051214163420.52F1593@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-14 16:34:10 +0000 (Wed, 14 Dec 2005) New Revision: 227 Added: box/chris/boxi/ Log: * http://bbdev.fluffy.co.uk/svn/box/chris/boxi - Created a branch for changes needed for Boxi (hope to merge eventually) Copied: box/chris/boxi (from rev 226, box/trunk) From boxbackup-dev at fluffy.co.uk Wed Dec 14 22:02:01 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 14 Dec 2005 22:02:01 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r228 - box/martin Message-ID: <20051214220201.D912593@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-14 22:02:00 +0000 (Wed, 14 Dec 2005) New Revision: 228 Removed: box/martin/test/ Log: Removing temporary branch From boxbackup-dev at fluffy.co.uk Wed Dec 14 22:27:36 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 14 Dec 2005 22:27:36 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r229 - in box/trunk: . bin/bbackupctl bin/bbackupd bin/bbackupobjdump bin/bbackupquery bin/bbstoreaccounts bin/bbstored infrastructure lib/backupclient lib/backupstore lib/common lib/compress lib/crypto lib/raidfile lib/server lib/win32 test/backupdiff test/backupstore test/backupstorefix test/backupstorepatch test/basicserver test/bbackupd test/common test/compress test/crypto test/raidfile Message-ID: <20051214222736.85EE693@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-14 22:27:32 +0000 (Wed, 14 Dec 2005) New Revision: 229 Modified: box/trunk/ box/trunk/bin/bbackupctl/ box/trunk/bin/bbackupd/ box/trunk/bin/bbackupobjdump/ box/trunk/bin/bbackupquery/ box/trunk/bin/bbstoreaccounts/ box/trunk/bin/bbstored/ box/trunk/infrastructure/ box/trunk/lib/backupclient/ box/trunk/lib/backupstore/ box/trunk/lib/common/ box/trunk/lib/compress/ box/trunk/lib/crypto/ box/trunk/lib/raidfile/ box/trunk/lib/server/ box/trunk/lib/win32/ box/trunk/test/backupdiff/ box/trunk/test/backupstore/ box/trunk/test/backupstorefix/ box/trunk/test/backupstorepatch/ box/trunk/test/basicserver/ box/trunk/test/bbackupd/ box/trunk/test/common/ box/trunk/test/compress/ box/trunk/test/crypto/ box/trunk/test/raidfile/ Log: Set svn:ignore on all dirs Property changes on: box/trunk ___________________________________________________________________ Name: svn:ignore + aclocal.m4 autom4te.cache config.log config.status configure debug ExceptionCodes.txt local Makefile parcels release Property changes on: box/trunk/bin/bbackupctl ___________________________________________________________________ Name: svn:ignore + Makefile Property changes on: box/trunk/bin/bbackupd ___________________________________________________________________ Name: svn:ignore + Makefile Property changes on: box/trunk/bin/bbackupobjdump ___________________________________________________________________ Name: svn:ignore + Makefile Property changes on: box/trunk/bin/bbackupquery ___________________________________________________________________ Name: svn:ignore + autogen_Documentation.cpp Makefile Property changes on: box/trunk/bin/bbstoreaccounts ___________________________________________________________________ Name: svn:ignore + Makefile Property changes on: box/trunk/bin/bbstored ___________________________________________________________________ Name: svn:ignore + autogen_BackupProtocolServer.cpp autogen_BackupProtocolServer.h Makefile Property changes on: box/trunk/infrastructure ___________________________________________________________________ Name: svn:ignore + BoxPlatform.pm Property changes on: box/trunk/lib/backupclient ___________________________________________________________________ Name: svn:ignore + autogen_BackupProtocolClient.cpp autogen_BackupProtocolClient.h autogen_BackupStoreException.cpp autogen_BackupStoreException.h Makefile Property changes on: box/trunk/lib/backupstore ___________________________________________________________________ Name: svn:ignore + Makefile Property changes on: box/trunk/lib/common ___________________________________________________________________ Name: svn:ignore + autogen_CommonException.cpp autogen_CommonException.h autogen_ConversionException.cpp autogen_ConversionException.h config.h config.h.in Makefile Property changes on: box/trunk/lib/compress ___________________________________________________________________ Name: svn:ignore + autogen_CompressException.cpp autogen_CompressException.h Makefile Property changes on: box/trunk/lib/crypto ___________________________________________________________________ Name: svn:ignore + autogen_CipherException.cpp autogen_CipherException.h Makefile Property changes on: box/trunk/lib/raidfile ___________________________________________________________________ Name: svn:ignore + autogen_RaidFileException.cpp autogen_RaidFileException.h Makefile Property changes on: box/trunk/lib/server ___________________________________________________________________ Name: svn:ignore + autogen_ConnectionException.cpp autogen_ConnectionException.h autogen_ServerException.cpp autogen_ServerException.h Makefile Property changes on: box/trunk/lib/win32 ___________________________________________________________________ Name: svn:ignore + Makefile Property changes on: box/trunk/test/backupdiff ___________________________________________________________________ Name: svn:ignore + _main.cpp Makefile _t _t-gdb Property changes on: box/trunk/test/backupstore ___________________________________________________________________ Name: svn:ignore + _main.cpp Makefile _t _t-gdb Property changes on: box/trunk/test/backupstorefix ___________________________________________________________________ Name: svn:ignore + _main.cpp Makefile _t _t-gdb Property changes on: box/trunk/test/backupstorepatch ___________________________________________________________________ Name: svn:ignore + _main.cpp Makefile _t _t-gdb Property changes on: box/trunk/test/basicserver ___________________________________________________________________ Name: svn:ignore + autogen_TestProtocolClient.cpp autogen_TestProtocolClient.h autogen_TestProtocolServer.cpp autogen_TestProtocolServer.h _main.cpp Makefile _t _t-gdb Property changes on: box/trunk/test/bbackupd ___________________________________________________________________ Name: svn:ignore + _main.cpp Makefile _t _t-gdb Property changes on: box/trunk/test/common ___________________________________________________________________ Name: svn:ignore + _main.cpp Makefile _t _t-gdb Property changes on: box/trunk/test/compress ___________________________________________________________________ Name: svn:ignore + _main.cpp Makefile _t _t-gdb Property changes on: box/trunk/test/crypto ___________________________________________________________________ Name: svn:ignore + _main.cpp Makefile _t _t-gdb Property changes on: box/trunk/test/raidfile ___________________________________________________________________ Name: svn:ignore + _main.cpp Makefile _t _t-gdb From boxbackup-dev at fluffy.co.uk Wed Dec 14 23:21:33 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Wed, 14 Dec 2005 23:21:33 +0000 Subject: [Box Backup-dev] COMMIT r229 - in box/trunk: . bin/bbackupctl bin/bbackupd bin/bbackupobjdump bin/bbackupquery bin/bbstoreaccounts bin/bbstored infrastructure lib/backupclient lib/backupstore lib/common lib/compress lib/crypto lib/raidfile lib/server lib/win32 test/backupdiff test/backupstore test/backupstorefix test/backupstorepatch test/basicserver test/bbackupd test/common test/compress test/crypto test/raidfile In-Reply-To: <20051214222736.85EE693@s0g0.pems.testserver.co.uk> References: <20051214222736.85EE693@s0g0.pems.testserver.co.uk> Message-ID: <1134602493.15783.21.camel@avenin.ebourne.me.uk> On Wed, 2005-12-14 at 22:27 +0000, subversion at fluffy.co.uk wrote: > Log: > Set svn:ignore on all dirs This means you can do 'svn st' on a built tree and not see any clutter. I may have missed some files, in which case I'll fix them when I see them. For reference, these are the commands I ran to set the flags: svn propset svn:ignore $'aclocal.m4\nautom4te.cache\nconfig.log\nconfig.status\nconfigure\ndebug\nExceptionCodes.txt\nlocal\nMakefile\nparcels\nrelease' . svn propset svn:ignore $'Makefile' bin/bbackupctl svn propset svn:ignore $'Makefile' bin/bbackupd svn propset svn:ignore $'Makefile' bin/bbackupobjdump svn propset svn:ignore $'autogen_Documentation.cpp\nMakefile' bin/bbackupquery svn propset svn:ignore $'Makefile' bin/bbstoreaccounts svn propset svn:ignore $'autogen_BackupProtocolServer.cpp\nautogen_BackupProtocolServer.h\nMakefile' bin/bbstored svn propset svn:ignore $'BoxPlatform.pm' infrastructure svn propset svn:ignore $'autogen_BackupProtocolClient.cpp\nautogen_BackupProtocolClient.h\nautogen_BackupStoreException.cpp\nautogen_BackupStoreException.h\nMakefile' lib/backupclient svn propset svn:ignore $'Makefile' lib/backupstore svn propset svn:ignore $'autogen_CommonException.cpp\nautogen_CommonException.h\nautogen_ConversionException.cpp\nautogen_ConversionException.h\nconfig.h\nconfig.h.in\nMakefile' lib/common svn propset svn:ignore $'autogen_CompressException.cpp\nautogen_CompressException.h\nMakefile' lib/compress svn propset svn:ignore $'autogen_CipherException.cpp\nautogen_CipherException.h\nMakefile' lib/crypto svn propset svn:ignore $'autogen_RaidFileException.cpp\nautogen_RaidFileException.h\nMakefile' lib/raidfile svn propset svn:ignore $'autogen_ConnectionException.cpp\nautogen_ConnectionException.h\nautogen_ServerException.cpp\nautogen_ServerException.h\nMakefile' lib/server svn propset svn:ignore $'Makefile' lib/win32 svn propset svn:ignore $'_main.cpp\nMakefile\n_t\n_t-gdb' test/backupdiff svn propset svn:ignore $'_main.cpp\nMakefile\n_t\n_t-gdb' test/backupstore svn propset svn:ignore $'_main.cpp\nMakefile\n_t\n_t-gdb' test/backupstorefix svn propset svn:ignore $'_main.cpp\nMakefile\n_t\n_t-gdb' test/backupstorepatch svn propset svn:ignore $'autogen_TestProtocolClient.cpp\nautogen_TestProtocolClient.h\nautogen_TestProtocolServer.cpp\nautogen_TestProtocolServer.h\n_main.cpp\nMakefile\n_t\n_t-gdb' test/basicserver svn propset svn:ignore $'_main.cpp\nMakefile\n_t\n_t-gdb' test/bbackupd svn propset svn:ignore $'_main.cpp\nMakefile\n_t\n_t-gdb' test/common svn propset svn:ignore $'_main.cpp\nMakefile\n_t\n_t-gdb' test/compress svn propset svn:ignore $'_main.cpp\nMakefile\n_t\n_t-gdb' test/crypto svn propset svn:ignore $'_main.cpp\nMakefile\n_t\n_t-gdb' test/raidfile Cheers, Martin. From boxbackup-dev at fluffy.co.uk Wed Dec 14 23:19:47 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 14 Dec 2005 23:19:47 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r230 - box/trunk/lib/common Message-ID: <20051214231947.35A4493@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-14 23:19:45 +0000 (Wed, 14 Dec 2005) New Revision: 230 Modified: box/trunk/lib/common/ConversionString.cpp Log: Fix assert on 64 bit Modified: box/trunk/lib/common/ConversionString.cpp =================================================================== --- box/trunk/lib/common/ConversionString.cpp 2005-12-14 22:27:32 UTC (rev 229) +++ box/trunk/lib/common/ConversionString.cpp 2005-12-14 23:19:45 UTC (rev 230) @@ -72,11 +72,17 @@ { case 32: { - // No extra checking needed, if this assert holds true - ASSERT(sizeof(long) == sizeof(int32_t)); + // No extra checking needed if long is an int32 + if(sizeof(long) > sizeof(int32_t)) + { + if(r <= (0 - 0x7fffffffL) || r > 0x7fffffffL) + { + THROW_EXCEPTION(ConversionException, IntOverflowInConvertFromString) + } + } + break; } - break; - + case 16: { if(r <= (0 - 0x7fff) || r > 0x7fff) From boxbackup-dev at fluffy.co.uk Wed Dec 14 23:47:48 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 14 Dec 2005 23:47:48 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r231 - box/chris/boxi/bin/bbackupquery Message-ID: <20051214234748.E203293@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-14 23:47:44 +0000 (Wed, 14 Dec 2005) New Revision: 231 Modified: box/chris/boxi/bin/bbackupquery/BackupQueries.cpp Log: * BackupQueries.cpp - Don't abort if the server sends back an error, but show error details instead Modified: box/chris/boxi/bin/bbackupquery/BackupQueries.cpp =================================================================== --- box/chris/boxi/bin/bbackupquery/BackupQueries.cpp 2005-12-14 23:19:45 UTC (rev 230) +++ box/chris/boxi/bin/bbackupquery/BackupQueries.cpp 2005-12-14 23:47:44 UTC (rev 231) @@ -333,16 +333,21 @@ return; } } - - // List it - List(rootDir, listRoot, opts, true /* first level to list */); + + try + { + // List it + List(rootDir, listRoot, opts, true /* first level to list */); + } catch (BoxException &e) { + printf("Error from server: %s\n", e.what()); + } } // -------------------------------------------------------------------------- // // Function -// Name: BackupQueries::CommandList2(int64_t, const std::string &, const bool *) +// Name: BackupQueries::List(int64_t, const std::string &, const bool *) // Purpose: Do the actual listing of directories and files // Created: 2003/10/10 // @@ -355,12 +360,30 @@ if(!opts[LIST_OPTION_ALLOWDELETED]) excludeFlags |= BackupProtocolClientListDirectory::Flags_Deleted; // Do communication - mrConnection.QueryListDirectory( + BackupProtocolClientListDirectory send( DirID, BackupProtocolClientListDirectory::Flags_INCLUDE_EVERYTHING, // both files and directories excludeFlags, true /* want attributes */); + try + { + mrConnection.Query(send); + } + catch (BoxException &e) + { + int type, subtype; + if (send.IsError(type, subtype) && + type == BackupProtocolClientError::ErrorType) + { + throw ConnectionException(subtype); + } + else + { + throw ConnectionException(e.GetSubType()); + } + } + // Retrieve the directory from the stream following BackupStoreDirectory dir; std::auto_ptr dirstream(mrConnection.ReceiveStream()); From boxbackup-dev at fluffy.co.uk Wed Dec 14 23:54:13 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 14 Dec 2005 23:54:13 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r232 - box/chris/boxi/bin/bbackupd Message-ID: <20051214235413.7885893@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-14 23:54:01 +0000 (Wed, 14 Dec 2005) New Revision: 232 Modified: box/chris/boxi/bin/bbackupd/BackupClientContext.cpp box/chris/boxi/bin/bbackupd/BackupClientContext.h box/chris/boxi/bin/bbackupd/BackupClientDirectoryRecord.cpp box/chris/boxi/bin/bbackupd/BackupClientDirectoryRecord.h box/chris/boxi/bin/bbackupd/BackupDaemon.cpp box/chris/boxi/bin/bbackupd/BackupDaemon.h Log: * bbackupd/BackupDaemon.h * bbackupd/BackupDaemon.cpp - Moved command socket management (connect, wait, disconnect) to a separate class, CommandSocketManager, to make it accessible from other classes (win32 stuff should be moved as well, but not tonight) * bbackupd/BackupClientContext.h * bbackupd/BackupClientContext.cpp - Use the LocationResolver interface to resolve paths to locations, making BackupClientContext independent of BackupDaemon * bbackupd/BackupClientDirectoryRecord.h * bbackupd/BackupClientDirectoryRecord.cpp - Use RunStatusProvider, SysadminNotifier and ProgressNotifier to report backup progress, making BackupClientDirectoryRecord independent of BackupDaemon - Use CommandSocketManager to process command socket commands during a backup run, allowing a sync to be stopped midway by bbackupctl on Unixes (thread does this on win32) Modified: box/chris/boxi/bin/bbackupd/BackupClientContext.cpp =================================================================== --- box/chris/boxi/bin/bbackupd/BackupClientContext.cpp 2005-12-14 23:47:44 UTC (rev 231) +++ box/chris/boxi/bin/bbackupd/BackupClientContext.cpp 2005-12-14 23:54:01 UTC (rev 232) @@ -33,9 +33,10 @@ // Created: 2003/10/08 // // -------------------------------------------------------------------------- -BackupClientContext::BackupClientContext(BackupDaemon &rDaemon, TLSContext &rTLSContext, const std::string &rHostname, - int32_t AccountNumber, bool ExtendedLogging) - : mrDaemon(rDaemon), +BackupClientContext::BackupClientContext(LocationResolver &rResolver, + TLSContext &rTLSContext, const std::string &rHostname, + int32_t AccountNumber, bool ExtendedLogging) + : mrResolver(rResolver), mrTLSContext(rTLSContext), mHostname(rHostname), mAccountNumber(AccountNumber), @@ -424,7 +425,8 @@ { // Location name -- look up in daemon's records std::string locPath; - if(!mrDaemon.FindLocationPathName(elementName.GetClearFilename(), locPath)) + if(!mrResolver.FindLocationPathName(elementName.GetClearFilename(), + locPath)) { // Didn't find the location... so can't give the local filename return false; Modified: box/chris/boxi/bin/bbackupd/BackupClientContext.h =================================================================== --- box/chris/boxi/bin/bbackupd/BackupClientContext.h 2005-12-14 23:47:44 UTC (rev 231) +++ box/chris/boxi/bin/bbackupd/BackupClientContext.h 2005-12-14 23:54:01 UTC (rev 232) @@ -26,6 +26,23 @@ // -------------------------------------------------------------------------- // // Class +// Name: LocationResolver +// Purpose: Interface for classes that can resolve locations to paths, +// like BackupDaemon +// Created: 2003/10/08 +// +// -------------------------------------------------------------------------- +class LocationResolver { + public: + virtual ~LocationResolver() { } + virtual bool FindLocationPathName(const std::string &rLocationName, + std::string &rPathOut) const = 0; +}; + + +// -------------------------------------------------------------------------- +// +// Class // Name: BackupClientContext // Purpose: // Created: 2003/10/08 @@ -34,8 +51,9 @@ class BackupClientContext { public: - BackupClientContext(BackupDaemon &rDaemon, TLSContext &rTLSContext, const std::string &rHostname, - int32_t AccountNumber, bool ExtendedLogging); + BackupClientContext(LocationResolver &rResolver, TLSContext &rTLSContext, + const std::string &rHostname, int32_t AccountNumber, + bool ExtendedLogging); ~BackupClientContext(); private: BackupClientContext(const BackupClientContext &); @@ -135,7 +153,7 @@ BackupStoreFilenameClear *pLeafname = 0); // not const as may connect to server private: - BackupDaemon &mrDaemon; + LocationResolver &mrResolver; TLSContext &mrTLSContext; std::string mHostname; int32_t mAccountNumber; @@ -153,4 +171,3 @@ #endif // BACKUPCLIENTCONTEXT__H - Modified: box/chris/boxi/bin/bbackupd/BackupClientDirectoryRecord.cpp =================================================================== --- box/chris/boxi/bin/bbackupd/BackupClientDirectoryRecord.cpp 2005-12-14 23:47:44 UTC (rev 231) +++ box/chris/boxi/bin/bbackupd/BackupClientDirectoryRecord.cpp 2005-12-14 23:54:01 UTC (rev 232) @@ -101,8 +101,14 @@ void BackupClientDirectoryRecord::SyncDirectory(BackupClientDirectoryRecord::SyncParams &rParams, int64_t ContainingDirectoryID, const std::string &rLocalPath, bool ThisDirHasJustBeenCreated) { + rParams.GetProgressNotifier().NotifyScanDirectory(this, rLocalPath); + + // Check for connections and commands on the command socket + if (rParams.mpCommandSocket) + rParams.mpCommandSocket->Wait(0); + // Signal received by daemon? - if(rParams.mrDaemon.StopRun()) + if(rParams.StopRun()) { // Yes. Stop now. THROW_EXCEPTION(BackupStoreException, SignalReceived) @@ -133,8 +139,8 @@ { // The directory has probably been deleted, so just ignore this error. // In a future scan, this deletion will be noticed, deleted from server, and this object deleted. - TRACE1("Stat failed for '%s' (directory)\n", - rLocalPath.c_str()); + rParams.GetProgressNotifier().NotifyDirStatFailed( + this, rLocalPath, strerror(errno)); return; } // Store inode number in map so directories are tracked in case they're renamed @@ -162,6 +168,7 @@ std::vector dirs; std::vector files; bool downloadDirectoryRecordBecauseOfFutureFiles = false; + // BLOCK { // read the contents... @@ -210,6 +217,10 @@ { // Report the error (logs and // eventual email to administrator) + rParams.GetProgressNotifier().NotifyFileStatFailed(this, + filename, strerror(errno)); + + // FIXME move to NotifyFileStatFailed() SetErrorWhenReadingFilesystemObject( rParams, filename.c_str()); @@ -268,8 +279,8 @@ // Log that this has happened if(!rParams.mHaveLoggedWarningAboutFutureFileTimes) { - ::syslog(LOG_ERR, "Some files have modification times excessively in the future. Check clock syncronisation.\n"); - ::syslog(LOG_ERR, "Example file (only one shown) : %s\n", filename.c_str()); + rParams.GetProgressNotifier().NotifyFileModifiedInFuture( + this, filename); rParams.mHaveLoggedWarningAboutFutureFileTimes = true; } } @@ -522,6 +533,8 @@ struct stat st; if(::lstat(filename.c_str(), &st) != 0) { + rParams.GetProgressNotifier().NotifyFileStatFailed(this, + filename, strerror(errno)); THROW_EXCEPTION(CommonException, OSFileError) } @@ -693,6 +706,8 @@ { // Connection errors should just be passed on to the main handler, retries // would probably just cause more problems. + rParams.GetProgressNotifier().NotifyFileUploadException(this, + filename, e); throw; } catch(BoxException &e) @@ -702,7 +717,8 @@ // Log it. SetErrorWhenReadingFilesystemObject(rParams, filename.c_str()); // Log error. - ::syslog(LOG_ERR, "Error code when uploading was (%d/%d), %s", e.GetType(), e.GetSubType(), e.what()); + rParams.GetProgressNotifier().NotifyFileUploadException(this, + filename, e); } // Update structures if the file was uploaded successfully. @@ -715,6 +731,11 @@ } } } + else + { + rParams.GetProgressNotifier().NotifyFileSkippedServerFull(this, + filename); + } } else if(en != 0 && en->GetAttributesHash() != attributesHash) { @@ -796,6 +817,9 @@ } } } + + rParams.GetProgressNotifier().NotifyFileSynchronised(this, filename, + fileSize); } // Erase contents of files to save space when recursing @@ -1070,6 +1094,8 @@ int64_t BackupClientDirectoryRecord::UploadFile(BackupClientDirectoryRecord::SyncParams &rParams, const std::string &rFilename, const BackupStoreFilename &rStoreFilename, int64_t FileSize, box_time_t ModificationTime, box_time_t AttributesHash, bool NoPreviousVersionOnServer) { + rParams.GetProgressNotifier().NotifyFileUploading(this, rFilename); + // Get the connection BackupProtocolClient &connection(rParams.mrContext.GetConnection()); @@ -1090,7 +1116,11 @@ if(diffFromID != 0) { - // Found an old version -- get the index + // Found an old version + rParams.GetProgressNotifier().NotifyFileUploadingPatch(this, + rFilename); + + // Get the index std::auto_ptr blockIndexStream(connection.ReceiveStream()); // Diff the file @@ -1139,7 +1169,7 @@ && subtype == BackupProtocolClientError::Err_StorageLimitExceeded) { // The hard limit was exceeded on the server, notify! - rParams.mrDaemon.NotifySysadmin(BackupDaemon::NotifyEvent_StoreFull); + rParams.NotifySysadmin(BackupDaemon::NotifyEvent_StoreFull); } } @@ -1147,6 +1177,8 @@ throw; } + rParams.GetProgressNotifier().NotifyFileUploaded(this, rFilename, FileSize); + // Return the new object ID of this file return objID; } @@ -1167,7 +1199,8 @@ ::memset(mStateChecksum, 0, sizeof(mStateChecksum)); // Log the error - ::syslog(LOG_ERR, "Backup object failed, error when reading %s", Filename); + rParams.GetProgressNotifier().NotifyFileReadFailed(this, + Filename, strerror(errno)); // Mark that an error occured in the parameters object rParams.mReadErrorsOnFilesystemObjects = true; @@ -1183,14 +1216,20 @@ // Created: 8/3/04 // // -------------------------------------------------------------------------- -BackupClientDirectoryRecord::SyncParams::SyncParams(BackupDaemon &rDaemon, BackupClientContext &rContext) - : mSyncPeriodStart(0), +BackupClientDirectoryRecord::SyncParams::SyncParams( + RunStatusProvider &rRunStatusProvider, + SysadminNotifier &rSysadminNotifier, + ProgressNotifier &rProgressNotifier, + BackupClientContext &rContext) + : mrRunStatusProvider(rRunStatusProvider), + mrSysadminNotifier(rSysadminNotifier), + mrProgressNotifier(rProgressNotifier), + mSyncPeriodStart(0), mSyncPeriodEnd(0), mMaxUploadWait(0), mMaxFileTimeInFuture(99999999999999999LL), mFileTrackingSizeThreshold(16*1024), mDiffingUploadSizeThreshold(16*1024), - mrDaemon(rDaemon), mrContext(rContext), mReadErrorsOnFilesystemObjects(false), mUploadAfterThisTimeInTheFuture(99999999999999999LL), @@ -1210,6 +1249,3 @@ BackupClientDirectoryRecord::SyncParams::~SyncParams() { } - - - Modified: box/chris/boxi/bin/bbackupd/BackupClientDirectoryRecord.h =================================================================== --- box/chris/boxi/bin/bbackupd/BackupClientDirectoryRecord.h 2005-12-14 23:47:44 UTC (rev 231) +++ box/chris/boxi/bin/bbackupd/BackupClientDirectoryRecord.h 2005-12-14 23:54:01 UTC (rev 232) @@ -20,10 +20,99 @@ class BackupClientContext; class BackupDaemon; +class CommandSocketManager; + // -------------------------------------------------------------------------- // // Class +// Name: RunStatusProvider +// Purpose: Provides a StopRun() method which returns true if the current +// backup should be halted. +// Created: 2005/11/15 +// +// -------------------------------------------------------------------------- +class RunStatusProvider +{ + public: + virtual ~RunStatusProvider() { } + virtual bool StopRun() = 0; +}; + +// -------------------------------------------------------------------------- +// +// Class +// Name: SysadminNotifier +// Purpose: Provides a NotifySysadmin() method to send mail to the sysadmin +// Created: 2005/11/15 +// +// -------------------------------------------------------------------------- +class SysadminNotifier +{ + public: + virtual ~SysadminNotifier() { } + virtual void NotifySysadmin(int Event) = 0; +}; + +// -------------------------------------------------------------------------- +// +// Class +// Name: ProgressNotifier +// Purpose: Provides methods for the backup library to inform the user +// interface about its progress with the backup +// Created: 2005/11/20 +// +// -------------------------------------------------------------------------- +class BackupClientDirectoryRecord; + +class ProgressNotifier +{ + public: + virtual ~ProgressNotifier() { } + virtual void NotifyScanDirectory( + const BackupClientDirectoryRecord* pDirRecord, + const std::string& rLocalPath) = 0; + virtual void NotifyDirStatFailed( + const BackupClientDirectoryRecord* pDirRecord, + const std::string& rLocalPath, + const std::string& rErrorMsg) = 0; + virtual void NotifyFileStatFailed( + const BackupClientDirectoryRecord* pDirRecord, + const std::string& rLocalPath, + const std::string& rErrorMsg) = 0; + virtual void NotifyFileReadFailed( + const BackupClientDirectoryRecord* pDirRecord, + const std::string& rLocalPath, + const std::string& rErrorMsg) = 0; + virtual void NotifyFileModifiedInFuture( + const BackupClientDirectoryRecord* pDirRecord, + const std::string& rLocalPath) = 0; + virtual void NotifyFileSkippedServerFull( + const BackupClientDirectoryRecord* pDirRecord, + const std::string& rLocalPath) = 0; + virtual void NotifyFileUploadException( + const BackupClientDirectoryRecord* pDirRecord, + const std::string& rLocalPath, + const BoxException& rException) = 0; + virtual void NotifyFileUploading( + const BackupClientDirectoryRecord* pDirRecord, + const std::string& rLocalPath) = 0; + virtual void NotifyFileUploadingPatch( + const BackupClientDirectoryRecord* pDirRecord, + const std::string& rLocalPath) = 0; + virtual void NotifyFileUploaded( + const BackupClientDirectoryRecord* pDirRecord, + const std::string& rLocalPath, + int64_t FileSize) = 0; + virtual void NotifyFileSynchronised( + const BackupClientDirectoryRecord* pDirRecord, + const std::string& rLocalPath, + int64_t FileSize) = 0; +}; + +// -------------------------------------------------------------------------- +// +// Class // Name: BackupClientDirectoryRecord // Purpose: Implementation of record about directory for backup client // Created: 2003/10/08 @@ -55,14 +144,21 @@ class SyncParams { public: - SyncParams(BackupDaemon &rDaemon, BackupClientContext &rContext); + SyncParams( + RunStatusProvider &rRunStatusProvider, + SysadminNotifier &rSysadminNotifier, + ProgressNotifier &rProgressNotifier, + BackupClientContext &rContext); ~SyncParams(); private: // No copying SyncParams(const SyncParams&); SyncParams &operator=(const SyncParams&); + RunStatusProvider &mrRunStatusProvider; + SysadminNotifier &mrSysadminNotifier; + ProgressNotifier &mrProgressNotifier; + public: - // Data members are public, as accessors are not justified here box_time_t mSyncPeriodStart; box_time_t mSyncPeriodEnd; @@ -70,13 +166,23 @@ box_time_t mMaxFileTimeInFuture; int32_t mFileTrackingSizeThreshold; int32_t mDiffingUploadSizeThreshold; - BackupDaemon &mrDaemon; BackupClientContext &mrContext; bool mReadErrorsOnFilesystemObjects; - + CommandSocketManager* mpCommandSocket; + // Member variables modified by syncing process box_time_t mUploadAfterThisTimeInTheFuture; bool mHaveLoggedWarningAboutFutureFileTimes; + + bool StopRun() { return mrRunStatusProvider.StopRun(); } + void NotifySysadmin(int Event) + { + mrSysadminNotifier.NotifySysadmin(Event); + } + ProgressNotifier& GetProgressNotifier() const + { + return mrProgressNotifier; + } }; void SyncDirectory(SyncParams &rParams, int64_t ContainingDirectoryID, const std::string &rLocalPath, @@ -111,5 +217,3 @@ }; #endif // BACKUPCLIENTDIRECTORYRECORD__H - - Modified: box/chris/boxi/bin/bbackupd/BackupDaemon.cpp =================================================================== --- box/chris/boxi/bin/bbackupd/BackupDaemon.cpp 2005-12-14 23:47:44 UTC (rev 231) +++ box/chris/boxi/bin/bbackupd/BackupDaemon.cpp 2005-12-14 23:54:01 UTC (rev 232) @@ -79,7 +79,7 @@ // // -------------------------------------------------------------------------- BackupDaemon::BackupDaemon() - : mState(BackupDaemon::State_Initialising), + : mState(State_Initialising), mpCommandSocketInfo(0), mDeleteUnusedRootDirEntriesAfter(0) { @@ -223,7 +223,7 @@ // Created: 18/2/04 // // -------------------------------------------------------------------------- -unsigned int WINAPI HelperThread( LPVOID lpParam ) +unsigned int cdecl HelperThread( LPVOID lpParam ) { printf( "Parameter = %lu.\n", *(DWORD*)lpParam ); ((BackupDaemon *)lpParam)->RunHelperThread(); @@ -285,15 +285,13 @@ else if(command == "sync") { // Sync now! - this->mDoSyncFlagOut = true; - this->mSyncIsForcedOut = false; + SetSyncRequested(); sendOK = true; } else if(command == "force-sync") { // Sync now (forced -- overrides any SyncAllowScript) - this->mDoSyncFlagOut = true; - this->mSyncIsForcedOut = true; + SetSyncForced(); sendOK = true; } else if(command == "reload") @@ -377,10 +375,8 @@ if(conf.KeyExists("CommandSocket")) { // Yes, create a local UNIX socket - mpCommandSocketInfo = new CommandSocketInfo; const char *socketName = conf.GetKeyValue("CommandSocket").c_str(); - ::unlink(socketName); - mpCommandSocketInfo->mListeningSocket.Listen(Socket::TypeUNIX, socketName); + mpCommandSocketInfo = new CommandSocketManager(conf, this, socketName); } #endif // WIN32 @@ -428,9 +424,10 @@ TLSContext tlsContext; const Configuration &conf(GetConfiguration()); std::string certFile(conf.GetKeyValue("CertificateFile")); - std::string keyFile(conf.GetKeyValue("PrivateKeyFile")); - std::string caFile(conf.GetKeyValue("TrustedCAsFile")); - tlsContext.Initialise(false /* as client */, certFile.c_str(), keyFile.c_str(), caFile.c_str()); + std::string keyFile (conf.GetKeyValue("PrivateKeyFile")); + std::string caFile (conf.GetKeyValue("TrustedCAsFile")); + tlsContext.Initialise(false /* as client */, certFile.c_str(), + keyFile.c_str(), caFile.c_str()); // Set up the keys for various things BackupClientCryptoKeys_Setup(conf.GetKeyValue("KeysFile").c_str()); @@ -476,8 +473,6 @@ { // Flags used below bool storageLimitExceeded = false; - bool doSync = false; - bool doSyncForcedByCommand = false; // Is a delay necessary? { @@ -501,7 +496,8 @@ if(mpCommandSocketInfo != 0) { // A command socket exists, so sleep by handling connections with it - WaitOnCommandSocket(requiredDelay, doSync, doSyncForcedByCommand); + TRACE1("Wait on command socket, delay = %lld\n", requiredDelay); + mpCommandSocketInfo->Wait(requiredDelay); } else { @@ -511,36 +507,45 @@ } } - } while((!automaticBackup || (currentTime < nextSyncTime)) && !doSync && !StopRun()); + } while((!automaticBackup || (currentTime < nextSyncTime)) + && !mSyncRequested && !mSyncForced && !StopRun()); } // Time of sync start, and if it's time for another sync (and we're doing automatic syncs), set the flag box_time_t currentSyncStartTime = GetCurrentBoxTime(); if(automaticBackup && currentSyncStartTime >= nextSyncTime) { - doSync = true; + mSyncRequested = true; } + bool doSync = mSyncForced; + // Use a script to see if sync is allowed now? - if(!doSyncForcedByCommand && doSync && !StopRun()) + if(mSyncRequested && !StopRun()) { int d = UseScriptToSeeIfSyncAllowed(); if(d > 0) { // Script has asked for a delay nextSyncTime = GetCurrentBoxTime() + SecondsToBoxTime((uint32_t)d); - doSync = false; } + else + { + doSync = true; + } } // Ready to sync? (but only if we're not supposed to be stopping) if(doSync && !StopRun()) { + mSyncRequested = false; + mSyncForced = false; + // Touch a file to record times in filesystem TouchFileInWorkingDir("last_sync_start"); // Tell anything connected to the command socket - SendSyncStartOrFinish(true /* start */); + mpCommandSocketInfo->SendSyncStartOrFinish(true /* start */); // Reset statistics on uploads BackupStoreFile::ResetStats(); @@ -581,13 +586,15 @@ conf.GetKeyValueInt("AccountNumber"), conf.GetKeyValueBool("ExtendedLogging")); // Set up the sync parameters - BackupClientDirectoryRecord::SyncParams params(*this, clientContext); + BackupClientDirectoryRecord::SyncParams params(*this, *this, + *this, clientContext); params.mSyncPeriodStart = syncPeriodStart; params.mSyncPeriodEnd = syncPeriodEndExtended; // use potentially extended end time params.mMaxUploadWait = maxUploadWait; params.mFileTrackingSizeThreshold = conf.GetKeyValueInt("FileTrackingSizeThreshold"); params.mDiffingUploadSizeThreshold = conf.GetKeyValueInt("DiffingUploadSizeThreshold"); params.mMaxFileTimeInFuture = SecondsToBoxTime((uint32_t)conf.GetKeyValueInt("MaxFileTimeInFuture")); + params.mpCommandSocket = mpCommandSocketInfo; // Set store marker clientContext.SetClientStoreMarker(clientStoreMarker); @@ -723,7 +730,22 @@ "to retry...", errorString, errorCode, errorSubCode); - ::sleep(10); + + // Sleep somehow. There are choices on how this should be + // done, depending on the state of the control connection + + if(mpCommandSocketInfo != 0) + { + // A command socket exists, so sleep by handling + // connections with it + mpCommandSocketInfo->Wait(100 * 1000 * 1000); + } + else + { + // No command socket or connection, just do a + // normal sleep + ::sleep(100); + } } } @@ -734,7 +756,7 @@ BackupStoreFile::ResetStats(); // Tell anything connected to the command socket - SendSyncStartOrFinish(false /* finish */); + mpCommandSocketInfo->SendSyncStartOrFinish(false /* finish */); // Touch a file to record times in filesystem TouchFileInWorkingDir("last_sync_finish"); @@ -820,288 +842,6 @@ } - -// -------------------------------------------------------------------------- -// -// Function -// Name: BackupDaemon::WaitOnCommandSocket(box_time_t, bool &, bool &) -// Purpose: Waits on a the command socket for a time of UP TO the required time -// but may be much less, and handles a command if necessary. -// Created: 18/2/04 -// -// -------------------------------------------------------------------------- -void BackupDaemon::WaitOnCommandSocket(box_time_t RequiredDelay, bool &DoSyncFlagOut, bool &SyncIsForcedOut) -{ -#ifdef WIN32 - // Really could use some interprocess protection, mutex etc - // any side effect should be too bad???? :) - DWORD timeout = BoxTimeToMilliSeconds(RequiredDelay); - - while ( this->mReceivedCommandConn == false ) - { - Sleep(1); - - if ( timeout == 0 ) - { - DoSyncFlagOut = false; - SyncIsForcedOut = false; - return; - } - timeout--; - } - this->mReceivedCommandConn = false; - DoSyncFlagOut = this->mDoSyncFlagOut; - SyncIsForcedOut = this->mSyncIsForcedOut; - - return; -#else // ! WIN32 - ASSERT(mpCommandSocketInfo != 0); - if(mpCommandSocketInfo == 0) {::sleep(1); return;} // failure case isn't too bad - - TRACE1("Wait on command socket, delay = %lld\n", RequiredDelay); - - try - { - // Timeout value for connections and things - int timeout = ((int)BoxTimeToMilliSeconds(RequiredDelay)) + 1; - // Handle bad boundary cases - if(timeout <= 0) timeout = 1; - if(timeout == INFTIM) timeout = 100000; - - // Wait for socket connection, or handle a command? - if(mpCommandSocketInfo->mpConnectedSocket.get() == 0) - { - // No connection, listen for a new one - mpCommandSocketInfo->mpConnectedSocket.reset(mpCommandSocketInfo->mListeningSocket.Accept(timeout).release()); - - if(mpCommandSocketInfo->mpConnectedSocket.get() == 0) - { - // If a connection didn't arrive, there was a timeout, which means we've - // waited long enough and it's time to go. - return; - } - else - { -#ifdef PLATFORM_CANNOT_FIND_PEER_UID_OF_UNIX_SOCKET - bool uidOK = true; - ::syslog(LOG_ERR, "On this platform, no security check can be made on the credientials of peers connecting to the command socket. (bbackupctl)"); -#else - // Security check -- does the process connecting to this socket have - // the same UID as this process? - bool uidOK = false; - // BLOCK - { - uid_t remoteEUID = 0xffff; - gid_t remoteEGID = 0xffff; - if(mpCommandSocketInfo->mpConnectedSocket->GetPeerCredentials(remoteEUID, remoteEGID)) - { - // Credentials are available -- check UID - if(remoteEUID == ::getuid()) - { - // Acceptable - uidOK = true; - } - } - } -#endif // PLATFORM_CANNOT_FIND_PEER_UID_OF_UNIX_SOCKET - - // Is this an acceptable connection? - if(!uidOK) - { - // Dump the connection - ::syslog(LOG_ERR, "Incoming command connection from peer had different user ID than this process, or security check could not be completed."); - mpCommandSocketInfo->mpConnectedSocket.reset(); - return; - } - else - { - // Log - ::syslog(LOG_INFO, "Connection from command socket"); - - // Send a header line summarising the configuration and current state - const Configuration &conf(GetConfiguration()); - char summary[256]; - int summarySize = sprintf(summary, "bbackupd: %d %d %d %d\nstate %d\n", - conf.GetKeyValueBool("AutomaticBackup"), - conf.GetKeyValueInt("UpdateStoreInterval"), - conf.GetKeyValueInt("MinimumFileAge"), - conf.GetKeyValueInt("MaxUploadWait"), - mState); - mpCommandSocketInfo->mpConnectedSocket->Write(summary, summarySize); - - // Set the timeout to something very small, so we don't wait too long on waiting - // for any incoming data - timeout = 10; // milliseconds - } - } - } - - // So there must be a connection now. - ASSERT(mpCommandSocketInfo->mpConnectedSocket.get() != 0); - - // Is there a getline object ready? - if(mpCommandSocketInfo->mpGetLine == 0) - { - // Create a new one - mpCommandSocketInfo->mpGetLine = new IOStreamGetLine(*(mpCommandSocketInfo->mpConnectedSocket.get())); - } - - // Ping the remote side, to provide errors which will mean the socket gets closed - mpCommandSocketInfo->mpConnectedSocket->Write("ping\n", 5); - - // Wait for a command or something on the socket - std::string command; - while(mpCommandSocketInfo->mpGetLine != 0 && !mpCommandSocketInfo->mpGetLine->IsEOF() - && mpCommandSocketInfo->mpGetLine->GetLine(command, false /* no preprocessing */, timeout)) - { - TRACE1("Receiving command '%s' over command socket\n", command.c_str()); - - bool sendOK = false; - bool sendResponse = true; - - // Command to process! - if(command == "quit" || command == "") - { - // Close the socket. - CloseCommandConnection(); - sendResponse = false; - } - else if(command == "sync") - { - // Sync now! - DoSyncFlagOut = true; - SyncIsForcedOut = false; - sendOK = true; - } - else if(command == "force-sync") - { - // Sync now (forced -- overrides any SyncAllowScript) - DoSyncFlagOut = true; - SyncIsForcedOut = true; - sendOK = true; - } - else if(command == "reload") - { - // Reload the configuration - SetReloadConfigWanted(); - sendOK = true; - } - else if(command == "terminate") - { - // Terminate the daemon cleanly - SetTerminateWanted(); - sendOK = true; - } - - // Send a response back? - if(sendResponse) - { - mpCommandSocketInfo->mpConnectedSocket->Write(sendOK?"ok\n":"error\n", sendOK?3:6); - } - - // Set timeout to something very small, so this just checks for data which is waiting - timeout = 1; - } - - // Close on EOF? - if(mpCommandSocketInfo->mpGetLine != 0 && mpCommandSocketInfo->mpGetLine->IsEOF()) - { - CloseCommandConnection(); - } - } - catch(...) - { - // If an error occurs, and there is a connection active, just close that - // connection and continue. Otherwise, let the error propagate. - if(mpCommandSocketInfo->mpConnectedSocket.get() == 0) - { - throw; - } - else - { - // Close socket and ignore error - CloseCommandConnection(); - } - } -#endif // WIN32 -} - - -// -------------------------------------------------------------------------- -// -// Function -// Name: BackupDaemon::CloseCommandConnection() -// Purpose: Close the command connection, ignoring any errors -// Created: 18/2/04 -// -// -------------------------------------------------------------------------- -void BackupDaemon::CloseCommandConnection() -{ - try - { - TRACE0("Closing command connection\n"); - -#ifdef WIN32 - mpCommandSocketInfo->mListeningSocket.Close(); -#else - if(mpCommandSocketInfo->mpGetLine) - { - delete mpCommandSocketInfo->mpGetLine; - mpCommandSocketInfo->mpGetLine = 0; - } - mpCommandSocketInfo->mpConnectedSocket.reset(); -#endif - } - catch(...) - { - // Ignore any errors - } -} - - -// -------------------------------------------------------------------------- -// -// File -// Name: BackupDaemon.cpp -// Purpose: Send a start or finish sync message to the command socket, if it's connected. -// -// Created: 18/2/04 -// -// -------------------------------------------------------------------------- -void BackupDaemon::SendSyncStartOrFinish(bool SendStart) -{ - // The bbackupctl program can't rely on a state change, because it may never - // change if the server doesn't need to be contacted. - - if (mpCommandSocketInfo != NULL && -#ifdef WIN32 - mpCommandSocketInfo->mListeningSocket.IsConnected() -#else - mpCommandSocketInfo->mpConnectedSocket.get() != 0 -#endif - ) - { - const char* message = SendStart ? "start-sync\n" : "finish-sync\n"; - try - { -#ifdef WIN32 - mpCommandSocketInfo->mListeningSocket.Write(message, - strlen(message)); -#else - mpCommandSocketInfo->mpConnectedSocket->Write(message, - strlen(message)); -#endif - } - catch(...) - { - CloseCommandConnection(); - } - } -} - - - - #ifndef HAVE_STRUCT_STATFS_F_MNTONNAME // string comparison ordering for when mount points are handled // by code, rather than the OS. @@ -1663,7 +1403,7 @@ // Created: 11/12/03 // // -------------------------------------------------------------------------- -void BackupDaemon::SetState(int State) +void BackupDaemon::SetState(state_t State) { // Two little checks if(State == mState) return; @@ -1679,6 +1419,11 @@ // If there's a command socket connected, then inform it -- disconnecting from the // command socket if there's an error + if (mpCommandSocketInfo != 0) + { + mpCommandSocketInfo->SendStateUpdate(mState); + } + char newState[64]; char newStateSize = sprintf(newState, "state %d\n", State); @@ -1864,35 +1609,3 @@ mpExcludeFiles = 0; } } - - -// -------------------------------------------------------------------------- -// -// Function -// Name: BackupDaemon::CommandSocketInfo::CommandSocketInfo() -// Purpose: Constructor -// Created: 18/2/04 -// -// -------------------------------------------------------------------------- -BackupDaemon::CommandSocketInfo::CommandSocketInfo() - : mpGetLine(0) -{ -} - - -// -------------------------------------------------------------------------- -// -// Function -// Name: BackupDaemon::CommandSocketInfo::~CommandSocketInfo() -// Purpose: Destructor -// Created: 18/2/04 -// -// -------------------------------------------------------------------------- -BackupDaemon::CommandSocketInfo::~CommandSocketInfo() -{ - if(mpGetLine) - { - delete mpGetLine; - mpGetLine = 0; - } -} Modified: box/chris/boxi/bin/bbackupd/BackupDaemon.h =================================================================== --- box/chris/boxi/bin/bbackupd/BackupDaemon.h 2005-12-14 23:47:44 UTC (rev 231) +++ box/chris/boxi/bin/bbackupd/BackupDaemon.h 2005-12-14 23:54:01 UTC (rev 232) @@ -15,18 +15,13 @@ #include #include "Daemon.h" -#include "BoxTime.h" -#include "Socket.h" -#include "SocketListen.h" -#include "SocketStream.h" -#include "WinNamedPipeStream.h" +#include "CommandSocketManager.h" +#include "BackupClientContext.h" +#include "BackupClientDirectoryRecord.h" -class BackupClientDirectoryRecord; -class BackupClientContext; class Configuration; class BackupClientInodeToIDMap; class ExcludeList; -class IOStreamGetLine; // -------------------------------------------------------------------------- // @@ -36,7 +31,8 @@ // Created: 2003/10/08 // // -------------------------------------------------------------------------- -class BackupDaemon : public Daemon +class BackupDaemon : public Daemon, CommandListener, LocationResolver, + RunStatusProvider, SysadminNotifier, ProgressNotifier { public: BackupDaemon(); @@ -50,20 +46,11 @@ virtual const char *DaemonBanner() const; const ConfigurationVerify *GetConfigVerify() const; - bool FindLocationPathName(const std::string &rLocationName, std::string &rPathOut) const; + bool FindLocationPathName(const std::string &rLocationName, + std::string &rPathOut) const; - enum - { - // Add stuff to this, make sure the textual equivalents in SetState() are changed too. - State_Initialising = -1, - State_Idle = 0, - State_Connected = 1, - State_Error = 2, - State_StorageLimitExceeded = 3 - }; + state_t GetState() {return mState;} - int GetState() {return mState;} - // Allow other classes to call this too enum { @@ -94,12 +81,8 @@ void MakeMapBaseName(unsigned int MountNumber, std::string &rNameOut) const; - void SetState(int State); + void SetState(state_t State); - void WaitOnCommandSocket(box_time_t RequiredDelay, bool &DoSyncFlagOut, bool &SyncIsForcedOut); - void CloseCommandConnection(); - void SendSyncStartOrFinish(bool SendStart); - void TouchFileInWorkingDir(const char *Filename); void DeleteUnusedRootDirEntries(BackupClientContext &rContext); @@ -111,7 +94,6 @@ int UseScriptToSeeIfSyncAllowed(); -private: class Location { public: @@ -129,7 +111,7 @@ ExcludeList *mpExcludeDirs; }; - int mState; // what the daemon is currently doing + state_t mState; // what the daemon is currently doing std::vector mLocations; @@ -137,28 +119,9 @@ std::vector mCurrentIDMaps; std::vector mNewIDMaps; - // For the command socket - class CommandSocketInfo - { - public: - CommandSocketInfo(); - ~CommandSocketInfo(); - private: - CommandSocketInfo(const CommandSocketInfo &); // no copying - CommandSocketInfo &operator=(const CommandSocketInfo &); - public: -#ifdef WIN32 - WinNamedPipeStream mListeningSocket; -#else - SocketListen mListeningSocket; - std::auto_ptr mpConnectedSocket; -#endif - IOStreamGetLine *mpGetLine; - }; - - // Using a socket? - CommandSocketInfo *mpCommandSocketInfo; - + // Using a socket? + CommandSocketManager *mpCommandSocketInfo; + // Stop notifications being repeated. bool mNotificationsSent[NotifyEvent__MAX + 1]; @@ -166,12 +129,81 @@ box_time_t mDeleteUnusedRootDirEntriesAfter; // time to delete them std::vector > mUnusedRootDirEntries; + bool mSyncRequested; + bool mSyncForced; + + void SetReloadConfigWanted() { this->Daemon::SetReloadConfigWanted(); } + void SetTerminateWanted() { this->Daemon::SetTerminateWanted(); } + void SetSyncRequested() { mSyncRequested = true; } + void SetSyncForced() { mSyncForced = true; } + + bool StopRun() { return this->Daemon::StopRun(); } + + /* ProgressNotifier implementation */ + virtual void NotifyScanDirectory( + const BackupClientDirectoryRecord* pDirRecord, + const std::string& rLocalPath) { } + virtual void NotifyDirStatFailed( + const BackupClientDirectoryRecord* pDirRecord, + const std::string& rLocalPath, + const std::string& rErrorMsg) + { + TRACE2("Stat failed for '%s' (directory): %s\n", + rLocalPath.c_str(), rErrorMsg.c_str()); + } + virtual void NotifyFileStatFailed( + const BackupClientDirectoryRecord* pDirRecord, + const std::string& rLocalPath, + const std::string& rErrorMsg) + { + TRACE1("Stat failed for '%s' (contents)\n", rLocalPath.c_str()); + } + virtual void NotifyFileReadFailed( + const BackupClientDirectoryRecord* pDirRecord, + const std::string& rLocalPath, + const std::string& rErrorMsg) + { + ::syslog(LOG_ERR, "Backup object failed, error when reading %s", + rLocalPath.c_str()); + } + virtual void NotifyFileModifiedInFuture( + const BackupClientDirectoryRecord* pDirRecord, + const std::string& rLocalPath) + { + ::syslog(LOG_ERR, "Some files have modification times " + "excessively in the future. Check clock syncronisation.\n"); + ::syslog(LOG_ERR, "Example file (only one shown) : %s\n", + rLocalPath.c_str()); + } + virtual void NotifyFileSkippedServerFull( + const BackupClientDirectoryRecord* pDirRecord, + const std::string& rLocalPath) { } + virtual void NotifyFileUploadException( + const BackupClientDirectoryRecord* pDirRecord, + const std::string& rLocalPath, + const BoxException& rException) + { + ::syslog(LOG_ERR, "Error code when uploading was (%d/%d), %s", + rException.GetType(), rException.GetSubType(), rException.what()); + } + virtual void NotifyFileUploading( + const BackupClientDirectoryRecord* pDirRecord, + const std::string& rLocalPath) { } + virtual void NotifyFileUploadingPatch( + const BackupClientDirectoryRecord* pDirRecord, + const std::string& rLocalPath) { } + virtual void NotifyFileUploaded( + const BackupClientDirectoryRecord* pDirRecord, + const std::string& rLocalPath, + int64_t FileSize) { } + virtual void NotifyFileSynchronised( + const BackupClientDirectoryRecord* pDirRecord, + const std::string& rLocalPath, + int64_t FileSize) { } + #ifdef WIN32 public: void RunHelperThread(void); - - private: - bool mDoSyncFlagOut, mSyncIsForcedOut, mReceivedCommandConn; #endif }; From boxbackup-dev at fluffy.co.uk Thu Dec 15 00:00:08 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 15 Dec 2005 00:00:08 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r233 - box/chris/boxi/bin/bbackupd Message-ID: <20051215000008.AADE693@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-15 00:00:02 +0000 (Thu, 15 Dec 2005) New Revision: 233 Added: box/chris/boxi/bin/bbackupd/CommandSocketManager.cpp box/chris/boxi/bin/bbackupd/CommandSocketManager.h Log: * CommandSocketManager.cpp * CommandSocketManager.h - Added new command socket manager class to Subversion Added: box/chris/boxi/bin/bbackupd/CommandSocketManager.cpp =================================================================== --- box/chris/boxi/bin/bbackupd/CommandSocketManager.cpp 2005-12-14 23:54:01 UTC (rev 232) +++ box/chris/boxi/bin/bbackupd/CommandSocketManager.cpp 2005-12-15 00:00:02 UTC (rev 233) @@ -0,0 +1,392 @@ +// distribution boxbackup-0.09 +// +// +// Copyright (c) 2003, 2004 +// Ben Summers. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All use of this software and associated advertising materials must +// display the following acknowledgement: +// This product includes software developed by Ben Summers. +// 4. The names of the Authors may not be used to endorse or promote +// products derived from this software without specific prior written +// permission. +// +// [Where legally impermissible the Authors do not disclaim liability for +// direct physical injury or death caused solely by defects in the software +// unless it is modified by a third party.] +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, +// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// +// +// -------------------------------------------------------------------------- +// +// File +// Name: CommandSocketManager.cpp +// Purpose: Implementation for command socket management interface +// Created: 2005/04/08 +// +// -------------------------------------------------------------------------- + +#include + +#include "Box.h" +#include "IOStreamGetLine.h" +#include "CommandSocketManager.h" + +// -------------------------------------------------------------------------- +// +// Function +// Name: CommandSocketManager::CommandSocketManager() +// Purpose: Constructor +// Created: 18/2/04 +// +// -------------------------------------------------------------------------- +CommandSocketManager::CommandSocketManager( + const Configuration& rConf, + CommandListener* pListener, + const char * pSocketName) + : mpGetLine(0), + mConf(rConf), + mState(State_Initialising) +{ + mpListener = pListener; + ::unlink(pSocketName); + mListeningSocket.Listen(Socket::TypeUNIX, pSocketName); +} + + +// -------------------------------------------------------------------------- +// +// Function +// Name: BackupDaemon::CommandSocketInfo::~CommandSocketInfo() +// Purpose: Destructor +// Created: 18/2/04 +// +// -------------------------------------------------------------------------- +CommandSocketManager::~CommandSocketManager() +{ + if (mpConnectedSocket.get() != 0) + { + CloseConnection(); + } +} + +// -------------------------------------------------------------------------- +// +// Function +// Name: CommandSocketManager::Wait(box_time_t, bool &, bool &) +// Purpose: Waits on a the command socket for a time of UP TO the required time +// but may be much less, and handles a command if necessary. +// Created: 18/2/04 +// +// -------------------------------------------------------------------------- + +void CommandSocketManager::Wait(box_time_t RequiredDelay) +{ +#ifdef WIN32 + // Another thread is listening on the command socket, + // no need for us to do anything here. + DWORD timeout = BoxTimeToMilliSeconds(RequiredDelay); + + if (timeout > 0) + { + Sleep(timeout); + } +#else // !WIN32 + TRACE1("Wait on command socket, delay = %lld\n", RequiredDelay); + + try + { + // Timeout value for connections and things + int timeout = ((int)BoxTimeToMilliSeconds(RequiredDelay)); + // Handle bad boundary cases + if(timeout <= 0) timeout = 1; + if(timeout == INFTIM) timeout = 100000; + + // Wait for socket connection, or handle a command? + if(mpConnectedSocket.get() == 0) + { + // No connection, listen for a new one + mpConnectedSocket.reset(mListeningSocket.Accept(timeout).release()); + + if(mpConnectedSocket.get() == 0) + { + // If a connection didn't arrive, there was a timeout, + // which means we've waited long enough and it's time to go. + return; + } + else + { +#ifdef PLATFORM_CANNOT_FIND_PEER_UID_OF_UNIX_SOCKET + bool uidOK = true; + ::syslog(LOG_ERR, "On this platform, no security check " + "can be made on the credientials of peers connecting " + "to the command socket. (bbackupctl)"); +#else + // Security check -- does the process connecting + // to this socket have the same UID as this process? + bool uidOK = false; + // BLOCK + { + uid_t remoteEUID = 0xffff; + gid_t remoteEGID = 0xffff; + if(mpConnectedSocket->GetPeerCredentials(remoteEUID, + remoteEGID)) + { + // Credentials are available -- check UID + if(remoteEUID == ::getuid()) + { + // Acceptable + uidOK = true; + } + } + } +#endif // PLATFORM_CANNOT_FIND_PEER_UID_OF_UNIX_SOCKET + + // Is this an acceptible connection? + if(!uidOK) + { + // Dump the connection + ::syslog(LOG_ERR, "Incoming command connection from peer " + "had different user ID than this process, or security " + "check could not be completed."); + mpConnectedSocket.reset(); + return; + } + + // Log + ::syslog(LOG_INFO, "Incoming connection to command socket"); + TRACE0("Accepted new command connection\n"); + + // Send a header line summarising the configuration and current state + char summary[256]; + int summarySize = sprintf(summary, "bbackupd: %d %d %d %d\n" + "state %d\n", + mConf.GetKeyValueBool("AutomaticBackup"), + mConf.GetKeyValueInt("UpdateStoreInterval"), + mConf.GetKeyValueInt("MinimumFileAge"), + mConf.GetKeyValueInt("MaxUploadWait"), + mState); + mpConnectedSocket->Write(summary, summarySize); + + // Set the timeout to something very small, so we don't + // spend too long on waiting for any incoming data + timeout = 10; // milliseconds + } + } + + // So there must be a connection now. + ASSERT(mpConnectedSocket.get() != 0); + + // Is there a getline object ready? + if(mpGetLine == 0) + { + // Create a new one + mpGetLine = new IOStreamGetLine(*(mpConnectedSocket.get())); + } + + // Ping the remote side, to provide errors which will mean the socket gets closed + // Don't do this if the timeout requested was zero, as we don't want + // to flood the connection during background polling + if (RequiredDelay > 0) + mpConnectedSocket->Write("ping\n", 5); + + // Wait for a command or something on the socket + std::string command; + while(mpGetLine != 0 && !mpGetLine->IsEOF() + && mpGetLine->GetLine(command, false /* no preprocessing */, timeout)) + { + TRACE1("Receiving command '%s' over command socket\n", command.c_str()); + + bool sendOK = false; + bool sendResponse = true; + + // Command to process! + if(command == "quit" || command == "") + { + // Close the socket. + CloseConnection(); + sendResponse = false; + } + else if(command == "sync") + { + // Sync now! + mpListener->SetSyncRequested(); + sendOK = true; + } + else if(command == "force-sync") + { + // Sync now (forced -- overrides any SyncAllowScript) + mpListener->SetSyncForced(); + sendOK = true; + } + else if(command == "reload") + { + // Reload the configuration + mpListener->SetReloadConfigWanted(); + sendOK = true; + } + else if(command == "terminate") + { + // Terminate the daemon cleanly + mpListener->SetTerminateWanted(); + sendOK = true; + } + + // Send a response back? + if(sendResponse) + { + mpConnectedSocket->Write(sendOK?"ok\n":"error\n", sendOK?3:6); + } + + // Set timeout to something very small, + // so this just checks for data which is waiting + timeout = 1; + } + + // Close on EOF? + if(mpGetLine != 0 && mpGetLine->IsEOF()) + { + CloseConnection(); + } + } + catch(...) + { + // If an error occurs, and there is a connection active, just close that + // connection and continue. Otherwise, let the error propagate. + if(mpConnectedSocket.get() == 0) + { + throw; + } + else + { + // Close socket and ignore error + CloseConnection(); + } + } +#endif // WIN32 +} + + +// -------------------------------------------------------------------------- +// +// Function +// Name: CommandSocketManager::CloseConnection() +// Purpose: Close the command connection, ignoring any errors +// Created: 18/2/04 +// +// -------------------------------------------------------------------------- +void CommandSocketManager::CloseConnection() +{ + try + { + TRACE0("Closing command connection\n"); + +#ifdef WIN32 + mListeningSocket.Close(); +#else + if(mpGetLine) + { + delete mpGetLine; + mpGetLine = 0; + } + mpConnectedSocket.reset(); +#endif + } + catch(...) + { + // Ignore any errors + } +} + + +// -------------------------------------------------------------------------- +// +// Function +// Name: CommandSocketManager::SendSyncStartOrFinish(bool sendStart) +// Purpose: Send a message to any connected client when a sync starts or +// finishes. +// Created: 18/2/04 +// +// -------------------------------------------------------------------------- +void CommandSocketManager::SendSyncStartOrFinish(bool SendStart) +{ + // The bbackupctl program can't rely on a state change, because it may never + // change if the server doesn't need to be contacted. + +#ifdef WIN32 + if (mListeningSocket.IsConnected()) +#else + if (mpConnectedSocket.get() != 0) +#endif + { + const char* message = SendStart ? "start-sync\n" : "finish-sync\n"; + + try + { +#ifdef WIN32 + mListeningSocket.Write(message, strlen(message)); +#else + mpConnectedSocket->Write(message, strlen(message)); +#endif + } + catch(...) + { + CloseConnection(); + } + } +} + +void CommandSocketManager::SendStateUpdate(state_t State) +{ + mState = State; + + // If there's a command socket connected, then inform it -- + // disconnecting from the command socket if there's an error + +#ifdef WIN32 + #warning FIX ME: race condition + // what happens if the socket is closed by the other thread before + // we can write to it? Null pointer deref at best. + if (mListeningSocket.IsConnected()) + return; +#else + if(mpConnectedSocket.get() == 0) + return; +#endif + + // Something connected to the command socket, tell it about the new state + char newState[64]; + char newStateSize = sprintf(newState, "state %d\n", State); + try + { +#ifdef WIN32 + mListeningSocket.Write(newState, newStateSize); +#else + mpConnectedSocket->Write(newState, newStateSize); +#endif + } + catch(...) + { + CloseConnection(); + } +} Added: box/chris/boxi/bin/bbackupd/CommandSocketManager.h =================================================================== --- box/chris/boxi/bin/bbackupd/CommandSocketManager.h 2005-12-14 23:54:01 UTC (rev 232) +++ box/chris/boxi/bin/bbackupd/CommandSocketManager.h 2005-12-15 00:00:02 UTC (rev 233) @@ -0,0 +1,74 @@ +// -------------------------------------------------------------------------- +// +// File +// Name: CommandSocketManager.h +// Purpose: Interface for managing command socket and processing +// client commands +// Created: 2003/10/08 +// +// -------------------------------------------------------------------------- + +#ifndef COMMANDSOCKETMANAGER__H +#define COMMANDSOCKETMANAGER__H + +#include "BoxTime.h" +#include "Configuration.h" +#include "Socket.h" +#include "SocketListen.h" +#include "SocketStream.h" +#include "WinNamedPipeStream.h" + +typedef enum +{ + // Add stuff to this, make sure the textual equivalents + // in BackupDaemon::SetState() are changed too. + State_Initialising = -1, + State_Idle = 0, + State_Connected = 1, + State_Error = 2, + State_StorageLimitExceeded = 3 +} state_t; + +class IOStreamGetLine; + +class CommandListener +{ + public: + virtual ~CommandListener() { } + virtual void SetReloadConfigWanted() = 0; + virtual void SetTerminateWanted() = 0; + virtual void SetSyncRequested() = 0; + virtual void SetSyncForced() = 0; +}; + +class CommandSocketManager +{ +public: + CommandSocketManager( + const Configuration& rConf, + CommandListener* pListener, + const char * pSocketName); + ~CommandSocketManager(); + void Wait(box_time_t RequiredDelay); + void CloseConnection(); + void SendSyncStartOrFinish(bool SendStart); + void SendStateUpdate(state_t newState); + +private: + CommandSocketManager(const CommandSocketManager &); // no copying + CommandSocketManager &operator=(const CommandSocketManager &); + +#ifdef WIN32 + WinNamedPipeStream mListeningSocket; +#else + SocketListen mListeningSocket; + std::auto_ptr mpConnectedSocket; +#endif + + IOStreamGetLine *mpGetLine; + CommandListener* mpListener; + Configuration mConf; + state_t mState; +}; + +#endif // COMMANDSOCKETMANAGER__H From boxbackup-dev at fluffy.co.uk Thu Dec 15 01:02:56 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Thu, 15 Dec 2005 01:02:56 +0000 Subject: [Box Backup-dev] COMMIT r233 - box/chris/boxi/bin/bbackupd In-Reply-To: <20051215000008.AADE693@s0g0.pems.testserver.co.uk> References: <20051215000008.AADE693@s0g0.pems.testserver.co.uk> Message-ID: <1134608577.15783.25.camel@avenin.ebourne.me.uk> On Thu, 2005-12-15 at 00:00 +0000, subversion at fluffy.co.uk wrote: > Author: chris > Date: 2005-12-15 00:00:02 +0000 (Thu, 15 Dec 2005) > New Revision: 233 > > Added: > box/chris/boxi/bin/bbackupd/CommandSocketManager.cpp > box/chris/boxi/bin/bbackupd/CommandSocketManager.h > Log: > * CommandSocketManager.cpp > * CommandSocketManager.h > - Added new command socket manager class to Subversion > > > Added: box/chris/boxi/bin/bbackupd/CommandSocketManager.cpp > =================================================================== > --- box/chris/boxi/bin/bbackupd/CommandSocketManager.cpp 2005-12-14 23:54:01 UTC (rev 232) > +++ box/chris/boxi/bin/bbackupd/CommandSocketManager.cpp 2005-12-15 00:00:02 UTC (rev 233) > @@ -0,0 +1,392 @@ > +// distribution boxbackup-0.09 > +// > +// > +// Copyright (c) 2003, 2004 > +// Ben Summers. All rights reserved. > +// Chris, You may already know, but if not, watch out for those copyright headers sneaking in! Cheers, Martin. From boxbackup-dev at fluffy.co.uk Thu Dec 15 01:05:40 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Thu, 15 Dec 2005 01:05:40 +0000 Subject: [Box Backup-dev] ASSERT Message-ID: <1134608740.15783.28.camel@avenin.ebourne.me.uk> This assert is false on x86_64: box_time_t GetCurrentBoxTime() { ASSERT(sizeof(uint32_t) == sizeof(time_t)); return SecondsToBoxTime((uint32_t)time(0)); } Are there any gotchas it is protecting? Just removing it looks plausible to me. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Thu Dec 15 01:06:47 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Thu, 15 Dec 2005 01:06:47 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r233 - box/chris/boxi/bin/bbackupd In-Reply-To: <1134608577.15783.25.camel@avenin.ebourne.me.uk> References: <20051215000008.AADE693@s0g0.pems.testserver.co.uk> <1134608577.15783.25.camel@avenin.ebourne.me.uk> Message-ID: Hi Martin, > You may already know, but if not, watch out for those copyright headers > sneaking in! Spot the deliberate mistake to see who's paying attention at 1am. :-) Cheers, chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Thu Dec 15 00:17:26 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 15 Dec 2005 00:17:26 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r234 - box/chris/boxi/bin/bbackupd Message-ID: <20051215001726.6FDEF93@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-15 00:17:22 +0000 (Thu, 15 Dec 2005) New Revision: 234 Modified: box/chris/boxi/bin/bbackupd/CommandSocketManager.cpp Log: * CommandSocketManager.cpp - Removed copyright header (thanks Martin! :?\194?\172) Modified: box/chris/boxi/bin/bbackupd/CommandSocketManager.cpp =================================================================== --- box/chris/boxi/bin/bbackupd/CommandSocketManager.cpp 2005-12-15 00:00:02 UTC (rev 233) +++ box/chris/boxi/bin/bbackupd/CommandSocketManager.cpp 2005-12-15 00:17:22 UTC (rev 234) @@ -1,42 +1,3 @@ -// distribution boxbackup-0.09 -// -// -// Copyright (c) 2003, 2004 -// Ben Summers. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. All use of this software and associated advertising materials must -// display the following acknowledgement: -// This product includes software developed by Ben Summers. -// 4. The names of the Authors may not be used to endorse or promote -// products derived from this software without specific prior written -// permission. -// -// [Where legally impermissible the Authors do not disclaim liability for -// direct physical injury or death caused solely by defects in the software -// unless it is modified by a third party.] -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// -// // -------------------------------------------------------------------------- // // File From boxbackup-dev at fluffy.co.uk Thu Dec 15 00:40:37 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 15 Dec 2005 00:40:37 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r235 - box/chris/boxi/bin/bbstored Message-ID: <20051215004037.0819B93@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-15 00:40:32 +0000 (Thu, 15 Dec 2005) New Revision: 235 Modified: box/chris/boxi/bin/bbstored/BackupCommands.cpp box/chris/boxi/bin/bbstored/backupprotocol.txt Log: * BackupCommands.cpp - Catch RaidFileExceptions and send an appropriate error back to the client, rather than aborting the connection Modified: box/chris/boxi/bin/bbstored/BackupCommands.cpp =================================================================== --- box/chris/boxi/bin/bbstored/BackupCommands.cpp 2005-12-15 00:17:22 UTC (rev 234) +++ box/chris/boxi/bin/bbstored/BackupCommands.cpp 2005-12-15 00:40:32 UTC (rev 235) @@ -12,6 +12,7 @@ #include #include "autogen_BackupProtocolServer.h" +#include "autogen_RaidFileException.h" #include "BackupConstants.h" #include "BackupContext.h" #include "CollectInBufferStream.h" @@ -156,18 +157,31 @@ CHECK_PHASE(Phase_Commands) // Ask the context for a directory - const BackupStoreDirectory &rdir(rContext.GetDirectory(mObjectID)); + try { + const BackupStoreDirectory &rdir( + rContext.GetDirectory(mObjectID)); - // Store the listing to a stream - std::auto_ptr stream(new CollectInBufferStream); - rdir.WriteToStream(*stream, mFlagsMustBeSet, mFlagsNotToBeSet, mSendAttributes, - false /* never send dependency info to the client */); - stream->SetForReading(); + // Store the listing to a stream + std::auto_ptr stream( + new CollectInBufferStream); + rdir.WriteToStream(*stream, mFlagsMustBeSet, + mFlagsNotToBeSet, mSendAttributes, + false /* never send dependency info to the client */); + stream->SetForReading(); - // Get the protocol to send the stream - rProtocol.SendStreamAfterCommand(stream.release()); + // Get the protocol to send the stream + rProtocol.SendStreamAfterCommand(stream.release()); - return std::auto_ptr(new BackupProtocolServerSuccess(mObjectID)); + return std::auto_ptr( + new BackupProtocolServerSuccess(mObjectID)); + } catch (RaidFileException &e) { + return std::auto_ptr( + new BackupProtocolServerError( + BackupProtocolServerError::ErrorType, + BackupProtocolServerError::Err_RaidFileDoesntExist + ) + ); + } } // -------------------------------------------------------------------------- Modified: box/chris/boxi/bin/bbstored/backupprotocol.txt =================================================================== --- box/chris/boxi/bin/bbstored/backupprotocol.txt 2005-12-15 00:17:22 UTC (rev 234) +++ box/chris/boxi/bin/bbstored/backupprotocol.txt 2005-12-15 00:40:32 UTC (rev 235) @@ -39,6 +39,7 @@ CONSTANT Err_DiffFromFileDoesNotExist 12 CONSTANT Err_DoesNotExistInDirectory 13 CONSTANT Err_PatchConsistencyError 14 + CONSTANT Err_RaidFileDoesntExist 15 Version 1 Command(Version) Reply int32 Version From boxbackup-dev at fluffy.co.uk Thu Dec 15 00:41:20 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 15 Dec 2005 00:41:20 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r236 - box/chris/boxi/lib/common Message-ID: <20051215004120.E860A93@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-15 00:41:19 +0000 (Thu, 15 Dec 2005) New Revision: 236 Modified: box/chris/boxi/lib/common/DebugMemLeakFinder.cpp Log: * DebugMemLeakFinder.cpp - Avoid buffer overflow on memory leaks when code compiled in debug mode Modified: box/chris/boxi/lib/common/DebugMemLeakFinder.cpp =================================================================== --- box/chris/boxi/lib/common/DebugMemLeakFinder.cpp 2005-12-15 00:40:32 UTC (rev 235) +++ box/chris/boxi/lib/common/DebugMemLeakFinder.cpp 2005-12-15 00:41:19 UTC (rev 236) @@ -180,7 +180,9 @@ } else { - sNotLeaksPre[sNotLeaksPreNum++] = ptr; + if ( sNotLeaksPreNum < + (unsigned)( sizeof(sNotLeaksPre)/sizeof(*sNotLeaksPre) ) ) + sNotLeaksPre[sNotLeaksPreNum++] = ptr; } /* { std::map::iterator i(sMallocBlocks.find(ptr)); From boxbackup-dev at fluffy.co.uk Thu Dec 15 00:42:13 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 15 Dec 2005 00:42:13 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r237 - box/chris/boxi/lib/server Message-ID: <20051215004213.AACC593@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-15 00:42:11 +0000 (Thu, 15 Dec 2005) New Revision: 237 Modified: box/chris/boxi/lib/server/ConnectionException.txt Log: * ConnectionException.txt - Updated description of TLSReadFailed Modified: box/chris/boxi/lib/server/ConnectionException.txt =================================================================== --- box/chris/boxi/lib/server/ConnectionException.txt 2005-12-15 00:41:19 UTC (rev 236) +++ box/chris/boxi/lib/server/ConnectionException.txt 2005-12-15 00:42:11 UTC (rev 237) @@ -10,7 +10,7 @@ TLSHandshakeFailed 30 TLSShutdownFailed 32 TLSWriteFailed 33 Probably a network issue between client and server. -TLSReadFailed 34 Probably a network issue between client and server. +TLSReadFailed 34 Probably a network issue between client and server, or account corrupted on server. TLSNoPeerCertificate 36 TLSPeerCertificateInvalid 37 Check certification process TLSClosedWhenWriting 38 From boxbackup-dev at fluffy.co.uk Thu Dec 15 00:47:19 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 15 Dec 2005 00:47:19 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r238 - box/chris/boxi/infrastructure Message-ID: <20051215004719.BFAEC93@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-15 00:47:17 +0000 (Thu, 15 Dec 2005) New Revision: 238 Modified: box/chris/boxi/infrastructure/makeparcels.pl Log: * makeparcels.pl - Experimental changes to add a real "clean" target and suppress unnecessary rebuilds of the parcel files Modified: box/chris/boxi/infrastructure/makeparcels.pl =================================================================== --- box/chris/boxi/infrastructure/makeparcels.pl 2005-12-15 00:42:11 UTC (rev 237) +++ box/chris/boxi/infrastructure/makeparcels.pl 2005-12-15 00:47:17 UTC (rev 238) @@ -86,13 +86,18 @@ print MAKE "all:\t",join(' ',map {parcel_target($_)} @parcels),"\n\n"; -print MAKE "clean:\n"; +print MAKE "clean-parcels:\n"; for my $parcel (@parcels) { print MAKE "\trm -rf ",parcel_dir($parcel),"\n"; print MAKE "\trm -f ",parcel_target($parcel),"\n"; } + print MAKE "\n"; +print MAKE "clean:\tclean-parcels\n"; +print MAKE "\tfind . -name '*.o' | xargs -r rm\n"; +print MAKE "\tfind . -name '*.a' | xargs -r rm\n"; +print MAKE "\n"; print MAKE "test:\trelease/common/test\n\nrelease/common/test:\n\t./runtest.pl ALL release\n\n"; @@ -100,13 +105,32 @@ for my $parcel (@parcels) { + my @parcel_deps; + + for (@{$parcel_contents{$parcel}}) + { + my ($type,$name) = split /\s+/; + if($type eq 'bin') + { + push @parcel_deps, $name.$platform_exe_ext; + print MAKE "$name:\n" . + "\t(cd bin/$name; $make_command $release_flag)\n\n"; + } + elsif ($type eq 'script') + { + push @parcel_deps, $name; + } + } + my $target = parcel_target($parcel); - print MAKE $target,":\n"; - + print MAKE $target,": @parcel_deps\n"; + my $dir = parcel_dir($parcel); - print MAKE "\tmkdir $dir\n"; + print MAKE "\tmkdir -p $dir\n"; - open SCRIPT,">parcels/scripts/install-$parcel" or die "Can't open installer script for $parcel for writing"; + open SCRIPT,">parcels/scripts/install-$parcel" + or die "Can't open installer script for $parcel for writing"; + print SCRIPT "#!/bin/sh\n\n"; for(@{$parcel_contents{$parcel}}) @@ -118,16 +142,19 @@ my $exeext = $platform_exe_ext; print MAKE "\t(cd bin/$name; \$(MAKE) $release_flag)\n"; print MAKE "\tcp release/bin/$name/$name$exeext $dir\n"; + $name .= $exeext; # for install } elsif ($type eq 'script') { print MAKE "\tcp $name $dir\n"; - # remove path from script name - $name =~ m~/([^/]+)\Z~; - $name = $1; } - print SCRIPT "install $name $install_into_dir\n"; + # remove path from file name, for install + $name =~ m~/([^/]+)\Z~; + $name = $1; + + print SCRIPT "install $name ". + "\$DESTDIR\${PREFIX:-$install_into_dir}\n"; } close SCRIPT; @@ -141,7 +168,7 @@ print MAKE "\n"; print MAKE "install-$parcel:\n"; - print MAKE "\t(cd $dir; ./install-$parcel)\n\n"; + print MAKE "\t(cd $dir; ./install-$parcel \$(DESTDIR))\n\n"; } print MAKE <<__E; From boxbackup-dev at fluffy.co.uk Thu Dec 15 00:50:06 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 15 Dec 2005 00:50:06 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r239 - box/chris/boxi/bin/bbackupctl Message-ID: <20051215005006.7A2BE93@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-15 00:50:03 +0000 (Thu, 15 Dec 2005) New Revision: 239 Modified: box/chris/boxi/bin/bbackupctl/bbackupctl.cpp Log: * bbackupctl.cpp - Added a "ping" command-line command to test that daemon is running Modified: box/chris/boxi/bin/bbackupctl/bbackupctl.cpp =================================================================== --- box/chris/boxi/bin/bbackupctl/bbackupctl.cpp 2005-12-15 00:47:17 UTC (rev 238) +++ box/chris/boxi/bin/bbackupctl/bbackupctl.cpp 2005-12-15 00:50:03 UTC (rev 239) @@ -207,6 +207,13 @@ // Yes... set the flag so we know what we're waiting for a sync to start areWaitingForSync = true; } + // Is the command the "ping" command? We're now connected to the daemon, + // so we have pinged it successfully and we can just exit. + else if(::strcmp(argv[0], "ping") == 0) + { + std::string cmd("quit\n"); + connection.Write(cmd.c_str(), cmd.size()); + } else { // No? Just send the command given plus a quit command. From boxbackup-dev at fluffy.co.uk Thu Dec 15 03:10:16 2005 From: boxbackup-dev at fluffy.co.uk (Jonathan Morton) Date: Thu, 15 Dec 2005 03:10:16 +0000 Subject: [Box Backup-dev] Getting trunk ready for release Message-ID: <3B60C128-7E3E-4616-AE33-438FDEAE0E24@chromatix.uklinux.net> This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-6--457289941 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed I'd like to see a fresh release with the merged code in it soon, if possible. Before that can happen, though, we need to fix some things. As of revision 230, the following problems are obvious (this time on Gentoo/PPC32): - Raidfile tests break horribly. This is a regression from a day or two ago, when merging the win32 port suddenly made them all work. - Berkeley DB is still not detected by the autoconf scripts. I think this is because it's looking for libdb-1.so instead of libdb1.so. But I don't know whether the other name appears on other platforms. - One other test fails: bbackupd, apparently in the "interrupted restore" test. This is probably a fault in the test script or the front-end, without affecting actual operation, but best to fix it either way. - Compilation emits warnings in a few places. This is particularly important, since TerraSoft Solutions want to include Box in their software directory, in connection with the Linux- on-POWER thing. -------------------------------------------------------------- from: Jonathan "Chromatix" Morton mail: chromi at chromatix.org.uk website: http://www.chromatix.uklinux.net/ tagline: The key to knowledge is not to rely on people to teach you it. --Apple-Mail-6--457289941 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iEYEARECAAYFAkOg3pgACgkQ6xAxI1ofIwqfhQCfYUNa5jqE5SsxgeqPAzXnLhxI biUAnArxk2p4kphf+54ES7CYr4MdQjz2 =3kJd -----END PGP SIGNATURE----- --Apple-Mail-6--457289941-- From boxbackup-dev at fluffy.co.uk Thu Dec 15 09:03:42 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Thu, 15 Dec 2005 09:03:42 +0000 Subject: [Box Backup-dev] Getting trunk ready for release In-Reply-To: <3B60C128-7E3E-4616-AE33-438FDEAE0E24@chromatix.uklinux.net> References: <3B60C128-7E3E-4616-AE33-438FDEAE0E24@chromatix.uklinux.net> Message-ID: <1134637422.15783.43.camel@avenin.ebourne.me.uk> On Thu, 2005-12-15 at 03:10 +0000, Jonathan Morton wrote: > I'd like to see a fresh release with the merged code in it soon, if > possible. > - Raidfile tests break horribly. This is a regression from a day or > two ago, when merging the win32 port suddenly made them all work. I've not seen these work since before the win32 stuff merged. 240 failures or something. Are you sure you saw them work after the win32 stuff? I looked at this last night. The first failure for me was line 1298 in RaidFileRead.cpp: // Lovely! length = stripe1LastData ^ parityLastData; // Convert to host byte order length = box_ntoh64(length); ASSERT(length <= (paritySize + stripe1Size)); Length has rubbish in it, presumably because one or both of the LastData vars are wrong. I couldn't see why and didn't debug further, it was gone 1 am this morning. :) > - Berkeley DB is still not detected by the autoconf scripts. I think > this is because it's looking for libdb-1.so instead of libdb1.so. > But I don't know whether the other name appears on other platforms. That's an easy fix, just look for both. Before release though I'd like to get it detecting and using db4 if it is available. > - One other test fails: bbackupd, apparently in the "interrupted > restore" test. This is probably a fault in the test script or the > front-end, without affecting actual operation, but best to fix it > either way. Tried this one in debug mode and it failed to start bbackupd due to the time assert I mailed about last night. Didn't get any further. > - Compilation emits warnings in a few places. Most of the warnings for me are due to 64 bit and printf. At some point it needs to be ostreamed. I think for the bug fixing it comes down simply to someone doing it. I fixed one and found one last night and will continue to persevere when I get chance, but there's no reason we can't all fix bugs. It would be nice if Ben could take a look at the raidfile test because he knows what the code should be doing at each point and is more likely to spot the problem. Must be something fairly fundamental to get 240 failures! Cheers, Martin. From boxbackup-dev at fluffy.co.uk Thu Dec 15 10:32:43 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Thu, 15 Dec 2005 10:32:43 +0000 Subject: [Box Backup-dev] ASSERT In-Reply-To: <1134608740.15783.28.camel@avenin.ebourne.me.uk> References: <1134608740.15783.28.camel@avenin.ebourne.me.uk> Message-ID: <5BDAB191-A1E0-4E4A-BDEA-06860DA5C98A@fluffy.co.uk> On 15 Dec 2005, at 01:05, Martin Ebourne wrote: > This assert is false on x86_64: > > box_time_t GetCurrentBoxTime() > { > ASSERT(sizeof(uint32_t) == sizeof(time_t)); > return SecondsToBoxTime((uint32_t)time(0)); > } > > Are there any gotchas it is protecting? Just removing it looks > plausible > to me. You could remove it, but it is protecting against turning a 64 bit time into a 32 bit one. It won't be a problem for a few more decades... Ben From boxbackup-dev at fluffy.co.uk Thu Dec 15 10:43:28 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Thu, 15 Dec 2005 10:43:28 +0000 Subject: [Box Backup-dev] COMMIT r235 - box/chris/boxi/bin/bbstored In-Reply-To: <20051215004037.0819B93@s0g0.pems.testserver.co.uk> References: <20051215004037.0819B93@s0g0.pems.testserver.co.uk> Message-ID: <4E7AE781-91BB-43D4-BED3-E417BEEFBE01@fluffy.co.uk> I don't this is quite right. The name of error is wrong. Why would the client care about RaidFiles anyway? Surely the error should be "directory doesn't exist". In which case, checking for a RaidFile exception isn't quite right, because you're missing the case where the object ID refers to a file. Also, brace placement is against style guide. What problem are you attempting to solve here? Ben On 15 Dec 2005, at 00:40, subversion at fluffy.co.uk wrote: > Author: chris > Date: 2005-12-15 00:40:32 +0000 (Thu, 15 Dec 2005) > New Revision: 235 > > Modified: > box/chris/boxi/bin/bbstored/BackupCommands.cpp > box/chris/boxi/bin/bbstored/backupprotocol.txt > Log: > * BackupCommands.cpp > - Catch RaidFileExceptions and send an appropriate error back to > the client, > rather than aborting the connection > > > Modified: box/chris/boxi/bin/bbstored/BackupCommands.cpp > =================================================================== > --- box/chris/boxi/bin/bbstored/BackupCommands.cpp 2005-12-15 > 00:17:22 UTC (rev 234) > +++ box/chris/boxi/bin/bbstored/BackupCommands.cpp 2005-12-15 > 00:40:32 UTC (rev 235) > @@ -12,6 +12,7 @@ > #include > > #include "autogen_BackupProtocolServer.h" > +#include "autogen_RaidFileException.h" > #include "BackupConstants.h" > #include "BackupContext.h" > #include "CollectInBufferStream.h" > @@ -156,18 +157,31 @@ > CHECK_PHASE(Phase_Commands) > > // Ask the context for a directory > - const BackupStoreDirectory &rdir(rContext.GetDirectory(mObjectID)); > + try { > + const BackupStoreDirectory &rdir( > + rContext.GetDirectory(mObjectID)); > > - // Store the listing to a stream > - std::auto_ptr stream(new > CollectInBufferStream); > - rdir.WriteToStream(*stream, mFlagsMustBeSet, mFlagsNotToBeSet, > mSendAttributes, > - false /* never send dependency info to the client */); > - stream->SetForReading(); > + // Store the listing to a stream > + std::auto_ptr stream( > + new CollectInBufferStream); > + rdir.WriteToStream(*stream, mFlagsMustBeSet, > + mFlagsNotToBeSet, mSendAttributes, > + false /* never send dependency info to the client */); > + stream->SetForReading(); > > - // Get the protocol to send the stream > - rProtocol.SendStreamAfterCommand(stream.release()); > + // Get the protocol to send the stream > + rProtocol.SendStreamAfterCommand(stream.release()); > > - return std::auto_ptr(new > BackupProtocolServerSuccess(mObjectID)); > + return std::auto_ptr( > + new BackupProtocolServerSuccess(mObjectID)); > + } catch (RaidFileException &e) { > + return std::auto_ptr( > + new BackupProtocolServerError( > + BackupProtocolServerError::ErrorType, > + BackupProtocolServerError::Err_RaidFileDoesntExist > + ) > + ); > + } > } > > // > ---------------------------------------------------------------------- > ---- > > Modified: box/chris/boxi/bin/bbstored/backupprotocol.txt > =================================================================== > --- box/chris/boxi/bin/bbstored/backupprotocol.txt 2005-12-15 > 00:17:22 UTC (rev 234) > +++ box/chris/boxi/bin/bbstored/backupprotocol.txt 2005-12-15 > 00:40:32 UTC (rev 235) > @@ -39,6 +39,7 @@ > CONSTANT Err_DiffFromFileDoesNotExist 12 > CONSTANT Err_DoesNotExistInDirectory 13 > CONSTANT Err_PatchConsistencyError 14 > + CONSTANT Err_RaidFileDoesntExist 15 > > Version 1 Command(Version) Reply > int32 Version > > _______________________________________________ > Boxbackup-dev mailing list > Boxbackup-dev at fluffy.co.uk > http://lists.warhead.org.uk/mailman/listinfo/boxbackup-dev From boxbackup-dev at fluffy.co.uk Thu Dec 15 10:46:28 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Thu, 15 Dec 2005 10:46:28 +0000 Subject: [Box Backup-dev] COMMIT r237 - box/chris/boxi/lib/server In-Reply-To: <20051215004213.AACC593@s0g0.pems.testserver.co.uk> References: <20051215004213.AACC593@s0g0.pems.testserver.co.uk> Message-ID: <1CE5F6C6-FD24-40E4-8CA4-BDA952611DA1@fluffy.co.uk> I believe this change is misleading, and messages regarding account corruption should be restricted to the server and only emitted when there is an actual problem which has been detected by the code. This is just going to worry users unnecessarily. Ben On 15 Dec 2005, at 00:42, subversion at fluffy.co.uk wrote: > Author: chris > Date: 2005-12-15 00:42:11 +0000 (Thu, 15 Dec 2005) > New Revision: 237 > > Modified: > box/chris/boxi/lib/server/ConnectionException.txt > Log: > * ConnectionException.txt > - Updated description of TLSReadFailed > > > Modified: box/chris/boxi/lib/server/ConnectionException.txt > =================================================================== > --- box/chris/boxi/lib/server/ConnectionException.txt 2005-12-15 > 00:41:19 UTC (rev 236) > +++ box/chris/boxi/lib/server/ConnectionException.txt 2005-12-15 > 00:42:11 UTC (rev 237) > @@ -10,7 +10,7 @@ > TLSHandshakeFailed 30 > TLSShutdownFailed 32 > TLSWriteFailed 33 Probably a network issue between client and > server. > -TLSReadFailed 34 Probably a network issue between client and > server. > +TLSReadFailed 34 Probably a network issue between client and > server, or account corrupted on server. > TLSNoPeerCertificate 36 > TLSPeerCertificateInvalid 37 Check certification process > TLSClosedWhenWriting 38 > > _______________________________________________ > Boxbackup-dev mailing list > Boxbackup-dev at fluffy.co.uk > http://lists.warhead.org.uk/mailman/listinfo/boxbackup-dev From boxbackup-dev at fluffy.co.uk Thu Dec 15 10:47:25 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Thu, 15 Dec 2005 10:47:25 +0000 Subject: [Box Backup-dev] ASSERT In-Reply-To: <5BDAB191-A1E0-4E4A-BDEA-06860DA5C98A@fluffy.co.uk> References: <1134608740.15783.28.camel@avenin.ebourne.me.uk> <5BDAB191-A1E0-4E4A-BDEA-06860DA5C98A@fluffy.co.uk> Message-ID: <20051215104725.a91vtnby80kw4koo@ebourne.me.uk> Ben Summers wrote: > On 15 Dec 2005, at 01:05, Martin Ebourne wrote: >> This assert is false on x86_64: >> >> box_time_t GetCurrentBoxTime() >> { >> ASSERT(sizeof(uint32_t) == sizeof(time_t)); >> return SecondsToBoxTime((uint32_t)time(0)); >> } >> >> Are there any gotchas it is protecting? Just removing it looks plausible >> to me. > > You could remove it, but it is protecting against turning a 64 bit > time into a 32 bit one. It won't be a problem for a few more > decades... box_time_t currently is 64 bit. Presumably SecondsToBoxTime ought to be fixed to take 64 bit, then there's no problem. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Thu Dec 15 11:16:47 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Thu, 15 Dec 2005 11:16:47 +0000 Subject: [Box Backup-dev] Getting trunk ready for release In-Reply-To: <1134637422.15783.43.camel@avenin.ebourne.me.uk> References: <3B60C128-7E3E-4616-AE33-438FDEAE0E24@chromatix.uklinux.net> <1134637422.15783.43.camel@avenin.ebourne.me.uk> Message-ID: <338B9450-EC8B-4F6A-B032-43D5E80F1B54@fluffy.co.uk> On 15 Dec 2005, at 09:03, Martin Ebourne wrote: > On Thu, 2005-12-15 at 03:10 +0000, Jonathan Morton wrote: > >> - Raidfile tests break horribly. This is a regression from a day or >> two ago, when merging the win32 port suddenly made them all work. > > I've not seen these work since before the win32 stuff merged. 240 > failures or something. Are you sure you saw them work after the win32 > stuff? > > I looked at this last night. The first failure for me was line 1298 in > RaidFileRead.cpp: > > // Lovely! > length = stripe1LastData ^ parityLastData; > // Convert to host byte order > length = box_ntoh64(length); > ASSERT(length <= (paritySize + stripe1Size)); > > Length has rubbish in it, presumably because one or both of the > LastData > vars are wrong. I couldn't see why and didn't debug further, it was > gone > 1 am this morning. :) lib/raidfile is scarily complex. I have begun to regret writing it. I will look into this as soon as I get a chance. I hope this will be in the next few days -- got a few urgent things to finish first, all while suffering from a nasty cold. > >> - One other test fails: bbackupd, apparently in the "interrupted >> restore" test. This is probably a fault in the test script or the >> front-end, without affecting actual operation, but best to fix it >> either way. > > Tried this one in debug mode and it failed to start bbackupd due to > the > time assert I mailed about last night. Didn't get any further. Again, I'll get that one going too. > >> - Compilation emits warnings in a few places. > > Most of the warnings for me are due to 64 bit and printf. At some > point > it needs to be ostreamed. I trust this won't involve nasty operator overloading for I/O. :-) Ben From boxbackup-dev at fluffy.co.uk Thu Dec 15 11:30:43 2005 From: boxbackup-dev at fluffy.co.uk (Jonathan Morton) Date: Thu, 15 Dec 2005 11:30:43 +0000 Subject: [Box Backup-dev] Getting trunk ready for release In-Reply-To: <1134637422.15783.43.camel@avenin.ebourne.me.uk> References: <3B60C128-7E3E-4616-AE33-438FDEAE0E24@chromatix.uklinux.net> <1134637422.15783.43.camel@avenin.ebourne.me.uk> Message-ID: <26C18051-81FE-463C-BD78-FA4330494EF5@chromatix.uklinux.net> This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-7--427262596 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed >> - Raidfile tests break horribly. This is a regression from a day or >> two ago, when merging the win32 port suddenly made them all work. > > I've not seen these work since before the win32 stuff merged. 240 > failures or something. Are you sure you saw them work after the win32 > stuff? It did on PPC64, at least. It may well still do, actually, because I haven't rebooted the G5 back into Linux to check. But it's heavily broken on PPC32 (1000+ failures) on both current revision and slightly earlier. > I think for the bug fixing it comes down simply to someone doing it. I > fixed one and found one last night and will continue to persevere > when I > get chance, but there's no reason we can't all fix bugs. Except I now have a day job to work at as well, while simultaneously clearing up my affairs enough to move countries. I have enough free time to fire off "svn up && ./bootstrap && ./configure && make test", and examine the output half an hour later, but not a great deal more. -------------------------------------------------------------- from: Jonathan "Chromatix" Morton mail: chromi at chromatix.org.uk website: http://www.chromatix.uklinux.net/ tagline: The key to knowledge is not to rely on people to teach you it. --Apple-Mail-7--427262596 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iEYEARECAAYFAkOhU+MACgkQ6xAxI1ofIwqTbwCgot4qX4+lu0nC9kF4yKwgwyDa rvIAn36C68bSlvsom0BJ09t+tBe0rVBc =A+7p -----END PGP SIGNATURE----- --Apple-Mail-7--427262596-- From boxbackup-dev at fluffy.co.uk Thu Dec 15 13:07:59 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Thu, 15 Dec 2005 13:07:59 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r235 - box/chris/boxi/bin/bbstored In-Reply-To: <4E7AE781-91BB-43D4-BED3-E417BEEFBE01@fluffy.co.uk> References: <20051215004037.0819B93@s0g0.pems.testserver.co.uk> <4E7AE781-91BB-43D4-BED3-E417BEEFBE01@fluffy.co.uk> Message-ID: Hi Ben, Thanks for looking at this patch. > I don't this is quite right. It probably isn't, after all I wrote it :-) > The name of error is wrong. Why would the client care about RaidFiles > anyway? Surely the error should be "directory doesn't exist". > > What problem are you attempting to solve here? When the store is corrupt on the server (e.g. missing raidfile directory), bbstored will die when trying to read it, which gives the client a TLSReadFailed. I couldn't think of a less helpful error to send to the client, so I tried to improve it. I wanted the client to be able to phone/email the server operator and say something more useful than "it doesn't work" or "the server disconnected me". Perhaps they shouldn't care about RAID files, but the error should at least indicate that the store is corrupt and the server admin should run bbstoreaccounts check on it. > In which case, checking for a RaidFile exception isn't quite right, because > you're missing the case where the object ID refers to a file. Sorry, what case? Surely that's the client's business. It always asks the server for an object ID. > Also, brace placement is against style guide. Sorry, which one, the try/catch? >> + try { [...] >> + } catch (RaidFileException &e) { Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Thu Dec 15 13:11:30 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Thu, 15 Dec 2005 13:11:30 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r237 - box/chris/boxi/lib/server In-Reply-To: <1CE5F6C6-FD24-40E4-8CA4-BDA952611DA1@fluffy.co.uk> References: <20051215004213.AACC593@s0g0.pems.testserver.co.uk> <1CE5F6C6-FD24-40E4-8CA4-BDA952611DA1@fluffy.co.uk> Message-ID: Hi Ben, > I believe this change is misleading, and messages regarding account > corruption should be restricted to the server and only emitted when > there is an actual problem which has been detected by the code. Why is it misleading? There are plenty of cases where TLSReadFailed can be caused by problems on the server rather than network problems (my previous patch fixes just one) and what use are reason messages that send the user (or admin) down the wrong garden path, looking for network problems where none exist? > This is just going to worry users unnecessarily. How about "or a problem with the server"? Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Thu Dec 15 13:16:10 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Thu, 15 Dec 2005 13:16:10 +0000 Subject: [Box Backup-dev] COMMIT r235 - box/chris/boxi/bin/bbstored In-Reply-To: References: <20051215004037.0819B93@s0g0.pems.testserver.co.uk> <4E7AE781-91BB-43D4-BED3-E417BEEFBE01@fluffy.co.uk> Message-ID: <27CB3421-4218-4612-A98A-85B2B5687FEE@fluffy.co.uk> On 15 Dec 2005, at 13:07, Chris Wilson wrote: > Hi Ben, > > Thanks for looking at this patch. > >> I don't this is quite right. > > It probably isn't, after all I wrote it :-) Hmmm. > >> The name of error is wrong. Why would the client care about >> RaidFiles anyway? Surely the error should be "directory doesn't >> exist". >> >> What problem are you attempting to solve here? > > When the store is corrupt on the server (e.g. missing raidfile > directory), bbstored will die when trying to read it, which gives > the client a TLSReadFailed. I couldn't think of a less helpful > error to send to the client, so I tried to improve it. > > I wanted the client to be able to phone/email the server operator > and say something more useful than "it doesn't work" or "the server > disconnected me". Perhaps they shouldn't care about RAID files, but > the error should at least indicate that the store is corrupt and > the server admin should run bbstoreaccounts check on it. Surely the server admin will be monitoring their server? If not, then you should not be trusting them anyway. In most cases, that error will not happen because of corrupt stores. Do you really want the client to think their backups are corrupt when most likely they're not? > >> In which case, checking for a RaidFile exception isn't quite >> right, because you're missing the case where the object ID refers >> to a file. > > Sorry, what case? Surely that's the client's business. It always > asks the server for an object ID. An object can be a file or a directory. If you try to use a file object ID where a directory is expected, you'll get a different error. And surely the fact that it's using a RaidFile is an implementation detail which the client has no need to know, and in fact, just obscures the real problem? > >> Also, brace placement is against style guide. > > Sorry, which one, the try/catch? > >>> + try { > [...] >>> + } catch (RaidFileException &e) { That's the one. try { ... } catch(...) { ... } Ben From boxbackup-dev at fluffy.co.uk Thu Dec 15 13:16:54 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Thu, 15 Dec 2005 13:16:54 +0000 Subject: [Box Backup-dev] COMMIT r237 - box/chris/boxi/lib/server In-Reply-To: References: <20051215004213.AACC593@s0g0.pems.testserver.co.uk> <1CE5F6C6-FD24-40E4-8CA4-BDA952611DA1@fluffy.co.uk> Message-ID: <980DF3D2-7BEA-434E-A97C-03F12E30DFA2@fluffy.co.uk> On 15 Dec 2005, at 13:11, Chris Wilson wrote: > Hi Ben, > >> I believe this change is misleading, and messages regarding >> account corruption should be restricted to the server and only >> emitted when there is an actual problem which has been detected by >> the code. > > Why is it misleading? In most cases the store is not corrupt. > There are plenty of cases where TLSReadFailed can be caused by > problems on the server rather than network problems (my previous > patch fixes just one) and what use are reason messages that send > the user (or admin) down the wrong garden path, looking for network > problems where none exist? > >> This is just going to worry users unnecessarily. > > How about "or a problem with the server"? That would be better. Ben From boxbackup-dev at fluffy.co.uk Thu Dec 15 12:46:29 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 15 Dec 2005 12:46:29 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r240 - box/chris/boxi/bin/bbstored Message-ID: <20051215124629.EEACA94@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-15 12:46:25 +0000 (Thu, 15 Dec 2005) New Revision: 240 Modified: box/chris/boxi/bin/bbstored/BackupCommands.cpp Log: * BackupCommands.cpp - Fixed brace style Modified: box/chris/boxi/bin/bbstored/BackupCommands.cpp =================================================================== --- box/chris/boxi/bin/bbstored/BackupCommands.cpp 2005-12-15 00:50:03 UTC (rev 239) +++ box/chris/boxi/bin/bbstored/BackupCommands.cpp 2005-12-15 12:46:25 UTC (rev 240) @@ -157,7 +157,8 @@ CHECK_PHASE(Phase_Commands) // Ask the context for a directory - try { + try + { const BackupStoreDirectory &rdir( rContext.GetDirectory(mObjectID)); @@ -174,7 +175,9 @@ return std::auto_ptr( new BackupProtocolServerSuccess(mObjectID)); - } catch (RaidFileException &e) { + } + catch(RaidFileException &e) + { return std::auto_ptr( new BackupProtocolServerError( BackupProtocolServerError::ErrorType, From boxbackup-dev at fluffy.co.uk Thu Dec 15 13:41:33 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Thu, 15 Dec 2005 13:41:33 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r237 - box/chris/boxi/lib/server In-Reply-To: <980DF3D2-7BEA-434E-A97C-03F12E30DFA2@fluffy.co.uk> References: <20051215004213.AACC593@s0g0.pems.testserver.co.uk> <1CE5F6C6-FD24-40E4-8CA4-BDA952611DA1@fluffy.co.uk> <980DF3D2-7BEA-434E-A97C-03F12E30DFA2@fluffy.co.uk> Message-ID: Hi Ben, >> How about "or a problem with the server"? > > That would be better. OK, thanks, fixed in branch. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Thu Dec 15 12:49:46 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 15 Dec 2005 12:49:46 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r241 - box/chris/boxi/lib/server Message-ID: <20051215124946.3529D94@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-15 12:49:43 +0000 (Thu, 15 Dec 2005) New Revision: 241 Modified: box/chris/boxi/lib/server/ConnectionException.txt Log: * ConnectionException.txt - Less scary error message Modified: box/chris/boxi/lib/server/ConnectionException.txt =================================================================== --- box/chris/boxi/lib/server/ConnectionException.txt 2005-12-15 12:46:25 UTC (rev 240) +++ box/chris/boxi/lib/server/ConnectionException.txt 2005-12-15 12:49:43 UTC (rev 241) @@ -10,7 +10,7 @@ TLSHandshakeFailed 30 TLSShutdownFailed 32 TLSWriteFailed 33 Probably a network issue between client and server. -TLSReadFailed 34 Probably a network issue between client and server, or account corrupted on server. +TLSReadFailed 34 Probably a network issue between client and server, or a problem with the server. TLSNoPeerCertificate 36 TLSPeerCertificateInvalid 37 Check certification process TLSClosedWhenWriting 38 From boxbackup-dev at fluffy.co.uk Thu Dec 15 13:44:12 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Thu, 15 Dec 2005 13:44:12 +0000 (GMT) Subject: [Box Backup-dev] Getting trunk ready for release In-Reply-To: <26C18051-81FE-463C-BD78-FA4330494EF5@chromatix.uklinux.net> References: <3B60C128-7E3E-4616-AE33-438FDEAE0E24@chromatix.uklinux.net> <1134637422.15783.43.camel@avenin.ebourne.me.uk> <26C18051-81FE-463C-BD78-FA4330494EF5@chromatix.uklinux.net> Message-ID: Hi Jonathan, > Except I now have a day job to work at as well, while simultaneously > clearing up my affairs enough to move countries. I have enough free > time to fire off "svn up && ./bootstrap && ./configure && make test", > and examine the output half an hour later, but not a great deal more. Can you give me some more details about your platform? I'm thinking I can try to use the SourceForge compile farm servers to diagnose this. Especially, if you can tell me which of the servers listed at [http://sourceforge.net/docs/E02/] are most similar to your boxes, that would be great. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Thu Dec 15 14:09:55 2005 From: boxbackup-dev at fluffy.co.uk (Jonathan Morton) Date: Thu, 15 Dec 2005 14:09:55 +0000 Subject: [Box Backup-dev] Getting trunk ready for release In-Reply-To: References: <3B60C128-7E3E-4616-AE33-438FDEAE0E24@chromatix.uklinux.net> <1134637422.15783.43.camel@avenin.ebourne.me.uk> <26C18051-81FE-463C-BD78-FA4330494EF5@chromatix.uklinux.net> Message-ID: <29D21A5F-EF3C-4EEE-A273-9A606B619C64@chromatix.uklinux.net> This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-9--417710618 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed >> Except I now have a day job to work at as well, while >> simultaneously clearing up my affairs enough to move countries. I >> have enough free time to fire off "svn up && ./bootstrap && ./ >> configure && make test", and examine the output half an hour >> later, but not a great deal more. > > Can you give me some more details about your platform? I'm thinking > I can try to use the SourceForge compile farm servers to diagnose > this. > > Especially, if you can tell me which of the servers listed at > [http://sourceforge.net/docs/E02/] are most similar to your boxes, > that would be great. The G5 (PPC64) is probably most similar to the OpenPOWER box, since the G5 is a direct derivative of the POWER4. The two G4s running OSX have hardware vaguely similar to my PPC32 machine, but I was running Linux on that too. You may find that you can target Linux/PPC32 more easily on the OpenPOWER box - the hardware itself should easily be able to run both. The two machines I've been trying here are a PowerMac G5 running Gentoo Linux/PPC64, and a PowerBook G3 "Pismo" running Gentoo Linux/ PPC32. I haven't tried running the merged tree on OSX yet. -------------------------------------------------------------- from: Jonathan "Chromatix" Morton mail: chromi at chromatix.org.uk website: http://www.chromatix.uklinux.net/ tagline: The key to knowledge is not to rely on people to teach you it. --Apple-Mail-9--417710618 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iEYEARECAAYFAkOheTMACgkQ6xAxI1ofIwqgoQCZAV5g7gj5BmsirKB6rqesZFWq JhsAnjqFTqLa79T9F6VqjdGylFTbhwmy =38qA -----END PGP SIGNATURE----- --Apple-Mail-9--417710618-- From boxbackup-dev at fluffy.co.uk Thu Dec 15 13:53:03 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 15 Dec 2005 13:53:03 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r242 - box/chris/win32 Message-ID: <20051215135303.1544994@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-15 13:52:55 +0000 (Thu, 15 Dec 2005) New Revision: 242 Added: box/chris/win32/pipe-security/ Log: * http://bbdev.fluffy.co.uk/svn/box/chris/win32/pipe-security - Branch for improving named pipe security and enabling message mode Copied: box/chris/win32/pipe-security (from rev 241, box/trunk) From boxbackup-dev at fluffy.co.uk Thu Dec 15 14:09:14 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 15 Dec 2005 14:09:14 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r243 - box/chris/win32/pipe-security/lib/win32 Message-ID: <20051215140914.2CBB094@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-15 14:09:10 +0000 (Thu, 15 Dec 2005) New Revision: 243 Modified: box/chris/win32/pipe-security/lib/win32/WinNamedPipeStream.cpp Log: * WinNamedPipeStream.cpp - Put pipe into message mode on client side - Attach a security descriptor on the server side to inherit security from the parent process, which should be safe? Modified: box/chris/win32/pipe-security/lib/win32/WinNamedPipeStream.cpp =================================================================== --- box/chris/win32/pipe-security/lib/win32/WinNamedPipeStream.cpp 2005-12-15 13:52:55 UTC (rev 242) +++ box/chris/win32/pipe-security/lib/win32/WinNamedPipeStream.cpp 2005-12-15 14:09:10 UTC (rev 243) @@ -72,6 +72,11 @@ THROW_EXCEPTION(ServerException, SocketAlreadyOpen) } + SECURITY_ATTRIBUTES Security; + Security.nLength = sizeof(SECURITY_ATTRIBUTES); + Security.lpSecurityDescriptor = NULL; // inherit from process + Security.bInheritHandle = FALSE; // don't pass to new processes + mSocketHandle = CreateNamedPipeW( pName, // pipe name PIPE_ACCESS_DUPLEX, // read/write access @@ -82,7 +87,7 @@ 4096, // output buffer size 4096, // input buffer size NMPWAIT_USE_DEFAULT_WAIT, // client time-out - NULL); // default security attribute + &Security); // use our security attributes if (mSocketHandle == NULL) { @@ -137,9 +142,23 @@ { ::syslog(LOG_ERR, "Failed to connect to server's named pipe: " "error %d", GetLastError()); + CloseHandle(mSocketHandle); + mSocketHandle = NULL; THROW_EXCEPTION(ServerException, SocketOpenError) } + if (!SetNamedPipeHandleState( + mSocketHandle, // pipe handle + PIPE_READMODE_MESSAGE | // put this end into message mode + PIPE_WAIT, // put this end into blocking mode + NULL, // don't change the collection count + NULL)) // don't change the collect timeout + { + ::syslog(LOG_ERR, "Failed to put pipe into message mode: " + "error %d", GetLastError()); + THROW_EXCEPTION(ServerException, SocketOpenError) + } + mReadClosed = FALSE; mWriteClosed = FALSE; mIsServer = FALSE; // just close the socket From boxbackup-dev at fluffy.co.uk Thu Dec 15 14:17:06 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 15 Dec 2005 14:17:06 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r244 - box/chris/win32/pipe-security/lib/win32 Message-ID: <20051215141706.D615094@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-15 14:17:04 +0000 (Thu, 15 Dec 2005) New Revision: 244 Modified: box/chris/win32/pipe-security/lib/win32/WinNamedPipeStream.cpp Log: * WinNamedPipeStream.cpp - Pass a pointer to flags to SetNamedPipeHandleState Modified: box/chris/win32/pipe-security/lib/win32/WinNamedPipeStream.cpp =================================================================== --- box/chris/win32/pipe-security/lib/win32/WinNamedPipeStream.cpp 2005-12-15 14:09:10 UTC (rev 243) +++ box/chris/win32/pipe-security/lib/win32/WinNamedPipeStream.cpp 2005-12-15 14:17:04 UTC (rev 244) @@ -147,10 +147,12 @@ THROW_EXCEPTION(ServerException, SocketOpenError) } + DWORD Flags = PIPE_READMODE_MESSAGE | // put this end into message mode + PIPE_WAIT; // put this end into blocking mode + if (!SetNamedPipeHandleState( mSocketHandle, // pipe handle - PIPE_READMODE_MESSAGE | // put this end into message mode - PIPE_WAIT, // put this end into blocking mode + &Flags, // mode flags NULL, // don't change the collection count NULL)) // don't change the collect timeout { From boxbackup-dev at fluffy.co.uk Thu Dec 15 15:13:36 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Thu, 15 Dec 2005 15:13:36 +0000 (GMT) Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: <439C7543.4000206@invis.net> References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> <9E4EE16C-FF57-4E56-80B3-8F05119BCBF7@fluffy.co.uk> <439873A6.5020009@invis.net> <439C7543.4000206@invis.net> Message-ID: Hi Charles, >> The pipe is created using PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | >> PIPE_WAIT, is that enough? > > No :-) Of course not, that would be too easy :-) >> Do I need to do anything on the client side, that opens the pipe with > CreateFileW? > > Yes - have a look at SetNamedPipeHandleState. A pipe client always > starts in byte mode. Does this look OK to you? mSocketHandle = CreateFileW(...) ... DWORD Flags = PIPE_READMODE_MESSAGE | // put this end into message mode PIPE_WAIT; // put this end into blocking mode if (!SetNamedPipeHandleState( mSocketHandle, // pipe handle &Flags, // mode flags NULL, // don't change the collection count NULL)) // don't change the collect timeout { ::syslog(LOG_ERR, "Failed to put pipe into message mode: " "error %d", GetLastError()); THROW_EXCEPTION(ServerException, SocketOpenError) } > Also, you need to think carefully about having a NULL SA on the pipe; > generally, this is a potential security problem. How about this? SECURITY_ATTRIBUTES Security; Security.nLength = sizeof(SECURITY_ATTRIBUTES); Security.lpSecurityDescriptor = NULL; // inherit from process Security.bInheritHandle = FALSE; // don't pass to new processes mSocketHandle = CreateNamedPipeW( ... &Security); // use our security attributes Both changes are now in [http://bbdev.fluffy.co.uk/svn/box/chris/win32/pipe-security]. Thanks for your help! Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Thu Dec 15 14:34:24 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 15 Dec 2005 14:34:24 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r245 - box/trunk/infrastructure/m4 Message-ID: <20051215143424.B12FC94@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-15 14:34:22 +0000 (Thu, 15 Dec 2005) New Revision: 245 Modified: box/trunk/infrastructure/m4/ax_check_bdb_v1.m4 Log: Add more libdb version checks when configuring for Berkeley DB Modified: box/trunk/infrastructure/m4/ax_check_bdb_v1.m4 =================================================================== --- box/trunk/infrastructure/m4/ax_check_bdb_v1.m4 2005-12-15 14:17:04 UTC (rev 244) +++ box/trunk/infrastructure/m4/ax_check_bdb_v1.m4 2005-12-15 14:34:22 UTC (rev 245) @@ -18,9 +18,9 @@ [ac_bdb_header=$ac_header; break], [ac_bdb_header=""]) if test "x$ac_bdb_header" != x; then AC_SEARCH_LIBS([__db185_open], - [db db-4.3 db-4.2 db-4.1 db-4.0 db-3], + [db db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db4 db-3 db3], [ac_have_bdb=yes], - [AC_SEARCH_LIBS([dbopen], [db-1 db], [ac_have_bdb=yes])]) + [AC_SEARCH_LIBS([dbopen], [db-1 db1 db], [ac_have_bdb=yes])]) fi if test "x$ac_have_bdb" = "xyes"; then AC_MSG_CHECKING([whether found db libraries work]) From boxbackup-dev at fluffy.co.uk Thu Dec 15 15:36:09 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Thu, 15 Dec 2005 15:36:09 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r235 - box/chris/boxi/bin/bbstored In-Reply-To: <27CB3421-4218-4612-A98A-85B2B5687FEE@fluffy.co.uk> References: <20051215004037.0819B93@s0g0.pems.testserver.co.uk> <4E7AE781-91BB-43D4-BED3-E417BEEFBE01@fluffy.co.uk> <27CB3421-4218-4612-A98A-85B2B5687FEE@fluffy.co.uk> Message-ID: Hi Ben, >> When the store is corrupt on the server (e.g. missing raidfile directory), >> bbstored will die when trying to read it, which gives the client a >> TLSReadFailed. I couldn't think of a less helpful error to send to the >> client, so I tried to improve it. >> >> I wanted the client to be able to phone/email the server operator and say >> something more useful than "it doesn't work" or "the server disconnected >> me". Perhaps they shouldn't care about RAID files, but the error should at >> least indicate that the store is corrupt and the server admin should run >> bbstoreaccounts check on it. > > Surely the server admin will be monitoring their server? If not, then you > should not be trusting them anyway. Ideally, yes. But Real Server Admins(TM) are not perfect, not immune from making mistakes, are overworked and overstretched, and don't always have time to read all their logs, let alone act on them. As a client I would verify my backups regularly rather than trusting the server operator to read and understand their logs. Or even better, I would expect my backup software to do that for me. And I would expect a better error message than TLSReadFailed if the store really was corrupt - which, as you say, a good admin should already have spotted and fixed before allowing me to connect again. Then again, I'm probably not the average client, and I'm willing to listen to others' views and do whatever I can to improve things in such a way that nobody disagrees. > In most cases, that error will not happen because of corrupt stores. Do > you really want the client to think their backups are corrupt when most > likely they're not? I just wanted to point out that it was an option, along with network issues. I didn't think they would automatically blame the server admin for a corrupt account when that was only the third possibility listed, after network issues. But I'm happy with the other, potentially less scary message as well. >> > In which case, checking for a RaidFile exception isn't quite right, >> > because you're missing the case where the object ID refers to a file. >> >> Sorry, what case? Surely that's the client's business. It always asks the >> server for an object ID. > > An object can be a file or a directory. If you try to use a file object ID > where a directory is expected, you'll get a different error. But that wasn't the error I was trying to catch. I made the least invasive change that stopped the server from crashing when I had a particular problem with the store. I'm not yet familiar enough with the code, or what exceptions could be thrown by that code path, to write a completely general error handler for that List command. Do you want me to try anyway? > And surely the fact that it's using a RaidFile is an implementation detail > which the client has no need to know, and in fact, just obscures the real > problem? Which is what, a corrupt store? > That's the one. OK, sorry, fixed in branch. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Thu Dec 15 14:50:00 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 15 Dec 2005 14:50:00 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r246 - box/trunk/test/backupdiff Message-ID: <20051215145000.CF9C894@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-15 14:49:58 +0000 (Thu, 15 Dec 2005) New Revision: 246 Modified: box/trunk/test/backupdiff/testbackupdiff.cpp Log: Diffing timeout in test too short for running debug build Modified: box/trunk/test/backupdiff/testbackupdiff.cpp =================================================================== --- box/trunk/test/backupdiff/testbackupdiff.cpp 2005-12-15 14:34:22 UTC (rev 245) +++ box/trunk/test/backupdiff/testbackupdiff.cpp 2005-12-15 14:49:58 UTC (rev 246) @@ -487,7 +487,7 @@ 2000 /* object ID of the file diffing from */, blockindex, IOStream::TimeOutInfinite, 0, 0)); encoded->CopyStreamTo(out); - TEST_THAT(time(0) < (beginTime + 20)); + TEST_THAT(time(0) < (beginTime + 40)); } // Remove zero-files to save disk space remove("testfiles/zero.0"); From boxbackup-dev at fluffy.co.uk Thu Dec 15 16:30:15 2005 From: boxbackup-dev at fluffy.co.uk (Gary) Date: Thu, 15 Dec 2005 08:30:15 -0800 (PST) Subject: [Box Backup-dev] Getting trunk ready for release In-Reply-To: <338B9450-EC8B-4F6A-B032-43D5E80F1B54@fluffy.co.uk> Message-ID: <20051215163015.56641.qmail@web36710.mail.mud.yahoo.com> > > At some point it needs to be ostreamed. > I trust this won't involve nasty operator overloading fo I/O. :-) LOL Gary __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From boxbackup-dev at fluffy.co.uk Thu Dec 15 16:34:56 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Thu, 15 Dec 2005 16:34:56 +0000 (GMT) Subject: [Box Backup-dev] Getting trunk ready for release In-Reply-To: <20051215163015.56641.qmail@web36710.mail.mud.yahoo.com> References: <20051215163015.56641.qmail@web36710.mail.mud.yahoo.com> Message-ID: Hi all, >>> At some point it needs to be ostreamed. > >> I trust this won't involve nasty operator overloading fo I/O. :-) > > LOL Is it even possible to use ostream sensibly without operator< - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Thu Dec 15 16:38:57 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Thu, 15 Dec 2005 16:38:57 +0000 Subject: [Box Backup-dev] Getting trunk ready for release In-Reply-To: References: <20051215163015.56641.qmail@web36710.mail.mud.yahoo.com> Message-ID: On 15 Dec 2005, at 16:34, Chris Wilson wrote: > Hi all, > >>>> At some point it needs to be ostreamed. >> >>> I trust this won't involve nasty operator overloading fo I/O. :-) >> >> LOL > > Is it even possible to use ostream sensibly without operator< ++ book says it's the only defined interface for writing formatted > output to an ostream. Wonderful. So some stupid example in a textbook just to demonstrate that operator overloading can be used to do things other than the operations that the operators imply (with all the potential for confusion, bugs, etc that that entails) is now going to pollute this project with it's idiocy? Lovely. Ben From boxbackup-dev at fluffy.co.uk Thu Dec 15 16:44:50 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Thu, 15 Dec 2005 16:44:50 +0000 (GMT) Subject: [Box Backup-dev] BackupDaemon refactoring Message-ID: Hi all, In order to make Boxi more powerful and easier to use, and lacking a status protocol for Box Backup to report progress, I've had to make Boxi link directly to Box Backup, working with the BackupClient* classes. In order to do this, I've had to duplicate significant amounts of the BackupDaemon code in Boxi. A lot of that code has changed in trunk with the win32 port, and now needs to be copied back into Boxi. I'd like to reduce the code duplication, but I don't really want to create an instance of the BackupDaemon. I was wondering if it might be OK to move the code that sets up locations and calls BackupClient* out of BackupDaemon and into a new class, maybe BackupManager, that I can use instead? Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Thu Dec 15 16:53:49 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Thu, 15 Dec 2005 16:53:49 +0000 Subject: [Box Backup-dev] BackupDaemon refactoring In-Reply-To: References: Message-ID: <1E8D29C7-8314-406F-A401-8F528BDDED13@fluffy.co.uk> On 15 Dec 2005, at 16:44, Chris Wilson wrote: > Hi all, > > In order to make Boxi more powerful and easier to use, and lacking > a status protocol for Box Backup to report progress, I've had to > make Boxi link directly to Box Backup, working with the > BackupClient* classes. > > In order to do this, I've had to duplicate significant amounts of > the BackupDaemon code in Boxi. A lot of that code has changed in > trunk with the win32 port, and now needs to be copied back into Boxi. > > I'd like to reduce the code duplication, but I don't really want to > create an instance of the BackupDaemon. I was wondering if it might > be OK to move the code that sets up locations and calls > BackupClient* out of BackupDaemon and into a new class, maybe > BackupManager, that I can use instead? Can you be a bit more specific about what you want to do? Do you need something it does over and above directly talking to the server using the autogenerated Protocol code? I have no problem with stuff being moved into more generic classes, but refactoring does mean there's potential for introducing bugs. BTW, I try to avoid calling classes *Manager, because this never actually describes what it does. *Factory, *Interface, are far better. Ben From boxbackup-dev at fluffy.co.uk Thu Dec 15 16:43:04 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Thu, 15 Dec 2005 16:43:04 +0000 (GMT) Subject: [Box Backup-dev] Getting trunk ready for release In-Reply-To: References: <20051215163015.56641.qmail@web36710.mail.mud.yahoo.com> Message-ID: Hi Ben, >> Is it even possible to use ostream sensibly without operator<> book says it's the only defined interface for writing formatted output to >> an ostream. > > Wonderful. So some stupid example in a textbook just to demonstrate that > operator overloading can be used to do things other than the operations that > the operators imply (with all the potential for confusion, bugs, etc that > that entails) is now going to pollute this project with it's idiocy? > > Lovely. I agree with the principle of what you're saying, but I didn't write the STL or choose that ostream could only be used with operator<<. Do we really want to write our own output stream class? Blame Bjarne and the C++ standards group :-) Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Thu Dec 15 17:11:39 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Thu, 15 Dec 2005 17:11:39 +0000 Subject: [Box Backup-dev] Getting trunk ready for release In-Reply-To: References: <20051215163015.56641.qmail@web36710.mail.mud.yahoo.com> Message-ID: <20051215171139.tpt90p4ogswc8swk@ebourne.me.uk> Ben Summers wrote: > Wonderful. So some stupid example in a textbook just to demonstrate > that operator overloading can be used to do things other than the > operations that the operators imply (with all the potential for > confusion, bugs, etc that that entails) is now going to pollute this > project with it's idiocy? Ben, I'm not sure I exactly understand your position on streams. I thought you meant you didn't want operator<< defined on box's own objects, but now it sounds like you don't want << used at all in the code for output. While I fully agree with you on most operator overloading (I've worked on lots of C++ and seen a lot of evil operator abuse), streams is one of the places where it really is useful. It's not a stupid example in a textbook, it's the way the C++ libraries are designed. Because it is so endemic to C++ and so common the pitfalls are generally avoided. Everyone knows what it does, what it means, and how it works. Those are the main disadvantages of bad operator overloading. Finding bugs in streams use (related to the operator itself) is extremely rare. About the only mistake is to forget that the precedence of << is higher than of some other operators. In that case it almost always fails to compile so there is no bug anyway. I don't think anyone is going to ostream box and fill it with uses of << if you say no, but hopefully that isn't the case. Streams is the only viable way of type safe output provided by C++. The current use of printf is a significant issue. I've ported box to several platforms and making the format string match the arguments is impossible on all platforms due to the different use of types. For that reason we have a load of '#ifdef WIN32' code just to provide alternate format specifiers for windows. Historically I've also seen more bugs with bad printf use than bad stream use. It's very easy and common to get the format specifier wrong, and almost nobody understands the implicit promotion rules of values passed to a varargs function, which creates quite a few bugs. There's no attempt at type safety with printf so a lot of problems are only run time detectable. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Thu Dec 15 17:11:53 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Thu, 15 Dec 2005 17:11:53 +0000 (GMT) Subject: [Box Backup-dev] BackupDaemon refactoring In-Reply-To: <1E8D29C7-8314-406F-A401-8F528BDDED13@fluffy.co.uk> References: <1E8D29C7-8314-406F-A401-8F528BDDED13@fluffy.co.uk> Message-ID: Hi Ben, >> I'd like to reduce the code duplication, but I don't really want to create >> an instance of the BackupDaemon. I was wondering if it might be OK to move >> the code that sets up locations and calls BackupClient* out of >> BackupDaemon and into a new class, maybe BackupManager, that I can use >> instead? > > Can you be a bit more specific about what you want to do? Do you need > something it does over and above directly talking to the server using the > autogenerated Protocol code? I want to run a backup when the user clicks on the Backup button in Boxi. I want to bypass the automatic backup scheduling in BackupDaemon, and I don't really want to fake an argv, have it intercept signals for me, or run a background thread to listen to a command socket on Win32. I also can't use BackupDaemon::Location as it's private. What I've done is to copy SetupLocations from BackupDaemon, customised it to use my own (identical) copy of BackupDaemon::Location, and my own (different) configuration structures, and then start a backup using some code extracted from BackupDaemon::Run2: SetupLocations(clientContext); // Get some ID maps going SetupIDMapsForSync(); [...] DeleteUnusedRootDirEntries(clientContext); [...] typedef const std::vector tLocationRecords; // Go through the records, counting files and bytes for (tLocationRecords::const_iterator i = mLocations.begin(); i != mLocations.end(); i++) { LocationRecord* pLocRecord = *i; // Set exclude lists (context doesn't take ownership) clientContext.SetExcludeLists( pLocRecord->mpExcludeFiles, pLocRecord->mpExcludeDirs); CountDirectory(clientContext, pLocRecord->mPath); } [...] // Go through the records, syncing them for (tLocationRecords::const_iterator i = mLocations.begin(); i != mLocations.end(); i++) { LocationRecord* pLocRecord = *i; int IDMapIndex = pLocRecord->mIDMapIndex; [...] // Set current and new ID map pointers in the context clientContext.SetIDMaps( mCurrentIDMaps[IDMapIndex], mNewIDMaps [IDMapIndex]); // Set exclude lists (context doesn't take ownership) clientContext.SetExcludeLists( pLocRecord->mpExcludeFiles, pLocRecord->mpExcludeDirs); // Sync the directory pLocRecord->mpDirectoryRecord->SyncDirectory(params, BackupProtocolClientListDirectory::RootDirectory, pLocRecord->mPath); // Unset exclude lists (just in case) clientContext.SetExcludeLists(0, 0); } The [...] sections are GUI code that I've inserted to let the user know what's going on while the backup is running, and allow them to cancel it by clicking on another button that causes StopRun() to return true. > I have no problem with stuff being moved into more generic classes, but > refactoring does mean there's potential for introducing bugs. Well, your test suite is very comprehensive, and we have a lot of testing to do on the win32 port especially, so I hope we can get the refactoring done and merged soon, so that any bugs we do introduce will get thrashed out by that testing. Also, I was hoping that the refactor could be as simple as moving some methods and members from BackupDaemon to a new class, which should mean that the compiler will pick up any mistakes we make. The amount of new code to be written should be trivial and easy to check. > BTW, I try to avoid calling classes *Manager, because this never > actually describes what it does. *Factory, *Interface, are far better. OK, good point. How about BackupRunner, or just Backup? Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Thu Dec 15 17:21:17 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Thu, 15 Dec 2005 17:21:17 +0000 Subject: [Box Backup-dev] Getting trunk ready for release In-Reply-To: <20051215171139.tpt90p4ogswc8swk@ebourne.me.uk> References: <20051215163015.56641.qmail@web36710.mail.mud.yahoo.com> <20051215171139.tpt90p4ogswc8swk@ebourne.me.uk> Message-ID: <05BF390C-F3AF-40D3-8AB7-A94A87FEAF90@fluffy.co.uk> On 15 Dec 2005, at 17:11, Martin Ebourne wrote: > Ben Summers wrote: >> Wonderful. So some stupid example in a textbook just to >> demonstrate that operator overloading can be used to do things >> other than the operations that the operators imply (with all the >> potential for confusion, bugs, etc that that entails) is now >> going to pollute this project with it's idiocy? > > Ben, > > I'm not sure I exactly understand your position on streams. I > thought you meant you didn't want operator<< defined on box's own > objects, but now it sounds like you don't want << used at all in > the code for output. > > While I fully agree with you on most operator overloading (I've > worked on lots of C++ and seen a lot of evil operator abuse), > streams is one of the places where it really is useful. It's not a > stupid example in a textbook, it's the way the C++ libraries are > designed. Because it is so endemic to C++ and so common the > pitfalls are generally avoided. Everyone knows what it does, what > it means, and how it works. Those are the main disadvantages of bad > operator overloading. > > Finding bugs in streams use (related to the operator itself) is > extremely rare. About the only mistake is to forget that the > precedence of << is higher than of some other operators. In that > case it almost always fails to compile so there is no bug anyway. > > I don't think anyone is going to ostream box and fill it with uses > of << if you say no, but hopefully that isn't the case. Streams is > the only viable way of type safe output provided by C++. > > The current use of printf is a significant issue. I've ported box > to several platforms and making the format string match the > arguments is impossible on all platforms due to the different use > of types. For that reason we have a load of '#ifdef WIN32' code > just to provide alternate format specifiers for windows. > > Historically I've also seen more bugs with bad printf use than bad > stream use. It's very easy and common to get the format specifier > wrong, and almost nobody understands the implicit promotion rules > of values passed to a varargs function, which creates quite a few > bugs. There's no attempt at type safety with printf so a lot of > problems are only run time detectable. Sorry, I have a cold and am feeling argumentative -- your position is the pragmatically correct one. As Chris points out, it's all Mr Stroustrup and the STL committees' fault, and too late to change now. So if it's going to improve the code, then streams will have to go in as it would be silly to reinvent the wheel. I'm not quite sure how this fits in with the TRACEx() macros though. As they currently stand, they don't get compiled in release builds, but other methods may not be so easy to deal with. Ben From boxbackup-dev at fluffy.co.uk Thu Dec 15 17:23:39 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Thu, 15 Dec 2005 17:23:39 +0000 (GMT) Subject: [Box Backup-dev] [OT] Autoconf nesting Message-ID: Hi all (especially Martin :-), Does anyone have any experience of building an autoconfiscated project with another one inside it? Can you point me to relevant useful resources? I'm having issues with Boxi, which includes Box Backup as a sub-project, now that BB is autoconfiscated. In particular, BB's config.h conflicts with my own (redefining PACKAGE_NAME, etc). and I'm not able to use all the libraries that BB detected for itself (which I need for linking). I'm thinking it would be nice, if possible, to include most (but not all) of BB's configure.ac in Boxi's configure.in file, but I don't know how feasible that is, or whether it creates other subtle traps. I can't include the whole thing because Boxi and BB both call AC_INIT. Thanks in advance for your help. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Thu Dec 15 17:28:41 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Thu, 15 Dec 2005 17:28:41 +0000 Subject: [Box Backup-dev] [OT] Autoconf nesting In-Reply-To: References: Message-ID: <5B63EBD3-E480-4A63-80BD-13FD6A650F5F@fluffy.co.uk> On 15 Dec 2005, at 17:23, Chris Wilson wrote: > Hi all (especially Martin :-), > > Does anyone have any experience of building an autoconfiscated > project with another one inside it? Can you point me to relevant > useful resources? > > I'm having issues with Boxi, which includes Box Backup as a sub- > project, now that BB is autoconfiscated. In particular, BB's > config.h conflicts with my own (redefining PACKAGE_NAME, etc). and > I'm not able to use all the libraries that BB detected for itself > (which I need for linking). > > I'm thinking it would be nice, if possible, to include most (but > not all) of BB's configure.ac in Boxi's configure.in file, but I > don't know how feasible that is, or whether it creates other subtle > traps. I can't include the whole thing because Boxi and BB both > call AC_INIT. Could you not include Boxi as another binary built within the Box Backup buildsystem? Ben From boxbackup-dev at fluffy.co.uk Thu Dec 15 17:33:25 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Thu, 15 Dec 2005 17:33:25 +0000 (GMT) Subject: [Box Backup-dev] [OT] Autoconf nesting In-Reply-To: <5B63EBD3-E480-4A63-80BD-13FD6A650F5F@fluffy.co.uk> References: <5B63EBD3-E480-4A63-80BD-13FD6A650F5F@fluffy.co.uk> Message-ID: Hi Ben, > Could you not include Boxi as another binary built within the Box Backup > buildsystem? I possibly could, but the changes would be quite invasive to BB, and the license situation might then become trickier. I'd probably have to distribute Boxi as a patch to BB, and Boxi is GPL'ed, but BB is under a BSD-like license. Also, I'm not sure how to do it. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Thu Dec 15 17:47:40 2005 From: boxbackup-dev at fluffy.co.uk (Charles Lecklider) Date: Thu, 15 Dec 2005 17:47:40 +0000 Subject: [Box Backup-dev] Reviewing code -- help! In-Reply-To: References: <5D5E73C0-E515-4534-89A4-95FCD0EBF81E@fluffy.co.uk> <1133955869.28417.25.camel@avenin.ebourne.me.uk> <1133957984.32364.10.camel@avenin.ebourne.me.uk> <1C8F1473-398C-4ADF-AB00-6C88574F44D7@fluffy.co.uk> <9E4EE16C-FF57-4E56-80B3-8F05119BCBF7@fluffy.co.uk> <439873A6.5020009@invis.net> <439C7543.4000206@invis.net> Message-ID: <43A1AC3C.2060206@invis.net> Chris Wilson wrote: > Does this look OK to you? > > mSocketHandle = CreateFileW(...) > ... > DWORD Flags = PIPE_READMODE_MESSAGE | // put this end into > message mode > PIPE_WAIT; // put this end into > blocking mode > > if (!SetNamedPipeHandleState( > mSocketHandle, // pipe handle > &Flags, // mode flags > NULL, // don't change the collection > count > NULL)) // don't change the collect timeout > { > ::syslog(LOG_ERR, "Failed to put pipe into message mode: " > "error %d", GetLastError()); > THROW_EXCEPTION(ServerException, SocketOpenError) > } Yes, that should do it. >> Also, you need to think carefully about having a NULL SA on the pipe; >> generally, this is a potential security problem. > > > How about this? > > SECURITY_ATTRIBUTES Security; > Security.nLength = sizeof(SECURITY_ATTRIBUTES); > Security.lpSecurityDescriptor = NULL; // inherit from process > Security.bInheritHandle = FALSE; // don't pass to new processes > > mSocketHandle = CreateNamedPipeW( > ... > &Security); // use our security attributes LOL! You've replaced "NULL" by something functionally almost identical; the only difference is that the handle doesn't get inherited. You need to decide what users and groups need to be able to access the pipe, and create a suitable security descriptor with a suitable DACL. Along the way you'll encounter SIDs, ACEs, and ACLs - hours of fun and joy await you! -C From boxbackup-dev at fluffy.co.uk Thu Dec 15 17:57:23 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Thu, 15 Dec 2005 17:57:23 +0000 Subject: [Box Backup-dev] [OT] Autoconf nesting In-Reply-To: References: Message-ID: <20051215175723.y42856sao4044o88@ebourne.me.uk> Chris Wilson wrote: > Does anyone have any experience of building an autoconfiscated > project with another one inside it? Can you point me to relevant > useful resources? The autotools book is good: http://sources.redhat.com/autobook/autobook/autobook_toc.html Doesn't directly cover what you're doing, but does cover similar stuff. Also the info pages as well. > I'm having issues with Boxi, which includes Box Backup as a > sub-project, now that BB is autoconfiscated. In particular, BB's > config.h conflicts with my own (redefining PACKAGE_NAME, etc). I'll rename the config.h to contain 'box'. That one has annoyed me before elsewhere. As to the defines, I'm not sure if there's a way of renaming those. I'll check later. In one of my projects I have this hack in the common.hpp file which is what includes config.h: // Remove config defines which should never have escaped log4cxx headers #include #undef PACKAGE #undef PACKAGE_BUGREPORT #undef PACKAGE_NAME #undef PACKAGE_STRING #undef PACKAGE_TARNAME #undef PACKAGE_VERSION #undef VERSION Horrid though. Need to come up with a better fix, there must be one out there. > I'm not able to use all the libraries that BB detected for itself > (which I need for linking). That's a problem with static libraries. It would be nice to make some kind of shared library for box at some point. That would contain dependencies itself on other libraries so it would just work. However, this is a post 0.10 task since we all want a release asap. For now, including chunks from box configure would make sense. > I'm thinking it would be nice, if possible, to include most (but not > all) of BB's configure.ac in Boxi's configure.in file, but I don't > know how feasible that is, or whether it creates other subtle traps. > I can't include the whole thing because Boxi and BB both call AC_INIT. Should be entirely feasible. Just pick the bits you need and include the infrastructure/m4 directory from box into your configure.ac. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Thu Dec 15 18:04:32 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Thu, 15 Dec 2005 18:04:32 +0000 (GMT) Subject: [Box Backup-dev] [OT] Autoconf nesting In-Reply-To: <20051215175723.y42856sao4044o88@ebourne.me.uk> References: <20051215175723.y42856sao4044o88@ebourne.me.uk> Message-ID: Hi Martin, > I'll rename the config.h to contain 'box'. That one has annoyed me before > elsewhere. It's not so much the file name that bothers me (yet) but the defines inside. > As to the defines, I'm not sure if there's a way of renaming those. I'll > check later. I didn't see any obvious way to achieve it, but if config.h could only define PACKAGE_* if they're not already defined, it would fix the issues I'm having. > // Remove config defines which should never have escaped log4cxx headers > # include > # undef PACKAGE > # undef PACKAGE_BUGREPORT > # undef PACKAGE_NAME > # undef PACKAGE_STRING > # undef PACKAGE_TARNAME > # undef PACKAGE_VERSION > # undef VERSION Yeah, I did that too, as a quick hack. > That's a problem with static libraries. It would be nice to make some > kind of shared library for box at some point. That would contain > dependencies itself on other libraries so it would just work. However, > this is a post 0.10 task since we all want a release asap. It would be great, but I agree that we shouldn't delay the next release of BB for it. > For now, including chunks from box configure would make sense. OK, will do, thanks. > Should be entirely feasible. Just pick the bits you need and include the > infrastructure/m4 directory from box into your configure.ac. Unfortunately the only way I found to include infrastructure/m4 (by adding "-I boxbackup/infrastructure/m4" to the aclocal command line in Boxi's autogen.sh) breaks compilation, because some important variables in the intl package makefiles aren't substituted any more. I guess there's a conflict between one of Boxi's m4 macros and one of BB's. I'm still trying to track it down. Thanks for your help! Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Thu Dec 15 18:10:07 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Thu, 15 Dec 2005 18:10:07 +0000 Subject: [Box Backup-dev] Getting trunk ready for release In-Reply-To: <05BF390C-F3AF-40D3-8AB7-A94A87FEAF90@fluffy.co.uk> References: <20051215163015.56641.qmail@web36710.mail.mud.yahoo.com> <20051215171139.tpt90p4ogswc8swk@ebourne.me.uk> <05BF390C-F3AF-40D3-8AB7-A94A87FEAF90@fluffy.co.uk> Message-ID: <20051215181007.k7m9epsuec48k440@ebourne.me.uk> Ben Summers wrote: > Sorry, I have a cold and am feeling argumentative -- your position is > the pragmatically correct one. As Chris points out, it's all Mr > Stroustrup and the STL committees' fault, and too late to change now. I should think that cold has been round most of London by now! If it's the same one that's been round our office for the last 6 weeks it's evil. I had it for 2-3 weeks and my wife was off work with it for over a week. I think everyone in the office had it at some point. Get well soon! > So if it's going to improve the code, then streams will have to go in > as it would be silly to reinvent the wheel. I'm not quite sure how > this fits in with the TRACEx() macros though. As they currently > stand, they don't get compiled in release builds, but other methods > may not be so easy to deal with. I'm sure we can come up with something suitable for the TRACE macros which will compile out on release builds. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Thu Dec 15 18:11:23 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Thu, 15 Dec 2005 18:11:23 +0000 Subject: [Box Backup-dev] [OT] Autoconf nesting In-Reply-To: References: <5B63EBD3-E480-4A63-80BD-13FD6A650F5F@fluffy.co.uk> Message-ID: <5BCC6744-782C-47F3-9C58-EF2B3F35BA57@fluffy.co.uk> On 15 Dec 2005, at 17:33, Chris Wilson wrote: > Hi Ben, > >> Could you not include Boxi as another binary built within the Box >> Backup buildsystem? > > I possibly could, but the changes would be quite invasive to BB, > and the license situation might then become trickier. I'd probably > have to distribute Boxi as a patch to BB, and Boxi is GPL'ed, but > BB is under a BSD-like license. Also, I'm not sure how to do it. Symlink your sources to bin/boxi, add a suitable line to modules.txt (which also mentions the libraries you need), add some stuff on ./ configure if you need to have additional header search paths, and you're good to go. You could make your build script do that automatically. Or the more complicated one of symlinking all of the Box Backup stuff into your directory. Ben From boxbackup-dev at fluffy.co.uk Thu Dec 15 18:43:56 2005 From: boxbackup-dev at fluffy.co.uk (Gary) Date: Thu, 15 Dec 2005 10:43:56 -0800 (PST) Subject: [Box Backup-dev] Getting trunk ready for release In-Reply-To: <20051215171139.tpt90p4ogswc8swk@ebourne.me.uk> Message-ID: <20051215184356.96270.qmail@web36711.mail.mud.yahoo.com> Well, I believe that the whole operator thing going on here is indirectly my fault - I introduced a serialization class to Box code some time ago that overloaded << and >> operators in a chain-like manner, and Ben wasn't crazy about it (hence my LOL previously ;)). The subject keeps coming back 8). Practically speaking, a (*this) returning << operator compiles down to the same as a chain of bool Write() calls (given, we are using exceptions for error handling), but it is a valid point when it comes to code style. Ben's aversion to operator overloading is similar to my aversion to COM/DCOM stuff - while some consider COM/DCOM a blessing, I consider it a pathetic, idiotic mess, that should have been solved at a C++ specification level, as it is nothing more than a runtime object reflection plus some interoperability stuff (Microsoft has finally figured it out for the C# language). Oh, well. > now it sounds like you don't want << used at all in the code > for output. If my memory serves me well, you can always cast to char* and wite() to avoid the overloaded operators? ;) > Historically I've also seen more bugs with bad printf use than > bad stream use. Very good point. Gary __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From boxbackup-dev at fluffy.co.uk Thu Dec 15 23:07:32 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Thu, 15 Dec 2005 23:07:32 +0000 Subject: [Box Backup-dev] Getting trunk ready for release In-Reply-To: <20051215184356.96270.qmail@web36711.mail.mud.yahoo.com> References: <20051215184356.96270.qmail@web36711.mail.mud.yahoo.com> Message-ID: <1134688052.4387.17.camel@avenin.ebourne.me.uk> On Thu, 2005-12-15 at 10:43 -0800, Gary wrote: > Well, I believe that the whole operator thing going on here is > indirectly my fault - I introduced a serialization class to Box code > some time ago that overloaded << and >> operators in a chain-like > manner, and Ben wasn't crazy about it (hence my LOL previously ;)). The > subject keeps coming back 8). This is off topic and there's no need to continue the subject because I think we all agree now, but I personally prefer named methods for serialisation. I don't think code should hold surprises and any time an operator does something different to normal that is a bad thing because it is hiding a surprise. Normally it gains nothing either. Streams are about the only place where it works, and then only because they are absolutely endemic. Everyone knows exactly what they do, no surprises. Maybe they should have made a new operator for streams, -< and >- say. I'm sure that would have solved the problems. > Ben's aversion to operator overloading is similar to my > aversion to COM/DCOM stuff - while some consider COM/DCOM a blessing, I > consider it a pathetic, idiotic mess, that should have been solved at a I've never dealt with COM/DCOM. But CORBA is simultaneously very good in what you can do, and a complete disaster in how it is implemented. > If my memory serves me well, you can always cast to char* and wite() to > avoid the overloaded operators? ;) Not for ints, or floats, or most kinds of data types. Works for strings though, but doesn't give any formatting control. Not really an option. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Thu Dec 15 23:52:36 2005 From: boxbackup-dev at fluffy.co.uk (Gary) Date: Thu, 15 Dec 2005 15:52:36 -0800 (PST) Subject: [Box Backup-dev] Getting trunk ready for release In-Reply-To: <1134688052.4387.17.camel@avenin.ebourne.me.uk> Message-ID: <20051215235236.55113.qmail@web36714.mail.mud.yahoo.com> Martin, > Streams are about the only place where it works, and then only > because they are absolutely endemic. Everyone knows exactly > what they do, no surprises. Well said, everyone knows the <<, >> stuff so well that one rarely runs into any other functionality other than serialization. When it comes to the "general" topic of operator overloading, I wouldn't agree, ==,=,< are wonderful for, say, GUID/FILETIME wrappers to establish equality, ordering, etc. > Not for ints, or floats, or most kinds of data types. Works for > strings though, but doesn't give any formatting control. Not > really an option. Well, one could try to: ostream::write((char*) &fValue, sizeof(float)/sizeof(char)); ...but that's a horrible way to do it. I think Chris was right: when it comes to streams, the operators just HAVE to be used. Gary __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From boxbackup-dev at fluffy.co.uk Fri Dec 16 09:46:04 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Fri, 16 Dec 2005 09:46:04 +0000 Subject: [Box Backup-dev] Getting trunk ready for release In-Reply-To: <20051215235236.55113.qmail@web36714.mail.mud.yahoo.com> References: <20051215235236.55113.qmail@web36714.mail.mud.yahoo.com> Message-ID: On 15 Dec 2005, at 23:52, Gary wrote: > Martin, > >> Streams are about the only place where it works, and then only >> because they are absolutely endemic. Everyone knows exactly >> what they do, no surprises. > > Well said, everyone knows the <<, >> stuff so well that one rarely > runs > into any other functionality other than serialization. When it > comes to > the "general" topic of operator overloading, I wouldn't agree, ==,=,< > are wonderful for, say, GUID/FILETIME wrappers to establish equality, > ordering, etc. The problem is not using operator overloading, it's using operator overloading for operations that the operator does not usually do. As long as == tests for equality, etc, then there's little reason not to use them for basic and simple type representation classes. It's when operators have side effects or do surprising things that there's a problem. Or when they start getting overloaded. Ben From boxbackup-dev at fluffy.co.uk Fri Dec 16 16:28:36 2005 From: boxbackup-dev at fluffy.co.uk (Jonathan Morton) Date: Fri, 16 Dec 2005 16:28:36 +0000 Subject: [Box Backup-dev] COMMIT r245 - box/trunk/infrastructure/m4 In-Reply-To: <20051215143424.B12FC94@s0g0.pems.testserver.co.uk> References: <20051215143424.B12FC94@s0g0.pems.testserver.co.uk> Message-ID: <0539782F-EB36-4C81-BE8C-2BAD3C6050C8@chromatix.uklinux.net> This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-11--322989922 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > Modified: > box/trunk/infrastructure/m4/ax_check_bdb_v1.m4 > Log: > Add more libdb version checks when configuring for Berkeley DB A step in the right direction, but not far enough. Libdb1 is now found, containing dbopen(), but the following "does it work" test uses db185_open(), and thus fails. -------------------------------------------------------------- from: Jonathan "Chromatix" Morton mail: chromi at chromatix.org.uk website: http://www.chromatix.uklinux.net/ tagline: The key to knowledge is not to rely on people to teach you it. --Apple-Mail-11--322989922 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iEYEARECAAYFAkOi6zQACgkQ6xAxI1ofIwrlMQCdEW0t1Rt5MlTNwBYJvARVl5eA Q0oAoKeyKPfz9BVwLFWvGm8jkLQvZNQO =gzqe -----END PGP SIGNATURE----- --Apple-Mail-11--322989922-- From boxbackup-dev at fluffy.co.uk Sun Dec 18 09:58:34 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Sun, 18 Dec 2005 09:58:34 +0000 Subject: [Box Backup-dev] First errors on Darwin Message-ID: <6874BE39-267F-415D-80E1-159B47D82CBE@fluffy.co.uk> So, checkout, ./bootstrap and ./configure all work fine on Darwin. Initial errors are g++ -DNDEBUG -O2 -Wall -I../../lib/win32 -I../../lib/common -I../../ lib/compress -I../../lib/crypto -I../../lib/server - DBOX_VERSION="\"0.09_autoconf_win32\"" -I/sw/include -c BackupDaemonConfigVerify.cpp -o ../../release/lib/backupclient/ BackupDaemonConfigVerify.o BackupClientFileAttributes.cpp: In static member function 'static void BackupClientFileAttributes::FillExtendedAttr (StreamableMemBlock&, const char*)': BackupClientFileAttributes.cpp:457: error: '::llistxattr' has not been declared BackupClientFileAttributes.cpp:463: error: '::llistxattr' has not been declared BackupClientFileAttributes.cpp:512: error: '::lgetxattr' has not been declared BackupClientFileAttributes.cpp:520: error: '::lgetxattr' has not been declared BackupClientFileAttributes.cpp: In member function 'void BackupClientFileAttributes::WriteExtendedAttr(const char*, int) const': BackupClientFileAttributes.cpp:791: error: '::lsetxattr' has not been declared g++ -DNDEBUG -O2 -Wall -I../../lib/win32 -I../../lib/common -I../../ lib/compress -I../../lib/crypto -I../../lib/server - DBOX_VERSION="\"0.09_autoconf_win32\"" -I/sw/include -c BackupStoreDirectory.cpp -o ../../release/lib/backupclient/ BackupStoreDirectory.o *** Error code 1 BackupStoreDirectory.cpp:42: warning: non-local variable ' dir_StreamFormatOptions' uses anonymous type The last one is probably easy to sort out, but Darwin doesn't have llistxattr, but it does have listxattr: ssize_t listxattr(const char *path, char *namebuf, size_t size, int options); What sort autoconf magic do I need to detect this? Ben From boxbackup-dev at fluffy.co.uk Sun Dec 18 10:21:28 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Sun, 18 Dec 2005 10:21:28 +0000 Subject: [Box Backup-dev] First errors on Darwin In-Reply-To: <6874BE39-267F-415D-80E1-159B47D82CBE@fluffy.co.uk> References: <6874BE39-267F-415D-80E1-159B47D82CBE@fluffy.co.uk> Message-ID: <1134901288.7452.12.camel@avenin.ebourne.me.uk> On Sun, 2005-12-18 at 09:58 +0000, Ben Summers wrote: > So, checkout, ./bootstrap and ./configure all work fine on Darwin. > The last one is probably easy to sort out, but Darwin doesn't have > llistxattr, but it does have listxattr: > > ssize_t > listxattr(const char *path, char *namebuf, size_t size, int > options); "llistxattr is identical to listxattr, except in the case of a symbolic link, where the list of names of extended attributes associated with the link itself is retrieved, not the file that it refers to." Does darwin not have symlinks? > What sort autoconf magic do I need to detect this? Add llistxattr to the end of this line in configure.ac. Then there should be a new HAVE_ in config.h which will be undefined for you. AC_CHECK_FUNCS([getpeereid kqueue lchown setproctitle]) If you need an extra library to be linked in, then instead add something like: AC_CHECK_LIB([xattr], [listxattr]) AC_CHECK_FUNCS([llistxattr]) If darwin does have symlinks but no llistxattr then I think probably some extra logic will be required too. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Sun Dec 18 13:09:16 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Sun, 18 Dec 2005 13:09:16 +0000 Subject: [Box Backup-dev] First errors on Darwin In-Reply-To: <1134901288.7452.12.camel@avenin.ebourne.me.uk> References: <6874BE39-267F-415D-80E1-159B47D82CBE@fluffy.co.uk> <1134901288.7452.12.camel@avenin.ebourne.me.uk> Message-ID: On 18 Dec 2005, at 10:21, Martin Ebourne wrote: > On Sun, 2005-12-18 at 09:58 +0000, Ben Summers wrote: >> So, checkout, ./bootstrap and ./configure all work fine on Darwin. >> The last one is probably easy to sort out, but Darwin doesn't have >> llistxattr, but it does have listxattr: >> >> ssize_t >> listxattr(const char *path, char *namebuf, size_t size, int >> options); > > "llistxattr is identical to listxattr, except in the case of a > symbolic > link, where the list of names of extended attributes associated > with > the link itself is retrieved, not the file that it refers to." > > Does darwin not have symlinks? It does have them, it would be a bit pants if it didn't. So llistxattr is just listxattr with XATTR_NOFOLLOW set in the options under Darwin. Learn something new every day. > >> What sort autoconf magic do I need to detect this? > > Add llistxattr to the end of this line in configure.ac. Then there > should be a new HAVE_ in config.h which will be undefined for you. > > AC_CHECK_FUNCS([getpeereid kqueue lchown setproctitle]) > > If you need an extra library to be linked in, then instead add > something > like: > > AC_CHECK_LIB([xattr], [listxattr]) > AC_CHECK_FUNCS([llistxattr]) > > If darwin does have symlinks but no llistxattr then I think probably > some extra logic will be required too. Can I check for XATTR_NOFOLLOW being defined in a similar way? Ben From boxbackup-dev at fluffy.co.uk Sun Dec 18 17:43:55 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Sun, 18 Dec 2005 17:43:55 +0000 Subject: [Box Backup-dev] First errors on Darwin In-Reply-To: References: <6874BE39-267F-415D-80E1-159B47D82CBE@fluffy.co.uk> <1134901288.7452.12.camel@avenin.ebourne.me.uk> Message-ID: <1134927835.7452.18.camel@avenin.ebourne.me.uk> On Sun, 2005-12-18 at 13:09 +0000, Ben Summers wrote: > So llistxattr is just listxattr with XATTR_NOFOLLOW set in the > options under Darwin. Learn something new every day. Ah, that makes sense. Didn't spot the difference in signature before. > ssize_t listxattr(const char *path, char *namebuf, size_t size, > int options); Linux: ssize_t listxattr (const char *path, char *list, size_t size); So options is new. > Can I check for XATTR_NOFOLLOW being defined in a similar way? There are several ways. You can try this for starters: AC_CHECK_DECLS([XATTR_NOFOLLOW],,, [[#include ]]) Again check the config.h for the HAVE_ define. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Sun Dec 18 17:54:02 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Sun, 18 Dec 2005 17:54:02 +0000 Subject: [Box Backup-dev] COMMIT r245 - box/trunk/infrastructure/m4 In-Reply-To: <0539782F-EB36-4C81-BE8C-2BAD3C6050C8@chromatix.uklinux.net> References: <20051215143424.B12FC94@s0g0.pems.testserver.co.uk> <0539782F-EB36-4C81-BE8C-2BAD3C6050C8@chromatix.uklinux.net> Message-ID: <1134928443.7452.21.camel@avenin.ebourne.me.uk> On Fri, 2005-12-16 at 16:28 +0000, Jonathan Morton wrote: > > Modified: > > box/trunk/infrastructure/m4/ax_check_bdb_v1.m4 > > Log: > > Add more libdb version checks when configuring for Berkeley DB > > A step in the right direction, but not far enough. Libdb1 is now > found, containing dbopen(), but the following "does it work" test > uses db185_open(), and thus fails. That's odd. What happens if you edit infrastructure/m4/ax_check_bdb_v1.m4 and change the line that says AC_SEARCH_LIBS([__db185_open], to AC_SEARCH_LIBS([db185_open], Cheers, Martin. From boxbackup-dev at fluffy.co.uk Mon Dec 19 10:49:50 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Mon, 19 Dec 2005 10:49:50 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r247 - box/chris/win32/pipe-security Message-ID: <20051219104950.09FDC94@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-19 10:49:48 +0000 (Mon, 19 Dec 2005) New Revision: 247 Modified: box/chris/win32/pipe-security/BUGS.txt Log: * BUGS.txt - Added a note about the cygwin bug reported by Peter Jalajas Modified: box/chris/win32/pipe-security/BUGS.txt =================================================================== --- box/chris/win32/pipe-security/BUGS.txt 2005-12-15 14:49:58 UTC (rev 246) +++ box/chris/win32/pipe-security/BUGS.txt 2005-12-19 10:49:48 UTC (rev 247) @@ -8,3 +8,40 @@ * if bbackupd gets an error then a signal, it may not wait it's full 100 seconds before retrying. And then won't stop the cycle... * bbackupquery restore, if not root, then won't do file ownership properly, but won't alert the user to this fact * empty (real) directories in the store aren't deleted when they're empty (and will never be used again) -- uses up disc space unnecessarily + +-- + +Problem with running as a Cygwin service +Reported by E.W. Peter Jalajas + +~/trunk/distribution/boxbackup/contrib/cygwin/install-cygwin-service.pl + +gave: + +cygrunsrv: Error starting a service: QueryServiceStatus: Win32 error +1062: + +And the log showed: + +bbackupd: exception Common OSFileOpenError (Can't open a file -- +attempted to load a non-existant config file or bad file referenced +within?) (1/2) +So I tweaked the registry: + +HKLM/System/CurrentControlSet/Services/BoxBackup/Parameters/AppArgs + +from: + +/etc/box/bbackupd.conf SINGLEPROCESS + +to: + +C:\cygwin\etc\box\bbackupd.conf SINGLEPROCESS + +and that resulted in the log output: + +Starting daemon (config: C:\cygwin\etc\box\bbackupd.conf) (version +0.09_autoconf_win32) +Parameter = 5274340. +exception Server BadSocketHandle (3/4) -- terminating + From boxbackup-dev at fluffy.co.uk Mon Dec 19 23:10:21 2005 From: boxbackup-dev at fluffy.co.uk (Jonathan Morton) Date: Mon, 19 Dec 2005 23:10:21 +0000 Subject: [Box Backup-dev] COMMIT r245 - box/trunk/infrastructure/m4 In-Reply-To: <1134928443.7452.21.camel@avenin.ebourne.me.uk> References: <20051215143424.B12FC94@s0g0.pems.testserver.co.uk> <0539782F-EB36-4C81-BE8C-2BAD3C6050C8@chromatix.uklinux.net> <1134928443.7452.21.camel@avenin.ebourne.me.uk> Message-ID: <793C9C30-3FF1-4B64-95A0-3670E6640442@chromatix.org.uk> This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-4--39685102 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed >>> Add more libdb version checks when configuring for Berkeley DB >> >> A step in the right direction, but not far enough. Libdb1 is now >> found, containing dbopen(), but the following "does it work" test >> uses db185_open(), and thus fails. > > That's odd. What happens if you edit > infrastructure/m4/ax_check_bdb_v1.m4 > and change the line that says > AC_SEARCH_LIBS([__db185_open], > to > AC_SEARCH_LIBS([db185_open], No difference, as far as I can tell. However, I notice that the code emitted by configure for this test actually tries to call dbopen(), but the linker complains that __db185_open() is missing. This tells me that db_185.h is doing something weird that breaks. I think the real fix is to move to proper db4 support, but I have no idea what that entails. -------------------------------------------------------------- from: Jonathan "Chromatix" Morton mail: chromi at chromatix.org.uk website: http://www.chromatix.uklinux.net/ tagline: The key to knowledge is not to rely on people to teach you it. --Apple-Mail-4--39685102 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iEYEARECAAYFAkOnPd0ACgkQ6xAxI1ofIwql5QCgvE20enBjeDOVdcSqJgRr6Q1m CSQAn064I6JqM/3XMjnr5tEwmY+LRc9q =BQPt -----END PGP SIGNATURE----- --Apple-Mail-4--39685102-- From boxbackup-dev at fluffy.co.uk Mon Dec 19 23:28:08 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Mon, 19 Dec 2005 23:28:08 +0000 Subject: [Box Backup-dev] COMMIT r245 - box/trunk/infrastructure/m4 In-Reply-To: <793C9C30-3FF1-4B64-95A0-3670E6640442@chromatix.org.uk> References: <20051215143424.B12FC94@s0g0.pems.testserver.co.uk> <0539782F-EB36-4C81-BE8C-2BAD3C6050C8@chromatix.uklinux.net> <1134928443.7452.21.camel@avenin.ebourne.me.uk> <793C9C30-3FF1-4B64-95A0-3670E6640442@chromatix.org.uk> Message-ID: <1135034888.25746.13.camel@avenin.ebourne.me.uk> On Mon, 2005-12-19 at 23:10 +0000, Jonathan Morton wrote: > > That's odd. What happens if you edit > > infrastructure/m4/ax_check_bdb_v1.m4 > > and change the line that says > > AC_SEARCH_LIBS([__db185_open], > > to > > AC_SEARCH_LIBS([db185_open], > > No difference, as far as I can tell. > > However, I notice that the code emitted by configure for this test > actually tries to call dbopen(), but the linker complains that > __db185_open() is missing. This tells me that db_185.h is doing > something weird that breaks. Interesting. db_185.h unsurprisingly #defines dbopen to __db185_open so that the same .so can provide v4 and v1.85 support. That's exactly how the version installed with fedora works. The odd thing is that your .so doesn't seem to match your header file. > I think the real fix is to move to proper db4 support, but I have no > idea what that entails. I agree and is what I plan. It should be fairly easy - the db4 stuff is all in the tree now, so really just a configure issue. However, I didn't want to do this until after the next release is out because every change delays it. I think now though I'll do it before. However I would like all the tests to pass before changing any more functionality. I've only had a little time to spend on it (I think we all have day jobs, even if we aren't all emigrating!), but I've worked out that the raidfile failures are only on 64 bit. No further than that though. I need to fix the time overflow problem on 64 bit too. Also I'm on the way to tracking the bbackupd failure down. It happens when testbbackupd deliberately sets some kind of marker in the backup store forwards and then checks that bbackupd stops backing up. It doesn't. About line 706 of the test I think - it checks for a return code of 2 from bbackupquery 'compare' to indicate differences but it gets 1 to indicate it all compared equal. No idea any more than that unfortunately. This is the only failure I'm aware of now on 32 bit Linux. I tracked the failure down to the first win32 merge onto trunk. Unfortunately I doubt Chris knows what it is because he didn't write a lot of the code. A look at the test, bbackupquery, and bbackupd diffs showed nothing interesting, so must be in one of the libs. In summary, I'm aware of only 1 test failure on 32 bit, and a further 2 on 64 bit. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Mon Dec 19 23:38:09 2005 From: boxbackup-dev at fluffy.co.uk (Jonathan Morton) Date: Mon, 19 Dec 2005 23:38:09 +0000 Subject: [Box Backup-dev] COMMIT r245 - box/trunk/infrastructure/m4 In-Reply-To: <1135034888.25746.13.camel@avenin.ebourne.me.uk> References: <20051215143424.B12FC94@s0g0.pems.testserver.co.uk> <0539782F-EB36-4C81-BE8C-2BAD3C6050C8@chromatix.uklinux.net> <1134928443.7452.21.camel@avenin.ebourne.me.uk> <793C9C30-3FF1-4B64-95A0-3670E6640442@chromatix.org.uk> <1135034888.25746.13.camel@avenin.ebourne.me.uk> Message-ID: <52CAEF11-1565-4A6F-9E4C-CA863DB08E98@chromatix.org.uk> This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-5--38016397 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed >> However, I notice that the code emitted by configure for this test >> actually tries to call dbopen(), but the linker complains that >> __db185_open() is missing. This tells me that db_185.h is doing >> something weird that breaks. > > Interesting. db_185.h unsurprisingly #defines dbopen to > __db185_open so > that the same .so can provide v4 and v1.85 support. That's exactly how > the version installed with fedora works. The odd thing is that > your .so > doesn't seem to match your header file. Yes, I did think it odd. Might be worth filing a bug with Gentoo. >> I think the real fix is to move to proper db4 support, but I have no >> idea what that entails. > > I agree and is what I plan. It should be fairly easy - the db4 > stuff is > all in the tree now, so really just a configure issue. However, I > didn't > want to do this until after the next release is out because every > change > delays it. I think now though I'll do it before. > > However I would like all the tests to pass before changing any more > functionality. I've only had a little time to spend on it (I think we > all have day jobs, even if we aren't all emigrating!), but I've worked > out that the raidfile failures are only on 64 bit. No further than > that > though. I need to fix the time overflow problem on 64 bit too. Actually, I've had the opposite experience - everything working on PPC64, but everything in Raidfile going crazy on PPC32. -------------------------------------------------------------- from: Jonathan "Chromatix" Morton mail: chromi at chromatix.org.uk website: http://www.chromatix.uklinux.net/ tagline: The key to knowledge is not to rely on people to teach you it. --Apple-Mail-5--38016397 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iEYEARECAAYFAkOnRGIACgkQ6xAxI1ofIwqM0QCfZpr/883rIlK/oi/6bFWyMPok piIAn3jihyt+LtHJa03CD8MlBXV5eHKA =lsOH -----END PGP SIGNATURE----- --Apple-Mail-5--38016397-- From boxbackup-dev at fluffy.co.uk Tue Dec 20 08:13:22 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Tue, 20 Dec 2005 08:13:22 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r248 - box/trunk/lib/backupclient Message-ID: <20051220081322.9F83A94@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-20 08:13:21 +0000 (Tue, 20 Dec 2005) New Revision: 248 Modified: box/trunk/lib/backupclient/BackupStoreFile.h Log: Fix CodingChunkAlloc/Free for use on 32 and 64 bit platforms Modified: box/trunk/lib/backupclient/BackupStoreFile.h =================================================================== --- box/trunk/lib/backupclient/BackupStoreFile.h 2005-12-19 10:49:48 UTC (rev 247) +++ box/trunk/lib/backupclient/BackupStoreFile.h 2005-12-20 08:13:21 UTC (rev 248) @@ -123,19 +123,20 @@ uint8_t *a = (uint8_t*)malloc((Size) + (BACKUPSTOREFILE_CODING_BLOCKSIZE * 3)); if(a == 0) return 0; // Align to main block size - ASSERT(sizeof(uint32_t) == sizeof(void*)); // make sure casting the right pointer size, will need to fix on platforms with 64 bit pointers - uint32_t adjustment = BACKUPSTOREFILE_CODING_BLOCKSIZE - (((uint32_t)(long)a) % BACKUPSTOREFILE_CODING_BLOCKSIZE); + ASSERT(sizeof(unsigned long) >= sizeof(void*)); // make sure casting the right pointer size + uint8_t adjustment = BACKUPSTOREFILE_CODING_BLOCKSIZE + - (uint8_t)(((unsigned long)a) % BACKUPSTOREFILE_CODING_BLOCKSIZE); uint8_t *b = (a + adjustment); // Store adjustment - *b = (uint8_t)adjustment; + *b = adjustment; // Return offset return b + BACKUPSTOREFILE_CODING_OFFSET; } inline static void CodingChunkFree(void *Block) { // Check alignment is as expected - ASSERT(sizeof(uint32_t) == sizeof(void*)); // make sure casting the right pointer size, will need to fix on platforms with 64 bit pointers - ASSERT((((uint32_t)(long)Block) % BACKUPSTOREFILE_CODING_BLOCKSIZE) == BACKUPSTOREFILE_CODING_OFFSET); + ASSERT(sizeof(unsigned long) >= sizeof(void*)); // make sure casting the right pointer size + ASSERT((uint8_t)(((unsigned long)Block) % BACKUPSTOREFILE_CODING_BLOCKSIZE) == BACKUPSTOREFILE_CODING_OFFSET); uint8_t *a = (uint8_t*)Block; a -= BACKUPSTOREFILE_CODING_OFFSET; // Adjust downwards... From boxbackup-dev at fluffy.co.uk Tue Dec 20 08:15:30 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Tue, 20 Dec 2005 08:15:30 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r249 - box/trunk/lib/common Message-ID: <20051220081530.A3EA194@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-20 08:15:28 +0000 (Tue, 20 Dec 2005) New Revision: 249 Modified: box/trunk/lib/common/Utils.cpp Log: Better to leak block quietly from backtrace_symbols on debug build than erroneously report a leak when there isn't one Modified: box/trunk/lib/common/Utils.cpp =================================================================== --- box/trunk/lib/common/Utils.cpp 2005-12-20 08:13:21 UTC (rev 248) +++ box/trunk/lib/common/Utils.cpp 2005-12-20 08:15:28 UTC (rev 249) @@ -76,7 +76,9 @@ for(i = 0; i < size; i++) printf("%s\n", strings[i]); +#ifndef MEMLEAKFINDER_MALLOC_MONITORING_DEFINED free (strings); +#endif } #endif From boxbackup-dev at fluffy.co.uk Tue Dec 20 08:20:35 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Tue, 20 Dec 2005 08:20:35 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r250 - in box/trunk: bin/bbackupd bin/bbackupquery bin/bbstored lib/common test/bbackupd Message-ID: <20051220082035.DE4EE94@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-20 08:20:33 +0000 (Tue, 20 Dec 2005) New Revision: 250 Modified: box/trunk/bin/bbackupd/BackupClientContext.cpp box/trunk/bin/bbackupd/BackupDaemon.cpp box/trunk/bin/bbackupquery/BackupQueries.cpp box/trunk/bin/bbstored/BBStoreDHousekeeping.cpp box/trunk/lib/common/BoxTime.cpp box/trunk/lib/common/BoxTime.h box/trunk/lib/common/BoxTimeToText.cpp box/trunk/test/bbackupd/testbbackupd.cpp Log: Rationalise type usage for time values. Now: Box time is always box_time_t seconds is time_t microseconds is uint64_t Modified: box/trunk/bin/bbackupd/BackupClientContext.cpp =================================================================== --- box/trunk/bin/bbackupd/BackupClientContext.cpp 2005-12-20 08:15:28 UTC (rev 249) +++ box/trunk/bin/bbackupd/BackupClientContext.cpp 2005-12-20 08:20:33 UTC (rev 250) @@ -201,7 +201,7 @@ if(mClientStoreMarker == ClientStoreMarker_NotKnown) { // Yes, choose one, the current time will do - int64_t marker = GetCurrentBoxTime(); + box_time_t marker = GetCurrentBoxTime(); // Set it on the store mpConnection->QuerySetClientStoreMarker(marker); Modified: box/trunk/bin/bbackupd/BackupDaemon.cpp =================================================================== --- box/trunk/bin/bbackupd/BackupDaemon.cpp 2005-12-20 08:15:28 UTC (rev 249) +++ box/trunk/bin/bbackupd/BackupDaemon.cpp 2005-12-20 08:20:33 UTC (rev 250) @@ -64,7 +64,7 @@ #include "MemLeakFindOn.h" -#define MAX_SLEEP_TIME ((unsigned int)1024) +static const time_t MAX_SLEEP_TIME = 1024; // Make the actual sync period have a little bit of extra time, up to a 64th of the main sync period. // This prevents repetative cycles of load on the server @@ -444,16 +444,16 @@ // Setup various timings // How often to connect to the store (approximate) - box_time_t updateStoreInterval = SecondsToBoxTime((uint32_t)conf.GetKeyValueInt("UpdateStoreInterval")); + box_time_t updateStoreInterval = SecondsToBoxTime(conf.GetKeyValueInt("UpdateStoreInterval")); // But are we connecting automatically? bool automaticBackup = conf.GetKeyValueBool("AutomaticBackup"); // The minimum age a file needs to be before it will be considered for uploading - box_time_t minimumFileAge = SecondsToBoxTime((uint32_t)conf.GetKeyValueInt("MinimumFileAge")); + box_time_t minimumFileAge = SecondsToBoxTime(conf.GetKeyValueInt("MinimumFileAge")); // The maximum time we'll wait to upload a file, regardless of how often it's modified - box_time_t maxUploadWait = SecondsToBoxTime((uint32_t)conf.GetKeyValueInt("MaxUploadWait")); + box_time_t maxUploadWait = SecondsToBoxTime(conf.GetKeyValueInt("MaxUploadWait")); // Adjust by subtracting the minimum file age, so is relative to sync period end in comparisons maxUploadWait = (maxUploadWait > minimumFileAge)?(maxUploadWait - minimumFileAge):(0); @@ -492,7 +492,8 @@ // Pause a while, but no more than MAX_SLEEP_TIME seconds (use the conditional because times are unsigned) box_time_t requiredDelay = (nextSyncTime < currentTime)?(0):(nextSyncTime - currentTime); // If there isn't automatic backup happening, set a long delay. And limit delays at the same time. - if(!automaticBackup || requiredDelay > SecondsToBoxTime((uint32_t)MAX_SLEEP_TIME)) requiredDelay = SecondsToBoxTime((uint32_t)MAX_SLEEP_TIME); + if(!automaticBackup || requiredDelay > SecondsToBoxTime(MAX_SLEEP_TIME)) + requiredDelay = SecondsToBoxTime(MAX_SLEEP_TIME); // Only do the delay if there is a delay required if(requiredDelay > 0) @@ -506,7 +507,7 @@ else { // No command socket or connection, just do a normal sleep - int sleepSeconds = BoxTimeToSeconds(requiredDelay); + time_t sleepSeconds = BoxTimeToSeconds(requiredDelay); ::sleep((sleepSeconds <= 0)?1:sleepSeconds); } } @@ -528,7 +529,7 @@ if(d > 0) { // Script has asked for a delay - nextSyncTime = GetCurrentBoxTime() + SecondsToBoxTime((uint32_t)d); + nextSyncTime = GetCurrentBoxTime() + SecondsToBoxTime(d); doSync = false; } } @@ -562,7 +563,7 @@ // files which are modified after the scan run started. // Of course, they may be eligable to be synced again the next time round, // but this should be OK, because the changes only upload should upload no data. - syncPeriodEndExtended += SecondsToBoxTime((uint32_t)(356*24*3600)); + syncPeriodEndExtended += SecondsToBoxTime((time_t)(356*24*3600)); } // Do sync @@ -587,7 +588,7 @@ params.mMaxUploadWait = maxUploadWait; params.mFileTrackingSizeThreshold = conf.GetKeyValueInt("FileTrackingSizeThreshold"); params.mDiffingUploadSizeThreshold = conf.GetKeyValueInt("DiffingUploadSizeThreshold"); - params.mMaxFileTimeInFuture = SecondsToBoxTime((uint32_t)conf.GetKeyValueInt("MaxFileTimeInFuture")); + params.mMaxFileTimeInFuture = SecondsToBoxTime(conf.GetKeyValueInt("MaxFileTimeInFuture")); // Set store marker clientContext.SetClientStoreMarker(clientStoreMarker); @@ -1397,7 +1398,7 @@ ASSERT(mUnusedRootDirEntries.size() > 0); // Time to delete them mDeleteUnusedRootDirEntriesAfter = - GetCurrentBoxTime() + SecondsToBoxTime((uint32_t)BACKUP_DELETE_UNUSED_ROOT_ENTRIES_AFTER); + GetCurrentBoxTime() + SecondsToBoxTime(BACKUP_DELETE_UNUSED_ROOT_ENTRIES_AFTER); } } Modified: box/trunk/bin/bbackupquery/BackupQueries.cpp =================================================================== --- box/trunk/bin/bbackupquery/BackupQueries.cpp 2005-12-20 08:15:28 UTC (rev 249) +++ box/trunk/bin/bbackupquery/BackupQueries.cpp 2005-12-20 08:20:33 UTC (rev 250) @@ -956,7 +956,7 @@ { // Files modified after this time shouldn't be on the server, so report errors slightly differently params.mLatestFileUploadTime = FileModificationTime(st) - - SecondsToBoxTime((uint32_t)mrConfiguration.GetKeyValueInt("MinimumFileAge")); + - SecondsToBoxTime(mrConfiguration.GetKeyValueInt("MinimumFileAge")); } else { Modified: box/trunk/bin/bbstored/BBStoreDHousekeeping.cpp =================================================================== --- box/trunk/bin/bbstored/BBStoreDHousekeeping.cpp 2005-12-20 08:15:28 UTC (rev 249) +++ box/trunk/bin/bbstored/BBStoreDHousekeeping.cpp 2005-12-20 08:20:33 UTC (rev 250) @@ -33,7 +33,7 @@ { // Get the time between housekeeping runs const Configuration &rconfig(GetConfiguration()); - int64_t housekeepingInterval = SecondsToBoxTime((uint32_t)rconfig.GetKeyValueInt("TimeBetweenHousekeeping")); + int64_t housekeepingInterval = SecondsToBoxTime(rconfig.GetKeyValueInt("TimeBetweenHousekeeping")); int64_t lastHousekeepingRun = 0; @@ -108,7 +108,7 @@ // Calculate how long should wait before doing the next housekeeping run timeNow = GetCurrentBoxTime(); - int64_t secondsToGo = BoxTimeToSeconds((lastHousekeepingRun + housekeepingInterval) - timeNow); + time_t secondsToGo = BoxTimeToSeconds((lastHousekeepingRun + housekeepingInterval) - timeNow); if(secondsToGo < 1) secondsToGo = 1; if(secondsToGo > 60) secondsToGo = 60; int32_t millisecondsToGo = ((int)secondsToGo) * 1000; Modified: box/trunk/lib/common/BoxTime.cpp =================================================================== --- box/trunk/lib/common/BoxTime.cpp 2005-12-20 08:15:28 UTC (rev 249) +++ box/trunk/lib/common/BoxTime.cpp 2005-12-20 08:20:33 UTC (rev 250) @@ -25,8 +25,7 @@ // -------------------------------------------------------------------------- box_time_t GetCurrentBoxTime() { - ASSERT(sizeof(uint32_t) == sizeof(time_t)); - return SecondsToBoxTime((uint32_t)time(0)); + return SecondsToBoxTime(time(0)); } Modified: box/trunk/lib/common/BoxTime.h =================================================================== --- box/trunk/lib/common/BoxTime.h 2005-12-20 08:15:28 UTC (rev 249) +++ box/trunk/lib/common/BoxTime.h 2005-12-20 08:20:33 UTC (rev 250) @@ -23,19 +23,15 @@ box_time_t GetCurrentBoxTime(); -inline box_time_t SecondsToBoxTime(uint32_t Seconds) +inline box_time_t SecondsToBoxTime(time_t Seconds) { return ((box_time_t)Seconds * MICRO_SEC_IN_SEC_LL); } -inline box_time_t SecondsToBoxTime(uint64_t Seconds) +inline time_t BoxTimeToSeconds(box_time_t Time) { - return ((box_time_t)Seconds * MICRO_SEC_IN_SEC_LL); -} -inline box_time_t BoxTimeToSeconds(box_time_t Time) -{ return Time / MICRO_SEC_IN_SEC_LL; } -inline box_time_t BoxTimeToMilliSeconds(box_time_t Time) +inline uint64_t BoxTimeToMilliSeconds(box_time_t Time) { return Time / MILLI_SEC_IN_NANO_SEC_LL; } Modified: box/trunk/lib/common/BoxTimeToText.cpp =================================================================== --- box/trunk/lib/common/BoxTimeToText.cpp 2005-12-20 08:15:28 UTC (rev 249) +++ box/trunk/lib/common/BoxTimeToText.cpp 2005-12-20 08:20:33 UTC (rev 250) @@ -29,7 +29,7 @@ { #ifdef WIN32 struct tm *time; - box_time_t bob = BoxTimeToSeconds(Time); + time_t bob = BoxTimeToSeconds(Time); __time64_t winTime = bob; @@ -46,7 +46,7 @@ time->tm_mon + 1, time->tm_mday, time->tm_hour, time->tm_min, time->tm_sec); #else // ! WIN32 - time_t timeInSecs = (time_t)BoxTimeToSeconds(Time); + time_t timeInSecs = BoxTimeToSeconds(Time); struct tm time; gmtime_r(&timeInSecs, &time); Modified: box/trunk/test/bbackupd/testbbackupd.cpp =================================================================== --- box/trunk/test/bbackupd/testbbackupd.cpp 2005-12-20 08:15:28 UTC (rev 249) +++ box/trunk/test/bbackupd/testbbackupd.cpp 2005-12-20 08:20:33 UTC (rev 250) @@ -452,7 +452,7 @@ fclose(f); // and then move the time backwards! struct timeval times[2]; - BoxTimeToTimeval(SecondsToBoxTime((uint32_t)(365*24*60*60)), times[1]); + BoxTimeToTimeval(SecondsToBoxTime((time_t)(365*24*60*60)), times[1]); times[0] = times[1]; TEST_THAT(::utimes("testfiles/TestDir1/sub23/rand.h", times) == 0); } @@ -646,7 +646,7 @@ fclose(f); // and then move the time forwards! struct timeval times[2]; - BoxTimeToTimeval(GetCurrentBoxTime() + SecondsToBoxTime((uint32_t)(365*24*60*60)), times[1]); + BoxTimeToTimeval(GetCurrentBoxTime() + SecondsToBoxTime((time_t)(365*24*60*60)), times[1]); times[0] = times[1]; TEST_THAT(::utimes("testfiles/TestDir1/sub23/in-the-future", times) == 0); } From boxbackup-dev at fluffy.co.uk Tue Dec 20 09:30:51 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Tue, 20 Dec 2005 09:30:51 +0000 Subject: [Box Backup-dev] COMMIT r245 - box/trunk/infrastructure/m4 In-Reply-To: <52CAEF11-1565-4A6F-9E4C-CA863DB08E98@chromatix.org.uk> References: <20051215143424.B12FC94@s0g0.pems.testserver.co.uk> <0539782F-EB36-4C81-BE8C-2BAD3C6050C8@chromatix.uklinux.net> <1134928443.7452.21.camel@avenin.ebourne.me.uk> <793C9C30-3FF1-4B64-95A0-3670E6640442@chromatix.org.uk> <1135034888.25746.13.camel@avenin.ebourne.me.uk> <52CAEF11-1565-4A6F-9E4C-CA863DB08E98@chromatix.org.uk> Message-ID: <00C2BC70-9E4E-4E98-8A2C-DE6E3DF7EBB0@fluffy.co.uk> On 19 Dec 2005, at 23:38, Jonathan Morton wrote: >>> However, I notice that the code emitted by configure for this test >>> actually tries to call dbopen(), but the linker complains that >>> __db185_open() is missing. This tells me that db_185.h is doing >>> something weird that breaks. >> >> Interesting. db_185.h unsurprisingly #defines dbopen to >> __db185_open so >> that the same .so can provide v4 and v1.85 support. That's exactly >> how >> the version installed with fedora works. The odd thing is that >> your .so >> doesn't seem to match your header file. > > Yes, I did think it odd. Might be worth filing a bug with Gentoo. I would like to keep things simpler for OpenBSD users by retaining db1 support. > >>> I think the real fix is to move to proper db4 support, but I have no >>> idea what that entails. >> >> I agree and is what I plan. It should be fairly easy - the db4 >> stuff is >> all in the tree now, so really just a configure issue. However, I >> didn't >> want to do this until after the next release is out because every >> change >> delays it. I think now though I'll do it before. >> >> However I would like all the tests to pass before changing any more >> functionality. I've only had a little time to spend on it (I think we >> all have day jobs, even if we aren't all emigrating!), but I've >> worked >> out that the raidfile failures are only on 64 bit. No further than >> that >> though. I need to fix the time overflow problem on 64 bit too. > > Actually, I've had the opposite experience - everything working on > PPC64, but everything in Raidfile going crazy on PPC32. Possibly an endian issue. I can't see any changes in lib/raidfile which might have caused an issue, apart from moving to use box_hton64 and the like. I'm still investigating. Ben From boxbackup-dev at fluffy.co.uk Tue Dec 20 11:08:02 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Tue, 20 Dec 2005 11:08:02 +0000 Subject: [Box Backup-dev] COMMIT r245 - box/trunk/infrastructure/m4 In-Reply-To: <00C2BC70-9E4E-4E98-8A2C-DE6E3DF7EBB0@fluffy.co.uk> References: <20051215143424.B12FC94@s0g0.pems.testserver.co.uk> <0539782F-EB36-4C81-BE8C-2BAD3C6050C8@chromatix.uklinux.net> <1134928443.7452.21.camel@avenin.ebourne.me.uk> <793C9C30-3FF1-4B64-95A0-3670E6640442@chromatix.org.uk> <1135034888.25746.13.camel@avenin.ebourne.me.uk> <52CAEF11-1565-4A6F-9E4C-CA863DB08E98@chromatix.org.uk> <00C2BC70-9E4E-4E98-8A2C-DE6E3DF7EBB0@fluffy.co.uk> Message-ID: <20051220110802.cwldzzi6sosc848w@ebourne.me.uk> Ben Summers wrote: > I would like to keep things simpler for OpenBSD users by retaining > db1 support. The plan is definitely to keep db1 support. Sorry if I gave the impression that wasn't the case. The code is currently conditional in trunk but the db4 code doesn't get used. I plan to leave the code alone and change configure to use db4 when available. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Tue Dec 20 11:15:35 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Tue, 20 Dec 2005 11:15:35 +0000 Subject: [Box Backup-dev] bbackupd test Message-ID: <20051220111535.gwuc3jftkc4gks4s@ebourne.me.uk> With my three commits of this morning the bbackupd test now fails in only one place on x86_64 FC4. That is the same failure as I get on i386 FC4. Doesn't fix raidfile though. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Tue Dec 20 17:10:12 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Tue, 20 Dec 2005 17:10:12 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r251 - box/trunk/bin/bbackupd Message-ID: <20051220171012.0D1C794@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-20 17:10:11 +0000 (Tue, 20 Dec 2005) New Revision: 251 Modified: box/trunk/bin/bbackupd/BackupDaemon.cpp Log: Revert this change to the error retry delay that slipped in with win32. Arguably the timeout was already too short, or should use an increasing backoff strategy. But 10s is way too short. Modified: box/trunk/bin/bbackupd/BackupDaemon.cpp =================================================================== --- box/trunk/bin/bbackupd/BackupDaemon.cpp 2005-12-20 08:20:33 UTC (rev 250) +++ box/trunk/bin/bbackupd/BackupDaemon.cpp 2005-12-20 17:10:11 UTC (rev 251) @@ -724,7 +724,7 @@ "to retry...", errorString, errorCode, errorSubCode); - ::sleep(10); + ::sleep(100); } } From boxbackup-dev at fluffy.co.uk Tue Dec 20 18:36:30 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Tue, 20 Dec 2005 18:36:30 +0000 Subject: [Box Backup-dev] tests passing on i386 Message-ID: <20051220183630.dke70hdcnkccggcs@ebourne.me.uk> With that last commit (which took too long to find), the tests all pass on i386 FC4, both in release and debug mode. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Tue Dec 20 18:42:58 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Tue, 20 Dec 2005 18:42:58 +0000 Subject: [Box Backup-dev] tests passing on i386 In-Reply-To: <20051220183630.dke70hdcnkccggcs@ebourne.me.uk> References: <20051220183630.dke70hdcnkccggcs@ebourne.me.uk> Message-ID: <7DC92618-B30F-480D-8464-31AB4857FB86@fluffy.co.uk> On 20 Dec 2005, at 18:36, Martin Ebourne wrote: > With that last commit (which took too long to find), the tests all > pass on i386 FC4, both in release and debug mode. Even raidfile? Ben From boxbackup-dev at fluffy.co.uk Tue Dec 20 20:11:38 2005 From: boxbackup-dev at fluffy.co.uk (Charles Lecklider) Date: Tue, 20 Dec 2005 20:11:38 +0000 Subject: [Box Backup-dev] Win32 Message-ID: <43A8657A.1000407@invis.net> Could someone check in a config.h suitable for Win32 please? Or perhaps just send me one? Generating one under FreeBSD seems to require all sorts of things I've never needed before, and really don't want to install just to get a config.h.... I'm perfectly happy to change it to suit so it doesn't really have to be a Win32 one - just something to start with. Thanks. -C From boxbackup-dev at fluffy.co.uk Tue Dec 20 19:44:57 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Tue, 20 Dec 2005 19:44:57 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r252 - box/chris/win32/pipe-security/lib/win32 Message-ID: <20051220194457.C2CF994@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-20 19:44:53 +0000 (Tue, 20 Dec 2005) New Revision: 252 Added: box/chris/win32/pipe-security/lib/win32/config.h.win32 Log: * config.h.win32 - Checked in an example config.h for win32 Added: box/chris/win32/pipe-security/lib/win32/config.h.win32 =================================================================== --- box/chris/win32/pipe-security/lib/win32/config.h.win32 2005-12-20 17:10:11 UTC (rev 251) +++ box/chris/win32/pipe-security/lib/win32/config.h.win32 2005-12-20 19:44:53 UTC (rev 252) @@ -0,0 +1,342 @@ +/* lib/common/config.h. Generated by configure. */ +/* lib/common/config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if the `closedir' function returns void instead of `int'. */ +/* #undef CLOSEDIR_VOID */ + +/* Define to the location of the Berkeley DB 1.85 header */ +/* #undef DB_HEADER */ + +/* Define to 1 if non-aligned int16 access will fail */ +/* #undef HAVE_ALIGNED_ONLY_INT16 */ + +/* Define to 1 if non-aligned int32 access will fail */ +/* #undef HAVE_ALIGNED_ONLY_INT32 */ + +/* Define to 1 if non-aligned int64 access will fail */ +/* #undef HAVE_ALIGNED_ONLY_INT64 */ + +/* Define to 1 if Berkeley DB is available */ +/* #undef HAVE_DB */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DB1_DB_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DB3_DB_185_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DB4_DB_185_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DB_185_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DB_H */ + +/* Define to 1 if you have the declaration of `F_SETLK', and to 0 if you + don't. */ +#define HAVE_DECL_F_SETLK 0 + +/* Define to 1 if you have the declaration of `INFTIM', and to 0 if you don't. + */ +#define HAVE_DECL_INFTIM 0 + +/* Define to 1 if you have the declaration of `O_EXLOCK', and to 0 if you + don't. */ +#define HAVE_DECL_O_EXLOCK 0 + +/* Define to 1 if you have the declaration of `SO_PEERCRED', and to 0 if you + don't. */ +#define HAVE_DECL_SO_PEERCRED 0 + +/* Define to 1 if #define of pragmas works */ +/* #undef HAVE_DEFINE_PRAGMA */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#define HAVE_DIRENT_H 1 + +/* define if the compiler supports exceptions */ +#define HAVE_EXCEPTIONS + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_EXECINFO_H */ + +/* Define to 1 if you have the `flock' function. */ +/* #undef HAVE_FLOCK */ + +/* Define to 1 if you have the `getmntent' function. */ +/* #undef HAVE_GETMNTENT */ + +/* Define to 1 if you have the `getpeereid' function. */ +/* #undef HAVE_GETPEEREID */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_HISTORY_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_INTTYPES_H */ + +/* Define to 1 if you have the `kqueue' function. */ +/* #undef HAVE_KQUEUE */ + +/* Define to 1 large file support is in use */ +/* #undef HAVE_LARGE_FILE_SUPPORT */ + +/* Define to 1 if you have the `lchown' function. */ +/* #undef HAVE_LCHOWN */ + +/* Define to 1 if you have the `crypto' library (-lcrypto). */ +#define HAVE_LIBCRYPTO 1 + +/* Define if you have a readline compatible library */ +/* #undef HAVE_LIBREADLINE */ + +/* Define to 1 if you have the `ssl' library (-lssl). */ +#define HAVE_LIBSSL 1 + +/* Define to 1 if you have the `z' library (-lz). */ +#define HAVE_LIBZ 1 + +/* Define to 1 if syscall lseek requires a dummy middle parameter */ +/* #undef HAVE_LSEEK_DUMMY_PARAM */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MNTENT_H */ + +/* Define to 1 if this platform supports mounts */ +/* #undef HAVE_MOUNTS */ + +/* define if the compiler implements namespaces */ +#define HAVE_NAMESPACES + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_IN_H */ + +/* Define to 1 if SSL is pre-0.9.7 */ +/* #undef HAVE_OLD_SSL */ + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_SSL_H 1 + +/* Define to 1 (and set RANDOM_DEVICE) if a random device is available */ +/* #undef HAVE_RANDOM_DEVICE */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_READLINE_H */ + +/* Define if your readline library has \`add_history' */ +/* #undef HAVE_READLINE_HISTORY */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_READLINE_HISTORY_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_READLINE_READLINE_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_REGEX_H */ + +/* Define to 1 if you have the `setproctitle' function. */ +/* #undef HAVE_SETPROCTITLE */ + +/* Define to 1 if SSL is available */ +#define HAVE_SSL 1 + +/* Define to 1 if you have the `statfs' function. */ +/* #undef HAVE_STATFS */ + +/* Define to 1 if `stat' has the bug that it succeeds when given the + zero-length file name argument. */ +/* #undef HAVE_STAT_EMPTY_STRING_BUG */ + +/* Define to 1 if stdbool.h conforms to C99. */ +#define HAVE_STDBOOL_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STDINT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if `d_type' is member of `struct dirent'. */ +/* #undef HAVE_STRUCT_DIRENT_D_TYPE */ + +/* Define to 1 if `mnt_dir' is member of `struct mntent'. */ +/* #undef HAVE_STRUCT_MNTENT_MNT_DIR */ + +/* Define to 1 if `mnt_mountp' is member of `struct mnttab'. */ +/* #undef HAVE_STRUCT_MNTTAB_MNT_MOUNTP */ + +/* Define to 1 if `sin_len' is member of `struct sockaddr_in'. */ +/* #undef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */ + +/* Define to 1 if `f_mntonname' is member of `struct statfs'. */ +/* #undef HAVE_STRUCT_STATFS_F_MNTONNAME */ + +/* Define to 1 if `st_flags' is member of `struct stat'. */ +/* #undef HAVE_STRUCT_STAT_ST_FLAGS */ + +/* Define to 1 if `st_mtimespec' is member of `struct stat'. */ +/* #undef HAVE_STRUCT_STAT_ST_MTIMESPEC */ + +/* Define to 1 if you have the `syscall' function. */ +/* #undef HAVE_SYSCALL */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MNTTAB_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MOUNT_H */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SYSCALL_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have that is POSIX.1 compatible. */ +/* #undef HAVE_SYS_WAIT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_XATTR_H */ + +/* Define to 1 if the system has the type `uint16_t'. */ +#define HAVE_UINT16_T 1 + +/* Define to 1 if the system has the type `uint32_t'. */ +#define HAVE_UINT32_T 1 + +/* Define to 1 if the system has the type `uint64_t'. */ +#define HAVE_UINT64_T 1 + +/* Define to 1 if the system has the type `uint8_t'. */ +#define HAVE_UINT8_T 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if the system has the type `u_int16_t'. */ +/* #undef HAVE_U_INT16_T */ + +/* Define to 1 if the system has the type `u_int32_t'. */ +/* #undef HAVE_U_INT32_T */ + +/* Define to 1 if the system has the type `u_int64_t'. */ +/* #undef HAVE_U_INT64_T */ + +/* Define to 1 if the system has the type `u_int8_t'. */ +/* #undef HAVE_U_INT8_T */ + +/* Define to 1 if struct dirent.d_type is valid */ +/* #undef HAVE_VALID_DIRENT_D_TYPE */ + +/* Define to 1 if the system has the type `_Bool'. */ +/* #undef HAVE__BOOL */ + +/* Define to 1 if you have the `__syscall' function. */ +/* #undef HAVE___SYSCALL */ + +/* Define to 1 if __syscall is available but needs a definition */ +/* #undef HAVE___SYSCALL_NEED_DEFN */ + +/* max value of long long calculated by configure */ +/* #undef LLONG_MAX */ + +/* min value of long long calculated by configure */ +/* #undef LLONG_MIN */ + +/* Define to 1 if `lstat' dereferences a symlink specified with a trailing + slash. */ +/* #undef LSTAT_FOLLOWS_SLASHED_SYMLINK */ + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "box at fluffy.co.uk" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "Box Backup" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "Box Backup 0.09" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "box-backup" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "0.09" + +/* Define to the filename of the random device (and set HAVE_RANDOM_DEVICE) */ +/* #undef RANDOM_DEVICE */ + +/* Define as the return type of signal handlers (`int' or `void'). */ +#define RETSIGTYPE void + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* TMP directory name */ +#define TEMP_DIRECTORY_NAME "/tmp" + +/* Define to 1 if you can safely include both and . */ +#define TIME_WITH_SYS_TIME 1 + +/* Define to 1 if your declares `struct tm'. */ +/* #undef TM_IN_SYS_TIME */ + +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +/* #undef WORDS_BIGENDIAN */ + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if __USE_MALLOC is required work around STL memory leaks */ +/* #undef __USE_MALLOC */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `int' if doesn't define. */ +#define gid_t int + +/* Define to `int' if does not define. */ +/* #undef mode_t */ + +/* Define to `long' if does not define. */ +/* #undef off_t */ + +/* Define to `int' if does not define. */ +/* #undef pid_t */ + +/* Define to `unsigned' if does not define. */ +/* #undef size_t */ + +/* Define to `int' if doesn't define. */ +#define uid_t int From boxbackup-dev at fluffy.co.uk Tue Dec 20 19:46:52 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Tue, 20 Dec 2005 19:46:52 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r253 - in box/chris/win32/pipe-security/lib: common win32 Message-ID: <20051220194652.0754F94@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-20 19:46:44 +0000 (Tue, 20 Dec 2005) New Revision: 253 Modified: box/chris/win32/pipe-security/lib/common/BoxPlatform.h box/chris/win32/pipe-security/lib/win32/emu.h Log: * lib/win32/emu.h * lib/common/BoxPlatform.h - Compile fixes for Microsoft Visual C++ 2005 (not retested on MinGW yet) Modified: box/chris/win32/pipe-security/lib/common/BoxPlatform.h =================================================================== --- box/chris/win32/pipe-security/lib/common/BoxPlatform.h 2005-12-20 19:44:53 UTC (rev 252) +++ box/chris/win32/pipe-security/lib/common/BoxPlatform.h 2005-12-20 19:46:44 UTC (rev 253) @@ -77,9 +77,13 @@ #define HAVE_UINT16_T #define HAVE_UINT32_T #define HAVE_UINT64_T + #define HAVE_U_INT8_T + #define HAVE_U_INT16_T + #define HAVE_U_INT32_T + #define HAVE_U_INT64_T - typedef unsigned int uid_t; - typedef unsigned int gid_t; + // typedef unsigned int uid_t; + // typedef unsigned int gid_t; typedef int pid_t; #endif // WIN32 && !__MINGW32__ Modified: box/chris/win32/pipe-security/lib/win32/emu.h =================================================================== --- box/chris/win32/pipe-security/lib/win32/emu.h 2005-12-20 19:44:53 UTC (rev 252) +++ box/chris/win32/pipe-security/lib/win32/emu.h 2005-12-20 19:46:44 UTC (rev 253) @@ -3,7 +3,7 @@ #if ! defined EMU_INCLUDE && defined WIN32 #define EMU_INCLUDE -#define _STAT_DEFINED +// #define _STAT_DEFINED #define _INO_T_DEFINED #include @@ -178,7 +178,7 @@ str = str.substr(index+1, str.size()); } - index = str.find('-'); + index = (int)str.find('-'); if ( index == -1 ) return -1; @@ -187,7 +187,7 @@ optind ++; str = args[optind]; } - while ( ( opttolookfor = interestin.find(opt)) == -1 ); + while ( ( opttolookfor = (int)interestin.find(opt)) == -1 ); if ( interestin[opttolookfor+1] == ':' ) { @@ -257,7 +257,7 @@ inline int mkdir(const char *pathname, mode_t mode) { - return mkdir(pathname); + return _mkdir(pathname); } #ifdef __MINGW32__ @@ -358,6 +358,7 @@ TCHAR f_mntonname[MAX_PATH]; }; +#if 0 // I think this should get us going // Although there is a warning about // mount points in win32 can now exists - which means inode number can be @@ -381,6 +382,7 @@ #ifndef __MINGW32__ typedef u_int64_t _ino_t; #endif +#endif // 0 int ourstat(const char * name, struct stat * st); int ourfstat(HANDLE file, struct stat * st); From boxbackup-dev at fluffy.co.uk Tue Dec 20 20:39:51 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Tue, 20 Dec 2005 20:39:51 +0000 (GMT) Subject: [Box Backup-dev] Win32 In-Reply-To: <43A8657A.1000407@invis.net> References: <43A8657A.1000407@invis.net> Message-ID: Hi Charles, > Could someone check in a config.h suitable for Win32 please? Or perhaps > just send me one? Generating one under FreeBSD seems to require all > sorts of things I've never needed before, and really don't want to > install just to get a config.h.... I'm perfectly happy to change it to > suit so it doesn't really have to be a Win32 one - just something to > start with. Please try [http://bbdev.fluffy.co.uk/svn/box/chris/win32/pipe-security/lib/win32/config.h.win32] Also, if you're compiling with Visual Studio, you may want the fixes I just checked in for lib/win32/emu.h and lib/common/BoxPlatform.h in pipe-security. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Tue Dec 20 20:54:45 2005 From: boxbackup-dev at fluffy.co.uk (Charles Lecklider) Date: Tue, 20 Dec 2005 20:54:45 +0000 Subject: [Box Backup-dev] Win32 In-Reply-To: References: <43A8657A.1000407@invis.net> Message-ID: <43A86F95.3070900@invis.net> Chris Wilson wrote: > Also, if you're compiling with Visual Studio, you may want the fixes I > just checked in for lib/win32/emu.h and lib/common/BoxPlatform.h in > pipe-security. Thanks - that's got me a bit further. Now I just get a few redefinition warnings (easy enough to solve - they obviously pre-date the autoconf work), and one missing autogen_CommonException.h. Is it the intention that Perl is required to build boxbackup? I think that's entirely reasonable for any *nix, but I'm not convinced it's a good idea for Windows. -C From boxbackup-dev at fluffy.co.uk Tue Dec 20 20:59:31 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Tue, 20 Dec 2005 20:59:31 +0000 (GMT) Subject: [Box Backup-dev] Win32 In-Reply-To: <43A86F95.3070900@invis.net> References: <43A8657A.1000407@invis.net> <43A86F95.3070900@invis.net> Message-ID: Hi Charles, > Thanks - that's got me a bit further. Now I just get a few redefinition > warnings (easy enough to solve - they obviously pre-date the autoconf > work), and one missing autogen_CommonException.h. > > Is it the intention that Perl is required to build boxbackup? I think > that's entirely reasonable for any *nix, but I'm not convinced it's a > good idea for Windows. It always used to be the case, but with autoconf, far more is required - a Bash-like shell and some other Posix tools. Nick's win32.bat used to work around the need to run configure, by running Perl to generate the autogen code, and using Visual Studio project files rather than Makefiles to build the project. I don't know if it still works. How about if someone runs a script to regularly autogenerate and configure the trunk for Win32 (on a *nix box) and posts tarballs that Windows users can download? By the way, you also need Perl to compile OpenSSL, on which Box Backup depends. This could be worked around in a similar fashion. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Tue Dec 20 21:05:26 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Tue, 20 Dec 2005 21:05:26 +0000 Subject: [Box Backup-dev] Win32 In-Reply-To: References: <43A8657A.1000407@invis.net> <43A86F95.3070900@invis.net> Message-ID: <81BC1C3D-2E31-4925-A906-49C413B0B609@fluffy.co.uk> On 20 Dec 2005, at 20:59, Chris Wilson wrote: > Hi Charles, > >> Thanks - that's got me a bit further. Now I just get a few >> redefinition >> warnings (easy enough to solve - they obviously pre-date the autoconf >> work), and one missing autogen_CommonException.h. >> >> Is it the intention that Perl is required to build boxbackup? I >> think >> that's entirely reasonable for any *nix, but I'm not convinced it's a >> good idea for Windows. > > It always used to be the case, but with autoconf, far more is > required - a Bash-like shell and some other Posix tools. Nick's > win32.bat used to work around the need to run configure, by running > Perl to generate the autogen code, and using Visual Studio project > files rather than Makefiles to build the project. I don't know if > it still works. > > How about if someone runs a script to regularly autogenerate and > configure the trunk for Win32 (on a *nix box) and posts tarballs > that Windows users can download? I'd prefer not to have the autogen_* stuff in SVN. Is such a script difficult? I could run it as a cron job on the repository server as long as it'll be happy with just a plain OpenBSD environment. Ben From boxbackup-dev at fluffy.co.uk Tue Dec 20 21:10:18 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Tue, 20 Dec 2005 21:10:18 +0000 (GMT) Subject: [Box Backup-dev] Win32 In-Reply-To: <81BC1C3D-2E31-4925-A906-49C413B0B609@fluffy.co.uk> References: <43A8657A.1000407@invis.net> <43A86F95.3070900@invis.net> <81BC1C3D-2E31-4925-A906-49C413B0B609@fluffy.co.uk> Message-ID: Hi Ben, >> How about if someone runs a script to regularly autogenerate and configure >> the trunk for Win32 (on a *nix box) and posts tarballs that Windows users >> can download? > > I'd prefer not to have the autogen_* stuff in SVN. I didn't mean to have it in SVN - rather to autogenerate it and tar it up, and make tarballs available on a separate server. However, I could also upload them to another SVN server such as my own, if people prefer to have access to the code via SVN. > Is such a script difficult? I could run it as a cron job on the > repository server as long as it'll be happy with just a plain OpenBSD > environment. The problem would be the stuff autodetected by configure, which would be targeted for your platform rather than Win32. If you install MinGW and cross-compile with that, it should work, more or less - MinGW and Visual C++ don't provide identical features, so some patching of config.h might be necessary. If you want to try this, I've put (incomplete) instructions on cross-compiling with MinGW on a *nix box in docs/backup/win32_build_on_linux_using_mingw.txt. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Tue Dec 20 21:29:54 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Tue, 20 Dec 2005 21:29:54 +0000 Subject: [Box Backup-dev] Win32 In-Reply-To: References: <43A8657A.1000407@invis.net> <43A86F95.3070900@invis.net> <81BC1C3D-2E31-4925-A906-49C413B0B609@fluffy.co.uk> Message-ID: <1135114194.1984.2.camel@avenin.ebourne.me.uk> On Tue, 2005-12-20 at 21:10 +0000, Chris Wilson wrote: > The problem would be the stuff autodetected by configure, which would be > targeted for your platform rather than Win32. If you install MinGW and > cross-compile with that, it should work, more or less - MinGW and Visual > C++ don't provide identical features, so some patching of config.h might > be necessary. Most projects just put up the windows executable/installer. After all, that's what most people want. If it is possible to cross compile that from unix, it would seem ideal. Not sure on the value of preconfigured source - anyone who wants to hack it on windows is able to set up cygwin, and users certainly don't want to compile on windows. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Tue Dec 20 21:31:58 2005 From: boxbackup-dev at fluffy.co.uk (Charles Lecklider) Date: Tue, 20 Dec 2005 21:31:58 +0000 Subject: [Box Backup-dev] Win32 In-Reply-To: References: <43A8657A.1000407@invis.net> <43A86F95.3070900@invis.net> Message-ID: <43A8784E.9080005@invis.net> Chris Wilson wrote: > By the way, you also need Perl to compile OpenSSL, on which Box Backup > depends. This could be worked around in a similar fashion. Yes, it does, but it really doesn't need to. The only reason it's still there is because of a pathological hatred of Windows on the part of the OpenSSL maintainers. All it does is generate a makefile, and the output hasn't changed in the last 10 releases.... Anyway, I think having a separate download for the files needed for Win32 is a good solution to the problem. Exactly how those files are generated is a problem for someone else :-) Having said that, can SVN run a script after a check-in on a given branch? -C From boxbackup-dev at fluffy.co.uk Tue Dec 20 21:34:03 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Tue, 20 Dec 2005 21:34:03 +0000 Subject: [Box Backup-dev] tests passing on i386 In-Reply-To: <7DC92618-B30F-480D-8464-31AB4857FB86@fluffy.co.uk> References: <20051220183630.dke70hdcnkccggcs@ebourne.me.uk> <7DC92618-B30F-480D-8464-31AB4857FB86@fluffy.co.uk> Message-ID: <1135114443.1984.7.camel@avenin.ebourne.me.uk> On Tue, 2005-12-20 at 18:42 +0000, Ben Summers wrote: > On 20 Dec 2005, at 18:36, Martin Ebourne wrote: > > > With that last commit (which took too long to find), the tests all > > pass on i386 FC4, both in release and debug mode. > > Even raidfile? I don't think raidfile was ever broken on i386. The only test I have outstanding to fix is raidfile on x86_64 FC4. 240 failures. All others pass whether release or debug on x86_64, and as I said above, all tests now pass on i386. Maybe when I fix the raidfile test on x86_64 it'll also fix ppc. I think all other ppc tests probably now work due to my other fixes. How is OpenBSD doing? Cheers, Martin. From boxbackup-dev at fluffy.co.uk Tue Dec 20 23:05:10 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Tue, 20 Dec 2005 23:05:10 +0000 Subject: [Box Backup-dev] tests passing on i386 In-Reply-To: <1135114443.1984.7.camel@avenin.ebourne.me.uk> References: <20051220183630.dke70hdcnkccggcs@ebourne.me.uk> <7DC92618-B30F-480D-8464-31AB4857FB86@fluffy.co.uk> <1135114443.1984.7.camel@avenin.ebourne.me.uk> Message-ID: <8D8E6252-4077-4F09-8EAC-0612F0F4AB2F@fluffy.co.uk> On 20 Dec 2005, at 21:34, Martin Ebourne wrote: > On Tue, 2005-12-20 at 18:42 +0000, Ben Summers wrote: >> On 20 Dec 2005, at 18:36, Martin Ebourne wrote: >> >>> With that last commit (which took too long to find), the tests all >>> pass on i386 FC4, both in release and debug mode. >> >> Even raidfile? > > I don't think raidfile was ever broken on i386. That explains the lack of it failing. I'm obviously getting confused. > > The only test I have outstanding to fix is raidfile on x86_64 FC4. 240 > failures. All others pass whether release or debug on x86_64, and as I > said above, all tests now pass on i386. > > Maybe when I fix the raidfile test on x86_64 it'll also fix ppc. I > think > all other ppc tests probably now work due to my other fixes. Maybe. I suspect endian issues for the raidfile on 64, or perhaps word length. It does some quite complex stuff to store files without using excess blocks on discs, doing stuff like ZORing the length into ends of files and the like. All good fun. > > How is OpenBSD doing? Two failures on 3.7: backstore (server throws RaidFile/ RaidFileDoesntExist) and backupstorefix (fails miserably), everything else is fine. Looking into it... Also, sys/mount.h isn't detected by autoconf, even though it does exist. Editing lib/common/config.h to #define the HAVE_SYS_MOUNT_H does make everything compile OK. I shall attempt to work out why that's happening. Ben From boxbackup-dev at fluffy.co.uk Tue Dec 20 22:30:45 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Tue, 20 Dec 2005 22:30:45 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r254 - box/chris/win32 Message-ID: <20051220223045.8C49394@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-20 22:30:38 +0000 (Tue, 20 Dec 2005) New Revision: 254 Added: box/chris/win32/vc2005-compile-fixes/ Log: * http://bbdev.fluffy.co.uk/svn/box/chris/win32/vc2005-compile-fixes - Branch for compile fixes for Visual C++ 2005 Express Copied: box/chris/win32/vc2005-compile-fixes (from rev 253, box/trunk) From boxbackup-dev at fluffy.co.uk Tue Dec 20 23:44:26 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Tue, 20 Dec 2005 23:44:26 +0000 Subject: [Box Backup-dev] tests passing on i386 In-Reply-To: <8D8E6252-4077-4F09-8EAC-0612F0F4AB2F@fluffy.co.uk> References: <20051220183630.dke70hdcnkccggcs@ebourne.me.uk> <7DC92618-B30F-480D-8464-31AB4857FB86@fluffy.co.uk> <1135114443.1984.7.camel@avenin.ebourne.me.uk> <8D8E6252-4077-4F09-8EAC-0612F0F4AB2F@fluffy.co.uk> Message-ID: <1135122266.7993.20.camel@avenin.ebourne.me.uk> On Tue, 2005-12-20 at 23:05 +0000, Ben Summers wrote: > Maybe. I suspect endian issues for the raidfile on 64, or perhaps > word length. It does some quite complex stuff to store files without > using excess blocks on discs, doing stuff like ZORing the length into > ends of files and the like. All good fun. I've just found the issue with raidfile on x86_64 FC4. It started with the autoconf patch which changed from using the native hton64 (stolen in an unpleasant manner from the kernel header file) to the box_swap64 function. Although the function appears to look and work perfectly ok, apparently there is a compiler bug with the inlining. If I make this change in Box.h: -inline uint64_t box_swap64(uint64_t x) +static uint64_t box_swap64(uint64_t x) Then it all magically works. This also explains why it has only broken now - when I wrote that patch and tested it before it was on FC3, which was gcc 3.4. FC4 is using gcc version 4.0.2 20051125 (Red Hat 4.0.2-8). I don't intend to do anything directly about that. I do plan to look at getting configure to find a built in swap64 instead though, which will hopefully fix it indirectly. This of course will make no odds to raidfile on PPC because that is big endian anyway. I can't directly help with those failures because all my machines are AMD64 only. > Also, sys/mount.h isn't detected by autoconf, even though it does > exist. Editing lib/common/config.h to #define the HAVE_SYS_MOUNT_H > does make everything compile OK. I shall attempt to work out why > that's happening. Most likely has a header it is dependent on. From the autoconf manual describing AC_CHECK_HEADERS: Previous versions of Autoconf merely checked whether the header was accepted by the preprocessor. This was changed because the old test was inappropriate for typical uses. Headers are typically used to compile, not merely to preprocess, and the old behavior sometimes accepted headers that clashed at compile-time. If you need to check whether a header is preprocessable, you can use `AC_PREPROC_IFELSE' (*note Running the Preprocessor::). This scheme, which improves the robustness of the test, also requires that you make sure that headers that must be included before the HEADER-FILE be part of the INCLUDES, (*note Default Includes::). If looking for `bar.h', which requires that `foo.h' be included before if it exists, we suggest the following scheme: AC_CHECK_HEADERS([foo.h]) AC_CHECK_HEADERS([bar.h], [], [], [#if HAVE_FOO_H # include # endif ]) The Linux man page doesn't give a dependency, but maybe OpenBSD has one where Linux doesn't. You can get more clues by looking at config.log. Search for 'checking for sys/mount.h' then see if there is a section immediately following which starts 'configure: failed program was:'. That gives you the program it tried to compile, and you should see the error message from the compiler too. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Tue Dec 20 22:59:51 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Tue, 20 Dec 2005 22:59:51 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r255 - in box/chris/win32/vc2005-compile-fixes/lib: common compress server win32 Message-ID: <20051220225951.EDCE794@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-20 22:59:29 +0000 (Tue, 20 Dec 2005) New Revision: 255 Modified: box/chris/win32/vc2005-compile-fixes/lib/common/CollectInBufferStream.cpp box/chris/win32/vc2005-compile-fixes/lib/common/CollectInBufferStream.h box/chris/win32/vc2005-compile-fixes/lib/common/DebugMemLeakFinder.cpp box/chris/win32/vc2005-compile-fixes/lib/common/EventWatchFilesystemObject.cpp box/chris/win32/vc2005-compile-fixes/lib/common/ExcludeList.h box/chris/win32/vc2005-compile-fixes/lib/common/FdGetLine.cpp box/chris/win32/vc2005-compile-fixes/lib/common/FileStream.h box/chris/win32/vc2005-compile-fixes/lib/common/Guards.h box/chris/win32/vc2005-compile-fixes/lib/common/IOStream.cpp box/chris/win32/vc2005-compile-fixes/lib/common/IOStream.h box/chris/win32/vc2005-compile-fixes/lib/common/IOStreamGetLine.cpp box/chris/win32/vc2005-compile-fixes/lib/common/IOStreamGetLine.h box/chris/win32/vc2005-compile-fixes/lib/common/MemBlockStream.cpp box/chris/win32/vc2005-compile-fixes/lib/common/MemBlockStream.h box/chris/win32/vc2005-compile-fixes/lib/common/PartialReadStream.cpp box/chris/win32/vc2005-compile-fixes/lib/common/PartialReadStream.h box/chris/win32/vc2005-compile-fixes/lib/common/ReadGatherStream.cpp box/chris/win32/vc2005-compile-fixes/lib/common/ReadGatherStream.h box/chris/win32/vc2005-compile-fixes/lib/common/StreamableMemBlock.cpp box/chris/win32/vc2005-compile-fixes/lib/common/StreamableMemBlock.h box/chris/win32/vc2005-compile-fixes/lib/common/UnixUser.cpp box/chris/win32/vc2005-compile-fixes/lib/common/Utils.cpp box/chris/win32/vc2005-compile-fixes/lib/common/WaitForEvent.cpp box/chris/win32/vc2005-compile-fixes/lib/compress/Compress.h box/chris/win32/vc2005-compile-fixes/lib/compress/CompressStream.cpp box/chris/win32/vc2005-compile-fixes/lib/compress/CompressStream.h box/chris/win32/vc2005-compile-fixes/lib/server/Protocol.h box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h Log: First set of Visual C++ 2005 compile fixes (not tested on any other platform) Modified: box/chris/win32/vc2005-compile-fixes/lib/common/CollectInBufferStream.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/CollectInBufferStream.cpp 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/common/CollectInBufferStream.cpp 2005-12-20 22:59:29 UTC (rev 255) @@ -61,9 +61,9 @@ if(mInWritePhase != false) { THROW_EXCEPTION(CommonException, CollectInBufferStreamNotInCorrectPhase) } // Adjust to number of bytes left - if(NBytes > (mBytesInBuffer - mReadPosition)) + if(NBytes > (int)(mBytesInBuffer - mReadPosition)) { - NBytes = (mBytesInBuffer - mReadPosition); + NBytes = (int)(mBytesInBuffer - mReadPosition); } ASSERT(NBytes >= 0); if(NBytes <= 0) return 0; // careful now @@ -157,7 +157,7 @@ { if(mInWritePhase != false) { THROW_EXCEPTION(CommonException, CollectInBufferStreamNotInCorrectPhase) } - int newPos = 0; + pos_type newPos = 0; switch(SeekType) { case IOStream::SeekType_Absolute: Modified: box/chris/win32/vc2005-compile-fixes/lib/common/CollectInBufferStream.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/CollectInBufferStream.h 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/common/CollectInBufferStream.h 2005-12-20 22:59:29 UTC (rev 255) @@ -52,7 +52,7 @@ MemoryBlockGuard mBuffer; int mBufferSize; int mBytesInBuffer; - int mReadPosition; + pos_type mReadPosition; bool mInWritePhase; }; Modified: box/chris/win32/vc2005-compile-fixes/lib/common/DebugMemLeakFinder.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/DebugMemLeakFinder.cpp 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/common/DebugMemLeakFinder.cpp 2005-12-20 22:59:29 UTC (rev 255) @@ -17,11 +17,14 @@ #undef free #include -#include #include #include #include +#ifndef WIN32 +#include +#endif + bool memleakfinder_global_enable = false; typedef struct @@ -220,12 +223,12 @@ } else { - TRACE4("Block 0x%08lx size %d allocated at %s:%d\n", (long)i->first, i->second.size, i->second.file, i->second.line); + TRACE4("Block 0x%08p size %d allocated at %s:%d\n", i->first, i->second.size, i->second.file, i->second.line); } } for(std::map::const_iterator i(sSectionObjectBlocks.begin()); i != sSectionObjectBlocks.end(); ++i) { - TRACE5("Object%s 0x%08lx size %d allocated at %s:%d\n", i->second.array?" []":"", (long)i->first, i->second.size, i->second.file, i->second.line); + TRACE5("Object%s 0x%08p size %d allocated at %s:%d\n", i->second.array?" []":"", i->first, i->second.size, i->second.file, i->second.line); } } @@ -250,11 +253,11 @@ { for(std::map::const_iterator i(sMallocBlocks.begin()); i != sMallocBlocks.end(); ++i) { - if(is_leak(i->first)) ::fprintf(file, "Block 0x%08lx size %d allocated at %s:%d\n", (long)i->first, i->second.size, i->second.file, i->second.line); + if(is_leak(i->first)) ::fprintf(file, "Block 0x%08p size %d allocated at %s:%d\n", i->first, i->second.size, i->second.file, i->second.line); } for(std::map::const_iterator i(sObjectBlocks.begin()); i != sObjectBlocks.end(); ++i) { - if(is_leak(i->first)) ::fprintf(file, "Object%s 0x%08lx size %d allocated at %s:%d\n", i->second.array?" []":"", (long)i->first, i->second.size, i->second.file, i->second.line); + if(is_leak(i->first)) ::fprintf(file, "Object%s 0x%08p size %d allocated at %s:%d\n", i->second.array?" []":"", i->first, i->second.size, i->second.file, i->second.line); } } Modified: box/chris/win32/vc2005-compile-fixes/lib/common/EventWatchFilesystemObject.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/EventWatchFilesystemObject.cpp 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/common/EventWatchFilesystemObject.cpp 2005-12-20 22:59:29 UTC (rev 255) @@ -10,7 +10,10 @@ #include "Box.h" #include + +#ifndef WIN32 #include +#endif #include "EventWatchFilesystemObject.h" #include "autogen_CommonException.h" Modified: box/chris/win32/vc2005-compile-fixes/lib/common/ExcludeList.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/ExcludeList.h 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/common/ExcludeList.h 2005-12-20 22:59:29 UTC (rev 255) @@ -43,8 +43,8 @@ bool IsExcluded(const std::string &rTest) const; // Mainly for tests - unsigned int SizeOfDefiniteList() const {return mDefinite.size();} - unsigned int SizeOfRegexList() const + size_t SizeOfDefiniteList() const {return mDefinite.size();} + size_t SizeOfRegexList() const #ifdef HAVE_REGEX_H {return mRegex.size();} #else Modified: box/chris/win32/vc2005-compile-fixes/lib/common/FdGetLine.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/FdGetLine.cpp 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/common/FdGetLine.cpp 2005-12-20 22:59:29 UTC (rev 255) @@ -10,7 +10,10 @@ #include "Box.h" #include + +#ifndef WIN32 #include +#endif #include "FdGetLine.h" #include "CommonException.h" @@ -151,8 +154,8 @@ else { // Check for comment char, but char before must be whitespace - int end = 0; - int size = r.size(); + size_t end = 0; + size_t size = r.size(); while(end < size) { if(r[end] == '#' && (end == 0 || (iw(r[end-1])))) @@ -163,7 +166,7 @@ } // Remove whitespace - int begin = 0; + size_t begin = 0; while(begin < size && iw(r[begin])) { begin++; Modified: box/chris/win32/vc2005-compile-fixes/lib/common/FileStream.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/FileStream.h 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/common/FileStream.h 2005-12-20 22:59:29 UTC (rev 255) @@ -15,7 +15,10 @@ #include #include #include + +#ifndef WIN32 #include +#endif #ifdef WIN32 #define INVALID_FILE NULL Modified: box/chris/win32/vc2005-compile-fixes/lib/common/Guards.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/Guards.h 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/common/Guards.h 2005-12-20 22:59:29 UTC (rev 255) @@ -14,9 +14,12 @@ #include #include #include -#include #include +#ifndef WIN32 +#include +#endif + #include "CommonException.h" #include "MemLeakFindOn.h" Modified: box/chris/win32/vc2005-compile-fixes/lib/common/IOStream.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/IOStream.cpp 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/common/IOStream.cpp 2005-12-20 22:59:29 UTC (rev 255) @@ -145,15 +145,15 @@ // Created: 2003/08/26 // // -------------------------------------------------------------------------- -bool IOStream::ReadFullBuffer(void *pBuffer, int NBytes, int *pNBytesRead, int Timeout) +bool IOStream::ReadFullBuffer(void *pBuffer, size_t NBytes, size_t *pNBytesRead, int Timeout) { - int bytesToGo = NBytes; + size_t bytesToGo = NBytes; char *buffer = (char*)pBuffer; if(pNBytesRead) (*pNBytesRead) = 0; while(bytesToGo > 0) { - int bytesRead = Read(buffer, bytesToGo, Timeout); + size_t bytesRead = Read(buffer, bytesToGo, Timeout); if(bytesRead == 0) { // Timeout or something @@ -222,7 +222,7 @@ while(StreamDataLeft()) { // Read some data - int bytes = Read(buffer, BufferSize, Timeout); + size_t bytes = Read(buffer, BufferSize, Timeout); if(bytes == 0 && StreamDataLeft()) { return false; // incomplete, timed out Modified: box/chris/win32/vc2005-compile-fixes/lib/common/IOStream.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/IOStream.h 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/common/IOStream.h 2005-12-20 22:59:29 UTC (rev 255) @@ -41,9 +41,9 @@ // Timeout in milliseconds // Read may return 0 -- does not mean end of stream. typedef int64_t pos_type; - virtual int Read(void *pBuffer, int NBytes, int Timeout = IOStream::TimeOutInfinite) = 0; + virtual size_t Read(void *pBuffer, size_t NBytes, int Timeout = IOStream::TimeOutInfinite) = 0; virtual pos_type BytesLeftToRead(); // may return IOStream::SizeOfStreamUnknown (and will for most stream types) - virtual void Write(const void *pBuffer, int NBytes) = 0; + virtual void Write(const void *pBuffer, size_t NBytes) = 0; virtual void WriteAllBuffered(); virtual pos_type GetPosition() const; virtual void Seek(pos_type Offset, int SeekType); @@ -55,7 +55,7 @@ virtual bool StreamClosed() = 0; // Utility functions - bool ReadFullBuffer(void *pBuffer, int NBytes, int *pNBytesRead, int Timeout = IOStream::TimeOutInfinite); + bool ReadFullBuffer(void *pBuffer, size_t NBytes, size_t *pNBytesRead, int Timeout = IOStream::TimeOutInfinite); bool CopyStreamTo(IOStream &rCopyTo, int Timeout = IOStream::TimeOutInfinite, int BufferSize = 1024); static int ConvertSeekTypeToOSWhence(int SeekType); Modified: box/chris/win32/vc2005-compile-fixes/lib/common/IOStreamGetLine.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/IOStreamGetLine.cpp 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/common/IOStreamGetLine.cpp 2005-12-20 22:59:29 UTC (rev 255) @@ -113,7 +113,7 @@ // Read more in? if(!foundLineEnd && mBufferBegin >= mBytesInBuffer && !mPendingEOF) { - int bytes = mrStream.Read(mBuffer, sizeof(mBuffer), Timeout); + size_t bytes = mrStream.Read(mBuffer, sizeof(mBuffer), Timeout); // Adjust buffer info mBytesInBuffer = bytes; @@ -151,8 +151,8 @@ else { // Check for comment char, but char before must be whitespace - int end = 0; - int size = r.size(); + size_t end = 0; + size_t size = r.size(); while(end < size) { if(r[end] == '#' && (end == 0 || (iw(r[end-1])))) @@ -163,7 +163,7 @@ } // Remove whitespace - int begin = 0; + size_t begin = 0; while(begin < size && iw(r[begin])) { begin++; @@ -193,7 +193,7 @@ void IOStreamGetLine::DetachFile() { // Adjust file pointer - int bytesOver = mBytesInBuffer - mBufferBegin; + size_t bytesOver = mBytesInBuffer - mBufferBegin; ASSERT(bytesOver >= 0); if(bytesOver > 0) { @@ -213,10 +213,10 @@ // Created: 22/12/04 // // -------------------------------------------------------------------------- -void IOStreamGetLine::IgnoreBufferedData(int BytesToIgnore) +void IOStreamGetLine::IgnoreBufferedData(size_t BytesToIgnore) { - int bytesInBuffer = mBytesInBuffer - mBufferBegin; - if(BytesToIgnore < 0 || BytesToIgnore > bytesInBuffer) + size_t bytesInBuffer = mBytesInBuffer - mBufferBegin; + if(BytesToIgnore > bytesInBuffer) { THROW_EXCEPTION(CommonException, IOStreamGetLineNotEnoughDataToIgnore) } Modified: box/chris/win32/vc2005-compile-fixes/lib/common/IOStreamGetLine.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/IOStreamGetLine.h 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/common/IOStreamGetLine.h 2005-12-20 22:59:29 UTC (rev 255) @@ -52,16 +52,16 @@ // For doing interesting stuff with the remaining data... // Be careful with this! const void *GetBufferedData() const {return mBuffer + mBufferBegin;} - int GetSizeOfBufferedData() const {return mBytesInBuffer - mBufferBegin;} - void IgnoreBufferedData(int BytesToIgnore); + size_t GetSizeOfBufferedData() const {return mBytesInBuffer - mBufferBegin;} + void IgnoreBufferedData(size_t BytesToIgnore); IOStream &GetUnderlyingStream() {return mrStream;} private: char mBuffer[IOSTREAMGETLINE_BUFFER_SIZE]; IOStream &mrStream; int mLineNumber; - int mBufferBegin; - int mBytesInBuffer; + size_t mBufferBegin; + size_t mBytesInBuffer; bool mPendingEOF; bool mEOF; std::string mPendingString; Modified: box/chris/win32/vc2005-compile-fixes/lib/common/MemBlockStream.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/MemBlockStream.cpp 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/common/MemBlockStream.cpp 2005-12-20 22:59:29 UTC (rev 255) @@ -108,7 +108,7 @@ // Created: 2003/09/05 // // -------------------------------------------------------------------------- -int MemBlockStream::Read(void *pBuffer, int NBytes, int Timeout) +IOStream::pos_type MemBlockStream::Read(void *pBuffer, pos_type NBytes, int Timeout) { // Adjust to number of bytes left if(NBytes > (mBytesInBuffer - mReadPosition)) @@ -117,9 +117,10 @@ } ASSERT(NBytes >= 0); if(NBytes <= 0) return 0; // careful now - + + ASSERT(sizeof(size_t) >= sizeof(pos_type)) // Copy in the requested number of bytes and adjust the read pointer - ::memcpy(pBuffer, mpBuffer + mReadPosition, NBytes); + ::memcpy(pBuffer, mpBuffer + mReadPosition, (size_t)NBytes); mReadPosition += NBytes; return NBytes; @@ -141,12 +142,12 @@ // -------------------------------------------------------------------------- // // Function -// Name: MemBlockStream::Write(void *, int) +// Name: MemBlockStream::Write(void *, pos_type) // Purpose: As interface. But only works in write phase // Created: 2003/09/05 // // -------------------------------------------------------------------------- -void MemBlockStream::Write(const void *pBuffer, int NBytes) +void MemBlockStream::Write(const void *pBuffer, pos_type NBytes) { THROW_EXCEPTION(CommonException, MemBlockStreamNotSupported) } @@ -175,7 +176,7 @@ // -------------------------------------------------------------------------- void MemBlockStream::Seek(pos_type Offset, int SeekType) { - int newPos = 0; + pos_type newPos = 0; switch(SeekType) { case IOStream::SeekType_Absolute: Modified: box/chris/win32/vc2005-compile-fixes/lib/common/MemBlockStream.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/MemBlockStream.h 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/common/MemBlockStream.h 2005-12-20 22:59:29 UTC (rev 255) @@ -34,9 +34,9 @@ ~MemBlockStream(); public: - virtual int Read(void *pBuffer, int NBytes, int Timeout = IOStream::TimeOutInfinite); + virtual pos_type Read(void *pBuffer, pos_type NBytes, int Timeout = IOStream::TimeOutInfinite); virtual pos_type BytesLeftToRead(); - virtual void Write(const void *pBuffer, int NBytes); + virtual void Write(const void *pBuffer, pos_type NBytes); virtual pos_type GetPosition() const; virtual void Seek(pos_type Offset, int SeekType); virtual bool StreamDataLeft(); @@ -44,8 +44,8 @@ private: const char *mpBuffer; - int mBytesInBuffer; - int mReadPosition; + size_t mBytesInBuffer; + pos_type mReadPosition; }; #endif // MEMBLOCKSTREAM__H Modified: box/chris/win32/vc2005-compile-fixes/lib/common/PartialReadStream.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/PartialReadStream.cpp 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/common/PartialReadStream.cpp 2005-12-20 22:59:29 UTC (rev 255) @@ -54,10 +54,10 @@ // Created: 2003/08/26 // // -------------------------------------------------------------------------- -int PartialReadStream::Read(void *pBuffer, int NBytes, int Timeout) +size_t PartialReadStream::Read(void *pBuffer, size_t NBytes, int Timeout) { // Finished? - if(mBytesLeft <= 0) + if(mBytesLeft == 0) { return 0; } @@ -70,7 +70,7 @@ } // Route the request to the source - int read = mrSource.Read(pBuffer, NBytes, Timeout); + size_t read = mrSource.Read(pBuffer, NBytes, Timeout); ASSERT(read <= mBytesLeft); // Adjust the count Modified: box/chris/win32/vc2005-compile-fixes/lib/common/PartialReadStream.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/PartialReadStream.h 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/common/PartialReadStream.h 2005-12-20 22:59:29 UTC (rev 255) @@ -31,7 +31,7 @@ PartialReadStream(const PartialReadStream &); public: - virtual int Read(void *pBuffer, int NBytes, int Timeout = IOStream::TimeOutInfinite); + virtual size_t Read(void *pBuffer, size_t NBytes, int Timeout = IOStream::TimeOutInfinite); virtual pos_type BytesLeftToRead(); virtual void Write(const void *pBuffer, int NBytes); virtual bool StreamDataLeft(); @@ -39,7 +39,7 @@ private: IOStream &mrSource; - int mBytesLeft; + size_t mBytesLeft; }; #endif // PARTIALREADSTREAM__H Modified: box/chris/win32/vc2005-compile-fixes/lib/common/ReadGatherStream.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/ReadGatherStream.cpp 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/common/ReadGatherStream.cpp 2005-12-20 22:59:29 UTC (rev 255) @@ -64,12 +64,12 @@ // Created: 10/12/03 // // -------------------------------------------------------------------------- -int ReadGatherStream::AddComponent(IOStream *pStream) +size_t ReadGatherStream::AddComponent(IOStream *pStream) { ASSERT(pStream != 0); // Just add the component to the list, returning it's index. - int index = mComponents.size(); + size_t index = mComponents.size(); mComponents.push_back(pStream); return index; } @@ -116,9 +116,9 @@ // Created: 10/12/03 // // -------------------------------------------------------------------------- -int ReadGatherStream::Read(void *pBuffer, int NBytes, int Timeout) +size_t ReadGatherStream::Read(void *pBuffer, size_t NBytes, int Timeout) { - int bytesToRead = NBytes; + size_t bytesToRead = NBytes; uint8_t *buffer = (uint8_t*)pBuffer; while(bytesToRead > 0) @@ -145,15 +145,18 @@ if(mPositionInCurrentBlock < mBlocks[mCurrentBlock].mLength) { // Read! - int s = mBlocks[mCurrentBlock].mLength - mPositionInCurrentBlock; + pos_type s = mBlocks[mCurrentBlock].mLength + - mPositionInCurrentBlock; if(s > bytesToRead) s = bytesToRead; + + ASSERT(sizeof(size_t) >= sizeof(pos_type)) + pos_type r = mComponents[mBlocks[mCurrentBlock] + .mComponent]->Read(buffer, (size_t)s, Timeout); - int r = mComponents[mBlocks[mCurrentBlock].mComponent]->Read(buffer, s, Timeout); - // update variables mPositionInCurrentBlock += r; buffer += r; - bytesToRead -= r; + bytesToRead -= (size_t)r; mCurrentPosition += r; if(r != s) Modified: box/chris/win32/vc2005-compile-fixes/lib/common/ReadGatherStream.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/ReadGatherStream.h 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/common/ReadGatherStream.h 2005-12-20 22:59:29 UTC (rev 255) @@ -32,10 +32,10 @@ ReadGatherStream &operator=(const ReadGatherStream &); public: - int AddComponent(IOStream *pStream); + size_t AddComponent(IOStream *pStream); void AddBlock(int Component, pos_type Length, bool Seek = false, pos_type SeekTo = 0); - virtual int Read(void *pBuffer, int NBytes, int Timeout = IOStream::TimeOutInfinite); + virtual size_t Read(void *pBuffer, size_t NBytes, int Timeout = IOStream::TimeOutInfinite); virtual pos_type BytesLeftToRead(); virtual void Write(const void *pBuffer, int NBytes); virtual bool StreamDataLeft(); Modified: box/chris/win32/vc2005-compile-fixes/lib/common/StreamableMemBlock.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/StreamableMemBlock.cpp 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/common/StreamableMemBlock.cpp 2005-12-20 22:59:29 UTC (rev 255) @@ -84,12 +84,12 @@ // -------------------------------------------------------------------------- // // Function -// Name: StreamableMemBlock::Set(void *, int) +// Name: StreamableMemBlock::Set(void *, size_t) // Purpose: Set the contents of the block // Created: 2003/09/05 // // -------------------------------------------------------------------------- -void StreamableMemBlock::Set(void *pBuffer, int Size) +void StreamableMemBlock::Set(void *pBuffer, size_t Size) { FreeBlock(); AllocateBlock(Size); @@ -115,7 +115,8 @@ } // Allocate a new block (this way to be exception safe) - char *pblock = (char*)malloc(size); + ASSERT(sizeof(size_t) >= sizeof(IOStream::pos_type)) + char *pblock = (char*)malloc((size_t)size); if(pblock == 0) { throw std::bad_alloc(); @@ -124,7 +125,7 @@ try { // Read in - if(!rStream.ReadFullBuffer(pblock, size, 0 /* not interested in bytes read if this fails */)) + if(!rStream.ReadFullBuffer(pblock, (size_t)size, 0 /* not interested in bytes read if this fails */)) { THROW_EXCEPTION(CommonException, StreamableMemBlockIncompleteRead) } @@ -141,7 +142,9 @@ // store... ASSERT(mpBuffer == 0); mpBuffer = pblock; - mSize = size; + + ASSERT(sizeof(size_t) >= sizeof(IOStream::pos_type)) + mSize = (size_t)size; } @@ -195,12 +198,12 @@ // -------------------------------------------------------------------------- // // Function -// Name: StreamableMemBlock::AllocateBlock(int) +// Name: StreamableMemBlock::AllocateBlock(size_t) // Purpose: Protected. Allocate the block of memory // Created: 2003/09/05 // // -------------------------------------------------------------------------- -void StreamableMemBlock::AllocateBlock(int Size) +void StreamableMemBlock::AllocateBlock(size_t Size) { ASSERT(mpBuffer == 0); if(Size > 0) @@ -299,7 +302,9 @@ // -------------------------------------------------------------------------- void StreamableMemBlock::WriteToStream(IOStream &rStream) const { - int32_t sizenbo = htonl(mSize); + ASSERT(sizeof(uint32_t) >= sizeof(mSize)) + uint32_t sizenbo = htonl((uint32_t)mSize); + // Size rStream.Write(&sizenbo, sizeof(sizenbo)); // Buffer Modified: box/chris/win32/vc2005-compile-fixes/lib/common/StreamableMemBlock.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/StreamableMemBlock.h 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/common/StreamableMemBlock.h 2005-12-20 22:59:29 UTC (rev 255) @@ -30,7 +30,7 @@ ~StreamableMemBlock(); void Set(const StreamableMemBlock &rBlock); - void Set(void *pBuffer, int Size); + void Set(void *pBuffer, size_t Size); void Set(IOStream &rStream, int Timeout); StreamableMemBlock &operator=(const StreamableMemBlock &rBlock) { @@ -46,7 +46,7 @@ void *GetBuffer() const; // Size of block - int GetSize() const {return mSize;} + size_t GetSize() const {return mSize;} // Buffer empty? bool IsEmpty() const {return mSize == 0;} @@ -59,12 +59,12 @@ void ResizeBlock(int Size); protected: // be careful with these! - void AllocateBlock(int Size); + void AllocateBlock(size_t Size); void FreeBlock(); private: void *mpBuffer; - int mSize; + size_t mSize; }; #endif // STREAMABLEMEMBLOCK__H Modified: box/chris/win32/vc2005-compile-fixes/lib/common/UnixUser.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/UnixUser.cpp 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/common/UnixUser.cpp 2005-12-20 22:59:29 UTC (rev 255) @@ -11,10 +11,9 @@ #ifndef WIN32 #include +#include #endif -#include - #include "UnixUser.h" #include "CommonException.h" Modified: box/chris/win32/vc2005-compile-fixes/lib/common/Utils.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/Utils.cpp 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/common/Utils.cpp 2005-12-20 22:59:29 UTC (rev 255) @@ -39,7 +39,7 @@ while(e = String.find_first_of(SplitOn, b), e != String.npos) { // Get this string - unsigned int len = e - b; + std::string::size_type len = e - b; if(len >= 1) { rOutput.push_back(String.substr(b, len)); Modified: box/chris/win32/vc2005-compile-fixes/lib/common/WaitForEvent.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/WaitForEvent.cpp 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/common/WaitForEvent.cpp 2005-12-20 22:59:29 UTC (rev 255) @@ -9,7 +9,10 @@ #include "Box.h" +#ifndef WIN32 #include +#endif + #include #include @@ -160,7 +163,8 @@ } // Poll! - switch(::poll(mpPollInfo, mItems.size(), mTimeout)) + ASSERT(sizeof(unsigned long) > sizeof(size_t)) + switch(::poll(mpPollInfo, (unsigned long)mItems.size(), mTimeout)) { case -1: // Interrupted system calls aren't an error, just equivalent to a timeout Modified: box/chris/win32/vc2005-compile-fixes/lib/compress/Compress.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/compress/Compress.h 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/compress/Compress.h 2005-12-20 22:59:29 UTC (rev 255) @@ -85,17 +85,19 @@ // Created: 5/12/03 // // -------------------------------------------------------------------------- - void Input(const void *pInBuffer, int InLength) + void Input(const void *pInBuffer, size_t InLength) { // Check usage if(mStream.avail_in != 0) { THROW_EXCEPTION(CompressException, BadUsageInputNotRequired) } + + ASSERT(sizeof(uInt) >= sizeof(size_t)) // Store info mStream.next_in = (unsigned char *)pInBuffer; - mStream.avail_in = InLength; + mStream.avail_in = (uInt)InLength; } // -------------------------------------------------------------------------- @@ -119,17 +121,19 @@ // Created: 5/12/03 // // -------------------------------------------------------------------------- - int Output(void *pOutBuffer, int OutLength, bool SyncFlush = false) + size_t Output(void *pOutBuffer, size_t OutLength, bool SyncFlush = false) { // need more input? if(mStream.avail_in == 0 && mFlush != Z_FINISH && !SyncFlush) { return 0; } + + ASSERT(sizeof(int) <= sizeof(size_t)) // Buffers mStream.next_out = (unsigned char *)pOutBuffer; - mStream.avail_out = OutLength; + mStream.avail_out = (unsigned int)OutLength; // Call one of the functions int flush = mFlush; Modified: box/chris/win32/vc2005-compile-fixes/lib/compress/CompressStream.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/compress/CompressStream.cpp 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/compress/CompressStream.cpp 2005-12-20 22:59:29 UTC (rev 255) @@ -131,12 +131,12 @@ // -------------------------------------------------------------------------- // // Function -// Name: CompressStream::Read(void *, int, int) +// Name: CompressStream::Read(void *, size_t, int) // Purpose: As interface // Created: 27/5/04 // // -------------------------------------------------------------------------- -int CompressStream::Read(void *pBuffer, int NBytes, int Timeout) +size_t CompressStream::Read(void *pBuffer, size_t NBytes, int Timeout) { USE_READ_COMPRESSOR if(pDecompress == 0) @@ -155,7 +155,7 @@ } // Read data into the buffer -- read as much as possible in one go - int s = mpStream->Read(pbuf, BUFFER_SIZE, Timeout); + size_t s = mpStream->Read(pbuf, BUFFER_SIZE, Timeout); if(s == 0) { return 0; @@ -172,12 +172,12 @@ // -------------------------------------------------------------------------- // // Function -// Name: CompressStream::Write(const void *, int) +// Name: CompressStream::Write(const void *, size_t) // Purpose: As interface // Created: 27/5/04 // // -------------------------------------------------------------------------- -void CompressStream::Write(const void *pBuffer, int NBytes) +void CompressStream::Write(const void *pBuffer, size_t NBytes) { USE_WRITE_COMPRESSOR if(pCompress == 0) @@ -262,7 +262,7 @@ USE_WRITE_COMPRESSOR if(pCompress == 0) {THROW_EXCEPTION(CompressException, Internal)} - int s = 0; + size_t s = 0; do { s = pCompress->Output(mpBuffer, BUFFER_SIZE, SyncFlush); Modified: box/chris/win32/vc2005-compile-fixes/lib/compress/CompressStream.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/compress/CompressStream.h 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/compress/CompressStream.h 2005-12-20 22:59:29 UTC (rev 255) @@ -32,8 +32,8 @@ CompressStream &operator=(const CompressStream &); public: - virtual int Read(void *pBuffer, int NBytes, int Timeout = IOStream::TimeOutInfinite); - virtual void Write(const void *pBuffer, int NBytes); + virtual size_t Read(void *pBuffer, size_t NBytes, int Timeout = IOStream::TimeOutInfinite); + virtual void Write(const void *pBuffer, size_t NBytes); virtual void WriteAllBuffered(); virtual void Close(); virtual bool StreamDataLeft(); Modified: box/chris/win32/vc2005-compile-fixes/lib/server/Protocol.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/server/Protocol.h 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/server/Protocol.h 2005-12-20 22:59:29 UTC (rev 255) @@ -94,7 +94,7 @@ void Read(int32_t &rOut); void Read(int16_t &rOut); void Read(int8_t &rOut); - void Read(bool &rOut) {int8_t read; Read(read); rOut = (read == true);} + void Read(bool &rOut) {bool read; Read(read); rOut = (read == true);} void Read(std::string &rOut); template void Read(type &rOut) Modified: box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h 2005-12-20 22:30:38 UTC (rev 254) +++ box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h 2005-12-20 22:59:29 UTC (rev 255) @@ -27,12 +27,19 @@ ( *(_result) = *gmtime( (_clock) ), \ (_result) ) - //signal in unix SIGVTALRM does not exist in win32 - but looking at the #define SIGVTALRM 254 #define SIGALRM SIGVTALRM #define ITIMER_VIRTUAL 0 +// Microsoft decided to deprecate the standard POSIX functions. Great! +#define open(file,flags,mode) _open(file,flags,mode) +#define close(fd) _close(fd) +#define dup(fd) _dup(fd) +#define read(fd,buf,count) _read(fd,buf,count) +#define write(fd,buf,count) _write(fd,buf,count) +#define lseek(fd,off,whence) _lseek(fd,off,whence) + int setitimer(int type , struct itimerval *timeout, int); void InitTimer(void); void FiniTimer(void); From boxbackup-dev at fluffy.co.uk Wed Dec 21 00:02:33 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Wed, 21 Dec 2005 00:02:33 +0000 Subject: [Box Backup-dev] COMMIT r255 - in box/chris/win32/vc2005-compile-fixes/lib: common compress server win32 In-Reply-To: <20051220225951.EDCE794@s0g0.pems.testserver.co.uk> References: <20051220225951.EDCE794@s0g0.pems.testserver.co.uk> Message-ID: <9CC918D2-909C-412F-9F9A-B46E21A8323C@fluffy.co.uk> On 20 Dec 2005, at 22:59, subversion at fluffy.co.uk wrote: > Author: chris > Date: 2005-12-20 22:59:29 +0000 (Tue, 20 Dec 2005) > New Revision: 255 > > Modified: > [snip] > Log: > First set of Visual C++ 2005 compile fixes (not tested on any other > platform) Eeek. You need to be careful with that -- IOStream and it's subclasses are rather fundamental. I think your changes will break 64 bit platforms as CollectInBufferStream hasn't had all it's function signatures changed int to size_t. I deliberately used int for sizes in IOStream functions, as I thought these frequently used functions should use arithmetic on the most natural integer size for the platform. But maybe my time as an assembly language programmer are distorting my view of reality in theses days when a VM is seen as a good plan. Anyway, that's the reason for using that type for sizes. Ben From boxbackup-dev at fluffy.co.uk Wed Dec 21 00:08:21 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Wed, 21 Dec 2005 00:08:21 +0000 Subject: [Box Backup-dev] COMMIT r255 - in box/chris/win32/vc2005-compile-fixes/lib: common compress server win32 In-Reply-To: <20051220225951.EDCE794@s0g0.pems.testserver.co.uk> References: <20051220225951.EDCE794@s0g0.pems.testserver.co.uk> Message-ID: <1135123701.7993.22.camel@avenin.ebourne.me.uk> On Tue, 2005-12-20 at 22:59 +0000, subversion at fluffy.co.uk wrote: > Author: chris > Date: 2005-12-20 22:59:29 +0000 (Tue, 20 Dec 2005) > New Revision: 255 > > -#include > +#ifndef WIN32 > +#include > +#endif Please don't use a platform check for header files. Please add a configure test (AC_CHECK_HEADERS) and use its define. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Wed Dec 21 00:08:20 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Wed, 21 Dec 2005 00:08:20 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r255 - in box/chris/win32/vc2005-compile-fixes/lib: common compress server win32 In-Reply-To: <9CC918D2-909C-412F-9F9A-B46E21A8323C@fluffy.co.uk> References: <20051220225951.EDCE794@s0g0.pems.testserver.co.uk> <9CC918D2-909C-412F-9F9A-B46E21A8323C@fluffy.co.uk> Message-ID: Hi Ben, > Eeek. You need to be careful with that -- IOStream and it's subclasses are > rather fundamental. I think your changes will break 64 bit platforms as > CollectInBufferStream hasn't had all it's function signatures changed int to > size_t. Yeah, that was a mistake, sorry. I was about to change it to size_t like the others. > I deliberately used int for sizes in IOStream functions, as I thought these > frequently used functions should use arithmetic on the most natural integer > size for the platform. I don't understand why you used a signed rather than an unsigned type for things which don't seem to make any sense as negatives, like buffer sizes. But I could use IOStream::pos_type instead if you prefer, or even make everything use signed integers if you insist. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Wed Dec 21 00:10:17 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Wed, 21 Dec 2005 00:10:17 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r255 - in box/chris/win32/vc2005-compile-fixes/lib: common compress server win32 In-Reply-To: <1135123701.7993.22.camel@avenin.ebourne.me.uk> References: <20051220225951.EDCE794@s0g0.pems.testserver.co.uk> <1135123701.7993.22.camel@avenin.ebourne.me.uk> Message-ID: Hi Martin, >> -#include >> +#ifndef WIN32 >> +#include >> +#endif > > Please don't use a platform check for header files. Please add a > configure test (AC_CHECK_HEADERS) and use its define. Even though configure doesn't run on win32? Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Tue Dec 20 23:34:10 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Tue, 20 Dec 2005 23:34:10 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r256 - box/trunk Message-ID: <20051220233410.8864894@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-20 23:34:09 +0000 (Tue, 20 Dec 2005) New Revision: 256 Modified: box/trunk/configure.ac Log: Fixed up configure.ac after win32 changes Modified: box/trunk/configure.ac =================================================================== --- box/trunk/configure.ac 2005-12-20 22:59:29 UTC (rev 255) +++ box/trunk/configure.ac 2005-12-20 23:34:09 UTC (rev 256) @@ -8,7 +8,6 @@ touch install-sh AC_CANONICAL_SYSTEM -# echo "Build target OS: '$target_os'" test -s install-sh || rm install-sh ### Checks for programs. @@ -30,11 +29,11 @@ ### Checks for libraries. + if test "$target_os" != "mingw32" -a "$target_os" != "winnt"; then -AC_SEARCH_LIBS([nanosleep], [rt], [ac_have_nanosleep=yes], - [AC_MSG_ERROR([[Cannot find a short sleep function (nanosleep)]])]) + AC_SEARCH_LIBS([nanosleep], [rt], [ac_have_nanosleep=yes], + [AC_MSG_ERROR([[Cannot find a short sleep function (nanosleep)]])]) fi - AC_CHECK_LIB([z], [zlibVersion],, [AC_MSG_ERROR([[Cannot find zlib]])]) AX_CHECK_BDB_V1 VL_LIB_READLINE @@ -95,12 +94,14 @@ AC_SYS_LARGEFILE AX_CHECK_LLONG_MINMAX AX_CHECK_DEFINE_PRAGMA - if test "$target_os" != "mingw32"; then -AX_RANDOM_DEVICE + AX_RANDOM_DEVICE fi - -AX_CHECK_MOUNT_POINT([],[]) +AX_CHECK_MOUNT_POINT(,[ + if test "$target_os" != "mingw32" -a "$target_os" != "winnt"; then + AC_MSG_ERROR([[cannot work out how to discover mount points on your platform]]) + fi + ]) AX_CHECK_MALLOC_WORKAROUND @@ -134,6 +135,13 @@ AC_CHECK_FUNCS([flock]) AC_CHECK_DECLS([O_EXLOCK],,, [[#include ]]) AC_CHECK_DECLS([F_SETLK],,, [[#include ]]) +if test "x$ac_cv_func_flock" != "xyes" && \ + test "x$ac_cv_have_decl_O_EXLOCK" != "xyes" && \ + test "x$ac_cv_have_decl_F_SETLK" != "xyes" && \ + test "$target_os" != "mingw32" -a "$target_os" != "winnt" +then + AC_MSG_ERROR([[cannot work out how to do file locking on your platform]]) +fi ## Get tmpdir temp_directory_name="/tmp" @@ -148,7 +156,7 @@ [static-bin], [AC_HELP_STRING([--enable-static-bin], [Link binaries with static libraries])]) if test "x$enable_static_bin" = "xyes"; then - AC_CHECK_LIB([ssl],[SSL_read],[],[],[crypto]) + AC_CHECK_LIB([ssl],[SSL_read],,, [crypto]) LIBS="-Wl,-Bstatic $LIBS -Wl,-Bdynamic" fi From boxbackup-dev at fluffy.co.uk Wed Dec 21 00:27:41 2005 From: boxbackup-dev at fluffy.co.uk (Charles Lecklider) Date: Wed, 21 Dec 2005 00:27:41 +0000 Subject: [Box Backup-dev] COMMIT r255 - in box/chris/win32/vc2005-compile-fixes/lib: common compress server win32 In-Reply-To: References: <20051220225951.EDCE794@s0g0.pems.testserver.co.uk> <1135123701.7993.22.camel@avenin.ebourne.me.uk> Message-ID: <43A8A17D.7050906@invis.net> Chris Wilson wrote: > Even though configure doesn't run on win32? Yes, because as I understand it, someone's going to keep the Win32 config.h in sync. I'm not sure how that's going to work, but there's really no alternative.... I suspect I may end up helping with that :-) -C From boxbackup-dev at fluffy.co.uk Wed Dec 21 00:36:16 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Wed, 21 Dec 2005 00:36:16 +0000 Subject: [Box Backup-dev] COMMIT r255 - in box/chris/win32/vc2005-compile-fixes/lib: common compress server win32 In-Reply-To: References: <20051220225951.EDCE794@s0g0.pems.testserver.co.uk> <1135123701.7993.22.camel@avenin.ebourne.me.uk> Message-ID: <1135125376.7993.28.camel@avenin.ebourne.me.uk> On Wed, 2005-12-21 at 00:10 +0000, Chris Wilson wrote: > Hi Martin, > > >> -#include > >> +#ifndef WIN32 > >> +#include > >> +#endif > > > > Please don't use a platform check for header files. Please add a > > configure test (AC_CHECK_HEADERS) and use its define. > > Even though configure doesn't run on win32? configure should run under cygwin, which I thought was the idea. Presumably you've tried that since there's stuff for win32 in configure.ac. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Wed Dec 21 00:39:55 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Wed, 21 Dec 2005 00:39:55 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r255 - in box/chris/win32/vc2005-compile-fixes/lib: common compress server win32 In-Reply-To: <1135125376.7993.28.camel@avenin.ebourne.me.uk> References: <20051220225951.EDCE794@s0g0.pems.testserver.co.uk> <1135123701.7993.22.camel@avenin.ebourne.me.uk> <1135125376.7993.28.camel@avenin.ebourne.me.uk> Message-ID: Hi Martin, >> Even though configure doesn't run on win32? > > configure should run under cygwin, which I thought was the idea. > > Presumably you've tried that since there's stuff for win32 in configure.ac. Sorry, I should have said "for Visual Studio". I don't want people to have to install Cygwin to compile box for windows, and I don't think Charles does either. I'll try and make autoconf detect platform-specific stuff and try to get cross-compilation working from cygwin to Visual Studio. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Wed Dec 21 00:49:32 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Wed, 21 Dec 2005 00:49:32 +0000 Subject: [Box Backup-dev] COMMIT r255 - in box/chris/win32/vc2005-compile-fixes/lib: common compress server win32 In-Reply-To: References: <20051220225951.EDCE794@s0g0.pems.testserver.co.uk> <1135123701.7993.22.camel@avenin.ebourne.me.uk> <1135125376.7993.28.camel@avenin.ebourne.me.uk> Message-ID: <1135126172.7993.33.camel@avenin.ebourne.me.uk> On Wed, 2005-12-21 at 00:39 +0000, Chris Wilson wrote: > Sorry, I should have said "for Visual Studio". I don't want people to have > to install Cygwin to compile box for windows, and I don't think Charles > does either. I don't think it's unreasonable for developers to install cygwin. That's pretty much how autoconf is intended to work. Clearly users shouldn't have to install cygwin, but precompiled binaries is the right answer there. > I'll try and make autoconf detect platform-specific stuff and try to > get cross-compilation working from cygwin to Visual Studio. Is that what would be required to build a non-cygwin dependent binary? It should be possible, I found some explanation of it when researching the use of autoconf ages ago. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Wed Dec 21 00:52:55 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Wed, 21 Dec 2005 00:52:55 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r255 - in box/chris/win32/vc2005-compile-fixes/lib: common compress server win32 In-Reply-To: <1135126172.7993.33.camel@avenin.ebourne.me.uk> References: <20051220225951.EDCE794@s0g0.pems.testserver.co.uk> <1135123701.7993.22.camel@avenin.ebourne.me.uk> <1135125376.7993.28.camel@avenin.ebourne.me.uk> <1135126172.7993.33.camel@avenin.ebourne.me.uk> Message-ID: Hi Martin, > I don't think it's unreasonable for developers to install cygwin. That's > pretty much how autoconf is intended to work. Well, if Charles doesn't object then I'll shut up :-) >> I'll try and make autoconf detect platform-specific stuff and try to >> get cross-compilation working from cygwin to Visual Studio. > > Is that what would be required to build a non-cygwin dependent binary? > It should be possible, I found some explanation of it when researching > the use of autoconf ages ago. Yes, you need to cross-compile using a native compiler (MinGW, Visual C++, Borland, Watcom, etc.), otherwise you have to distribute cygwin1.dll and your application falls under the GPL and runs like frozen treacle. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Wed Dec 21 00:23:12 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 21 Dec 2005 00:23:12 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r257 - in box/trunk: . lib/common Message-ID: <20051221002312.4449694@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-21 00:23:10 +0000 (Wed, 21 Dec 2005) New Revision: 257 Modified: box/trunk/configure.ac box/trunk/lib/common/Box.h Log: Allow use of native 64 bit endian swapping functions Modified: box/trunk/configure.ac =================================================================== --- box/trunk/configure.ac 2005-12-20 23:34:09 UTC (rev 256) +++ box/trunk/configure.ac 2005-12-21 00:23:10 UTC (rev 257) @@ -65,6 +65,7 @@ AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([execinfo.h netinet/in.h regex.h sys/types.h sys/xattr.h]) +AC_CHECK_HEADERS([sys/endian.h asm/byteorder.h]) ### Checks for typedefs, structures, and compiler characteristics. Modified: box/trunk/lib/common/Box.h =================================================================== --- box/trunk/lib/common/Box.h 2005-12-20 23:34:09 UTC (rev 256) +++ box/trunk/lib/common/Box.h 2005-12-21 00:23:10 UTC (rev 257) @@ -114,6 +114,10 @@ // extra macros for converting to network byte order +#ifdef HAVE_NETINET_IN_H + #include +#endif + // Always define a swap64 function, as it's useful. inline uint64_t box_swap64(uint64_t x) { @@ -131,13 +135,19 @@ #define box_hton64(x) (x) #define box_ntoh64(x) (x) #else - #define box_hton64(x) box_swap64(x) - #define box_ntoh64(x) box_swap64(x) + #ifdef HAVE_SYS_ENDIAN_H + #include + #define box_hton64(x) htobe64(x) + #define box_ntoh64(x) betoh64(x) + #elif HAVE_ASM_BYTEORDER_H + #include + #define box_hton64(x) __cpu_to_be64(x) + #define box_ntoh64(x) __be64_to_cpu(x) + #else + #define box_hton64(x) box_swap64(x) + #define box_ntoh64(x) box_swap64(x) + #endif #endif -#ifdef HAVE_NETINET_IN_H - #include -#endif - #endif // BOX__H From boxbackup-dev at fluffy.co.uk Wed Dec 21 00:25:49 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 21 Dec 2005 00:25:49 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r258 - in box/chris/win32/vc2005-compile-fixes: . lib/common lib/compress lib/win32 Message-ID: <20051221002549.60AA094@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-21 00:25:17 +0000 (Wed, 21 Dec 2005) New Revision: 258 Added: box/chris/win32/vc2005-compile-fixes/lib/win32/config.h.win32 Modified: box/chris/win32/vc2005-compile-fixes/configure.ac box/chris/win32/vc2005-compile-fixes/lib/common/BoxPlatform.h box/chris/win32/vc2005-compile-fixes/lib/common/CollectInBufferStream.cpp box/chris/win32/vc2005-compile-fixes/lib/common/DebugMemLeakFinder.cpp box/chris/win32/vc2005-compile-fixes/lib/common/EventWatchFilesystemObject.cpp box/chris/win32/vc2005-compile-fixes/lib/common/ExcludeList.h box/chris/win32/vc2005-compile-fixes/lib/common/FdGetLine.cpp box/chris/win32/vc2005-compile-fixes/lib/common/FileStream.h box/chris/win32/vc2005-compile-fixes/lib/common/Guards.h box/chris/win32/vc2005-compile-fixes/lib/common/IOStream.cpp box/chris/win32/vc2005-compile-fixes/lib/common/IOStream.h box/chris/win32/vc2005-compile-fixes/lib/common/IOStreamGetLine.cpp box/chris/win32/vc2005-compile-fixes/lib/common/IOStreamGetLine.h box/chris/win32/vc2005-compile-fixes/lib/common/MemBlockStream.cpp box/chris/win32/vc2005-compile-fixes/lib/common/MemBlockStream.h box/chris/win32/vc2005-compile-fixes/lib/common/NamedLock.cpp box/chris/win32/vc2005-compile-fixes/lib/common/PartialReadStream.cpp box/chris/win32/vc2005-compile-fixes/lib/common/PartialReadStream.h box/chris/win32/vc2005-compile-fixes/lib/common/ReadGatherStream.cpp box/chris/win32/vc2005-compile-fixes/lib/common/ReadGatherStream.h box/chris/win32/vc2005-compile-fixes/lib/common/StreamableMemBlock.cpp box/chris/win32/vc2005-compile-fixes/lib/common/StreamableMemBlock.h box/chris/win32/vc2005-compile-fixes/lib/common/Test.h box/chris/win32/vc2005-compile-fixes/lib/common/UnixUser.cpp box/chris/win32/vc2005-compile-fixes/lib/common/WaitForEvent.cpp box/chris/win32/vc2005-compile-fixes/lib/compress/Compress.h box/chris/win32/vc2005-compile-fixes/lib/compress/CompressStream.cpp box/chris/win32/vc2005-compile-fixes/lib/compress/CompressStream.h box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h Log: Try again, less invasively and with Autoconfiscated Goodness(TM) Modified: box/chris/win32/vc2005-compile-fixes/configure.ac =================================================================== --- box/chris/win32/vc2005-compile-fixes/configure.ac 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/configure.ac 2005-12-21 00:25:17 UTC (rev 258) @@ -65,7 +65,7 @@ AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS([execinfo.h netinet/in.h regex.h sys/types.h sys/xattr.h]) +AC_CHECK_HEADERS([execinfo.h netinet/in.h regex.h sys/types.h sys/xattr.h pwd.h]) ### Checks for typedefs, structures, and compiler characteristics. Modified: box/chris/win32/vc2005-compile-fixes/lib/common/BoxPlatform.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/BoxPlatform.h 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/common/BoxPlatform.h 2005-12-21 00:25:17 UTC (rev 258) @@ -73,13 +73,11 @@ typedef unsigned __int32 u_int32_t; typedef unsigned __int64 u_int64_t; - #define HAVE_UINT8_T - #define HAVE_UINT16_T - #define HAVE_UINT32_T - #define HAVE_UINT64_T + #define HAVE_U_INT8_T + #define HAVE_U_INT16_T + #define HAVE_U_INT32_T + #define HAVE_U_INT64_T - typedef unsigned int uid_t; - typedef unsigned int gid_t; typedef int pid_t; #endif // WIN32 && !__MINGW32__ Modified: box/chris/win32/vc2005-compile-fixes/lib/common/CollectInBufferStream.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/CollectInBufferStream.cpp 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/common/CollectInBufferStream.cpp 2005-12-21 00:25:17 UTC (rev 258) @@ -61,7 +61,7 @@ if(mInWritePhase != false) { THROW_EXCEPTION(CommonException, CollectInBufferStreamNotInCorrectPhase) } // Adjust to number of bytes left - if(NBytes > (int)(mBytesInBuffer - mReadPosition)) + if(NBytes > (mBytesInBuffer - mReadPosition)) { NBytes = (int)(mBytesInBuffer - mReadPosition); } Modified: box/chris/win32/vc2005-compile-fixes/lib/common/DebugMemLeakFinder.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/DebugMemLeakFinder.cpp 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/common/DebugMemLeakFinder.cpp 2005-12-21 00:25:17 UTC (rev 258) @@ -16,15 +16,15 @@ #undef realloc #undef free +#ifdef HAVE_UNISTD_H + #include +#endif + #include #include #include #include -#ifndef WIN32 -#include -#endif - bool memleakfinder_global_enable = false; typedef struct Modified: box/chris/win32/vc2005-compile-fixes/lib/common/EventWatchFilesystemObject.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/EventWatchFilesystemObject.cpp 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/common/EventWatchFilesystemObject.cpp 2005-12-21 00:25:17 UTC (rev 258) @@ -11,8 +11,8 @@ #include -#ifndef WIN32 -#include +#ifdef HAVE_UNISTD_H + #include #endif #include "EventWatchFilesystemObject.h" Modified: box/chris/win32/vc2005-compile-fixes/lib/common/ExcludeList.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/ExcludeList.h 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/common/ExcludeList.h 2005-12-21 00:25:17 UTC (rev 258) @@ -43,10 +43,11 @@ bool IsExcluded(const std::string &rTest) const; // Mainly for tests - size_t SizeOfDefiniteList() const {return mDefinite.size();} - size_t SizeOfRegexList() const + unsigned int SizeOfDefiniteList() const + {return (unsigned int)mDefinite.size();} + unsigned int SizeOfRegexList() const #ifdef HAVE_REGEX_H - {return mRegex.size();} + {return (unsigned int)mRegex.size();} #else {return 0;} #endif Modified: box/chris/win32/vc2005-compile-fixes/lib/common/FdGetLine.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/FdGetLine.cpp 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/common/FdGetLine.cpp 2005-12-21 00:25:17 UTC (rev 258) @@ -11,8 +11,8 @@ #include -#ifndef WIN32 -#include +#ifdef HAVE_UNISTD_H + #include #endif #include "FdGetLine.h" @@ -154,8 +154,8 @@ else { // Check for comment char, but char before must be whitespace - size_t end = 0; - size_t size = r.size(); + std::string::size_type end = 0; + std::string::size_type size = r.size(); while(end < size) { if(r[end] == '#' && (end == 0 || (iw(r[end-1])))) @@ -166,7 +166,7 @@ } // Remove whitespace - size_t begin = 0; + std::string::size_type begin = 0; while(begin < size && iw(r[begin])) { begin++; Modified: box/chris/win32/vc2005-compile-fixes/lib/common/FileStream.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/FileStream.h 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/common/FileStream.h 2005-12-21 00:25:17 UTC (rev 258) @@ -16,8 +16,8 @@ #include #include -#ifndef WIN32 -#include +#ifdef HAVE_UNISTD_H + #include #endif #ifdef WIN32 Modified: box/chris/win32/vc2005-compile-fixes/lib/common/Guards.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/Guards.h 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/common/Guards.h 2005-12-21 00:25:17 UTC (rev 258) @@ -11,15 +11,17 @@ #ifndef GUARDS__H #define GUARDS__H +#include "Box.h" + +#ifdef HAVE_UNISTD_H + #include +#endif + #include #include #include #include -#ifndef WIN32 -#include -#endif - #include "CommonException.h" #include "MemLeakFindOn.h" Modified: box/chris/win32/vc2005-compile-fixes/lib/common/IOStream.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/IOStream.cpp 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/common/IOStream.cpp 2005-12-21 00:25:17 UTC (rev 258) @@ -145,15 +145,15 @@ // Created: 2003/08/26 // // -------------------------------------------------------------------------- -bool IOStream::ReadFullBuffer(void *pBuffer, size_t NBytes, size_t *pNBytesRead, int Timeout) +bool IOStream::ReadFullBuffer(void *pBuffer, int NBytes, int *pNBytesRead, int Timeout) { - size_t bytesToGo = NBytes; + int bytesToGo = NBytes; char *buffer = (char*)pBuffer; if(pNBytesRead) (*pNBytesRead) = 0; while(bytesToGo > 0) { - size_t bytesRead = Read(buffer, bytesToGo, Timeout); + int bytesRead = Read(buffer, bytesToGo, Timeout); if(bytesRead == 0) { // Timeout or something @@ -222,7 +222,7 @@ while(StreamDataLeft()) { // Read some data - size_t bytes = Read(buffer, BufferSize, Timeout); + int bytes = Read(buffer, BufferSize, Timeout); if(bytes == 0 && StreamDataLeft()) { return false; // incomplete, timed out Modified: box/chris/win32/vc2005-compile-fixes/lib/common/IOStream.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/IOStream.h 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/common/IOStream.h 2005-12-21 00:25:17 UTC (rev 258) @@ -41,9 +41,9 @@ // Timeout in milliseconds // Read may return 0 -- does not mean end of stream. typedef int64_t pos_type; - virtual size_t Read(void *pBuffer, size_t NBytes, int Timeout = IOStream::TimeOutInfinite) = 0; + virtual int Read(void *pBuffer, int NBytes, int Timeout = IOStream::TimeOutInfinite) = 0; virtual pos_type BytesLeftToRead(); // may return IOStream::SizeOfStreamUnknown (and will for most stream types) - virtual void Write(const void *pBuffer, size_t NBytes) = 0; + virtual void Write(const void *pBuffer, int NBytes) = 0; virtual void WriteAllBuffered(); virtual pos_type GetPosition() const; virtual void Seek(pos_type Offset, int SeekType); @@ -55,7 +55,7 @@ virtual bool StreamClosed() = 0; // Utility functions - bool ReadFullBuffer(void *pBuffer, size_t NBytes, size_t *pNBytesRead, int Timeout = IOStream::TimeOutInfinite); + bool ReadFullBuffer(void *pBuffer, int NBytes, int *pNBytesRead, int Timeout = IOStream::TimeOutInfinite); bool CopyStreamTo(IOStream &rCopyTo, int Timeout = IOStream::TimeOutInfinite, int BufferSize = 1024); static int ConvertSeekTypeToOSWhence(int SeekType); Modified: box/chris/win32/vc2005-compile-fixes/lib/common/IOStreamGetLine.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/IOStreamGetLine.cpp 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/common/IOStreamGetLine.cpp 2005-12-21 00:25:17 UTC (rev 258) @@ -113,7 +113,7 @@ // Read more in? if(!foundLineEnd && mBufferBegin >= mBytesInBuffer && !mPendingEOF) { - size_t bytes = mrStream.Read(mBuffer, sizeof(mBuffer), Timeout); + int bytes = mrStream.Read(mBuffer, sizeof(mBuffer), Timeout); // Adjust buffer info mBytesInBuffer = bytes; @@ -151,8 +151,8 @@ else { // Check for comment char, but char before must be whitespace - size_t end = 0; - size_t size = r.size(); + std::string::size_type end = 0; + std::string::size_type size = r.size(); while(end < size) { if(r[end] == '#' && (end == 0 || (iw(r[end-1])))) @@ -163,7 +163,7 @@ } // Remove whitespace - size_t begin = 0; + std::string::size_type begin = 0; while(begin < size && iw(r[begin])) { begin++; @@ -193,7 +193,7 @@ void IOStreamGetLine::DetachFile() { // Adjust file pointer - size_t bytesOver = mBytesInBuffer - mBufferBegin; + int bytesOver = mBytesInBuffer - mBufferBegin; ASSERT(bytesOver >= 0); if(bytesOver > 0) { @@ -213,10 +213,10 @@ // Created: 22/12/04 // // -------------------------------------------------------------------------- -void IOStreamGetLine::IgnoreBufferedData(size_t BytesToIgnore) +void IOStreamGetLine::IgnoreBufferedData(int BytesToIgnore) { - size_t bytesInBuffer = mBytesInBuffer - mBufferBegin; - if(BytesToIgnore > bytesInBuffer) + int bytesInBuffer = mBytesInBuffer - mBufferBegin; + if(BytesToIgnore < 0 || BytesToIgnore > bytesInBuffer) { THROW_EXCEPTION(CommonException, IOStreamGetLineNotEnoughDataToIgnore) } Modified: box/chris/win32/vc2005-compile-fixes/lib/common/IOStreamGetLine.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/IOStreamGetLine.h 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/common/IOStreamGetLine.h 2005-12-21 00:25:17 UTC (rev 258) @@ -52,16 +52,16 @@ // For doing interesting stuff with the remaining data... // Be careful with this! const void *GetBufferedData() const {return mBuffer + mBufferBegin;} - size_t GetSizeOfBufferedData() const {return mBytesInBuffer - mBufferBegin;} - void IgnoreBufferedData(size_t BytesToIgnore); + int GetSizeOfBufferedData() const {return mBytesInBuffer - mBufferBegin;} + void IgnoreBufferedData(int BytesToIgnore); IOStream &GetUnderlyingStream() {return mrStream;} private: char mBuffer[IOSTREAMGETLINE_BUFFER_SIZE]; IOStream &mrStream; int mLineNumber; - size_t mBufferBegin; - size_t mBytesInBuffer; + int mBufferBegin; + int mBytesInBuffer; bool mPendingEOF; bool mEOF; std::string mPendingString; Modified: box/chris/win32/vc2005-compile-fixes/lib/common/MemBlockStream.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/MemBlockStream.cpp 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/common/MemBlockStream.cpp 2005-12-21 00:25:17 UTC (rev 258) @@ -108,19 +108,18 @@ // Created: 2003/09/05 // // -------------------------------------------------------------------------- -IOStream::pos_type MemBlockStream::Read(void *pBuffer, pos_type NBytes, int Timeout) +int MemBlockStream::Read(void *pBuffer, int NBytes, int Timeout) { // Adjust to number of bytes left if(NBytes > (mBytesInBuffer - mReadPosition)) { - NBytes = (mBytesInBuffer - mReadPosition); + NBytes = (int)(mBytesInBuffer - mReadPosition); } ASSERT(NBytes >= 0); if(NBytes <= 0) return 0; // careful now - - ASSERT(sizeof(size_t) >= sizeof(pos_type)) + // Copy in the requested number of bytes and adjust the read pointer - ::memcpy(pBuffer, mpBuffer + mReadPosition, (size_t)NBytes); + ::memcpy(pBuffer, mpBuffer + mReadPosition, NBytes); mReadPosition += NBytes; return NBytes; @@ -142,12 +141,12 @@ // -------------------------------------------------------------------------- // // Function -// Name: MemBlockStream::Write(void *, pos_type) +// Name: MemBlockStream::Write(void *, int) // Purpose: As interface. But only works in write phase // Created: 2003/09/05 // // -------------------------------------------------------------------------- -void MemBlockStream::Write(const void *pBuffer, pos_type NBytes) +void MemBlockStream::Write(const void *pBuffer, int NBytes) { THROW_EXCEPTION(CommonException, MemBlockStreamNotSupported) } Modified: box/chris/win32/vc2005-compile-fixes/lib/common/MemBlockStream.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/MemBlockStream.h 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/common/MemBlockStream.h 2005-12-21 00:25:17 UTC (rev 258) @@ -34,9 +34,9 @@ ~MemBlockStream(); public: - virtual pos_type Read(void *pBuffer, pos_type NBytes, int Timeout = IOStream::TimeOutInfinite); + virtual int Read(void *pBuffer, int NBytes, int Timeout = IOStream::TimeOutInfinite); virtual pos_type BytesLeftToRead(); - virtual void Write(const void *pBuffer, pos_type NBytes); + virtual void Write(const void *pBuffer, int NBytes); virtual pos_type GetPosition() const; virtual void Seek(pos_type Offset, int SeekType); virtual bool StreamDataLeft(); @@ -44,8 +44,8 @@ private: const char *mpBuffer; - size_t mBytesInBuffer; - pos_type mReadPosition; + int mBytesInBuffer; + pos_type mReadPosition; }; #endif // MEMBLOCKSTREAM__H Modified: box/chris/win32/vc2005-compile-fixes/lib/common/NamedLock.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/NamedLock.cpp 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/common/NamedLock.cpp 2005-12-21 00:25:17 UTC (rev 258) @@ -11,7 +11,11 @@ #include #include -#include + +#ifdef HAVE_UNISTD_H + #include +#endif + #ifdef HAVE_FLOCK #include #endif Modified: box/chris/win32/vc2005-compile-fixes/lib/common/PartialReadStream.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/PartialReadStream.cpp 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/common/PartialReadStream.cpp 2005-12-21 00:25:17 UTC (rev 258) @@ -54,10 +54,10 @@ // Created: 2003/08/26 // // -------------------------------------------------------------------------- -size_t PartialReadStream::Read(void *pBuffer, size_t NBytes, int Timeout) +int PartialReadStream::Read(void *pBuffer, int NBytes, int Timeout) { // Finished? - if(mBytesLeft == 0) + if(mBytesLeft <= 0) { return 0; } @@ -70,7 +70,7 @@ } // Route the request to the source - size_t read = mrSource.Read(pBuffer, NBytes, Timeout); + int read = mrSource.Read(pBuffer, NBytes, Timeout); ASSERT(read <= mBytesLeft); // Adjust the count Modified: box/chris/win32/vc2005-compile-fixes/lib/common/PartialReadStream.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/PartialReadStream.h 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/common/PartialReadStream.h 2005-12-21 00:25:17 UTC (rev 258) @@ -31,7 +31,7 @@ PartialReadStream(const PartialReadStream &); public: - virtual size_t Read(void *pBuffer, size_t NBytes, int Timeout = IOStream::TimeOutInfinite); + virtual int Read(void *pBuffer, int NBytes, int Timeout = IOStream::TimeOutInfinite); virtual pos_type BytesLeftToRead(); virtual void Write(const void *pBuffer, int NBytes); virtual bool StreamDataLeft(); @@ -39,7 +39,7 @@ private: IOStream &mrSource; - size_t mBytesLeft; + int mBytesLeft; }; #endif // PARTIALREADSTREAM__H Modified: box/chris/win32/vc2005-compile-fixes/lib/common/ReadGatherStream.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/ReadGatherStream.cpp 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/common/ReadGatherStream.cpp 2005-12-21 00:25:17 UTC (rev 258) @@ -64,12 +64,12 @@ // Created: 10/12/03 // // -------------------------------------------------------------------------- -size_t ReadGatherStream::AddComponent(IOStream *pStream) +int ReadGatherStream::AddComponent(IOStream *pStream) { ASSERT(pStream != 0); // Just add the component to the list, returning it's index. - size_t index = mComponents.size(); + int index = (int)mComponents.size(); mComponents.push_back(pStream); return index; } @@ -116,9 +116,9 @@ // Created: 10/12/03 // // -------------------------------------------------------------------------- -size_t ReadGatherStream::Read(void *pBuffer, size_t NBytes, int Timeout) +int ReadGatherStream::Read(void *pBuffer, int NBytes, int Timeout) { - size_t bytesToRead = NBytes; + int bytesToRead = NBytes; uint8_t *buffer = (uint8_t*)pBuffer; while(bytesToRead > 0) @@ -145,18 +145,16 @@ if(mPositionInCurrentBlock < mBlocks[mCurrentBlock].mLength) { // Read! - pos_type s = mBlocks[mCurrentBlock].mLength - - mPositionInCurrentBlock; + int s = (int)(mBlocks[mCurrentBlock].mLength - + mPositionInCurrentBlock); if(s > bytesToRead) s = bytesToRead; - - ASSERT(sizeof(size_t) >= sizeof(pos_type)) - pos_type r = mComponents[mBlocks[mCurrentBlock] - .mComponent]->Read(buffer, (size_t)s, Timeout); + int r = mComponents[mBlocks[mCurrentBlock].mComponent]->Read(buffer, s, Timeout); + // update variables mPositionInCurrentBlock += r; buffer += r; - bytesToRead -= (size_t)r; + bytesToRead -= r; mCurrentPosition += r; if(r != s) Modified: box/chris/win32/vc2005-compile-fixes/lib/common/ReadGatherStream.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/ReadGatherStream.h 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/common/ReadGatherStream.h 2005-12-21 00:25:17 UTC (rev 258) @@ -32,10 +32,10 @@ ReadGatherStream &operator=(const ReadGatherStream &); public: - size_t AddComponent(IOStream *pStream); + int AddComponent(IOStream *pStream); void AddBlock(int Component, pos_type Length, bool Seek = false, pos_type SeekTo = 0); - virtual size_t Read(void *pBuffer, size_t NBytes, int Timeout = IOStream::TimeOutInfinite); + virtual int Read(void *pBuffer, int NBytes, int Timeout = IOStream::TimeOutInfinite); virtual pos_type BytesLeftToRead(); virtual void Write(const void *pBuffer, int NBytes); virtual bool StreamDataLeft(); Modified: box/chris/win32/vc2005-compile-fixes/lib/common/StreamableMemBlock.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/StreamableMemBlock.cpp 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/common/StreamableMemBlock.cpp 2005-12-21 00:25:17 UTC (rev 258) @@ -84,12 +84,12 @@ // -------------------------------------------------------------------------- // // Function -// Name: StreamableMemBlock::Set(void *, size_t) +// Name: StreamableMemBlock::Set(void *, int) // Purpose: Set the contents of the block // Created: 2003/09/05 // // -------------------------------------------------------------------------- -void StreamableMemBlock::Set(void *pBuffer, size_t Size) +void StreamableMemBlock::Set(void *pBuffer, int Size) { FreeBlock(); AllocateBlock(Size); @@ -115,7 +115,6 @@ } // Allocate a new block (this way to be exception safe) - ASSERT(sizeof(size_t) >= sizeof(IOStream::pos_type)) char *pblock = (char*)malloc((size_t)size); if(pblock == 0) { @@ -125,7 +124,7 @@ try { // Read in - if(!rStream.ReadFullBuffer(pblock, (size_t)size, 0 /* not interested in bytes read if this fails */)) + if(!rStream.ReadFullBuffer(pblock, (int)size, 0 /* not interested in bytes read if this fails */)) { THROW_EXCEPTION(CommonException, StreamableMemBlockIncompleteRead) } @@ -142,9 +141,7 @@ // store... ASSERT(mpBuffer == 0); mpBuffer = pblock; - - ASSERT(sizeof(size_t) >= sizeof(IOStream::pos_type)) - mSize = (size_t)size; + mSize = (int)size; } @@ -198,12 +195,12 @@ // -------------------------------------------------------------------------- // // Function -// Name: StreamableMemBlock::AllocateBlock(size_t) +// Name: StreamableMemBlock::AllocateBlock(int) // Purpose: Protected. Allocate the block of memory // Created: 2003/09/05 // // -------------------------------------------------------------------------- -void StreamableMemBlock::AllocateBlock(size_t Size) +void StreamableMemBlock::AllocateBlock(int Size) { ASSERT(mpBuffer == 0); if(Size > 0) @@ -302,9 +299,7 @@ // -------------------------------------------------------------------------- void StreamableMemBlock::WriteToStream(IOStream &rStream) const { - ASSERT(sizeof(uint32_t) >= sizeof(mSize)) - uint32_t sizenbo = htonl((uint32_t)mSize); - + int32_t sizenbo = htonl(mSize); // Size rStream.Write(&sizenbo, sizeof(sizenbo)); // Buffer Modified: box/chris/win32/vc2005-compile-fixes/lib/common/StreamableMemBlock.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/StreamableMemBlock.h 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/common/StreamableMemBlock.h 2005-12-21 00:25:17 UTC (rev 258) @@ -30,7 +30,7 @@ ~StreamableMemBlock(); void Set(const StreamableMemBlock &rBlock); - void Set(void *pBuffer, size_t Size); + void Set(void *pBuffer, int Size); void Set(IOStream &rStream, int Timeout); StreamableMemBlock &operator=(const StreamableMemBlock &rBlock) { @@ -46,7 +46,7 @@ void *GetBuffer() const; // Size of block - size_t GetSize() const {return mSize;} + int GetSize() const {return mSize;} // Buffer empty? bool IsEmpty() const {return mSize == 0;} @@ -59,12 +59,12 @@ void ResizeBlock(int Size); protected: // be careful with these! - void AllocateBlock(size_t Size); + void AllocateBlock(int Size); void FreeBlock(); private: void *mpBuffer; - size_t mSize; + int mSize; }; #endif // STREAMABLEMEMBLOCK__H Modified: box/chris/win32/vc2005-compile-fixes/lib/common/Test.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/Test.h 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/common/Test.h 2005-12-21 00:25:17 UTC (rev 258) @@ -10,12 +10,17 @@ #ifndef TEST__H #define TEST__H +#include "Box.h" + #include #include #include #include -#include +#ifdef HAVE_UNISTD_H + #include +#endif + #include extern int failures; Modified: box/chris/win32/vc2005-compile-fixes/lib/common/UnixUser.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/UnixUser.cpp 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/common/UnixUser.cpp 2005-12-21 00:25:17 UTC (rev 258) @@ -9,11 +9,14 @@ #include "Box.h" -#ifndef WIN32 -#include -#include +#ifdef HAVE_PWD_H + #include #endif +#ifdef HAVE_UNISTD_H + #include +#endif + #include "UnixUser.h" #include "CommonException.h" Modified: box/chris/win32/vc2005-compile-fixes/lib/common/WaitForEvent.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/WaitForEvent.cpp 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/common/WaitForEvent.cpp 2005-12-21 00:25:17 UTC (rev 258) @@ -9,8 +9,8 @@ #include "Box.h" -#ifndef WIN32 -#include +#ifdef HAVE_UNISTD_H + #include #endif #include @@ -163,8 +163,7 @@ } // Poll! - ASSERT(sizeof(unsigned long) > sizeof(size_t)) - switch(::poll(mpPollInfo, (unsigned long)mItems.size(), mTimeout)) + switch(::poll(mpPollInfo, (unsigned int)mItems.size(), mTimeout)) { case -1: // Interrupted system calls aren't an error, just equivalent to a timeout Modified: box/chris/win32/vc2005-compile-fixes/lib/compress/Compress.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/compress/Compress.h 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/compress/Compress.h 2005-12-21 00:25:17 UTC (rev 258) @@ -85,19 +85,17 @@ // Created: 5/12/03 // // -------------------------------------------------------------------------- - void Input(const void *pInBuffer, size_t InLength) + void Input(const void *pInBuffer, int InLength) { // Check usage if(mStream.avail_in != 0) { THROW_EXCEPTION(CompressException, BadUsageInputNotRequired) } - - ASSERT(sizeof(uInt) >= sizeof(size_t)) // Store info mStream.next_in = (unsigned char *)pInBuffer; - mStream.avail_in = (uInt)InLength; + mStream.avail_in = InLength; } // -------------------------------------------------------------------------- @@ -121,19 +119,17 @@ // Created: 5/12/03 // // -------------------------------------------------------------------------- - size_t Output(void *pOutBuffer, size_t OutLength, bool SyncFlush = false) + int Output(void *pOutBuffer, int OutLength, bool SyncFlush = false) { // need more input? if(mStream.avail_in == 0 && mFlush != Z_FINISH && !SyncFlush) { return 0; } - - ASSERT(sizeof(int) <= sizeof(size_t)) // Buffers mStream.next_out = (unsigned char *)pOutBuffer; - mStream.avail_out = (unsigned int)OutLength; + mStream.avail_out = OutLength; // Call one of the functions int flush = mFlush; Modified: box/chris/win32/vc2005-compile-fixes/lib/compress/CompressStream.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/compress/CompressStream.cpp 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/compress/CompressStream.cpp 2005-12-21 00:25:17 UTC (rev 258) @@ -131,12 +131,12 @@ // -------------------------------------------------------------------------- // // Function -// Name: CompressStream::Read(void *, size_t, int) +// Name: CompressStream::Read(void *, int, int) // Purpose: As interface // Created: 27/5/04 // // -------------------------------------------------------------------------- -size_t CompressStream::Read(void *pBuffer, size_t NBytes, int Timeout) +int CompressStream::Read(void *pBuffer, int NBytes, int Timeout) { USE_READ_COMPRESSOR if(pDecompress == 0) @@ -155,7 +155,7 @@ } // Read data into the buffer -- read as much as possible in one go - size_t s = mpStream->Read(pbuf, BUFFER_SIZE, Timeout); + int s = mpStream->Read(pbuf, BUFFER_SIZE, Timeout); if(s == 0) { return 0; @@ -172,12 +172,12 @@ // -------------------------------------------------------------------------- // // Function -// Name: CompressStream::Write(const void *, size_t) +// Name: CompressStream::Write(const void *, int) // Purpose: As interface // Created: 27/5/04 // // -------------------------------------------------------------------------- -void CompressStream::Write(const void *pBuffer, size_t NBytes) +void CompressStream::Write(const void *pBuffer, int NBytes) { USE_WRITE_COMPRESSOR if(pCompress == 0) @@ -262,7 +262,7 @@ USE_WRITE_COMPRESSOR if(pCompress == 0) {THROW_EXCEPTION(CompressException, Internal)} - size_t s = 0; + int s = 0; do { s = pCompress->Output(mpBuffer, BUFFER_SIZE, SyncFlush); Modified: box/chris/win32/vc2005-compile-fixes/lib/compress/CompressStream.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/compress/CompressStream.h 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/compress/CompressStream.h 2005-12-21 00:25:17 UTC (rev 258) @@ -32,8 +32,8 @@ CompressStream &operator=(const CompressStream &); public: - virtual size_t Read(void *pBuffer, size_t NBytes, int Timeout = IOStream::TimeOutInfinite); - virtual void Write(const void *pBuffer, size_t NBytes); + virtual int Read(void *pBuffer, int NBytes, int Timeout = IOStream::TimeOutInfinite); + virtual void Write(const void *pBuffer, int NBytes); virtual void WriteAllBuffered(); virtual void Close(); virtual bool StreamDataLeft(); Added: box/chris/win32/vc2005-compile-fixes/lib/win32/config.h.win32 =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/win32/config.h.win32 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/win32/config.h.win32 2005-12-21 00:25:17 UTC (rev 258) @@ -0,0 +1,342 @@ +/* lib/common/config.h. Generated by configure. */ +/* lib/common/config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if the `closedir' function returns void instead of `int'. */ +/* #undef CLOSEDIR_VOID */ + +/* Define to the location of the Berkeley DB 1.85 header */ +/* #undef DB_HEADER */ + +/* Define to 1 if non-aligned int16 access will fail */ +/* #undef HAVE_ALIGNED_ONLY_INT16 */ + +/* Define to 1 if non-aligned int32 access will fail */ +/* #undef HAVE_ALIGNED_ONLY_INT32 */ + +/* Define to 1 if non-aligned int64 access will fail */ +/* #undef HAVE_ALIGNED_ONLY_INT64 */ + +/* Define to 1 if Berkeley DB is available */ +/* #undef HAVE_DB */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DB1_DB_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DB3_DB_185_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DB4_DB_185_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DB_185_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DB_H */ + +/* Define to 1 if you have the declaration of `F_SETLK', and to 0 if you + don't. */ +#define HAVE_DECL_F_SETLK 0 + +/* Define to 1 if you have the declaration of `INFTIM', and to 0 if you don't. + */ +#define HAVE_DECL_INFTIM 0 + +/* Define to 1 if you have the declaration of `O_EXLOCK', and to 0 if you + don't. */ +#define HAVE_DECL_O_EXLOCK 0 + +/* Define to 1 if you have the declaration of `SO_PEERCRED', and to 0 if you + don't. */ +#define HAVE_DECL_SO_PEERCRED 0 + +/* Define to 1 if #define of pragmas works */ +/* #undef HAVE_DEFINE_PRAGMA */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#define HAVE_DIRENT_H 1 + +/* define if the compiler supports exceptions */ +#define HAVE_EXCEPTIONS + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_EXECINFO_H */ + +/* Define to 1 if you have the `flock' function. */ +/* #undef HAVE_FLOCK */ + +/* Define to 1 if you have the `getmntent' function. */ +/* #undef HAVE_GETMNTENT */ + +/* Define to 1 if you have the `getpeereid' function. */ +/* #undef HAVE_GETPEEREID */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_HISTORY_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_INTTYPES_H */ + +/* Define to 1 if you have the `kqueue' function. */ +/* #undef HAVE_KQUEUE */ + +/* Define to 1 large file support is in use */ +/* #undef HAVE_LARGE_FILE_SUPPORT */ + +/* Define to 1 if you have the `lchown' function. */ +/* #undef HAVE_LCHOWN */ + +/* Define to 1 if you have the `crypto' library (-lcrypto). */ +#define HAVE_LIBCRYPTO 1 + +/* Define if you have a readline compatible library */ +/* #undef HAVE_LIBREADLINE */ + +/* Define to 1 if you have the `ssl' library (-lssl). */ +#define HAVE_LIBSSL 1 + +/* Define to 1 if you have the `z' library (-lz). */ +#define HAVE_LIBZ 1 + +/* Define to 1 if syscall lseek requires a dummy middle parameter */ +/* #undef HAVE_LSEEK_DUMMY_PARAM */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MNTENT_H */ + +/* Define to 1 if this platform supports mounts */ +/* #undef HAVE_MOUNTS */ + +/* define if the compiler implements namespaces */ +#define HAVE_NAMESPACES + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_IN_H */ + +/* Define to 1 if SSL is pre-0.9.7 */ +/* #undef HAVE_OLD_SSL */ + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_SSL_H 1 + +/* Define to 1 (and set RANDOM_DEVICE) if a random device is available */ +/* #undef HAVE_RANDOM_DEVICE */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_READLINE_H */ + +/* Define if your readline library has \`add_history' */ +/* #undef HAVE_READLINE_HISTORY */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_READLINE_HISTORY_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_READLINE_READLINE_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_REGEX_H */ + +/* Define to 1 if you have the `setproctitle' function. */ +/* #undef HAVE_SETPROCTITLE */ + +/* Define to 1 if SSL is available */ +#define HAVE_SSL 1 + +/* Define to 1 if you have the `statfs' function. */ +/* #undef HAVE_STATFS */ + +/* Define to 1 if `stat' has the bug that it succeeds when given the + zero-length file name argument. */ +/* #undef HAVE_STAT_EMPTY_STRING_BUG */ + +/* Define to 1 if stdbool.h conforms to C99. */ +#define HAVE_STDBOOL_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STDINT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if `d_type' is member of `struct dirent'. */ +/* #undef HAVE_STRUCT_DIRENT_D_TYPE */ + +/* Define to 1 if `mnt_dir' is member of `struct mntent'. */ +/* #undef HAVE_STRUCT_MNTENT_MNT_DIR */ + +/* Define to 1 if `mnt_mountp' is member of `struct mnttab'. */ +/* #undef HAVE_STRUCT_MNTTAB_MNT_MOUNTP */ + +/* Define to 1 if `sin_len' is member of `struct sockaddr_in'. */ +/* #undef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */ + +/* Define to 1 if `f_mntonname' is member of `struct statfs'. */ +/* #undef HAVE_STRUCT_STATFS_F_MNTONNAME */ + +/* Define to 1 if `st_flags' is member of `struct stat'. */ +/* #undef HAVE_STRUCT_STAT_ST_FLAGS */ + +/* Define to 1 if `st_mtimespec' is member of `struct stat'. */ +/* #undef HAVE_STRUCT_STAT_ST_MTIMESPEC */ + +/* Define to 1 if you have the `syscall' function. */ +/* #undef HAVE_SYSCALL */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MNTTAB_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MOUNT_H */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SYSCALL_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have that is POSIX.1 compatible. */ +/* #undef HAVE_SYS_WAIT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_XATTR_H */ + +/* Define to 1 if the system has the type `uint16_t'. */ +// #define HAVE_UINT16_T 1 + +/* Define to 1 if the system has the type `uint32_t'. */ +// #define HAVE_UINT32_T 1 + +/* Define to 1 if the system has the type `uint64_t'. */ +// #define HAVE_UINT64_T 1 + +/* Define to 1 if the system has the type `uint8_t'. */ +// #define HAVE_UINT8_T 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if the system has the type `u_int16_t'. */ +/* #undef HAVE_U_INT16_T */ + +/* Define to 1 if the system has the type `u_int32_t'. */ +/* #undef HAVE_U_INT32_T */ + +/* Define to 1 if the system has the type `u_int64_t'. */ +/* #undef HAVE_U_INT64_T */ + +/* Define to 1 if the system has the type `u_int8_t'. */ +/* #undef HAVE_U_INT8_T */ + +/* Define to 1 if struct dirent.d_type is valid */ +/* #undef HAVE_VALID_DIRENT_D_TYPE */ + +/* Define to 1 if the system has the type `_Bool'. */ +/* #undef HAVE__BOOL */ + +/* Define to 1 if you have the `__syscall' function. */ +/* #undef HAVE___SYSCALL */ + +/* Define to 1 if __syscall is available but needs a definition */ +/* #undef HAVE___SYSCALL_NEED_DEFN */ + +/* max value of long long calculated by configure */ +/* #undef LLONG_MAX */ + +/* min value of long long calculated by configure */ +/* #undef LLONG_MIN */ + +/* Define to 1 if `lstat' dereferences a symlink specified with a trailing + slash. */ +/* #undef LSTAT_FOLLOWS_SLASHED_SYMLINK */ + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "box at fluffy.co.uk" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "Box Backup" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "Box Backup 0.09" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "box-backup" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "0.09" + +/* Define to the filename of the random device (and set HAVE_RANDOM_DEVICE) */ +/* #undef RANDOM_DEVICE */ + +/* Define as the return type of signal handlers (`int' or `void'). */ +#define RETSIGTYPE void + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* TMP directory name */ +#define TEMP_DIRECTORY_NAME "/tmp" + +/* Define to 1 if you can safely include both and . */ +#define TIME_WITH_SYS_TIME 1 + +/* Define to 1 if your declares `struct tm'. */ +/* #undef TM_IN_SYS_TIME */ + +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +/* #undef WORDS_BIGENDIAN */ + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if __USE_MALLOC is required work around STL memory leaks */ +/* #undef __USE_MALLOC */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `int' if doesn't define. */ +#define gid_t int + +/* Define to `int' if does not define. */ +/* #undef mode_t */ + +/* Define to `long' if does not define. */ +/* #undef off_t */ + +/* Define to `int' if does not define. */ +/* #undef pid_t */ + +/* Define to `unsigned' if does not define. */ +/* #undef size_t */ + +/* Define to `int' if doesn't define. */ +#define uid_t int Modified: box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h 2005-12-21 00:23:10 UTC (rev 257) +++ box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h 2005-12-21 00:25:17 UTC (rev 258) @@ -3,7 +3,7 @@ #if ! defined EMU_INCLUDE && defined WIN32 #define EMU_INCLUDE -#define _STAT_DEFINED +// #define _STAT_DEFINED #define _INO_T_DEFINED #include @@ -185,7 +185,7 @@ str = str.substr(index+1, str.size()); } - index = str.find('-'); + index = (int)str.find('-'); if ( index == -1 ) return -1; @@ -194,7 +194,7 @@ optind ++; str = args[optind]; } - while ( ( opttolookfor = interestin.find(opt)) == -1 ); + while ( ( opttolookfor = (int)interestin.find(opt)) == -1 ); if ( interestin[opttolookfor+1] == ':' ) { @@ -264,7 +264,7 @@ inline int mkdir(const char *pathname, mode_t mode) { - return mkdir(pathname); + return _mkdir(pathname); } #ifdef __MINGW32__ @@ -365,6 +365,7 @@ TCHAR f_mntonname[MAX_PATH]; }; +#if 0 // I think this should get us going // Although there is a warning about // mount points in win32 can now exists - which means inode number can be @@ -388,6 +389,7 @@ #ifndef __MINGW32__ typedef u_int64_t _ino_t; #endif +#endif int ourstat(const char * name, struct stat * st); int ourfstat(HANDLE file, struct stat * st); From boxbackup-dev at fluffy.co.uk Wed Dec 21 00:26:33 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 21 Dec 2005 00:26:33 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r259 - box/chris/win32/vc2005-compile-fixes/lib/win32 Message-ID: <20051221002633.1190794@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-21 00:26:30 +0000 (Wed, 21 Dec 2005) New Revision: 259 Modified: box/chris/win32/vc2005-compile-fixes/lib/win32/config.h.win32 Log: * config.h.win32 - Undefine HAVE_UNISTD_H since Visual C++ 2005 doesn't Modified: box/chris/win32/vc2005-compile-fixes/lib/win32/config.h.win32 =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/win32/config.h.win32 2005-12-21 00:25:17 UTC (rev 258) +++ box/chris/win32/vc2005-compile-fixes/lib/win32/config.h.win32 2005-12-21 00:26:30 UTC (rev 259) @@ -238,7 +238,7 @@ // #define HAVE_UINT8_T 1 /* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 +// #define HAVE_UNISTD_H 1 /* Define to 1 if the system has the type `u_int16_t'. */ /* #undef HAVE_U_INT16_T */ From boxbackup-dev at fluffy.co.uk Wed Dec 21 01:24:41 2005 From: boxbackup-dev at fluffy.co.uk (Charles Lecklider) Date: Wed, 21 Dec 2005 01:24:41 +0000 Subject: [Box Backup-dev] COMMIT r255 - in box/chris/win32/vc2005-compile-fixes/lib: common compress server win32 In-Reply-To: <1135126172.7993.33.camel@avenin.ebourne.me.uk> References: <20051220225951.EDCE794@s0g0.pems.testserver.co.uk> <1135123701.7993.22.camel@avenin.ebourne.me.uk> <1135125376.7993.28.camel@avenin.ebourne.me.uk> <1135126172.7993.33.camel@avenin.ebourne.me.uk> Message-ID: <43A8AED9.1070801@invis.net> Martin Ebourne wrote: > I don't think it's unreasonable for developers to install cygwin. That's > pretty much how autoconf is intended to work. Well, I do :-) Cygwin is an evil kludge designed to prevent *nix programmers from having to come to terms with a different way of doing things. > Clearly users shouldn't have to install cygwin, but precompiled binaries > is the right answer there. As long as they're native non-Cygwin binaries, sure. Maybe it would help if I said what I'm trying to do with boxbackup.... I need a remote backup solution for my clients. If Ben hadn't written boxbackup I would have had to kludge something together, and I wouldn't have had the time to make it nearly as good. Now, the simple reality is that in >90% of the world people run Windows. Another simple reality is that I can only make money if I don't have to spend time babysitting software that should just work, which pretty much rules out Cygwin binaries. My aim is to make the Win32 version a true native *client*, every bit as good as the *nix version. (I have no interest in seeing a Win32 server version, but I don't want to prevent it either). However, in order to have time to do that I need to have a Windows development environment, not a unix one ported to kinda work under Windows, maybe, when it feels like it and the phase of the moon is right. Hence, no Cygwin anywhere, and if at all possible, no Perl. I like Perl, but it's a sod to integrate into the build process under Windows. -C From boxbackup-dev at fluffy.co.uk Wed Dec 21 01:25:49 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Wed, 21 Dec 2005 01:25:49 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r248 - box/trunk/lib/backupclient In-Reply-To: <20051220081322.9F83A94@s0g0.pems.testserver.co.uk> References: <20051220081322.9F83A94@s0g0.pems.testserver.co.uk> Message-ID: Hi Martin, > Author: martin > Date: 2005-12-20 08:13:21 +0000 (Tue, 20 Dec 2005) > New Revision: 248 > > Modified: > box/trunk/lib/backupclient/BackupStoreFile.h > Log: > Fix CodingChunkAlloc/Free for use on 32 and 64 bit platforms I'm getting some warnings from Visual Studio about pointer truncation in this code. In BackupStoreFile.h lines 128 and 139, I get "pointer truncation from '{uint8_t,void} *' to 'unsigned long'. This code is really hairy and I'm not sure how to work around it. Is it possible to do the calculation without casting pointers to longs? Does that even work on 64-bit platforms? Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Wed Dec 21 01:28:56 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Wed, 21 Dec 2005 01:28:56 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r248 - box/trunk/lib/backupclient In-Reply-To: References: <20051220081322.9F83A94@s0g0.pems.testserver.co.uk> Message-ID: Hi Martin, On Wed, 21 Dec 2005, Chris Wilson wrote: > Does that even work on 64-bit platforms? I guess that if it doesn't, you'll hit the ASSERT just above it. Sorry. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Wed Dec 21 01:31:56 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Wed, 21 Dec 2005 01:31:56 +0000 Subject: [Box Backup-dev] COMMIT r248 - box/trunk/lib/backupclient In-Reply-To: References: <20051220081322.9F83A94@s0g0.pems.testserver.co.uk> Message-ID: <1135128716.1294.2.camel@avenin.ebourne.me.uk> On Wed, 2005-12-21 at 01:25 +0000, Chris Wilson wrote: > I'm getting some warnings from Visual Studio about pointer truncation in > this code. In BackupStoreFile.h lines 128 and 139, I get "pointer > truncation from '{uint8_t,void} *' to 'unsigned long'. > > This code is really hairy and I'm not sure how to work around it. Is it > possible to do the calculation without casting pointers to longs? Does > that even work on 64-bit platforms? It needs to become an integer to do the non-additive arithmetic. Curious to know what size pointers are on this setup. Are they long long? Previously the code was casting to int32_t so I doubt that would have been any better. Cheers, Martin From boxbackup-dev at fluffy.co.uk Wed Dec 21 00:43:33 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 21 Dec 2005 00:43:33 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r260 - in box/trunk: . lib/common Message-ID: <20051221004333.4E75294@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-21 00:43:31 +0000 (Wed, 21 Dec 2005) New Revision: 260 Modified: box/trunk/configure.ac box/trunk/lib/common/BoxPlatform.h Log: Rename config.h to BoxConfig.h to help prevent clashes Modified: box/trunk/configure.ac =================================================================== --- box/trunk/configure.ac 2005-12-21 00:26:30 UTC (rev 259) +++ box/trunk/configure.ac 2005-12-21 00:43:31 UTC (rev 260) @@ -4,7 +4,7 @@ AC_PREREQ(2.59) AC_INIT([Box Backup], 0.09, [box at fluffy.co.uk]) AC_CONFIG_SRCDIR([lib/common/Box.h]) -AC_CONFIG_HEADERS([lib/common/config.h]) +AC_CONFIG_HEADERS([lib/common/BoxConfig.h]) touch install-sh AC_CANONICAL_SYSTEM Modified: box/trunk/lib/common/BoxPlatform.h =================================================================== --- box/trunk/lib/common/BoxPlatform.h 2005-12-21 00:26:30 UTC (rev 259) +++ box/trunk/lib/common/BoxPlatform.h 2005-12-21 00:43:31 UTC (rev 260) @@ -21,7 +21,7 @@ #define PLATFORM_DEV_NULL "/dev/null" -#include "config.h" +#include "BoxConfig.h" #ifdef WIN32 // need msvcrt version 6.1 or higher for _gmtime64() From boxbackup-dev at fluffy.co.uk Wed Dec 21 01:40:08 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Wed, 21 Dec 2005 01:40:08 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r248 - box/trunk/lib/backupclient In-Reply-To: <1135128716.1294.2.camel@avenin.ebourne.me.uk> References: <20051220081322.9F83A94@s0g0.pems.testserver.co.uk> <1135128716.1294.2.camel@avenin.ebourne.me.uk> Message-ID: Hi Martin, > It needs to become an integer to do the non-additive arithmetic. Curious > to know what size pointers are on this setup. Are they long long? > Previously the code was casting to int32_t so I doubt that would have > been any better. I've enabled the win64 portability warnings. I'd guess that long might be 32-bit on some Windows platforms, or else visual c++ is being overly paranoid. Using long long seems to shut it up. And yes, I was getting similar errors with the old code, so you didn't make it any worse :-) Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Wed Dec 21 01:41:20 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Wed, 21 Dec 2005 01:41:20 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r255 - in box/chris/win32/vc2005-compile-fixes/lib: common compress server win32 In-Reply-To: <1135123701.7993.22.camel@avenin.ebourne.me.uk> References: <20051220225951.EDCE794@s0g0.pems.testserver.co.uk> <1135123701.7993.22.camel@avenin.ebourne.me.uk> Message-ID: Hi Martin, > Please don't use a platform check for header files. Please add a > configure test (AC_CHECK_HEADERS) and use its define. How would I check the type of struct timeval.tv_sec using autoconf? Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Wed Dec 21 03:12:46 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 21 Dec 2005 03:12:46 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r261 - in box/chris/win32/vc2005-compile-fixes: . bin/bbackupctl bin/bbackupd bin/bbackupquery lib/backupclient lib/common lib/server lib/win32 Message-ID: <20051221031246.DA8AB94@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-21 03:11:48 +0000 (Wed, 21 Dec 2005) New Revision: 261 Modified: box/chris/win32/vc2005-compile-fixes/bin/bbackupctl/bbackupctl.cpp box/chris/win32/vc2005-compile-fixes/bin/bbackupd/BackupClientDirectoryRecord.cpp box/chris/win32/vc2005-compile-fixes/bin/bbackupd/BackupDaemon.cpp box/chris/win32/vc2005-compile-fixes/bin/bbackupd/Win32ServiceFunctions.cpp box/chris/win32/vc2005-compile-fixes/bin/bbackupd/bbackupd.cpp box/chris/win32/vc2005-compile-fixes/bin/bbackupquery/BackupQueries.cpp box/chris/win32/vc2005-compile-fixes/bin/bbackupquery/bbackupquery.cpp box/chris/win32/vc2005-compile-fixes/configure.ac box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientFileAttributes.cpp box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientRestore.cpp box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreDirectory.cpp box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreDirectory.h box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFile.cpp box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFile.h box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileCmbDiff.cpp box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileCmbIdx.cpp box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileCombine.cpp box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileDiff.cpp box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileEncodeStream.cpp box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileRevDiff.cpp box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFilename.cpp box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFilenameClear.cpp box/chris/win32/vc2005-compile-fixes/lib/common/BoxTimeToUnix.h box/chris/win32/vc2005-compile-fixes/lib/common/DebugMemLeakFinder.cpp box/chris/win32/vc2005-compile-fixes/lib/server/Daemon.cpp box/chris/win32/vc2005-compile-fixes/lib/server/LocalProcessStream.cpp box/chris/win32/vc2005-compile-fixes/lib/server/Protocol.cpp box/chris/win32/vc2005-compile-fixes/lib/server/Socket.cpp box/chris/win32/vc2005-compile-fixes/lib/server/SocketListen.h box/chris/win32/vc2005-compile-fixes/lib/server/SocketStream.cpp box/chris/win32/vc2005-compile-fixes/lib/server/SocketStreamTLS.cpp box/chris/win32/vc2005-compile-fixes/lib/win32/WinNamedPipeStream.cpp box/chris/win32/vc2005-compile-fixes/lib/win32/config.h.win32 box/chris/win32/vc2005-compile-fixes/lib/win32/emu.cpp box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h Log: Remaining Visual C++ 2005 compile fixes Modified: box/chris/win32/vc2005-compile-fixes/bin/bbackupctl/bbackupctl.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/bin/bbackupctl/bbackupctl.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/bin/bbackupctl/bbackupctl.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -10,8 +10,11 @@ #include "Box.h" #include -#include +#ifdef HAVE_UNISTD_H + #include +#endif + #include "MainHelper.h" #include "BoxPortsAndFiles.h" #include "BackupDaemonConfigVerify.h" @@ -212,7 +215,7 @@ // No? Just send the command given plus a quit command. std::string cmd(argv[0]); cmd += "\nquit\n"; - connection.Write(cmd.c_str(), cmd.size()); + connection.Write(cmd.c_str(), (int)cmd.size()); } // Read the response Modified: box/chris/win32/vc2005-compile-fixes/bin/bbackupd/BackupClientDirectoryRecord.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/bin/bbackupd/BackupClientDirectoryRecord.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/bin/bbackupd/BackupClientDirectoryRecord.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -9,7 +9,10 @@ #include "Box.h" -#include +#ifdef HAVE_DIRENT_H + #include +#endif + #include #include @@ -257,7 +260,7 @@ checksum_info.mAttributeModificationTime = FileAttrModificationTime(st); checksum_info.mSize = st.st_size; currentStateChecksum.Add(&checksum_info, sizeof(checksum_info)); - currentStateChecksum.Add(en->d_name, strlen(en->d_name)); + currentStateChecksum.Add(en->d_name, (int)strlen(en->d_name)); // If the file has been modified madly into the future, download the // directory record anyway to ensure that it doesn't get uploaded Modified: box/chris/win32/vc2005-compile-fixes/bin/bbackupd/BackupDaemon.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/bin/bbackupd/BackupDaemon.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/bin/bbackupd/BackupDaemon.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -10,8 +10,11 @@ #include "Box.h" #include -#include +#ifdef HAVE_UNISTD_H + #include +#endif + #ifndef WIN32 #include #include @@ -28,6 +31,9 @@ #include #include #endif +#ifdef HAVE_PROCESS_H + #include +#endif #include "Configuration.h" #include "IOStream.h" @@ -259,7 +265,7 @@ conf.GetKeyValueInt("MaxUploadWait"), mState); - mpCommandSocketInfo->mListeningSocket.Write(summary, summarySize); + mpCommandSocketInfo->mListeningSocket.Write(summary, (int)summarySize); mpCommandSocketInfo->mListeningSocket.Write("ping\n", 5); IOStreamGetLine readLine(mpCommandSocketInfo->mListeningSocket); @@ -314,7 +320,7 @@ { const char* response = sendOK ? "ok\n" : "error\n"; mpCommandSocketInfo->mListeningSocket.Write( - response, strlen(response)); + response, (int)strlen(response)); } if (disconnect) @@ -508,7 +514,7 @@ { // No command socket or connection, just do a normal sleep time_t sleepSeconds = BoxTimeToSeconds(requiredDelay); - ::sleep((sleepSeconds <= 0)?1:sleepSeconds); + ::sleep((unsigned int)((sleepSeconds <= 0)?1:sleepSeconds)); } } @@ -663,7 +669,8 @@ } // Calculate when the next sync run should be - nextSyncTime = currentSyncStartTime + updateStoreInterval + Random::RandomInt(updateStoreInterval >> SYNC_PERIOD_RANDOM_EXTRA_TIME_SHIFT_BY); + nextSyncTime = currentSyncStartTime + updateStoreInterval + + Random::RandomInt((uint32_t)updateStoreInterval >> SYNC_PERIOD_RANDOM_EXTRA_TIME_SHIFT_BY); // Commit the ID Maps CommitIDMapsAfterSync(); @@ -836,7 +843,7 @@ #ifdef WIN32 // Really could use some interprocess protection, mutex etc // any side effect should be too bad???? :) - DWORD timeout = BoxTimeToMilliSeconds(RequiredDelay); + DWORD timeout = (DWORD)BoxTimeToMilliSeconds(RequiredDelay); while ( this->mReceivedCommandConn == false ) { @@ -1087,7 +1094,7 @@ { #ifdef WIN32 mpCommandSocketInfo->mListeningSocket.Write(message, - strlen(message)); + (int)strlen(message)); #else mpCommandSocketInfo->mpConnectedSocket->Write(message, strlen(message)); @@ -1684,7 +1691,9 @@ char newStateSize = sprintf(newState, "state %d\n", State); #ifdef WIN32 - #warning FIX ME: race condition +#ifndef _MSC_VER +#warning FIX ME: race condition +#endif // what happens if the socket is closed by the other thread before // we can write to it? Null pointer deref at best. if (mpCommandSocketInfo && Modified: box/chris/win32/vc2005-compile-fixes/bin/bbackupd/Win32ServiceFunctions.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/bin/bbackupd/Win32ServiceFunctions.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/bin/bbackupd/Win32ServiceFunctions.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -14,10 +14,12 @@ #include "Box.h" -//#include -//#include -#include -//#include +#ifdef HAVE_UNISTD_H + #include +#endif +#ifdef HAVE_PROCESS_H + #include +#endif extern void TerminateService(void); extern unsigned int WINAPI RunService(LPVOID lpParameter); @@ -31,18 +33,23 @@ #define SERVICE_NAME "boxbackup" +void ShowMessage(char *s) +{ + MessageBox(0, s, "Box Backup Message", + MB_OK | MB_SETFOREGROUND | MB_DEFAULT_DESKTOP_ONLY); +} + void ErrorHandler(char *s, DWORD err) { char buf[256]; memset(buf, 0, sizeof(buf)); - snprintf(buf, sizeof(buf)-1, "%s (%d)", s, err); + _snprintf(buf, sizeof(buf)-1, "%s (%d)", s, err); ::syslog(LOG_ERR, "%s", buf); MessageBox(0, buf, "Error", MB_OK | MB_SETFOREGROUND | MB_DEFAULT_DESKTOP_ONLY); ExitProcess(err); } - void WINAPI ServiceControlHandler( DWORD controlCode ) { switch ( controlCode ) @@ -118,6 +125,8 @@ return; } + ShowMessage("Starting..."); + HANDLE ourThread = (HANDLE)_beginthreadex( NULL, 0, @@ -185,7 +194,7 @@ cmd[sizeof(cmd)-1] = 0; char cmd_args[MAX_PATH]; - snprintf(cmd_args, sizeof(cmd_args)-1, "%s --service", cmd); + _snprintf(cmd_args, sizeof(cmd_args)-1, "%s --service", cmd); cmd_args[sizeof(cmd_args)-1] = 0; newService = CreateService( Modified: box/chris/win32/vc2005-compile-fixes/bin/bbackupd/bbackupd.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/bin/bbackupd/bbackupd.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/bin/bbackupd/bbackupd.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -54,7 +54,7 @@ WSADATA info; - if (WSAStartup(MAKELONG(1, 1), &info) == SOCKET_ERROR) + if (WSAStartup(0x0101, &info) == SOCKET_ERROR) { // box backup will not run without sockets ::syslog(LOG_ERR, "Failed to initialise Windows Sockets"); Modified: box/chris/win32/vc2005-compile-fixes/bin/bbackupquery/BackupQueries.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/bin/bbackupquery/BackupQueries.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/bin/bbackupquery/BackupQueries.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -9,16 +9,22 @@ #include "Box.h" +#ifdef HAVE_UNISTD_H + #include +#endif + #include #include -#include #include #include #include #include #include -#include +#ifdef HAVE_DIRENT_H + #include +#endif + #include #include "BackupQueries.h" @@ -1247,7 +1253,7 @@ for(std::set >::const_iterator i = storeFiles.begin(); i != storeFiles.end(); ++i) { // Does the file exist locally? - std::set::const_iterator local(localFiles.find(i->first)); + std::set::iterator local(localFiles.find(i->first)); if(local == localFiles.end()) { // Not found -- report @@ -1415,7 +1421,7 @@ } // Report any files which exist on the locally, but not on the store - for(std::set::const_iterator i = localFiles.begin(); i != localFiles.end(); ++i) + for(std::set::iterator i = localFiles.begin(); i != localFiles.end(); ++i) { std::string localName(rLocalDir + DIRECTORY_SEPARATOR + *i); // Should this be ignored (ie is excluded)? @@ -1452,7 +1458,7 @@ for(std::set >::const_iterator i = storeDirs.begin(); i != storeDirs.end(); ++i) { // Does the directory exist locally? - std::set::const_iterator local(localDirs.find(i->first)); + std::set::iterator local(localDirs.find(i->first)); if(local == localDirs.end()) { // Not found -- report Modified: box/chris/win32/vc2005-compile-fixes/bin/bbackupquery/bbackupquery.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/bin/bbackupquery/bbackupquery.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/bin/bbackupquery/bbackupquery.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -9,7 +9,9 @@ #include "Box.h" -#include +#ifdef HAVE_UNISTD_H + #include +#endif #include #include #ifdef HAVE_LIBREADLINE @@ -62,7 +64,7 @@ // Under Win32 we must initialise the Winsock library // before using it. - if (WSAStartup(MAKELONG(1, 1), &info) == SOCKET_ERROR) + if (WSAStartup(0x0101, &info) == SOCKET_ERROR) { // throw error? perhaps give it its own id in the furture THROW_EXCEPTION(BackupStoreException, Internal) Modified: box/chris/win32/vc2005-compile-fixes/configure.ac =================================================================== --- box/chris/win32/vc2005-compile-fixes/configure.ac 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/configure.ac 2005-12-21 03:11:48 UTC (rev 261) @@ -65,7 +65,7 @@ AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS([execinfo.h netinet/in.h regex.h sys/types.h sys/xattr.h pwd.h]) +AC_CHECK_HEADERS([execinfo.h netinet/in.h regex.h sys/types.h sys/xattr.h pwd.h process.h sys/socket.h dirent.h]) ### Checks for typedefs, structures, and compiler characteristics. @@ -110,7 +110,7 @@ AC_FUNC_ERROR_AT_LINE AC_TYPE_SIGNAL AC_FUNC_STAT -AC_CHECK_FUNCS([getpeereid kqueue lchown setproctitle]) +AC_CHECK_FUNCS([getpeereid kqueue lchown setproctitle getpid]) AX_FUNC_SYSCALL AX_CHECK_SYSCALL_LSEEK Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientFileAttributes.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientFileAttributes.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientFileAttributes.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -9,10 +9,13 @@ #include "Box.h" +#ifdef HAVE_UNISTD_H + #include +#endif + #include #include #include -#include #include #include #include @@ -620,7 +623,7 @@ } #endif - xattrOffset += std::strlen(reinterpret_cast(pattr+1))+1; + xattrOffset += (int)std::strlen(reinterpret_cast(pattr+1))+1; } // If working as root, set user IDs @@ -974,7 +977,7 @@ MD5Digest digest; digest.Add(&hashData, sizeof(hashData)); digest.Add(xattr.GetBuffer(), xattr.GetSize()); - digest.Add(leafname.c_str(), leafname.size()); + digest.Add(leafname.c_str(), (int)leafname.size()); digest.Add(sAttributeHashSecret, sAttributeHashSecretLength); digest.Finish(); Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientRestore.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientRestore.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientRestore.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -9,11 +9,14 @@ #include "Box.h" +#ifdef HAVE_UNISTD_H + #include +#endif + #include #include #include #include -#include #include #include @@ -101,9 +104,9 @@ // ID rWrite.Write(&mNextLevelID, sizeof(mNextLevelID)); // Name string - int32_t nsize = mNextLevelLocalName.size(); + std::string::size_type nsize = mNextLevelLocalName.size(); rWrite.Write(&nsize, sizeof(nsize)); - rWrite.Write(mNextLevelLocalName.c_str(), nsize); + rWrite.Write(mNextLevelLocalName.c_str(), (int)nsize); // And then the level itself mpNextLevel->SaveLevel(rWrite); } Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreDirectory.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreDirectory.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreDirectory.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -192,7 +192,7 @@ void BackupStoreDirectory::WriteToStream(IOStream &rStream, int16_t FlagsMustBeSet, int16_t FlagsNotToBeSet, bool StreamAttributes, bool StreamDependencyInfo) const { // Get count of entries - int32_t count = mEntries.size(); + std::vector::size_type count = mEntries.size(); if(FlagsMustBeSet != Entry::Flags_INCLUDE_EVERYTHING || FlagsNotToBeSet != Entry::Flags_EXCLUDE_NOTHING) { // Need to count the entries @@ -230,7 +230,7 @@ // Build header dir_StreamFormat hdr; hdr.mMagicValue = htonl(OBJECTMAGIC_DIR_MAGIC_VALUE); - hdr.mNumEntries = htonl(count); + hdr.mNumEntries = htonl((u_long)count); hdr.mObjectID = box_hton64(mObjectID); hdr.mContainerID = box_hton64(mContainerID); hdr.mAttributesModTime = box_hton64(mAttributesModTime); Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreDirectory.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreDirectory.h 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreDirectory.h 2005-12-21 03:11:48 UTC (rev 261) @@ -146,7 +146,8 @@ int64_t GetRevisionID() const {return mRevisionID;} void SetRevisionID(int64_t RevisionID) {mRevisionID = RevisionID;} - unsigned int GetNumberOfEntries() const {return mEntries.size();} + unsigned int GetNumberOfEntries() const + {return (unsigned int)mEntries.size();} // User info -- not serialised into streams int64_t GetUserInfo1_SizeInBlocks() const {return mUserInfo1;} Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFile.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFile.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFile.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -9,7 +9,10 @@ #include "Box.h" -#include +#ifdef HAVE_UNISTD_H + #include +#endif + #include #include #include @@ -519,21 +522,22 @@ if(mNumBlocks > 0) { // Find the maximum encoded data size - int32_t maxEncodedDataSize = 0; + uint64_t maxEncodedDataSize = 0; const file_BlockIndexEntry *entry = (file_BlockIndexEntry *)mpBlockIndex; ASSERT(entry != 0); for(int64_t e = 0; e < mNumBlocks; e++) { // Get the clear and encoded size - int32_t encodedSize = box_ntoh64(entry[e].mEncodedSize); + uint64_t encodedSize = box_ntoh64(entry[e].mEncodedSize); ASSERT(encodedSize > 0); // Larger? - if(encodedSize > maxEncodedDataSize) maxEncodedDataSize = encodedSize; + if(encodedSize > maxEncodedDataSize) + maxEncodedDataSize = encodedSize; } // Allocate those blocks! - mpEncodedData = (uint8_t*)BackupStoreFile::CodingChunkAlloc(maxEncodedDataSize + 32); + mpEncodedData = (uint8_t*)BackupStoreFile::CodingChunkAlloc((int)maxEncodedDataSize + 32); // Allocate the block for the clear data, using the hint from the header. // If this is wrong, things will exception neatly later on, so it can't be used @@ -601,14 +605,15 @@ int64_t indexSize = sizeof(file_BlockIndexEntry) * mNumBlocks; // Allocate some memory - mpBlockIndex = ::malloc(indexSize); + mpBlockIndex = ::malloc((size_t)indexSize); if(mpBlockIndex == 0) { throw std::bad_alloc(); } // Read it in - if(!mrEncodedFile.ReadFullBuffer(mpBlockIndex, indexSize, 0 /* not interested in bytes read if this fails */, mTimeout)) + if(!mrEncodedFile.ReadFullBuffer(mpBlockIndex, (int)indexSize, + 0 /* not interested in bytes read if this fails */, mTimeout)) { // Couldn't read header THROW_EXCEPTION(BackupStoreException, WhenDecodingExpectedToReadButCouldnt) @@ -675,7 +680,7 @@ // Get the size from the block index const file_BlockIndexEntry *entry = (file_BlockIndexEntry *)mpBlockIndex; - int32_t encodedSize = box_ntoh64(entry[mCurrentBlock].mEncodedSize); + uint64_t encodedSize = box_ntoh64(entry[mCurrentBlock].mEncodedSize); if(encodedSize <= 0) { // The caller is attempting to decode a file which is the direct result of a diff @@ -685,14 +690,16 @@ } // Load in next block - if(!mrEncodedFile.ReadFullBuffer(mpEncodedData, encodedSize, 0 /* not interested in bytes read if this fails */, mTimeout)) + if(!mrEncodedFile.ReadFullBuffer(mpEncodedData, (int)encodedSize, + 0 /* not interested in bytes read if this fails */, mTimeout)) { // Couldn't read header THROW_EXCEPTION(BackupStoreException, WhenDecodingExpectedToReadButCouldnt) } // Decode the data - mCurrentBlockClearSize = BackupStoreFile::DecodeChunk(mpEncodedData, encodedSize, mpClearData, mClearDataSize); + mCurrentBlockClearSize = BackupStoreFile::DecodeChunk(mpEncodedData, + (int)encodedSize, mpClearData, mClearDataSize); // Calculate IV for this entry uint64_t iv = mEntryIVBase; @@ -931,7 +938,7 @@ } // Check alignment of the block - ASSERT((((uint32_t)(long)rOutput.mpBuffer) % BACKUPSTOREFILE_CODING_BLOCKSIZE) == BACKUPSTOREFILE_CODING_OFFSET); + ASSERT((((long long)rOutput.mpBuffer) % BACKUPSTOREFILE_CODING_BLOCKSIZE) == BACKUPSTOREFILE_CODING_OFFSET); // Want to compress it? bool compressChunk = (ChunkSize >= BACKUP_FILE_MIN_COMPRESSED_CHUNK_SIZE); @@ -1019,7 +1026,7 @@ int BackupStoreFile::DecodeChunk(const void *Encoded, int EncodedSize, void *Output, int OutputSize) { // Check alignment of the encoded block - ASSERT((((uint32_t)(long)Encoded) % BACKUPSTOREFILE_CODING_BLOCKSIZE) == BACKUPSTOREFILE_CODING_OFFSET); + ASSERT((((long long)Encoded) % BACKUPSTOREFILE_CODING_BLOCKSIZE) == BACKUPSTOREFILE_CODING_OFFSET); // First check if(EncodedSize < 1) Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFile.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFile.h 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFile.h 2005-12-21 03:11:48 UTC (rev 261) @@ -125,7 +125,7 @@ // Align to main block size ASSERT(sizeof(unsigned long) >= sizeof(void*)); // make sure casting the right pointer size uint8_t adjustment = BACKUPSTOREFILE_CODING_BLOCKSIZE - - (uint8_t)(((unsigned long)a) % BACKUPSTOREFILE_CODING_BLOCKSIZE); + - (uint8_t)(((unsigned long long)a) % BACKUPSTOREFILE_CODING_BLOCKSIZE); uint8_t *b = (a + adjustment); // Store adjustment *b = adjustment; @@ -136,7 +136,7 @@ { // Check alignment is as expected ASSERT(sizeof(unsigned long) >= sizeof(void*)); // make sure casting the right pointer size - ASSERT((uint8_t)(((unsigned long)Block) % BACKUPSTOREFILE_CODING_BLOCKSIZE) == BACKUPSTOREFILE_CODING_OFFSET); + ASSERT((uint8_t)(((unsigned long long)Block) % BACKUPSTOREFILE_CODING_BLOCKSIZE) == BACKUPSTOREFILE_CODING_OFFSET); uint8_t *a = (uint8_t*)Block; a -= BACKUPSTOREFILE_CODING_OFFSET; // Adjust downwards... Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileCmbDiff.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileCmbDiff.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileCmbDiff.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -79,7 +79,7 @@ } int64_t diff1NumBlocks = box_ntoh64(diff1IdxHdr.mNumBlocks); // Allocate some memory - int64_t *diff1BlockStartPositions = (int64_t*)::malloc((diff1NumBlocks + 1) * sizeof(int64_t)); + int64_t *diff1BlockStartPositions = (int64_t*)::malloc(((size_t)diff1NumBlocks + 1) * sizeof(int64_t)); if(diff1BlockStartPositions == 0) { throw std::bad_alloc(); @@ -201,14 +201,14 @@ // Block is in the old diff file, copy it across copyBlock = true; copyFrom = diff1BlockStartPositions[blockIndex]; - int nb = blockIndex + 1; + int nb = (int)blockIndex + 1; while(diff1BlockStartPositions[nb] <= 0) { // This is safe, because the last entry will terminate it properly! ++nb; ASSERT(nb <= diff1NumBlocks); } - copySize = diff1BlockStartPositions[nb] - copyFrom; + copySize = (int)(diff1BlockStartPositions[nb] - copyFrom); fromFileDiff1 = true; } } @@ -284,7 +284,7 @@ if(diff1BlockStartPositions[blockIndex] > 0) { // Block is in the first diff file, stick in size - int nb = blockIndex + 1; + int nb = (int)blockIndex + 1; while(diff1BlockStartPositions[nb] <= 0) { // This is safe, because the last entry will terminate it properly! Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileCmbIdx.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileCmbIdx.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileCmbIdx.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -174,7 +174,7 @@ // Then... allocate memory for the list of sizes mNumEntriesInFromFile = box_ntoh64(fromHdr.mNumBlocks); - mFromBlockSizes = (int64_t*)::malloc(mNumEntriesInFromFile * sizeof(int64_t)); + mFromBlockSizes = (int64_t*)::malloc((size_t)mNumEntriesInFromFile * sizeof(int64_t)); if(mFromBlockSizes == 0) { throw std::bad_alloc(); @@ -241,7 +241,7 @@ int entriesToWrite = NBytes / sizeof(file_BlockIndexEntry); if(entriesToWrite > mNumEntriesToGo) { - entriesToWrite = mNumEntriesToGo; + entriesToWrite = (int)mNumEntriesToGo; } // Setup ready to go @@ -256,7 +256,7 @@ } // Does this need adjusting? - int s = box_ntoh64(poutput[b].mEncodedSize); + int s = (int)box_ntoh64(poutput[b].mEncodedSize); if(s <= 0) { // A reference to a block in the from file Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileCombine.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileCombine.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileCombine.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -96,7 +96,7 @@ // Allocate memory for the block index of the From file int64_t fromNumBlocks = box_ntoh64(fromHdr.mNumBlocks); // NOTE: An extra entry is required so that the length of the last block can be calculated - FromIndexEntry *pFromIndex = (FromIndexEntry*)::malloc((fromNumBlocks+1) * sizeof(FromIndexEntry)); + FromIndexEntry *pFromIndex = (FromIndexEntry*)::malloc(((int)fromNumBlocks+1) * sizeof(FromIndexEntry)); if(pFromIndex == 0) { throw std::bad_alloc(); @@ -252,7 +252,7 @@ if(encodedSize > 0) { // The block is actually in the diff file - blockSize = encodedSize; + blockSize = (int32_t)encodedSize; } else { @@ -264,7 +264,9 @@ THROW_EXCEPTION(BackupStoreException, BadBackupStoreFile) } // Calculate size. This operation is safe because of the extra entry at the end - blockSize = pFromIndex[blockIdx + 1].mFilePosition - pFromIndex[blockIdx].mFilePosition; + blockSize = (int32_t)( + pFromIndex[blockIdx + 1].mFilePosition - + pFromIndex[blockIdx].mFilePosition ); } ASSERT(blockSize > 0); @@ -394,7 +396,9 @@ THROW_EXCEPTION(BackupStoreException, BadBackupStoreFile) } // Calculate size. This operation is safe because of the extra entry at the end - int32_t blockSize = pFromIndex[blockIdx + 1].mFilePosition - pFromIndex[blockIdx].mFilePosition; + int32_t blockSize = (int32_t)( + pFromIndex[blockIdx + 1].mFilePosition - + pFromIndex[blockIdx].mFilePosition ); // Then replace entry en.mEncodedSize = box_hton64(((uint64_t)blockSize)); } Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileDiff.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileDiff.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileDiff.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -317,7 +317,7 @@ //TODO: Verify that these sizes look reasonable // Allocate space for the index - BlocksAvailableEntry *pindex = (BlocksAvailableEntry*)::malloc(sizeof(BlocksAvailableEntry) * numBlocks); + BlocksAvailableEntry *pindex = (BlocksAvailableEntry*)::malloc(sizeof(BlocksAvailableEntry) * (size_t)numBlocks); if(pindex == 0) { throw std::bad_alloc(); Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileEncodeStream.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileEncodeStream.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileEncodeStream.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -270,7 +270,7 @@ } while(rBlockSizeOut <= BACKUP_FILE_MAX_BLOCK_SIZE && rNumBlocksOut > BACKUP_FILE_INCREASE_BLOCK_SIZE_AFTER); // Last block size - rLastBlockSizeOut = DataSize - ((rNumBlocksOut - 1) * rBlockSizeOut); + rLastBlockSizeOut = (int32_t)(DataSize - ((rNumBlocksOut - 1) * rBlockSizeOut)); // Avoid small blocks? if(rLastBlockSizeOut < BACKUP_FILE_AVOID_BLOCKS_LESS_THAN @@ -451,7 +451,7 @@ } // Index of the first block in old file (being diffed from) - int firstIndex = mpRecipe->BlockPtrToIndex((*mpRecipe)[mInstructionNumber].mpStartBlock); + int firstIndex = (int)mpRecipe->BlockPtrToIndex((*mpRecipe)[mInstructionNumber].mpStartBlock); int64_t sizeToSkip = 0; Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileRevDiff.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileRevDiff.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileRevDiff.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -60,7 +60,7 @@ // For each block in the from file, we want to know it's index in the // diff file. Allocate memory for this information. int64_t fromNumBlocks = box_ntoh64(hdr.mNumBlocks); - int64_t *pfromIndexInfo = (int64_t*)::malloc(fromNumBlocks * sizeof(int64_t)); + int64_t *pfromIndexInfo = (int64_t*)::malloc((size_t)fromNumBlocks * sizeof(int64_t)); if(pfromIndexInfo == 0) { throw std::bad_alloc(); @@ -176,21 +176,21 @@ bufferSize = 0; } // Allocate new block - buffer = ::malloc(blockSize); + buffer = ::malloc((size_t)blockSize); if(buffer == 0) { throw std::bad_alloc(); } - bufferSize = blockSize; + bufferSize = (int)blockSize; } ASSERT(bufferSize >= blockSize); // Copy the block - if(!rFrom.ReadFullBuffer(buffer, blockSize, 0)) + if(!rFrom.ReadFullBuffer(buffer, (int)blockSize, 0)) { THROW_EXCEPTION(BackupStoreException, FailedToReadBlockOnCombine) } - rOut.Write(buffer, blockSize); + rOut.Write(buffer, (int)blockSize); // Store the size pfromIndexInfo[b] = blockSize; Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFilename.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFilename.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFilename.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -141,7 +141,7 @@ { CheckValid(); - rProtocol.Write(c_str(), size()); + rProtocol.Write(c_str(), (int)size()); } // -------------------------------------------------------------------------- @@ -216,7 +216,7 @@ { CheckValid(); - rStream.Write(c_str(), size()); + rStream.Write(c_str(), (int)size()); } // -------------------------------------------------------------------------- Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFilenameClear.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFilenameClear.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFilenameClear.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -218,7 +218,7 @@ void BackupStoreFilenameClear::EncryptClear(const std::string &rToEncode, CipherContext &rCipherContext, int StoreAsEncoding) { // Work out max size - int maxOutSize = rCipherContext.MaxOutSizeForInBufferSize(rToEncode.size()) + 4; + int maxOutSize = rCipherContext.MaxOutSizeForInBufferSize((int)rToEncode.size()) + 4; // Make sure encode/decode buffer has enough space if(sEncDecBufferSize < maxOutSize) @@ -233,7 +233,7 @@ MEMLEAKFINDER_NOT_A_LEAK(buffer); // Encode -- do entire block in one go - int encSize = rCipherContext.TransformBlock(buffer + 2, sEncDecBufferSize - 2, rToEncode.c_str(), rToEncode.size()); + int encSize = rCipherContext.TransformBlock(buffer + 2, sEncDecBufferSize - 2, rToEncode.c_str(), (int)rToEncode.size()); // and add in header size encSize += 2; @@ -256,7 +256,7 @@ void BackupStoreFilenameClear::DecryptEncoded(CipherContext &rCipherContext) const { // Work out max size - int maxOutSize = rCipherContext.MaxOutSizeForInBufferSize(size()) + 4; + int maxOutSize = rCipherContext.MaxOutSizeForInBufferSize((int)size()) + 4; // Make sure encode/decode buffer has enough space if(sEncDecBufferSize < maxOutSize) @@ -272,7 +272,7 @@ // Decrypt const char *str = c_str() + 2; - int sizeOut = rCipherContext.TransformBlock(buffer, sEncDecBufferSize, str, size() - 2); + int sizeOut = rCipherContext.TransformBlock(buffer, sEncDecBufferSize, str, (int)size() - 2); // Assign to this mClearFilename.assign((char*)buffer, sizeOut); Modified: box/chris/win32/vc2005-compile-fixes/lib/common/BoxTimeToUnix.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/BoxTimeToUnix.h 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/common/BoxTimeToUnix.h 2005-12-21 03:11:48 UTC (rev 261) @@ -26,7 +26,7 @@ inline void BoxTimeToTimespec(box_time_t Time, struct timespec &tv) { - tv.tv_sec = (time_t)(Time / MICRO_SEC_IN_SEC_LL); + tv.tv_sec = (long)(Time / MICRO_SEC_IN_SEC_LL); tv.tv_nsec = ((long)(Time % MICRO_SEC_IN_SEC_LL)) * NANO_SEC_IN_USEC; } Modified: box/chris/win32/vc2005-compile-fixes/lib/common/DebugMemLeakFinder.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/DebugMemLeakFinder.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/common/DebugMemLeakFinder.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -274,7 +274,11 @@ { if(memleakfinder_numleaks() > 0) { +#ifdef HAVE_GETPID fprintf(file, "MEMORY LEAKS FROM PROCESS %d (%s)\n", getpid(), markertext); +#else + fprintf(file, "MEMORY LEAKS (%s)\n", markertext); +#endif memleakfinder_reportleaks_file(file); } Modified: box/chris/win32/vc2005-compile-fixes/lib/server/Daemon.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/server/Daemon.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/server/Daemon.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -9,8 +9,11 @@ #include "Box.h" +#ifdef HAVE_UNISTD_H + #include +#endif + #include -#include #include #include #include Modified: box/chris/win32/vc2005-compile-fixes/lib/server/LocalProcessStream.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/server/LocalProcessStream.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/server/LocalProcessStream.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -9,11 +9,14 @@ #include "Box.h" -#ifndef WIN32 -#include +#ifdef HAVE_SYS_SOCKET_H + #include #endif -#include +#ifdef HAVE_UNISTD_H + #include +#endif + #include "LocalProcessStream.h" #include "SocketStream.h" #include "autogen_ServerException.h" Modified: box/chris/win32/vc2005-compile-fixes/lib/server/Protocol.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/server/Protocol.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/server/Protocol.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -638,7 +638,7 @@ Write((int32_t)(rValue.size())); WRITE_ENSURE_BYTES_AVAILABLE(rValue.size()) - Write(rValue.c_str(), rValue.size()); + Write(rValue.c_str(), (int)rValue.size()); } // -------------------------------------------------------------------------- @@ -706,11 +706,11 @@ } // Inform sub class - InformStreamSending(streamSize); + InformStreamSending((u_int32_t)streamSize); // Make header PW_ObjectHeader objHeader; - objHeader.mObjSize = htonl(uncertainSize?(ProtocolStream_SizeUncertain):streamSize); + objHeader.mObjSize = htonl((u_long)(uncertainSize?(ProtocolStream_SizeUncertain):streamSize)); objHeader.mObjType = htonl(SPECIAL_STREAM_OBJECT_TYPE); // Write header Modified: box/chris/win32/vc2005-compile-fixes/lib/server/Socket.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/server/Socket.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/server/Socket.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -9,7 +9,10 @@ #include "Box.h" -#include +#ifdef HAVE_UNISTD_H + #include +#endif + #include #ifndef WIN32 #include Modified: box/chris/win32/vc2005-compile-fixes/lib/server/SocketListen.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/server/SocketListen.h 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/server/SocketListen.h 2005-12-21 03:11:48 UTC (rev 261) @@ -11,8 +11,11 @@ #define SOCKETLISTEN__H #include -#include +#ifdef HAVE_UNISTD_H + #include +#endif + #ifdef HAVE_KQUEUE #include #include Modified: box/chris/win32/vc2005-compile-fixes/lib/server/SocketStream.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/server/SocketStream.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/server/SocketStream.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -9,7 +9,10 @@ #include "Box.h" -#include +#ifdef HAVE_UNISTD_H + #include +#endif + #include #include @@ -67,7 +70,7 @@ // // -------------------------------------------------------------------------- SocketStream::SocketStream(const SocketStream &rToCopy) - : mSocketHandle(::dup(rToCopy.mSocketHandle)), + : mSocketHandle(::dup((int)rToCopy.mSocketHandle)), mReadClosed(rToCopy.mReadClosed), mWriteClosed(rToCopy.mWriteClosed) Modified: box/chris/win32/vc2005-compile-fixes/lib/server/SocketStreamTLS.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/server/SocketStreamTLS.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/server/SocketStreamTLS.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -125,7 +125,7 @@ } tOSSocketHandle socket = GetSocketHandle(); - BIO_set_fd(mpBIO, socket, BIO_NOCLOSE); + BIO_set_fd(mpBIO, (int)socket, BIO_NOCLOSE); // Then the SSL object mpSSL = ::SSL_new(rContext.GetRawContext()); Modified: box/chris/win32/vc2005-compile-fixes/lib/win32/WinNamedPipeStream.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/win32/WinNamedPipeStream.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/win32/WinNamedPipeStream.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -11,7 +11,10 @@ #ifdef WIN32 -#include +#ifdef HAVE_UNISTD_H + #include +#endif + #include #include #include Modified: box/chris/win32/vc2005-compile-fixes/lib/win32/config.h.win32 =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/win32/config.h.win32 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/win32/config.h.win32 2005-12-21 03:11:48 UTC (rev 261) @@ -55,7 +55,7 @@ /* Define to 1 if you have the header file, and it defines `DIR'. */ -#define HAVE_DIRENT_H 1 +// #define HAVE_DIRENT_H 1 /* define if the compiler supports exceptions */ #define HAVE_EXCEPTIONS @@ -120,6 +120,8 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_NETINET_IN_H */ +#define HAVE_PROCESS_H 1 + /* Define to 1 if SSL is pre-0.9.7 */ /* #undef HAVE_OLD_SSL */ Modified: box/chris/win32/vc2005-compile-fixes/lib/win32/emu.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/win32/emu.cpp 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/win32/emu.cpp 2005-12-21 03:11:48 UTC (rev 261) @@ -12,11 +12,18 @@ #include #include // #include -#include +#ifdef HAVE_UNISTD_H + #include +#endif + #include #include +#ifdef HAVE_PROCESS_H + #include +#endif + //our implimentation for a timer //based on a simple thread which sleeps for a //period of time @@ -343,7 +350,7 @@ // This next example is how we get our INODE (equivalent) information conv.HighPart = fi.nFileIndexHigh; conv.LowPart = fi.nFileIndexLow; - st->st_ino = conv.QuadPart; + st->st_ino = (_ino_t)conv.QuadPart; // get the time information st->st_ctime = ConvertFileTimeToTime_t(&fi.ftCreationTime); @@ -362,7 +369,7 @@ conv.HighPart = st_size.HighPart; conv.LowPart = st_size.LowPart; - st->st_size = conv.QuadPart; + st->st_size = (_off_t)conv.QuadPart; //the mode of the file st->st_mode = 0; @@ -878,7 +885,7 @@ void syslog(int loglevel, const char *frmt, ...) { - DWORD errinfo; + WORD errinfo; char* buffer; std::string sixfour(frmt); @@ -905,7 +912,7 @@ int sixfourpos; - while ( ( sixfourpos = sixfour.find("%ll")) != -1 ) + while ( (sixfourpos = (int)sixfour.find("%ll")) != -1 ) { //maintain portability - change the 64 bit formater... std::string temp = sixfour.substr(0,sixfourpos); Modified: box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h 2005-12-21 00:43:31 UTC (rev 260) +++ box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h 2005-12-21 03:11:48 UTC (rev 261) @@ -39,6 +39,11 @@ #define read(fd,buf,count) _read(fd,buf,count) #define write(fd,buf,count) _write(fd,buf,count) #define lseek(fd,off,whence) _lseek(fd,off,whence) +#define unlink(file) _unlink(file) +#define chmod(file,mode) _chmod(file,mode) +#define getcwd(buf,length) _getcwd(buf,length) +#define fileno(struct_file) _fileno(struct_file) +#define chdir(dir) _chdir(dir) int setitimer(int type , struct itimerval *timeout, int); void InitTimer(void); @@ -116,7 +121,7 @@ return 0; } -inline int chmod(const char * Filename, int uid) +inline int _chmod(const char * Filename, int uid) { //indicate sucsess return 0; @@ -252,9 +257,9 @@ #define S_ISLNK(x) ( false ) // nasty implementation to get working - TODO get the win32 equiv -#ifdef _DEBUG -#define getpid() 1 -#endif +//#ifdef _DEBUG +//#define getpid() 1 +//#endif #define vsnprintf _vsnprintf From boxbackup-dev at fluffy.co.uk Wed Dec 21 08:56:18 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Wed, 21 Dec 2005 08:56:18 +0000 Subject: [Box Backup-dev] COMMIT r255 - in box/chris/win32/vc2005-compile-fixes/lib: common compress server win32 In-Reply-To: References: <20051220225951.EDCE794@s0g0.pems.testserver.co.uk> <1135123701.7993.22.camel@avenin.ebourne.me.uk> Message-ID: <1135155378.5569.3.camel@avenin.ebourne.me.uk> On Wed, 2005-12-21 at 01:41 +0000, Chris Wilson wrote: > Hi Martin, > > > Please don't use a platform check for header files. Please add a > > configure test (AC_CHECK_HEADERS) and use its define. > > How would I check the type of struct timeval.tv_sec using autoconf? Firstly use a run block to run some test code. There's already an example in configure.ac: From boxbackup-dev at fluffy.co.uk Wed Dec 21 00:17:28 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Wed, 21 Dec 2005 00:17:28 +0000 Subject: [Box Backup-dev] COMMIT r255 - in box/chris/win32/vc2005-compile-fixes/lib: common compress server win32 In-Reply-To: References: <20051220225951.EDCE794@s0g0.pems.testserver.co.uk> <1135123701.7993.22.camel@avenin.ebourne.me.uk> Message-ID: <1135124249.7993.26.camel@avenin.ebourne.me.uk> On Wed, 2005-12-21 at 00:10 +0000, Chris Wilson wrote: > Hi Martin, > > >> -#include > >> +#ifndef WIN32 > >> +#include > >> +#endif > > > > Please don't use a platform check for header files. Please add a > > configure test (AC_CHECK_HEADERS) and use its define. > > Even though configure doesn't run on win32? configure should run under cygwin, which I thought was the idea. Have you not tried that yet? Cheers, Martin. From boxbackup-dev at fluffy.co.uk Wed Dec 21 09:07:09 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Wed, 21 Dec 2005 09:07:09 +0000 Subject: [Box Backup-dev] COMMIT r255 - in box/chris/win32/vc2005-compile-fixes/lib: common compress server win32 In-Reply-To: References: <20051220225951.EDCE794@s0g0.pems.testserver.co.uk> <1135123701.7993.22.camel@avenin.ebourne.me.uk> Message-ID: <1135156029.5569.14.camel@avenin.ebourne.me.uk> Stupid email program sent the email when I accidentally held ctrl and pressed enter! On Wed, 2005-12-21 at 01:41 +0000, Chris Wilson wrote: > Hi Martin, > > > Please don't use a platform check for header files. Please add a > > configure test (AC_CHECK_HEADERS) and use its define. > > How would I check the type of struct timeval.tv_sec using autoconf? Firstly use a run block to run some test code. There's already an example in configure.ac: AC_CACHE_CHECK([if we have large file support enabled], [have_large_file_support], [AC_RUN_IFELSE([AC_LANG_PROGRAM([[$ac_includes_default]], [[ return sizeof(off_t)==4; ]])], [have_large_file_support=yes], [have_large_file_support=no] )]) if test "x$have_large_file_support" = "xyes"; then AC_DEFINE([HAVE_LARGE_FILE_SUPPORT], 1, [Define to 1 large file support is in use]) fi Now the fun comes in trying to detect at run time what the type is. I can think of several possibilities: 1. Use sizeof. Of course, this only works if the sizes are known and vary. 2. Cast the member using say a const_cast. Thus if the type does not match the program will fail to compile. In this case you could use the compile variant of RUN_IFELSE. 3. Use overloading. Write 2 or more functions 'foo' that take a parameter of different types and return an int with different values. Then call it and the compiler will tell you which type you have. May not work because you may not know all the types. 4. Use template partial specialisation. Write a template function 'foo' that is just like the foo in (3) but is type generic. Get it to return 0 say. Then write a specialisation for it with the type you want to match, and make that return 1. Much like (3) but should always work - this is the most generic method. One of those should sort you out. Unfortunately of the obvious two candidates, typeof is a g++ extension and C++ rtti only works on polymorphic classes. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Wed Dec 21 10:14:52 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Wed, 21 Dec 2005 10:14:52 +0000 Subject: [Box Backup-dev] COMMIT r258 - in box/chris/win32/vc2005-compile-fixes: . lib/common lib/compress lib/win32 In-Reply-To: <20051221002549.60AA094@s0g0.pems.testserver.co.uk> References: <20051221002549.60AA094@s0g0.pems.testserver.co.uk> Message-ID: On 21 Dec 2005, at 00:25, subversion at fluffy.co.uk wrote: > Author: chris > Date: 2005-12-21 00:25:17 +0000 (Wed, 21 Dec 2005) > New Revision: 258 > > Added: > box/chris/win32/vc2005-compile-fixes/lib/win32/config.h.win32 > Modified: > box/chris/win32/vc2005-compile-fixes/configure.ac > box/chris/win32/vc2005-compile-fixes/lib/common/BoxPlatform.h > [snip] > box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h > Log: > Try again, less invasively and with Autoconfiscated Goodness(TM) I think we need to be very careful about wholesale changes to types. Is there a better way? Or were the types wrong in the first place? Ben From boxbackup-dev at fluffy.co.uk Wed Dec 21 10:16:30 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Wed, 21 Dec 2005 10:16:30 +0000 Subject: [Box Backup-dev] COMMIT r255 - in box/chris/win32/vc2005-compile-fixes/lib: common compress server win32 In-Reply-To: References: <20051220225951.EDCE794@s0g0.pems.testserver.co.uk> <9CC918D2-909C-412F-9F9A-B46E21A8323C@fluffy.co.uk> Message-ID: <7CB38991-A73D-4B14-9C37-CE920F1A6524@fluffy.co.uk> On 21 Dec 2005, at 00:08, Chris Wilson wrote: > >> I deliberately used int for sizes in IOStream functions, as I >> thought these frequently used functions should use arithmetic on >> the most natural integer size for the platform. > > I don't understand why you used a signed rather than an unsigned > type for things which don't seem to make any sense as negatives, > like buffer sizes. To be consistent with the seek arguments, and to mess with the mind of anyone else working on the code. > But I could use IOStream::pos_type instead if you prefer, or even > make everything use signed integers if you insist. I'm not sure quite what's best here. What's the underlying reason for this change? Why does VC need it? Why didn't Nick have this problem? Ben From boxbackup-dev at fluffy.co.uk Wed Dec 21 15:45:14 2005 From: boxbackup-dev at fluffy.co.uk (Jonathan Morton) Date: Wed, 21 Dec 2005 15:45:14 +0000 Subject: [Box Backup-dev] COMMIT r257 - in box/trunk: . lib/common In-Reply-To: <20051221002312.4449694@s0g0.pems.testserver.co.uk> References: <20051221002312.4449694@s0g0.pems.testserver.co.uk> Message-ID: <9B5B383C-77A3-40D2-B7D1-DAD8AD2DEAA5@chromatix.uklinux.net> This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-7-106407966 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > Allow use of native 64 bit endian swapping functions This hasn't fixed raidfile for me on PPC32 (haven't retested on PPC64 yet). Basicserver also seems to fail, apparently through the server not starting. Everything else now passes, even though BDB still isn't detected properly. -------------------------------------------------------------- from: Jonathan "Chromatix" Morton mail: chromi at chromatix.org.uk website: http://www.chromatix.uklinux.net/ tagline: The key to knowledge is not to rely on people to teach you it. --Apple-Mail-7-106407966 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iEYEARECAAYFAkOpeIoACgkQ6xAxI1ofIwoSdQCguhnrsITNRwkq2v1wF6BVOBja ZfoAn1T23fZlSESiXYirgtb7biOgPZiM =8Ucw -----END PGP SIGNATURE----- --Apple-Mail-7-106407966-- From boxbackup-dev at fluffy.co.uk Wed Dec 21 19:09:44 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Wed, 21 Dec 2005 19:09:44 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r258 - in box/chris/win32/vc2005-compile-fixes: . lib/common lib/compress lib/win32 In-Reply-To: References: <20051221002549.60AA094@s0g0.pems.testserver.co.uk> Message-ID: Hi Ben, > I think we need to be very careful about wholesale changes to types. Is > there a better way? Or were the types wrong in the first place? I was getting a lot of warnings about mismatched types from Visual C++. All the ones that I could change the destination type of an assignment to match the source without changing the API, I did, otherwise I casted it. I'd quite like to be able to see the real warnings on win32. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Wed Dec 21 19:10:33 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Wed, 21 Dec 2005 19:10:33 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r255 - in box/chris/win32/vc2005-compile-fixes/lib: common compress server win32 In-Reply-To: <7CB38991-A73D-4B14-9C37-CE920F1A6524@fluffy.co.uk> References: <20051220225951.EDCE794@s0g0.pems.testserver.co.uk> <9CC918D2-909C-412F-9F9A-B46E21A8323C@fluffy.co.uk> <7CB38991-A73D-4B14-9C37-CE920F1A6524@fluffy.co.uk> Message-ID: Hi Ben, > I'm not sure quite what's best here. What's the underlying reason for this > change? Why does VC need it? Why didn't Nick have this problem? I think Nick was happy to ignore compiler warnings, and he was using an older version of Visual C++. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Thu Dec 22 00:35:06 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 22 Dec 2005 00:35:06 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r262 - box/chris/win32/vc2005-compile-fixes/lib/win32 Message-ID: <20051222003506.1ED6194@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-22 00:35:02 +0000 (Thu, 22 Dec 2005) New Revision: 262 Modified: box/chris/win32/vc2005-compile-fixes/lib/win32/emu.cpp Log: * lib/win32/emu.cpp - Better logging when we fail to open a file - Fixed ReportEvent crashes due to pointer types and va_start/end stack corruption Modified: box/chris/win32/vc2005-compile-fixes/lib/win32/emu.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/win32/emu.cpp 2005-12-21 03:11:48 UTC (rev 261) +++ box/chris/win32/vc2005-compile-fixes/lib/win32/emu.cpp 2005-12-22 00:35:02 UTC (rev 262) @@ -206,8 +206,8 @@ // -------------------------------------------------------------------------- HANDLE openfile(const char *filename, int flags, int mode) { - try{ - + try + { wchar_t *buffer; std::string fileN(filename); @@ -241,6 +241,9 @@ buffer = new wchar_t[strlen+1]; if ( buffer == NULL ) { + ::syslog(LOG_WARNING, "Failed to allocate buffer " + "for converting file name: %s", + tmpStr.c_str()); return NULL; } @@ -255,6 +258,9 @@ if ( strlen == 0 ) { + ::syslog(LOG_WARNING, "Failed to convert filename " + "to unicode: %s (error %i)", + tmpStr.c_str(), GetLastError()); delete [] buffer; return NULL; } @@ -266,21 +272,30 @@ DWORD shareMode = FILE_SHARE_READ; DWORD accessRights = FILE_READ_ATTRIBUTES | FILE_LIST_DIRECTORY | FILE_READ_EA; - if ( flags & O_WRONLY ) + if (flags & O_WRONLY) { - createDisposition = OPEN_EXISTING; - shareMode |= FILE_SHARE_READ ;//| FILE_SHARE_WRITE; + shareMode = FILE_SHARE_WRITE; } - if ( flags & O_CREAT ) + if (flags & O_RDWR) { - createDisposition = OPEN_ALWAYS; - shareMode |= FILE_SHARE_READ ;//| FILE_SHARE_WRITE; - accessRights |= FILE_WRITE_ATTRIBUTES | FILE_WRITE_DATA | FILE_WRITE_EA | FILE_ALL_ACCESS; + shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE; } - if ( flags & O_TRUNC ) + if (flags & O_CREAT) { createDisposition = OPEN_ALWAYS; + shareMode |= FILE_SHARE_WRITE; + accessRights |= FILE_WRITE_ATTRIBUTES + | FILE_WRITE_DATA | FILE_WRITE_EA + | FILE_ALL_ACCESS; } + if (flags & O_TRUNC) + { + createDisposition = CREATE_ALWAYS; + } + if (flags & O_EXCL) + { + shareMode = 0; + } HANDLE hdir = CreateFileW(buffer, accessRights, @@ -292,8 +307,9 @@ if ( hdir == INVALID_HANDLE_VALUE ) { - // DWORD err = GetLastError(); - // syslog(EVENTLOG_WARNING_TYPE, "Couldn't open file %s, err %i\n", filename, err); + DWORD err = GetLastError(); + ::syslog(LOG_WARNING, "Failed to open file %s: " + "error %i", filename, err); delete [] buffer; return NULL; } @@ -304,7 +320,7 @@ } catch(...) { - printf("Caught openfile:%s\r\n", filename); + ::syslog(LOG_ERR, "Caught openfile: %s", filename); } return NULL; @@ -886,7 +902,7 @@ void syslog(int loglevel, const char *frmt, ...) { WORD errinfo; - char* buffer; + char buffer[1024]; std::string sixfour(frmt); switch (loglevel) @@ -907,79 +923,46 @@ //taken from MSDN - try + int sixfourpos; + while ( (sixfourpos = (int)sixfour.find("%ll")) != -1 ) { + //maintain portability - change the 64 bit formater... + std::string temp = sixfour.substr(0,sixfourpos); + temp += "%I64"; + temp += sixfour.substr(sixfourpos+3, sixfour.length()); + sixfour = temp; + } + //printf("parsed string is:%s\r\n", sixfour.c_str()); - int sixfourpos; - while ( (sixfourpos = (int)sixfour.find("%ll")) != -1 ) - { - //maintain portability - change the 64 bit formater... - std::string temp = sixfour.substr(0,sixfourpos); - temp += "%I64"; - temp += sixfour.substr(sixfourpos+3, sixfour.length()); - sixfour = temp; - } + va_list args; + va_start(args, frmt); - //printf("parsed string is:%s\r\n", sixfour.c_str()); + int len = vsnprintf(buffer, sizeof(buffer)-1, sixfour.c_str(), args); + buffer[sizeof(buffer)-1] = 0; - va_list args; - va_start(args, frmt); + va_end(args); -#ifdef __MINGW32__ - // no _vscprintf, use a fixed size buffer - buffer = new char[1024]; - int len = 1023; -#else - int len = _vscprintf( sixfour.c_str(), args ); - ASSERT(len > 0) + LPCSTR strings[] = { buffer, NULL }; - len = len + 1; - char* buffer = new char[len]; -#endif + if (!ReportEvent(gSyslogH, // event log handle + errinfo, // event type + 0, // category zero + MSG_ERR_EXIST, // event identifier - + // we will call them all the same + NULL, // no user security identifier + 1, // one substitution string + 0, // no data + strings, // pointer to string array + NULL)) // pointer to data - ASSERT(buffer) - memset(buffer, 0, len); - - int len2 = vsnprintf(buffer, len, sixfour.c_str(), args); - ASSERT(len2 <= len); - - va_end(args); - } - catch (...) { - printf("Caught syslog: %s", sixfour.c_str()); - return; + DWORD err = GetLastError(); + printf("Unable to send message to Event Log " + "(error %i):\r\n", err); } - try - { - - if (!ReportEvent(gSyslogH, // event log handle - errinfo, // event type - 0, // category zero - MSG_ERR_EXIST, // event identifier - - // we will call them all the same - NULL, // no user security identifier - 1, // one substitution string - 0, // no data - (LPCSTR*)&buffer, // pointer to string array - NULL)) // pointer to data - - { - DWORD err = GetLastError(); - printf("Unable to send message to Event Log " - "(error %i):\r\n", err); - } - - printf("%s\r\n", buffer); - - if (buffer) delete [] buffer; - } - catch (...) - { - printf("Caught syslog ReportEvent"); - } + printf("%s\r\n", buffer); } #endif // WIN32 From boxbackup-dev at fluffy.co.uk Thu Dec 22 00:35:52 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 22 Dec 2005 00:35:52 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r263 - box/chris/win32/vc2005-compile-fixes/lib/win32 Message-ID: <20051222003552.ED9E594@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-22 00:35:50 +0000 (Thu, 22 Dec 2005) New Revision: 263 Modified: box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h Log: * lib/win32/emu.h - Only redefine POSIX functions to underscored versions on MSVC (still need to check which versions of MSVC - TODO) Modified: box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h 2005-12-22 00:35:02 UTC (rev 262) +++ box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h 2005-12-22 00:35:50 UTC (rev 263) @@ -32,6 +32,7 @@ #define SIGALRM SIGVTALRM #define ITIMER_VIRTUAL 0 +#ifdef _MSC_VER // Microsoft decided to deprecate the standard POSIX functions. Great! #define open(file,flags,mode) _open(file,flags,mode) #define close(fd) _close(fd) @@ -44,6 +45,7 @@ #define getcwd(buf,length) _getcwd(buf,length) #define fileno(struct_file) _fileno(struct_file) #define chdir(dir) _chdir(dir) +#endif int setitimer(int type , struct itimerval *timeout, int); void InitTimer(void); From boxbackup-dev at fluffy.co.uk Thu Dec 22 00:38:49 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 22 Dec 2005 00:38:49 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r264 - box/chris/win32/vc2005-compile-fixes/bin/bbackupd Message-ID: <20051222003849.5DCA894@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-22 00:38:45 +0000 (Thu, 22 Dec 2005) New Revision: 264 Modified: box/chris/win32/vc2005-compile-fixes/bin/bbackupd/BackupDaemon.cpp Log: * bin/bbackupd/BackupDaemon.cpp - Ignore exceptions thrown while closing command socket after receiving an exception, to avoid masking that exception Modified: box/chris/win32/vc2005-compile-fixes/bin/bbackupd/BackupDaemon.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/bin/bbackupd/BackupDaemon.cpp 2005-12-22 00:35:50 UTC (rev 263) +++ box/chris/win32/vc2005-compile-fixes/bin/bbackupd/BackupDaemon.cpp 2005-12-22 00:38:45 UTC (rev 264) @@ -400,7 +400,16 @@ { if(mpCommandSocketInfo != 0) { - delete mpCommandSocketInfo; + try + { + delete mpCommandSocketInfo; + } + catch(...) + { + ::syslog(LOG_WARNING, + "Error closing command socket " + "after exception, ignored."); + } mpCommandSocketInfo = 0; } From boxbackup-dev at fluffy.co.uk Thu Dec 22 00:39:45 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 22 Dec 2005 00:39:45 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r265 - box/chris/win32/vc2005-compile-fixes/test/win32 Message-ID: <20051222003945.F2A6B94@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-22 00:39:44 +0000 (Thu, 22 Dec 2005) New Revision: 265 Modified: box/chris/win32/vc2005-compile-fixes/test/win32/testlibwin32.cpp Log: * testlibwin32.cpp - Fixed another POSIX function that now needs underscores Modified: box/chris/win32/vc2005-compile-fixes/test/win32/testlibwin32.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/test/win32/testlibwin32.cpp 2005-12-22 00:38:45 UTC (rev 264) +++ box/chris/win32/vc2005-compile-fixes/test/win32/testlibwin32.cpp 2005-12-22 00:39:44 UTC (rev 265) @@ -12,7 +12,7 @@ int main(int argc, char* argv[]) { - chdir("c:\\tmp"); + _chdir("c:\\tmp"); openfile("test", O_CREAT, 0); struct stat ourfs; //test our opendir, readdir and closedir From boxbackup-dev at fluffy.co.uk Thu Dec 22 02:09:06 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 22 Dec 2005 02:09:06 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r266 - box/chris/win32/vc2005-compile-fixes/lib/win32 Message-ID: <20051222020906.39D0D94@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-22 02:09:03 +0000 (Thu, 22 Dec 2005) New Revision: 266 Modified: box/chris/win32/vc2005-compile-fixes/lib/win32/emu.cpp Log: Fixed incorrect use of list iterator Modified: box/chris/win32/vc2005-compile-fixes/lib/win32/emu.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/win32/emu.cpp 2005-12-22 00:39:44 UTC (rev 265) +++ box/chris/win32/vc2005-compile-fixes/lib/win32/emu.cpp 2005-12-22 02:09:03 UTC (rev 266) @@ -104,8 +104,13 @@ if (rTimer.countDown == -1) { gTimerList.erase(it); - //if we don't do this the search is on a corrupt list + + // the iterator is now invalid, so restart search it = gTimerList.begin(); + + // if the list is now empty, don't try to increment + // the iterator again + if (it == gTimerList.end()) break; } } From boxbackup-dev at fluffy.co.uk Thu Dec 22 02:09:21 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 22 Dec 2005 02:09:21 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r267 - box/chris/win32/vc2005-compile-fixes/lib/win32 Message-ID: <20051222020921.EF14E94@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-22 02:09:21 +0000 (Thu, 22 Dec 2005) New Revision: 267 Modified: box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h Log: Added prototype for SetTimerHandler function Modified: box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h 2005-12-22 02:09:03 UTC (rev 266) +++ box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h 2005-12-22 02:09:21 UTC (rev 267) @@ -47,7 +47,8 @@ #define chdir(dir) _chdir(dir) #endif -int setitimer(int type , struct itimerval *timeout, int); +int SetTimerHandler(void (__cdecl *func ) (int)); +int setitimer(int type, struct itimerval *timeout, int); void InitTimer(void); void FiniTimer(void); From boxbackup-dev at fluffy.co.uk Thu Dec 22 02:09:52 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 22 Dec 2005 02:09:52 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r268 - box/chris/win32/vc2005-compile-fixes/lib/backupclient Message-ID: <20051222020952.A31DB94@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-22 02:09:50 +0000 (Thu, 22 Dec 2005) New Revision: 268 Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileDiff.cpp Log: Use SetTimerHandler rather than signal on win32 Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileDiff.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileDiff.cpp 2005-12-22 02:09:21 UTC (rev 267) +++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileDiff.cpp 2005-12-22 02:09:50 UTC (rev 268) @@ -1031,12 +1031,17 @@ // -------------------------------------------------------------------------- void StartDiffTimer() { +#ifdef WIN32 + // no support for SIGVTALRM + SetTimerHandler(TimerSignalHandler); +#else // Set timer signal handler if(!sSetTimerSignelHandler) { ::signal(SIGVTALRM, TimerSignalHandler); sSetTimerSignelHandler = true; } +#endif struct itimerval timeout; // Don't want this to repeat From boxbackup-dev at fluffy.co.uk Thu Dec 22 02:10:58 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 22 Dec 2005 02:10:58 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r269 - box/chris/win32/vc2005-compile-fixes/lib/backupclient Message-ID: <20051222021058.C2D7294@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-22 02:10:57 +0000 (Thu, 22 Dec 2005) New Revision: 269 Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientFileAttributes.cpp Log: Avoid aborting on win32 when large invalid times are present in the store Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientFileAttributes.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientFileAttributes.cpp 2005-12-22 02:09:50 UTC (rev 268) +++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientFileAttributes.cpp 2005-12-22 02:10:57 UTC (rev 269) @@ -335,7 +335,13 @@ box_time_t bob = BoxTimeToSeconds(pattr->ModificationTime); __time64_t winTime = bob; - if (_gmtime64(&winTime) == 0 ) + + // _MAX__TIME64_T doesn't seem to be defined, but the code below + // will throw an assertion failure if we exceed it :-) + // Microsoft says dates up to the year 3000 are valid, which + // is a bit more than 15 * 2^32. Even that doesn't seem + // to be true (still aborts), but it can at least hold 2^32. + if (winTime >= 0x100000000 || _gmtime64(&winTime) == 0) { ::syslog(LOG_ERR, "Corrupt value in store " "Modification Time in file %s", Filename); @@ -344,7 +350,7 @@ bob = BoxTimeToSeconds(pattr->AttrModificationTime); winTime = bob; - if (_gmtime64(&winTime) == 0 ) + if (winTime > 0x100000000 || _gmtime64(&winTime) == 0) { ::syslog(LOG_ERR, "Corrupt value in store " "Attr Modification Time in file %s", Filename); From boxbackup-dev at fluffy.co.uk Thu Dec 22 02:14:42 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 22 Dec 2005 02:14:42 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r270 - box/chris/win32/vc2005-compile-fixes/bin/bbackupd Message-ID: <20051222021442.76FB994@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-22 02:14:40 +0000 (Thu, 22 Dec 2005) New Revision: 270 Modified: box/chris/win32/vc2005-compile-fixes/bin/bbackupd/bbackupd.cpp Log: Slightly cleaner code Modified: box/chris/win32/vc2005-compile-fixes/bin/bbackupd/bbackupd.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/bin/bbackupd/bbackupd.cpp 2005-12-22 02:10:57 UTC (rev 269) +++ box/chris/win32/vc2005-compile-fixes/bin/bbackupd/bbackupd.cpp 2005-12-22 02:14:40 UTC (rev 270) @@ -48,7 +48,13 @@ InstallService(); return 0; } - + + bool runAsWin32Service = false; + if (argc == 2 && ::strcmp(argv[1], "--service") == 0) + { + runAsWin32Service = true; + } + // Under win32 we must initialise the Winsock library // before using sockets @@ -65,7 +71,7 @@ int ExitCode = 0; - if (argc == 2 && ::strcmp(argv[1], "--service") == 0) + if (runAsWin32Service) { syslog(LOG_INFO,"Starting Box Backup Service"); OurService(); From boxbackup-dev at fluffy.co.uk Thu Dec 22 02:15:37 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 22 Dec 2005 02:15:37 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r271 - in box/chris/win32/vc2005-compile-fixes: . infrastructure infrastructure/msvc infrastructure/msvc/2003 infrastructure/msvc/2005 lib/common Message-ID: <20051222021537.4479794@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-22 02:15:24 +0000 (Thu, 22 Dec 2005) New Revision: 271 Added: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/ box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2003/ box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2003/bbackupctl.vcproj box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2003/bbackupd.vcproj box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2003/boxbackup.sln box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2003/boxbackup.suo box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2003/boxquery.vcproj box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2003/common.vcproj box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2003/win32test.vcproj box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/ box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/bbackupctl.vcproj box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/bbackupd.vcproj box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/boxbackup.sln box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/boxbackup.suo box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/boxquery.vcproj box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/common.vcproj box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/win32test.vcproj Removed: box/chris/win32/vc2005-compile-fixes/bbackupctl.vcproj box/chris/win32/vc2005-compile-fixes/bbackupd.vcproj box/chris/win32/vc2005-compile-fixes/boxbackup.sln box/chris/win32/vc2005-compile-fixes/boxbackup.suo box/chris/win32/vc2005-compile-fixes/boxquery.vcproj box/chris/win32/vc2005-compile-fixes/common.vcproj box/chris/win32/vc2005-compile-fixes/win32test.vcproj Modified: box/chris/win32/vc2005-compile-fixes/lib/common/FdGetLine.cpp Log: * Moved Visual C++ project files to infrastructure/msvc * Added Visual C++ 2005 compatible project Deleted: box/chris/win32/vc2005-compile-fixes/bbackupctl.vcproj =================================================================== --- box/chris/win32/vc2005-compile-fixes/bbackupctl.vcproj 2005-12-22 02:14:40 UTC (rev 270) +++ box/chris/win32/vc2005-compile-fixes/bbackupctl.vcproj 2005-12-22 02:15:24 UTC (rev 271) @@ -1,150 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Deleted: box/chris/win32/vc2005-compile-fixes/bbackupd.vcproj =================================================================== --- box/chris/win32/vc2005-compile-fixes/bbackupd.vcproj 2005-12-22 02:14:40 UTC (rev 270) +++ box/chris/win32/vc2005-compile-fixes/bbackupd.vcproj 2005-12-22 02:15:24 UTC (rev 271) @@ -1,204 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Deleted: box/chris/win32/vc2005-compile-fixes/boxbackup.sln =================================================================== --- box/chris/win32/vc2005-compile-fixes/boxbackup.sln 2005-12-22 02:14:40 UTC (rev 270) +++ box/chris/win32/vc2005-compile-fixes/boxbackup.sln 2005-12-22 02:15:24 UTC (rev 271) @@ -1,67 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boxquery", "boxquery.vcproj", "{FE9EC666-4B3A-4370-B3D4-DEBD4A21F36E}" - ProjectSection(ProjectDependencies) = postProject - {98598F62-FEA7-4134-AA29-0AD2315A214F} = {98598F62-FEA7-4134-AA29-0AD2315A214F} - {A089CEE6-EBF0-4232-A0C0-74850A8127A6} = {A089CEE6-EBF0-4232-A0C0-74850A8127A6} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "common.vcproj", "{A089CEE6-EBF0-4232-A0C0-74850A8127A6}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bbackupd", "bbackupd.vcproj", "{22D325FB-9131-4BD6-B390-968F0491D687}" - ProjectSection(ProjectDependencies) = postProject - {98598F62-FEA7-4134-AA29-0AD2315A214F} = {98598F62-FEA7-4134-AA29-0AD2315A214F} - {A089CEE6-EBF0-4232-A0C0-74850A8127A6} = {A089CEE6-EBF0-4232-A0C0-74850A8127A6} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "win32test", "win32test.vcproj", "{28C29E72-76A2-4D0C-B35B-12D446733D2E}" - ProjectSection(ProjectDependencies) = postProject - {A089CEE6-EBF0-4232-A0C0-74850A8127A6} = {A089CEE6-EBF0-4232-A0C0-74850A8127A6} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bbackupctl", "bbackupctl.vcproj", "{9FD51412-E945-4457-A17A-CA3C505CF431}" - ProjectSection(ProjectDependencies) = postProject - {A089CEE6-EBF0-4232-A0C0-74850A8127A6} = {A089CEE6-EBF0-4232-A0C0-74850A8127A6} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boost_regex", "lib\win32\boost_regex.vcproj", "{98598F62-FEA7-4134-AA29-0AD2315A214F}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {FE9EC666-4B3A-4370-B3D4-DEBD4A21F36E}.Debug.ActiveCfg = Debug|Win32 - {FE9EC666-4B3A-4370-B3D4-DEBD4A21F36E}.Debug.Build.0 = Debug|Win32 - {FE9EC666-4B3A-4370-B3D4-DEBD4A21F36E}.Release.ActiveCfg = Release|Win32 - {FE9EC666-4B3A-4370-B3D4-DEBD4A21F36E}.Release.Build.0 = Release|Win32 - {A089CEE6-EBF0-4232-A0C0-74850A8127A6}.Debug.ActiveCfg = Debug|Win32 - {A089CEE6-EBF0-4232-A0C0-74850A8127A6}.Debug.Build.0 = Debug|Win32 - {A089CEE6-EBF0-4232-A0C0-74850A8127A6}.Release.ActiveCfg = Release|Win32 - {A089CEE6-EBF0-4232-A0C0-74850A8127A6}.Release.Build.0 = Release|Win32 - {22D325FB-9131-4BD6-B390-968F0491D687}.Debug.ActiveCfg = Debug|Win32 - {22D325FB-9131-4BD6-B390-968F0491D687}.Debug.Build.0 = Debug|Win32 - {22D325FB-9131-4BD6-B390-968F0491D687}.Release.ActiveCfg = Release|Win32 - {22D325FB-9131-4BD6-B390-968F0491D687}.Release.Build.0 = Release|Win32 - {28C29E72-76A2-4D0C-B35B-12D446733D2E}.Debug.ActiveCfg = Debug|Win32 - {28C29E72-76A2-4D0C-B35B-12D446733D2E}.Debug.Build.0 = Debug|Win32 - {28C29E72-76A2-4D0C-B35B-12D446733D2E}.Release.ActiveCfg = Release|Win32 - {28C29E72-76A2-4D0C-B35B-12D446733D2E}.Release.Build.0 = Release|Win32 - {9FD51412-E945-4457-A17A-CA3C505CF431}.Debug.ActiveCfg = Debug|Win32 - {9FD51412-E945-4457-A17A-CA3C505CF431}.Debug.Build.0 = Debug|Win32 - {9FD51412-E945-4457-A17A-CA3C505CF431}.Release.ActiveCfg = Release|Win32 - {9FD51412-E945-4457-A17A-CA3C505CF431}.Release.Build.0 = Release|Win32 - {98598F62-FEA7-4134-AA29-0AD2315A214F}.Debug.ActiveCfg = Debug|Win32 - {98598F62-FEA7-4134-AA29-0AD2315A214F}.Debug.Build.0 = Debug|Win32 - {98598F62-FEA7-4134-AA29-0AD2315A214F}.Release.ActiveCfg = Release|Win32 - {98598F62-FEA7-4134-AA29-0AD2315A214F}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal Deleted: box/chris/win32/vc2005-compile-fixes/boxbackup.suo =================================================================== (Binary files differ) Deleted: box/chris/win32/vc2005-compile-fixes/boxquery.vcproj =================================================================== --- box/chris/win32/vc2005-compile-fixes/boxquery.vcproj 2005-12-22 02:14:40 UTC (rev 270) +++ box/chris/win32/vc2005-compile-fixes/boxquery.vcproj 2005-12-22 02:15:24 UTC (rev 271) @@ -1,171 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Deleted: box/chris/win32/vc2005-compile-fixes/common.vcproj =================================================================== --- box/chris/win32/vc2005-compile-fixes/common.vcproj 2005-12-22 02:14:40 UTC (rev 270) +++ box/chris/win32/vc2005-compile-fixes/common.vcproj 2005-12-22 02:15:24 UTC (rev 271) @@ -1,638 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Copied: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2003/bbackupctl.vcproj (from rev 255, box/chris/win32/vc2005-compile-fixes/bbackupctl.vcproj) =================================================================== --- box/chris/win32/vc2005-compile-fixes/bbackupctl.vcproj 2005-12-20 22:59:29 UTC (rev 255) +++ box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2003/bbackupctl.vcproj 2005-12-22 02:15:24 UTC (rev 271) @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Copied: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2003/bbackupd.vcproj (from rev 255, box/chris/win32/vc2005-compile-fixes/bbackupd.vcproj) =================================================================== --- box/chris/win32/vc2005-compile-fixes/bbackupd.vcproj 2005-12-20 22:59:29 UTC (rev 255) +++ box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2003/bbackupd.vcproj 2005-12-22 02:15:24 UTC (rev 271) @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Copied: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2003/boxbackup.sln (from rev 255, box/chris/win32/vc2005-compile-fixes/boxbackup.sln) Copied: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2003/boxbackup.suo (from rev 255, box/chris/win32/vc2005-compile-fixes/boxbackup.suo) Copied: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2003/boxquery.vcproj (from rev 255, box/chris/win32/vc2005-compile-fixes/boxquery.vcproj) =================================================================== --- box/chris/win32/vc2005-compile-fixes/boxquery.vcproj 2005-12-20 22:59:29 UTC (rev 255) +++ box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2003/boxquery.vcproj 2005-12-22 02:15:24 UTC (rev 271) @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Copied: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2003/common.vcproj (from rev 255, box/chris/win32/vc2005-compile-fixes/common.vcproj) =================================================================== --- box/chris/win32/vc2005-compile-fixes/common.vcproj 2005-12-20 22:59:29 UTC (rev 255) +++ box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2003/common.vcproj 2005-12-22 02:15:24 UTC (rev 271) @@ -0,0 +1,638 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Copied: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2003/win32test.vcproj (from rev 255, box/chris/win32/vc2005-compile-fixes/win32test.vcproj) =================================================================== --- box/chris/win32/vc2005-compile-fixes/win32test.vcproj 2005-12-20 22:59:29 UTC (rev 255) +++ box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2003/win32test.vcproj 2005-12-22 02:15:24 UTC (rev 271) @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/bbackupctl.vcproj =================================================================== --- box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/bbackupctl.vcproj 2005-12-22 02:14:40 UTC (rev 270) +++ box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/bbackupctl.vcproj 2005-12-22 02:15:24 UTC (rev 271) @@ -0,0 +1,217 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property changes on: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/bbackupctl.vcproj ___________________________________________________________________ Name: svn:eol-style + CRLF Added: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/bbackupd.vcproj =================================================================== --- box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/bbackupd.vcproj 2005-12-22 02:14:40 UTC (rev 270) +++ box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/bbackupd.vcproj 2005-12-22 02:15:24 UTC (rev 271) @@ -0,0 +1,286 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property changes on: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/bbackupd.vcproj ___________________________________________________________________ Name: svn:eol-style + CRLF Added: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/boxbackup.sln =================================================================== --- box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/boxbackup.sln 2005-12-22 02:14:40 UTC (rev 270) +++ box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/boxbackup.sln 2005-12-22 02:15:24 UTC (rev 271) @@ -0,0 +1,55 @@ +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual C++ Express 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boxquery", "boxquery.vcproj", "{FE9EC666-4B3A-4370-B3D4-DEBD4A21F36E}" + ProjectSection(ProjectDependencies) = postProject + {A089CEE6-EBF0-4232-A0C0-74850A8127A6} = {A089CEE6-EBF0-4232-A0C0-74850A8127A6} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "common.vcproj", "{A089CEE6-EBF0-4232-A0C0-74850A8127A6}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bbackupd", "bbackupd.vcproj", "{22D325FB-9131-4BD6-B390-968F0491D687}" + ProjectSection(ProjectDependencies) = postProject + {A089CEE6-EBF0-4232-A0C0-74850A8127A6} = {A089CEE6-EBF0-4232-A0C0-74850A8127A6} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "win32test", "win32test.vcproj", "{28C29E72-76A2-4D0C-B35B-12D446733D2E}" + ProjectSection(ProjectDependencies) = postProject + {A089CEE6-EBF0-4232-A0C0-74850A8127A6} = {A089CEE6-EBF0-4232-A0C0-74850A8127A6} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bbackupctl", "bbackupctl.vcproj", "{9FD51412-E945-4457-A17A-CA3C505CF431}" + ProjectSection(ProjectDependencies) = postProject + {A089CEE6-EBF0-4232-A0C0-74850A8127A6} = {A089CEE6-EBF0-4232-A0C0-74850A8127A6} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FE9EC666-4B3A-4370-B3D4-DEBD4A21F36E}.Debug|Win32.ActiveCfg = Debug|Win32 + {FE9EC666-4B3A-4370-B3D4-DEBD4A21F36E}.Debug|Win32.Build.0 = Debug|Win32 + {FE9EC666-4B3A-4370-B3D4-DEBD4A21F36E}.Release|Win32.ActiveCfg = Release|Win32 + {FE9EC666-4B3A-4370-B3D4-DEBD4A21F36E}.Release|Win32.Build.0 = Release|Win32 + {A089CEE6-EBF0-4232-A0C0-74850A8127A6}.Debug|Win32.ActiveCfg = Debug|Win32 + {A089CEE6-EBF0-4232-A0C0-74850A8127A6}.Debug|Win32.Build.0 = Debug|Win32 + {A089CEE6-EBF0-4232-A0C0-74850A8127A6}.Release|Win32.ActiveCfg = Release|Win32 + {A089CEE6-EBF0-4232-A0C0-74850A8127A6}.Release|Win32.Build.0 = Release|Win32 + {22D325FB-9131-4BD6-B390-968F0491D687}.Debug|Win32.ActiveCfg = Debug|Win32 + {22D325FB-9131-4BD6-B390-968F0491D687}.Debug|Win32.Build.0 = Debug|Win32 + {22D325FB-9131-4BD6-B390-968F0491D687}.Release|Win32.ActiveCfg = Release|Win32 + {22D325FB-9131-4BD6-B390-968F0491D687}.Release|Win32.Build.0 = Release|Win32 + {28C29E72-76A2-4D0C-B35B-12D446733D2E}.Debug|Win32.ActiveCfg = Debug|Win32 + {28C29E72-76A2-4D0C-B35B-12D446733D2E}.Debug|Win32.Build.0 = Debug|Win32 + {28C29E72-76A2-4D0C-B35B-12D446733D2E}.Release|Win32.ActiveCfg = Release|Win32 + {28C29E72-76A2-4D0C-B35B-12D446733D2E}.Release|Win32.Build.0 = Release|Win32 + {9FD51412-E945-4457-A17A-CA3C505CF431}.Debug|Win32.ActiveCfg = Debug|Win32 + {9FD51412-E945-4457-A17A-CA3C505CF431}.Debug|Win32.Build.0 = Debug|Win32 + {9FD51412-E945-4457-A17A-CA3C505CF431}.Release|Win32.ActiveCfg = Release|Win32 + {9FD51412-E945-4457-A17A-CA3C505CF431}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Property changes on: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/boxbackup.sln ___________________________________________________________________ Name: svn:eol-style + CRLF Added: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/boxbackup.suo =================================================================== (Binary files differ) Property changes on: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/boxbackup.suo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/boxquery.vcproj =================================================================== --- box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/boxquery.vcproj 2005-12-22 02:14:40 UTC (rev 270) +++ box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/boxquery.vcproj 2005-12-22 02:15:24 UTC (rev 271) @@ -0,0 +1,242 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property changes on: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/boxquery.vcproj ___________________________________________________________________ Name: svn:eol-style + CRLF Added: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/common.vcproj =================================================================== --- box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/common.vcproj 2005-12-22 02:14:40 UTC (rev 270) +++ box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/common.vcproj 2005-12-22 02:15:24 UTC (rev 271) @@ -0,0 +1,845 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property changes on: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/common.vcproj ___________________________________________________________________ Name: svn:eol-style + CRLF Added: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/win32test.vcproj =================================================================== --- box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/win32test.vcproj 2005-12-22 02:14:40 UTC (rev 270) +++ box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/win32test.vcproj 2005-12-22 02:15:24 UTC (rev 271) @@ -0,0 +1,217 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property changes on: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/win32test.vcproj ___________________________________________________________________ Name: svn:eol-style + CRLF Modified: box/chris/win32/vc2005-compile-fixes/lib/common/FdGetLine.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/FdGetLine.cpp 2005-12-22 02:14:40 UTC (rev 270) +++ box/chris/win32/vc2005-compile-fixes/lib/common/FdGetLine.cpp 2005-12-22 02:15:24 UTC (rev 271) @@ -154,7 +154,7 @@ else { // Check for comment char, but char before must be whitespace - std::string::size_type end = 0; + int end = 0; std::string::size_type size = r.size(); while(end < size) { @@ -166,7 +166,7 @@ } // Remove whitespace - std::string::size_type begin = 0; + int begin = 0; while(begin < size && iw(r[begin])) { begin++; Deleted: box/chris/win32/vc2005-compile-fixes/win32test.vcproj =================================================================== --- box/chris/win32/vc2005-compile-fixes/win32test.vcproj 2005-12-22 02:14:40 UTC (rev 270) +++ box/chris/win32/vc2005-compile-fixes/win32test.vcproj 2005-12-22 02:15:24 UTC (rev 271) @@ -1,148 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From boxbackup-dev at fluffy.co.uk Thu Dec 22 02:33:25 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 22 Dec 2005 02:33:25 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r272 - box/chris/win32/vc2005-compile-fixes/lib/common Message-ID: <20051222023325.D2EB094@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-22 02:33:24 +0000 (Thu, 22 Dec 2005) New Revision: 272 Modified: box/chris/win32/vc2005-compile-fixes/lib/common/Guards.h Log: Ported Guards.h for Win32 Modified: box/chris/win32/vc2005-compile-fixes/lib/common/Guards.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/Guards.h 2005-12-22 02:15:24 UTC (rev 271) +++ box/chris/win32/vc2005-compile-fixes/lib/common/Guards.h 2005-12-22 02:33:24 UTC (rev 272) @@ -26,12 +26,24 @@ #include "MemLeakFindOn.h" +#ifdef WIN32 + #define INVALID_FILE NULL + typedef HANDLE tOSFileHandle; +#else + #define INVALID_FILE -1 + typedef int tOSFileHandle; +#endif + template class FileHandleGuard { public: FileHandleGuard(const char *filename) +#ifdef WIN32 + : mOSFileHandle(::openfile(filename, flags, mode)) +#else : mOSFileHandle(::open(filename, flags, mode)) +#endif { if(mOSFileHandle < 0) { @@ -41,7 +53,7 @@ ~FileHandleGuard() { - if(mOSFileHandle >= 0) + if(mOSFileHandle == INVALID_FILE) { Close(); } @@ -49,24 +61,28 @@ void Close() { - if(mOSFileHandle < 0) + if(mOSFileHandle == INVALID_FILE) { THROW_EXCEPTION(CommonException, FileAlreadyClosed) } +#ifdef WIN32 + if(::CloseHandle(mOSFileHandle) == 0) +#else if(::close(mOSFileHandle) != 0) +#endif { THROW_EXCEPTION(CommonException, OSFileCloseError) } - mOSFileHandle = -1; + mOSFileHandle = INVALID_FILE; } operator int() const { - return mOSFileHandle; + return (int)mOSFileHandle; } private: - int mOSFileHandle; + tOSFileHandle mOSFileHandle; }; template From boxbackup-dev at fluffy.co.uk Thu Dec 22 22:26:43 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 22 Dec 2005 22:26:43 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r273 - box/chris/win32/vc2005-compile-fixes/lib/win32 Message-ID: <20051222222643.449A994@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-22 22:26:40 +0000 (Thu, 22 Dec 2005) New Revision: 273 Modified: box/chris/win32/vc2005-compile-fixes/lib/win32/WinNamedPipeStream.cpp Log: * WinNamedPipeStream.cpp - Avoid crash on shutdown when named pipe is not connected Modified: box/chris/win32/vc2005-compile-fixes/lib/win32/WinNamedPipeStream.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/win32/WinNamedPipeStream.cpp 2005-12-22 02:33:24 UTC (rev 272) +++ box/chris/win32/vc2005-compile-fixes/lib/win32/WinNamedPipeStream.cpp 2005-12-22 22:26:40 UTC (rev 273) @@ -53,7 +53,7 @@ // -------------------------------------------------------------------------- WinNamedPipeStream::~WinNamedPipeStream() { - if (mSocketHandle != NULL) + if (mSocketHandle != NULL && IsConnected()) { Close(); } From boxbackup-dev at fluffy.co.uk Thu Dec 22 22:27:56 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 22 Dec 2005 22:27:56 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r274 - box/chris/win32/vc2005-compile-fixes Message-ID: <20051222222756.49B4594@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-22 22:27:35 +0000 (Thu, 22 Dec 2005) New Revision: 274 Modified: box/chris/win32/vc2005-compile-fixes/win32.bat Log: * win32.bat - No longer requires cygwin - only Perl (such as ActiveState Perl) Modified: box/chris/win32/vc2005-compile-fixes/win32.bat =================================================================== --- box/chris/win32/vc2005-compile-fixes/win32.bat 2005-12-22 22:26:40 UTC (rev 273) +++ box/chris/win32/vc2005-compile-fixes/win32.bat 2005-12-22 22:27:35 UTC (rev 274) @@ -1,27 +1,28 @@ + at echo off -pwd = /usr/src/boxbackup0.08/ +echo quick and dirty to get up and running by generating the required files +echo using Cygwin and Perl -# quick and dirty to get up and running by generating the required files -# using Cygwin and Perl +cd .\bin\bbackupquery\ & perl ./../../bin/bbackupquery/makedocumentation.pl +cd ..\..\ -cd ./bin/bbackupquery/ & perl ./../../bin/bbackupquery/makedocumentation.pl -cd ../../ - -cd ./lib/backupclient & perl ./../../lib/common/makeexception.pl BackupStoreException.txt +cd .\lib\backupclient & perl ./../../lib/common/makeexception.pl BackupStoreException.txt perl ./../../lib/server/makeprotocol.pl Client ./../../bin/bbstored/backupprotocol.txt -cd ../../ +cd ..\..\ -cd ./lib/compress & perl ./../../lib/common/makeexception.pl CompressException.txt -cd ../../ +cd .\lib\compress & perl ./../../lib/common/makeexception.pl CompressException.txt +cd ..\..\ -cd ./lib/common & perl ./../../lib/common/makeexception.pl CommonException.txt & perl ./../../lib/common/makeexception.pl ConversionException.txt +cd .\lib\common & perl ./../../lib/common/makeexception.pl CommonException.txt & perl ./../../lib/common/makeexception.pl ConversionException.txt -cd ../../ +cd ..\..\ -cd ./lib/crypto & perl ./../../lib/common/makeexception.pl CipherException.txt -cd ../../ +cd .\lib\crypto & perl ./../../lib/common/makeexception.pl CipherException.txt +cd ..\..\ -# server parts - which appears as though some of the clients rely on +echo server parts - which appears as though some of the clients rely on -cd ./lib/server & perl ./../../lib/common/makeexception.pl ServerException.txt & perl ./../../lib/common/makeexception.pl ConnectionException.txt -cd ../../ +cd .\lib\server & perl ./../../lib/common/makeexception.pl ServerException.txt & perl ./../../lib/common/makeexception.pl ConnectionException.txt +cd ..\..\ + +copy lib\win32\config.h.win32 lib\common\config.h From boxbackup-dev at fluffy.co.uk Thu Dec 22 22:29:02 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 22 Dec 2005 22:29:02 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r275 - box/chris/win32/vc2005-compile-fixes/bin/bbackupd Message-ID: <20051222222902.F1A8A94@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-22 22:29:00 +0000 (Thu, 22 Dec 2005) New Revision: 275 Modified: box/chris/win32/vc2005-compile-fixes/bin/bbackupd/Win32ServiceFunctions.cpp Log: * Win32ServiceFunctions.cpp - Better logging of service install/remove errors - Add a description to the Box Backup service - Removed dialog box on service startup - Start service automatically on boot (why else would you want a service?) Modified: box/chris/win32/vc2005-compile-fixes/bin/bbackupd/Win32ServiceFunctions.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/bin/bbackupd/Win32ServiceFunctions.cpp 2005-12-22 22:27:35 UTC (rev 274) +++ box/chris/win32/vc2005-compile-fixes/bin/bbackupd/Win32ServiceFunctions.cpp 2005-12-22 22:29:00 UTC (rev 275) @@ -125,8 +125,6 @@ return; } - ShowMessage("Starting..."); - HANDLE ourThread = (HANDLE)_beginthreadex( NULL, 0, @@ -187,7 +185,12 @@ scm = OpenSCManager(0,0,SC_MANAGER_CREATE_SERVICE); - if (!scm) return; + if (!scm) + { + syslog(LOG_ERR, "Failed to open service control manager: " + "error %d", GetLastError()); + return; + } char cmd[MAX_PATH]; GetModuleFileName(NULL, cmd, sizeof(cmd)-1); @@ -203,12 +206,31 @@ "Box Backup", SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, - SERVICE_DEMAND_START, + SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, cmd_args, 0,0,0,0,0); - if (newService) CloseServiceHandle(newService); + if (!newService) + { + ::syslog(LOG_ERR, "Failed to create Box Backup service: " + "error %d", GetLastError()); + return; + } + + ::syslog(LOG_INFO, "Created Box Backup service"); + + SERVICE_DESCRIPTION desc; + desc.lpDescription = "Backs up your data files over the Internet"; + + if (!ChangeServiceConfig2(newService, SERVICE_CONFIG_DESCRIPTION, + &desc)) + { + ::syslog(LOG_WARNING, "Failed to set description for " + "Box Backup service: error %d", GetLastError()); + } + + CloseServiceHandle(newService); CloseServiceHandle(scm); } @@ -219,23 +241,31 @@ scm = OpenSCManager(0,0,SC_MANAGER_CREATE_SERVICE); - if (!scm) return; + if (!scm) + { + syslog(LOG_ERR, "Failed to open service control manager: " + "error %d", GetLastError()); + return; + } service = OpenService(scm, SERVICE_NAME, SERVICE_ALL_ACCESS|DELETE); ControlService(service, SERVICE_CONTROL_STOP, &status); if (!service) { - printf("Failed to open service manager"); + syslog(LOG_ERR, "Failed to open Box Backup service: " + "error %d", GetLastError()); return; } + if (DeleteService(service)) { - printf("Service removed"); + syslog(LOG_INFO, "Box Backup service deleted"); } else { - printf("Failed to remove service"); + syslog(LOG_ERR, "Failed to remove Box Backup service: " + "error %d", GetLastError()); } CloseServiceHandle(service); From boxbackup-dev at fluffy.co.uk Thu Dec 22 22:29:46 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 22 Dec 2005 22:29:46 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r276 - box/chris/win32/vc2005-compile-fixes/bin/bbackupd Message-ID: <20051222222946.34C1294@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-22 22:29:45 +0000 (Thu, 22 Dec 2005) New Revision: 276 Modified: box/chris/win32/vc2005-compile-fixes/bin/bbackupd/BackupDaemon.cpp Log: * BackupDaemon.cpp - Ignore errors when closing the named pipe during shutdown Modified: box/chris/win32/vc2005-compile-fixes/bin/bbackupd/BackupDaemon.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/bin/bbackupd/BackupDaemon.cpp 2005-12-22 22:29:00 UTC (rev 275) +++ box/chris/win32/vc2005-compile-fixes/bin/bbackupd/BackupDaemon.cpp 2005-12-22 22:29:45 UTC (rev 276) @@ -1909,6 +1909,17 @@ // -------------------------------------------------------------------------- BackupDaemon::CommandSocketInfo::~CommandSocketInfo() { +#ifdef WIN32 + try + { + mListeningSocket.Close(); + } + catch(ServerException &e) + { + // ignore errors as we're closing down anyway + } +#endif + if(mpGetLine) { delete mpGetLine; From boxbackup-dev at fluffy.co.uk Thu Dec 22 22:34:31 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 22 Dec 2005 22:34:31 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r277 - box/chris/win32/vc2005-compile-fixes/lib/common Message-ID: <20051222223431.3C88494@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-22 22:34:28 +0000 (Thu, 22 Dec 2005) New Revision: 277 Modified: box/chris/win32/vc2005-compile-fixes/lib/common/Guards.h Log: * Guards.h - Reverted bad win32 fixes Modified: box/chris/win32/vc2005-compile-fixes/lib/common/Guards.h =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/common/Guards.h 2005-12-22 22:29:45 UTC (rev 276) +++ box/chris/win32/vc2005-compile-fixes/lib/common/Guards.h 2005-12-22 22:34:28 UTC (rev 277) @@ -26,24 +26,12 @@ #include "MemLeakFindOn.h" -#ifdef WIN32 - #define INVALID_FILE NULL - typedef HANDLE tOSFileHandle; -#else - #define INVALID_FILE -1 - typedef int tOSFileHandle; -#endif - template class FileHandleGuard { public: FileHandleGuard(const char *filename) -#ifdef WIN32 - : mOSFileHandle(::openfile(filename, flags, mode)) -#else : mOSFileHandle(::open(filename, flags, mode)) -#endif { if(mOSFileHandle < 0) { @@ -53,7 +41,7 @@ ~FileHandleGuard() { - if(mOSFileHandle == INVALID_FILE) + if(mOSFileHandle >= 0) { Close(); } @@ -61,28 +49,24 @@ void Close() { - if(mOSFileHandle == INVALID_FILE) + if(mOSFileHandle < 0) { THROW_EXCEPTION(CommonException, FileAlreadyClosed) } -#ifdef WIN32 - if(::CloseHandle(mOSFileHandle) == 0) -#else if(::close(mOSFileHandle) != 0) -#endif { THROW_EXCEPTION(CommonException, OSFileCloseError) } - mOSFileHandle = INVALID_FILE; + mOSFileHandle = -1; } operator int() const { - return (int)mOSFileHandle; + return mOSFileHandle; } private: - tOSFileHandle mOSFileHandle; + int mOSFileHandle; }; template From boxbackup-dev at fluffy.co.uk Thu Dec 22 23:00:23 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 22 Dec 2005 23:00:23 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r278 - box/chris/win32/vc2005-compile-fixes/lib/backupclient Message-ID: <20051222230023.0950C94@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-22 23:00:04 +0000 (Thu, 22 Dec 2005) New Revision: 278 Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientFileAttributes.cpp Log: * BackupClientFileAttributes.cpp - Fix erroneous detection of invalid timestamps on local files Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientFileAttributes.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientFileAttributes.cpp 2005-12-22 22:34:28 UTC (rev 277) +++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientFileAttributes.cpp 2005-12-22 23:00:04 UTC (rev 278) @@ -333,8 +333,9 @@ // __time64_t winTime = BoxTimeToSeconds( // pnewAttr->ModificationTime); - box_time_t bob = BoxTimeToSeconds(pattr->ModificationTime); - __time64_t winTime = bob; + u_int64_t modTime = box_ntoh64(pattr->ModificationTime); + box_time_t modSecs = BoxTimeToSeconds(modTime); + __time64_t winTime = modSecs; // _MAX__TIME64_T doesn't seem to be defined, but the code below // will throw an assertion failure if we exceed it :-) @@ -343,17 +344,19 @@ // to be true (still aborts), but it can at least hold 2^32. if (winTime >= 0x100000000 || _gmtime64(&winTime) == 0) { - ::syslog(LOG_ERR, "Corrupt value in store " - "Modification Time in file %s", Filename); + ::syslog(LOG_ERR, "Invalid Modification Time " + "caught for file: %s", Filename); pattr->ModificationTime = 0; } - bob = BoxTimeToSeconds(pattr->AttrModificationTime); - winTime = bob; + modTime = box_ntoh64(pattr->AttrModificationTime); + modSecs = BoxTimeToSeconds(modTime); + winTime = modSecs; + if (winTime > 0x100000000 || _gmtime64(&winTime) == 0) { - ::syslog(LOG_ERR, "Corrupt value in store " - "Attr Modification Time in file %s", Filename); + ::syslog(LOG_ERR, "Invalid Attribute Modification " + "Time caught for file: %s", Filename); pattr->AttrModificationTime = 0; } #endif From boxbackup-dev at fluffy.co.uk Thu Dec 22 23:56:09 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Thu, 22 Dec 2005 23:56:09 +0000 (GMT) Subject: [Box Backup-dev] Win32 port Message-ID: Hi all, With the latest changes in vc2005-compile-fixes, it's now possible (and actually not too difficult) to compile Box Backup on a Win32 machine without Cygwin, using Visual C++ Express 2005 and ActiveState Perl. I did it from scratch in about 4 hours, including download and installation times. Also, Box now runs properly as a service, as long as it can read the config file and write to the DataDirectory specified therein. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Thu Dec 22 23:08:04 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 22 Dec 2005 23:08:04 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r279 - box/chris/win32/vc2005-compile-fixes/lib/backupclient Message-ID: <20051222230804.17ED394@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-22 23:08:00 +0000 (Thu, 22 Dec 2005) New Revision: 279 Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFile.cpp Log: * BackupStoreFile.cpp - Don't log messages about reallocating the encoding buffer on Win32, as it fills up the system event log very quickly Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFile.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFile.cpp 2005-12-22 23:00:04 UTC (rev 278) +++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFile.cpp 2005-12-22 23:08:00 UTC (rev 279) @@ -1487,7 +1487,9 @@ // -------------------------------------------------------------------------- void BackupStoreFile::EncodingBuffer::Reallocate(int NewSize) { +#ifndef WIN32 TRACE2("Reallocating EncodingBuffer from %d to %d\n", mBufferSize, NewSize); +#endif ASSERT(mpBuffer != 0); uint8_t *buffer = (uint8_t*)BackupStoreFile::CodingChunkAlloc(NewSize); if(buffer == 0) From boxbackup-dev at fluffy.co.uk Thu Dec 22 23:14:51 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 22 Dec 2005 23:14:51 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r280 - box/chris/win32/vc2005-compile-fixes/lib/backupclient Message-ID: <20051222231451.3949894@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-22 23:14:49 +0000 (Thu, 22 Dec 2005) New Revision: 280 Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFilenameClear.cpp Log: * backupclient/BackupStoreFilenameClear.cpp - Similarly suppress log messages about reallocating filename encoding buffer on Win32 Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFilenameClear.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFilenameClear.cpp 2005-12-22 23:08:00 UTC (rev 279) +++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFilenameClear.cpp 2005-12-22 23:14:49 UTC (rev 280) @@ -223,7 +223,9 @@ // Make sure encode/decode buffer has enough space if(sEncDecBufferSize < maxOutSize) { +#ifndef WIN32 TRACE2("Reallocating filename encoding/decoding buffer from %d to %d\n", sEncDecBufferSize, maxOutSize); +#endif spEncDecBuffer.Resize(maxOutSize); sEncDecBufferSize = maxOutSize; } @@ -261,7 +263,9 @@ // Make sure encode/decode buffer has enough space if(sEncDecBufferSize < maxOutSize) { +#ifndef WIN32 TRACE2("Reallocating filename encoding/decoding buffer from %d to %d\n", sEncDecBufferSize, maxOutSize); +#endif spEncDecBuffer.Resize(maxOutSize); sEncDecBufferSize = maxOutSize; } From boxbackup-dev at fluffy.co.uk Thu Dec 22 23:33:46 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Thu, 22 Dec 2005 23:33:46 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r281 - box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005 Message-ID: <20051222233346.045EF94@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-22 23:33:42 +0000 (Thu, 22 Dec 2005) New Revision: 281 Modified: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/bbackupctl.vcproj box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/bbackupd.vcproj box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/boxbackup.suo box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/boxquery.vcproj box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/common.vcproj box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/win32test.vcproj Log: * Tidied up include directories * Fix compilation problems caused by openssl/include/openssl symlinks Modified: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/bbackupctl.vcproj =================================================================== --- box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/bbackupctl.vcproj 2005-12-22 23:14:49 UTC (rev 280) +++ box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/bbackupctl.vcproj 2005-12-22 23:33:42 UTC (rev 281) @@ -40,7 +40,7 @@ Author: chris Date: 2005-12-22 23:57:28 +0000 (Thu, 22 Dec 2005) New Revision: 282 Modified: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/boxbackup.suo box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientFileAttributes.cpp Log: * infrastructure/msvc/2005/boxbackup.suo - Unknown change? * lib/backupclient/BackupClientFileAttributes.cpp - Compile fix for MinGW Modified: box/chris/win32/vc2005-compile-fixes/infrastructure/msvc/2005/boxbackup.suo =================================================================== (Binary files differ) Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientFileAttributes.cpp =================================================================== --- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientFileAttributes.cpp 2005-12-22 23:33:42 UTC (rev 281) +++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientFileAttributes.cpp 2005-12-22 23:57:28 UTC (rev 282) @@ -342,7 +342,7 @@ // Microsoft says dates up to the year 3000 are valid, which // is a bit more than 15 * 2^32. Even that doesn't seem // to be true (still aborts), but it can at least hold 2^32. - if (winTime >= 0x100000000 || _gmtime64(&winTime) == 0) + if (winTime >= 0x100000000LL || _gmtime64(&winTime) == 0) { ::syslog(LOG_ERR, "Invalid Modification Time " "caught for file: %s", Filename); @@ -353,7 +353,7 @@ modSecs = BoxTimeToSeconds(modTime); winTime = modSecs; - if (winTime > 0x100000000 || _gmtime64(&winTime) == 0) + if (winTime > 0x100000000LL || _gmtime64(&winTime) == 0) { ::syslog(LOG_ERR, "Invalid Attribute Modification " "Time caught for file: %s", Filename); From boxbackup-dev at fluffy.co.uk Fri Dec 23 08:43:30 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Fri, 23 Dec 2005 08:43:30 +0000 Subject: [Box Backup-dev] NDEBUG in Win32 release (was: COMMIT r279 - box/chris/win32/vc2005-compile-fixes/lib/backupclient) In-Reply-To: <20051222230804.17ED394@s0g0.pems.testserver.co.uk> References: <20051222230804.17ED394@s0g0.pems.testserver.co.uk> Message-ID: On 22 Dec 2005, at 23:08, subversion at fluffy.co.uk wrote: > Author: chris > Date: 2005-12-22 23:08:00 +0000 (Thu, 22 Dec 2005) > New Revision: 279 > > Modified: > box/chris/win32/vc2005-compile-fixes/lib/backupclient/ > BackupStoreFile.cpp > Log: > * BackupStoreFile.cpp > - Don't log messages about reallocating the encoding buffer on Win32, > as it fills up the system event log very quickly [snip] > +#ifndef WIN32 > TRACE2("Reallocating EncodingBuffer from %d to %d\n", > mBufferSize, NewSize); > +#endif [snip] Set NDEBUG as a preprocessor definition in your release build settings, and all the trace statements will not be compiled in. It'll also remove some code which really shouldn't be in a release build. Ben From boxbackup-dev at fluffy.co.uk Fri Dec 23 08:44:54 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Fri, 23 Dec 2005 08:44:54 +0000 Subject: [Box Backup-dev] Win32 port In-Reply-To: References: Message-ID: <6BF45CBE-27A7-4A5E-9D0B-690B18775DFB@fluffy.co.uk> On 22 Dec 2005, at 23:56, Chris Wilson wrote: > Hi all, > > With the latest changes in vc2005-compile-fixes, it's now possible > (and actually not too difficult) to compile Box Backup on a Win32 > machine without Cygwin, using Visual C++ Express 2005 and > ActiveState Perl. I did it from scratch in about 4 hours, including > download and installation times. > > Also, Box now runs properly as a service, as long as it can read > the config file and write to the DataDirectory specified therein. Can you put instructions on the wiki? Thanks for all your hard work! Ben From boxbackup-dev at fluffy.co.uk Fri Dec 23 08:46:18 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Fri, 23 Dec 2005 08:46:18 +0000 Subject: [Box Backup-dev] Win32 port In-Reply-To: References: Message-ID: <2BC5083F-C0C3-420C-9331-CAEAB3DA8729@fluffy.co.uk> On 22 Dec 2005, at 23:56, Chris Wilson wrote: > Hi all, > > With the latest changes in vc2005-compile-fixes, it's now possible > (and actually not too difficult) to compile Box Backup on a Win32 > machine without Cygwin, using Visual C++ Express 2005 and > ActiveState Perl. I did it from scratch in about 4 hours, including > download and installation times. > > Also, Box now runs properly as a service, as long as it can read > the config file and write to the DataDirectory specified therein. I'll try and review all the changes you made soon. I'm still a bit dubious about the type changes, and the impact it might have on the POSIX side. I trust you've tried to compile it on a POSIX box? Ben From boxbackup-dev at fluffy.co.uk Fri Dec 23 11:30:18 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Fri, 23 Dec 2005 11:30:18 +0000 (GMT) Subject: [Box Backup-dev] NDEBUG in Win32 release (was: COMMIT r279 - box/chris/win32/vc2005-compile-fixes/lib/backupclient) In-Reply-To: References: <20051222230804.17ED394@s0g0.pems.testserver.co.uk> Message-ID: Hi Ben, > [snip] >> +#ifndef WIN32 >> TRACE2("Reallocating EncodingBuffer from %d to %d\n", mBufferSize, >> NewSize); >> +#endif > [snip] > > Set NDEBUG as a preprocessor definition in your release build settings, and > all the trace statements will not be compiled in. It'll also remove some code > which really shouldn't be in a release build. I considered that, but I _really_ want exception logging with source files and line numbers in these builds. Unless I hack about with Box.h, the only way to get them seems to be compiling without -NDEBUG. What's the extra code, assertions and memory leak checks? Assertions I'm quite happy to keep, and memory leak checks don't bother me too much unless they have a huge performance impact or are likely to crash Box in different ways. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Fri Dec 23 13:50:39 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Fri, 23 Dec 2005 13:50:39 +0000 (GMT) Subject: [Box Backup-dev] Win32 port In-Reply-To: <2BC5083F-C0C3-420C-9331-CAEAB3DA8729@fluffy.co.uk> References: <2BC5083F-C0C3-420C-9331-CAEAB3DA8729@fluffy.co.uk> Message-ID: Hi Ben, > I'll try and review all the changes you made soon. I'm still a bit dubious > about the type changes, and the impact it might have on the POSIX side. I > trust you've tried to compile it on a POSIX box? I'm a bit dubious about the type changes too - I had to revert one of them because it needed to store a negative integer (in FdGetLine). Feel free to ignore them for now, and just apply the other changes. I think the typecasts are OK - they're just making the implicit casts explicit to keep VC happy. It might be worth reviewing the code around them to see whether the assumptions about sizes and signedness are justified or should be made explicit with assertions or other checks. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Fri Dec 23 13:57:22 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Fri, 23 Dec 2005 13:57:22 +0000 (GMT) Subject: [Box Backup-dev] More wiki vandalism Message-ID: Hi Ben, Your wiki is being destroyed by bots. The Help and Contents pages are gone and not recoverable (unless they never existed in the first place - the oldest available versions are blank). I think the wiki will become unusable unless you start restricting changes to registered users. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Fri Dec 23 19:32:56 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Fri, 23 Dec 2005 19:32:56 +0000 Subject: [Box Backup-dev] More wiki vandalism In-Reply-To: References: Message-ID: <201A957F-E5E8-40A6-A829-64EAAD76955A@fluffy.co.uk> On 23 Dec 2005, at 13:57, Chris Wilson wrote: > Hi Ben, > > Your wiki is being destroyed by bots. The Help and Contents pages > are gone and not recoverable (unless they never existed in the > first place - the oldest available versions are blank). I don't think they ever existed. > > I think the wiki will become unusable unless you start restricting > changes to registered users. Yes, it is an unfortunate thing. However, I note by looking in recent changes that some bots are registering users. Interestingly enough, there have been massive numbers of changes, but only in the Talk pages. I suppose in your average wiki these will go unnoticed, but will be found by search engines. Ben From boxbackup-dev at fluffy.co.uk Fri Dec 23 19:49:35 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Fri, 23 Dec 2005 19:49:35 +0000 (GMT) Subject: [Box Backup-dev] Win32 port In-Reply-To: <6BF45CBE-27A7-4A5E-9D0B-690B18775DFB@fluffy.co.uk> References: <6BF45CBE-27A7-4A5E-9D0B-690B18775DFB@fluffy.co.uk> Message-ID: Hi Ben, > Can you put instructions on the wiki? I'm working on it, but to complete the instructions I need to post a patched version of OpenSSL (and the patch). Can I put them into Subversion, or should I upload them to another host, such as one of my own boxes? Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Fri Dec 23 21:43:45 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Fri, 23 Dec 2005 21:43:45 +0000 (GMT) Subject: [Box Backup-dev] Win32 port In-Reply-To: <6BF45CBE-27A7-4A5E-9D0B-690B18775DFB@fluffy.co.uk> References: <6BF45CBE-27A7-4A5E-9D0B-690B18775DFB@fluffy.co.uk> Message-ID: Hi Ben and all, > Can you put instructions on the wiki? OK, you can find it at: [http://boxbackup.hostworks.ca/index.php/Compile_With_Visual_C] > Thanks for all your hard work! You're very welcome, thank you all for your input and support! And a very merry christmas and happy new year to you all! Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Fri Dec 23 22:23:55 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Fri, 23 Dec 2005 22:23:55 +0000 (GMT) Subject: [Box Backup-dev] Logging Message-ID: Hi all, The Win32 port has showed up what looks to me like a limitation with the logging capabilities of Box. In a number of places, the Box code calls fprintf(stderr, ...) or ::syslog(...) or TRACE(...). It's not possible to redirect these calls easily to a different destination, or change the logging verbosity on the fly (or at all, without recompiling everything). Under Windows, when running as a service, I'd like to be able to send all messages to the Windows event log only (since stderr goes nowhere). When running from the command prompt, I'd like to send them both to stdout/stderr and the event log - especially for startup errors, since if the user double-clicks on bbackupd.exe, the window closes too fast for them to read the error message. I'd like to propose replacing all three current logging methods with something like this: * A global namespace Log:: for logging functions, constants and classes * A global function Log::Log(priority, format, ...) to send log messages to all attached targets * A global set of priorities: Log::DEBUG, Log::INFO, Log::PROGRESS, Log::WARNING, Log::ERROR, Log::FATAL * Classes for sending log messages to particular destinations (abstract Log::Target, implemented by Log::Console and Log::Syslog) * Global functions to add and remove targets: Log::Targets::Add(Log::Target& t), Log::Targets::Remove(...) * Global instances of Console and Syslog targets (Log::CONSOLE and Log::SYSLOG) * Target method to change verbosity (Log::Target::Filter(priority)) I'd like to change the way that logging is used throughout the code, as follows: * In command-line tools for all platforms, the Console target is added immediately at startup. * In Unix daemons, the Console and Syslog targets are added at startup, and the Console target is removed from the child process after the first fork. * In Windows daemons, when running as a service, the Syslog target is added at startup. * In Windows daemons, when running from the command line, the Console and Syslog targets are added at startup. * All TRACE calls are changed to Log::Log(Log::TRACE, ...) * All fprintf(stderr, ...) calls are changed to Log::Log(Log::ERROR, ...) * All ::syslog() calls are changed to Log::Log Does this seem like a reasonable plan? Does anyone have any comments, questions or objections? Not answering counts as acceptance in my book :-) Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Fri Dec 23 22:30:21 2005 From: boxbackup-dev at fluffy.co.uk (Charles Lecklider) Date: Fri, 23 Dec 2005 22:30:21 +0000 Subject: [Box Backup-dev] Logging In-Reply-To: References: Message-ID: <43AC7A7D.6010701@invis.net> Chris Wilson wrote: > Does this seem like a reasonable plan? Does anyone have any comments, > questions or objections? Not answering counts as acceptance in my book :-) Don't forget that a Win32 service can have a console too; it's incredibly handy if you want to see what's going on, but don't want to fill the eventlog. Once you've persuaded the RTL that stdout/stderr really do have someplace to go, everything works just like a normal console app. -C From boxbackup-dev at fluffy.co.uk Fri Dec 23 22:37:15 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Fri, 23 Dec 2005 22:37:15 +0000 (GMT) Subject: [Box Backup-dev] Logging In-Reply-To: <43AC7A7D.6010701@invis.net> References: <43AC7A7D.6010701@invis.net> Message-ID: Hi Charles, > Don't forget that a Win32 service can have a console too; it's > incredibly handy if you want to see what's going on, but don't want to > fill the eventlog. Once you've persuaded the RTL that stdout/stderr > really do have someplace to go, everything works just like a normal > console app. Where can I find out more about how to persuade the RTL and how to open the console window? Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Fri Dec 23 22:57:07 2005 From: boxbackup-dev at fluffy.co.uk (Charles Lecklider) Date: Fri, 23 Dec 2005 22:57:07 +0000 Subject: [Box Backup-dev] Logging In-Reply-To: References: <43AC7A7D.6010701@invis.net> Message-ID: <43AC80C3.8050704@invis.net> Chris Wilson wrote: > Hi Charles, > >> Don't forget that a Win32 service can have a console too; it's >> incredibly handy if you want to see what's going on, but don't want to >> fill the eventlog. Once you've persuaded the RTL that stdout/stderr >> really do have someplace to go, everything works just like a normal >> console app. > > > Where can I find out more about how to persuade the RTL and how to open > the console window? http://msdn.microsoft.com/library/en-us/dllproc/base/allocconsole.asp AllocConsole gets you a new console with some handles. I have no idea how you persuade the VC RTL to use it - I've only ever done it with Watcom (and that's trivial - just call __NTConsoleOutput). -C From boxbackup-dev at fluffy.co.uk Sat Dec 24 09:52:22 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Sat, 24 Dec 2005 09:52:22 +0000 Subject: [Box Backup-dev] Logging In-Reply-To: References: Message-ID: <1135417943.17780.9.camel@avenin.ebourne.me.uk> On Fri, 2005-12-23 at 22:23 +0000, Chris Wilson wrote: > I'd like to propose replacing all three current logging methods with > something like this: > > ... > > Does this seem like a reasonable plan? Does anyone have any comments, > questions or objections? Not answering counts as acceptance in my book :-) Sounds like a great plan to me. I was going to propose something in that direction when converting from printf to streams. Maybe we could do that transition in one go. log4cxx is a good place to look if you need any further inspiration on how to do this. It does (almost?) everything you list and much more. I doubt Ben would want to use it directly because it would introduce more dependencies (it itself is dependent on boost). Cheers, Martin. From boxbackup-dev at fluffy.co.uk Sat Dec 24 13:26:32 2005 From: boxbackup-dev at fluffy.co.uk (James O'Gorman) Date: Sat, 24 Dec 2005 13:26:32 +0000 Subject: [Box Backup-dev] Trunk build failure on FreeBSD/i386 5.4 Message-ID: <43AD4C88.8090109@netinertia.co.uk> This is a multi-part message in MIME format. --------------040105050301070603010706 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi all, I just tried to build trunk on FreeBSD 5.4-RELEASE/i386 and make failed with an error - attached is the script output. I'm no C++ hacker so I'm not quite sure what's gone wrong! James --------------040105050301070603010706 Content-Type: application/octet-stream; x-mac-type="0"; x-mac-creator="0"; name="bb-trunk-build.log" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="bb-trunk-build.log" U2NyaXB0IHN0YXJ0ZWQgb24gU2F0IERlYyAyNCAxMzoyMTowMCAyMDA1ChtdMjsvZGF0YS9i YmRldi9ib3gvdHJ1bmsHDRtbbRtbMjNtG1syNG0bW0pqYW1lc0BoYXJ2ZXk6L2RhdGEvYmJk ZXYvYm94L3RydW5rJSAbW0thCGFjbG9jYWwxOSAtSSBpbmZyYXN0cnVjdHVyZS9tNA0NChtd MjsvZGF0YS9iYmRldi9ib3gvdHJ1bmsHDRtbbRtbMjNtG1syNG0bW0pqYW1lc0BoYXJ2ZXk6 L2RhdGEvYmJkZXYvYm94L3RydW5rJSAbW0thCGF1dG9oZWFkZXIyNTkNDQobXTI7L2RhdGEv YmJkZXYvYm94L3RydW5rBw0bW20bWzIzbRtbMjRtG1tKamFtZXNAaGFydmV5Oi9kYXRhL2Ji ZGV2L2JveC90cnVuayUgG1tLYQhhdXRvY29uZjI1OQ0NChtdMjsvZGF0YS9iYmRldi9ib3gv dHJ1bmsHDRtbbRtbMjNtG1syNG0bW0pqYW1lc0BoYXJ2ZXk6L2RhdGEvYmJkZXYvYm94L3Ry dW5rJSAbW0suCC4vY29uZmlndXJlDQ0KY2hlY2tpbmcgYnVpbGQgc3lzdGVtIHR5cGUuLi4g aTM4Ni11bmtub3duLWZyZWVic2Q1LjQNCmNoZWNraW5nIGhvc3Qgc3lzdGVtIHR5cGUuLi4g aTM4Ni11bmtub3duLWZyZWVic2Q1LjQNCmNoZWNraW5nIHRhcmdldCBzeXN0ZW0gdHlwZS4u LiBpMzg2LXVua25vd24tZnJlZWJzZDUuNA0KY2hlY2tpbmcgZm9yIGcrKy4uLiBnKysNCmNo ZWNraW5nIGZvciBDKysgY29tcGlsZXIgZGVmYXVsdCBvdXRwdXQgZmlsZSBuYW1lLi4uIGEu b3V0DQpjaGVja2luZyB3aGV0aGVyIHRoZSBDKysgY29tcGlsZXIgd29ya3MuLi4geWVzDQpj aGVja2luZyB3aGV0aGVyIHdlIGFyZSBjcm9zcyBjb21waWxpbmcuLi4gbm8NCmNoZWNraW5n IGZvciBzdWZmaXggb2YgZXhlY3V0YWJsZXMuLi4gDQpjaGVja2luZyBmb3Igc3VmZml4IG9m IG9iamVjdCBmaWxlcy4uLiBvDQpjaGVja2luZyB3aGV0aGVyIHdlIGFyZSB1c2luZyB0aGUg R05VIEMrKyBjb21waWxlci4uLiB5ZXMNCmNoZWNraW5nIHdoZXRoZXIgZysrIGFjY2VwdHMg LWcuLi4geWVzDQpjaGVja2luZyB3aGV0aGVyIHRoZSBjb21waWxlciBzdXBwb3J0cyBleGNl cHRpb25zLi4uIHllcw0KY2hlY2tpbmcgd2hldGhlciB0aGUgY29tcGlsZXIgaW1wbGVtZW50 cyBuYW1lc3BhY2VzLi4uIHllcw0KY2hlY2tpbmcgZm9yIGxpYnJhcnkgY29udGFpbmluZyBu YW5vc2xlZXAuLi4gbm9uZSByZXF1aXJlZA0KY2hlY2tpbmcgZm9yIHpsaWJWZXJzaW9uIGlu IC1sei4uLiB5ZXMNCmNoZWNraW5nIGhvdyB0byBydW4gdGhlIEMrKyBwcmVwcm9jZXNzb3Iu Li4gZysrIC1FDQpjaGVja2luZyBmb3IgZWdyZXAuLi4gZ3JlcCAtRQ0KY2hlY2tpbmcgZm9y IEFOU0kgQyBoZWFkZXIgZmlsZXMuLi4geWVzDQpjaGVja2luZyBmb3Igc3lzL3R5cGVzLmgu Li4geWVzDQpjaGVja2luZyBmb3Igc3lzL3N0YXQuaC4uLiB5ZXMNCmNoZWNraW5nIGZvciBz dGRsaWIuaC4uLiB5ZXMNCmNoZWNraW5nIGZvciBzdHJpbmcuaC4uLiB5ZXMNCmNoZWNraW5n IGZvciBtZW1vcnkuaC4uLiB5ZXMNCmNoZWNraW5nIGZvciBzdHJpbmdzLmguLi4geWVzDQpj aGVja2luZyBmb3IgaW50dHlwZXMuaC4uLiB5ZXMNCmNoZWNraW5nIGZvciBzdGRpbnQuaC4u LiB5ZXMNCmNoZWNraW5nIGZvciB1bmlzdGQuaC4uLiB5ZXMNCmNoZWNraW5nIGRiXzE4NS5o IHVzYWJpbGl0eS4uLiBubw0KY2hlY2tpbmcgZGJfMTg1LmggcHJlc2VuY2UuLi4gbm8NCmNo ZWNraW5nIGZvciBkYl8xODUuaC4uLiBubw0KY2hlY2tpbmcgZGI0L2RiXzE4NS5oIHVzYWJp bGl0eS4uLiBubw0KY2hlY2tpbmcgZGI0L2RiXzE4NS5oIHByZXNlbmNlLi4uIG5vDQpjaGVj a2luZyBmb3IgZGI0L2RiXzE4NS5oLi4uIG5vDQpjaGVja2luZyBkYjMvZGJfMTg1LmggdXNh YmlsaXR5Li4uIG5vDQpjaGVja2luZyBkYjMvZGJfMTg1LmggcHJlc2VuY2UuLi4gbm8NCmNo ZWNraW5nIGZvciBkYjMvZGJfMTg1LmguLi4gbm8NCmNoZWNraW5nIGRiMS9kYi5oIHVzYWJp bGl0eS4uLiBubw0KY2hlY2tpbmcgZGIxL2RiLmggcHJlc2VuY2UuLi4gbm8NCmNoZWNraW5n IGZvciBkYjEvZGIuaC4uLiBubw0KY2hlY2tpbmcgZGIuaCB1c2FiaWxpdHkuLi4geWVzDQpj aGVja2luZyBkYi5oIHByZXNlbmNlLi4uIHllcw0KY2hlY2tpbmcgZm9yIGRiLmguLi4geWVz DQpjaGVja2luZyBmb3IgbGlicmFyeSBjb250YWluaW5nIF9fZGIxODVfb3Blbi4uLiBubw0K Y2hlY2tpbmcgZm9yIGxpYnJhcnkgY29udGFpbmluZyBkYm9wZW4uLi4gbm9uZSByZXF1aXJl ZA0KY2hlY2tpbmcgd2hldGhlciBmb3VuZCBkYiBsaWJyYXJpZXMgd29yay4uLiB5ZXMNCmNo ZWNraW5nIGZvciBhIHJlYWRsaW5lIGNvbXBhdGlibGUgbGlicmFyeS4uLiBubw0KY2hlY2tp bmcgb3BlbnNzbC9zc2wuaCB1c2FiaWxpdHkuLi4geWVzDQpjaGVja2luZyBvcGVuc3NsL3Nz bC5oIHByZXNlbmNlLi4uIHllcw0KY2hlY2tpbmcgZm9yIG9wZW5zc2wvc3NsLmguLi4geWVz DQpjaGVja2luZyBmb3IgU1NMX3JlYWQgaW4gLWxzc2wuLi4geWVzDQpjaGVja2luZyBmb3Ig RVZQX0NpcGhlckluaXRfZXggaW4gLWxjcnlwdG8uLi4geWVzDQpjaGVja2luZyBmb3IgZGly ZW50LmggdGhhdCBkZWZpbmVzIERJUi4uLiB5ZXMNCmNoZWNraW5nIGZvciBsaWJyYXJ5IGNv bnRhaW5pbmcgb3BlbmRpci4uLiBub25lIHJlcXVpcmVkDQpjaGVja2luZyBmb3IgQU5TSSBD IGhlYWRlciBmaWxlcy4uLiAoY2FjaGVkKSB5ZXMNCmNoZWNraW5nIGZvciBzeXMvd2FpdC5o IHRoYXQgaXMgUE9TSVguMSBjb21wYXRpYmxlLi4uIHllcw0KY2hlY2tpbmcgZXhlY2luZm8u aCB1c2FiaWxpdHkuLi4gbm8NCmNoZWNraW5nIGV4ZWNpbmZvLmggcHJlc2VuY2UuLi4gbm8N CmNoZWNraW5nIGZvciBleGVjaW5mby5oLi4uIG5vDQpjaGVja2luZyBuZXRpbmV0L2luLmgg dXNhYmlsaXR5Li4uIHllcw0KY2hlY2tpbmcgbmV0aW5ldC9pbi5oIHByZXNlbmNlLi4uIHll cw0KY2hlY2tpbmcgZm9yIG5ldGluZXQvaW4uaC4uLiB5ZXMNCmNoZWNraW5nIHJlZ2V4Lmgg dXNhYmlsaXR5Li4uIHllcw0KY2hlY2tpbmcgcmVnZXguaCBwcmVzZW5jZS4uLiB5ZXMNCmNo ZWNraW5nIGZvciByZWdleC5oLi4uIHllcw0KY2hlY2tpbmcgZm9yIHN5cy90eXBlcy5oLi4u IChjYWNoZWQpIHllcw0KY2hlY2tpbmcgc3lzL3hhdHRyLmggdXNhYmlsaXR5Li4uIG5vDQpj aGVja2luZyBzeXMveGF0dHIuaCBwcmVzZW5jZS4uLiBubw0KY2hlY2tpbmcgZm9yIHN5cy94 YXR0ci5oLi4uIG5vDQpjaGVja2luZyBzeXMvZW5kaWFuLmggdXNhYmlsaXR5Li4uIHllcw0K Y2hlY2tpbmcgc3lzL2VuZGlhbi5oIHByZXNlbmNlLi4uIHllcw0KY2hlY2tpbmcgZm9yIHN5 cy9lbmRpYW4uaC4uLiB5ZXMNCmNoZWNraW5nIGFzbS9ieXRlb3JkZXIuaCB1c2FiaWxpdHku Li4gbm8NCmNoZWNraW5nIGFzbS9ieXRlb3JkZXIuaCBwcmVzZW5jZS4uLiBubw0KY2hlY2tp bmcgZm9yIGFzbS9ieXRlb3JkZXIuaC4uLiBubw0KY2hlY2tpbmcgZm9yIHVfaW50OF90Li4u IHllcw0KY2hlY2tpbmcgZm9yIHVfaW50MTZfdC4uLiB5ZXMNCmNoZWNraW5nIGZvciB1X2lu dDMyX3QuLi4geWVzDQpjaGVja2luZyBmb3IgdV9pbnQ2NF90Li4uIHllcw0KY2hlY2tpbmcg Zm9yIHVpbnQ4X3QuLi4geWVzDQpjaGVja2luZyBmb3IgdWludDE2X3QuLi4geWVzDQpjaGVj a2luZyBmb3IgdWludDMyX3QuLi4geWVzDQpjaGVja2luZyBmb3IgdWludDY0X3QuLi4geWVz DQpjaGVja2luZyBmb3Igc3RkYm9vbC5oIHRoYXQgY29uZm9ybXMgdG8gQzk5Li4uIG5vDQpj aGVja2luZyBmb3IgX0Jvb2wuLi4gbm8NCmNoZWNraW5nIGZvciBhbiBBTlNJIEMtY29uZm9y bWluZyBjb25zdC4uLiB5ZXMNCmNoZWNraW5nIHdoZXRoZXIgYnl0ZSBvcmRlcmluZyBpcyBi aWdlbmRpYW4uLi4gbm8NCmNoZWNraW5nIGlmIG5vbi1hbGlnbmVkIDE2IGJpdCB3b3JkIGFj Y2Vzc2VzIGZhaWwuLi4gbm8NCmNoZWNraW5nIGlmIG5vbi1hbGlnbmVkIDMyIGJpdCB3b3Jk IGFjY2Vzc2VzIGZhaWwuLi4gbm8NCmNoZWNraW5nIGlmIG5vbi1hbGlnbmVkIDY0IGJpdCB3 b3JkIGFjY2Vzc2VzIGZhaWwuLi4gbm8NCmNoZWNraW5nIGZvciB1aWRfdCBpbiBzeXMvdHlw ZXMuaC4uLiB5ZXMNCmNoZWNraW5nIGZvciBtb2RlX3QuLi4geWVzDQpjaGVja2luZyBmb3Ig b2ZmX3QuLi4geWVzDQpjaGVja2luZyBmb3IgcGlkX3QuLi4geWVzDQpjaGVja2luZyBmb3Ig c2l6ZV90Li4uIHllcw0KY2hlY2tpbmcgZm9yIHN0cnVjdCBzdGF0LnN0X2ZsYWdzLi4uIHll cw0KY2hlY2tpbmcgZm9yIHN0cnVjdCBzdGF0LnN0X210aW1lc3BlYy4uLiB5ZXMNCmNoZWNr aW5nIGZvciBzdHJ1Y3Qgc29ja2FkZHJfaW4uc2luX2xlbi4uLiB5ZXMNCmNoZWNraW5nIHdo ZXRoZXIgSU5GVElNIGlzIGRlY2xhcmVkLi4uIHllcw0KY2hlY2tpbmcgd2hldGhlciBTT19Q RUVSQ1JFRCBpcyBkZWNsYXJlZC4uLiBubw0KY2hlY2tpbmcgd2hldGhlciB0aW1lLmggYW5k IHN5cy90aW1lLmggbWF5IGJvdGggYmUgaW5jbHVkZWQuLi4geWVzDQpjaGVja2luZyB3aGV0 aGVyIHN0cnVjdCB0bSBpcyBpbiBzeXMvdGltZS5oIG9yIHRpbWUuaC4uLiB0aW1lLmgNCmNo ZWNraW5nIGZvciBzdHJ1Y3QgZGlyZW50LmRfdHlwZS4uLiB5ZXMNCmNoZWNraW5nIHdoZXRo ZXIgc3RydWN0IGRpcmVudC5kX3R5cGUgaXMgdmFsaWQuLi4geWVzDQpjaGVja2luZyBmb3Ig c3BlY2lhbCBDIGNvbXBpbGVyIG9wdGlvbnMgbmVlZGVkIGZvciBsYXJnZSBmaWxlcy4uLiBu bw0KY2hlY2tpbmcgZm9yIF9GSUxFX09GRlNFVF9CSVRTIHZhbHVlIG5lZWRlZCBmb3IgbGFy Z2UgZmlsZXMuLi4gbm8NCmNoZWNraW5nIGZvciBfTEFSR0VfRklMRVMgdmFsdWUgbmVlZGVk IGZvciBsYXJnZSBmaWxlcy4uLiBubw0KY2hlY2tpbmcgd2hldGhlciBMTE9OR19NQVggaXMg ZGVjbGFyZWQuLi4geWVzDQpjaGVja2luZyBmb3IgcHJlLXByb2Nlc3NvciBwcmFnbWEgZGVm aW5lcy4uLiBubw0KY2hlY2tpbmcgZm9yICIvZGV2L3VyYW5kb20iLi4uIHllcw0KY2hlY2tp bmcgZm9yIGdldG1udGVudC4uLiBubw0KY2hlY2tpbmcgZm9yIHN0YXRmcy4uLiB5ZXMNCmNo ZWNraW5nIGZvciBtbnRlbnQuaC4uLiBubw0KY2hlY2tpbmcgZm9yIHN5cy9tbnR0YWIuaC4u LiBubw0KY2hlY2tpbmcgZm9yIHN5cy9tb3VudC5oLi4uIG5vDQpjaGVja2luZyBmb3Igc3Ry dWN0IHN0YXRmcy5mX21udG9ubmFtZS4uLiB5ZXMNCmNoZWNraW5nIGZvciBzdHJ1Y3QgbW50 ZW50Lm1udF9kaXIuLi4gbm8NCmNoZWNraW5nIGZvciBzdHJ1Y3QgbW50dGFiLm1udF9tb3Vu dHAuLi4gbm8NCmNoZWNraW5nIGZvciBnY2MgdmVyc2lvbiAzIG9yIGxhdGVyLi4uIHllcw0K Y2hlY2tpbmcgd2hldGhlciBjbG9zZWRpciByZXR1cm5zIHZvaWQuLi4gbm8NCmNoZWNraW5n IGZvciBlcnJvcl9hdF9saW5lLi4uIG5vDQpjaGVja2luZyByZXR1cm4gdHlwZSBvZiBzaWdu YWwgaGFuZGxlcnMuLi4gdm9pZA0KY2hlY2tpbmcgd2hldGhlciBsc3RhdCBkZXJlZmVyZW5j ZXMgYSBzeW1saW5rIHNwZWNpZmllZCB3aXRoIGEgdHJhaWxpbmcgc2xhc2guLi4gbm8NCmNo ZWNraW5nIHdoZXRoZXIgc3RhdCBhY2NlcHRzIGFuIGVtcHR5IHN0cmluZy4uLiBubw0KY2hl Y2tpbmcgZm9yIGdldHBlZXJlaWQuLi4geWVzDQpjaGVja2luZyBmb3Iga3F1ZXVlLi4uIHll cw0KY2hlY2tpbmcgZm9yIGxjaG93bi4uLiB5ZXMNCmNoZWNraW5nIGZvciBzZXRwcm9jdGl0 bGUuLi4geWVzDQpjaGVja2luZyBzeXMvc3lzY2FsbC5oIHVzYWJpbGl0eS4uLiB5ZXMNCmNo ZWNraW5nIHN5cy9zeXNjYWxsLmggcHJlc2VuY2UuLi4geWVzDQpjaGVja2luZyBmb3Igc3lz L3N5c2NhbGwuaC4uLiB5ZXMNCmNoZWNraW5nIGZvciB1bmlzdGQuaC4uLiAoY2FjaGVkKSB5 ZXMNCmNoZWNraW5nIGZvciBzeXNjYWxsLi4uIHllcw0KY2hlY2tpbmcgZm9yIF9fc3lzY2Fs bC4uLiB5ZXMNCmNoZWNraW5nIHdoZXRoZXIgc3lzY2FsbCBsc2VlayByZXF1aXJlcyBkdW1t eSBwYXJhbWV0ZXIuLi4geWVzDQpjaGVja2luZyBpZiB3ZSBoYXZlIGxhcmdlIGZpbGUgc3Vw cG9ydCBlbmFibGVkLi4uIHllcw0KY2hlY2tpbmcgZm9yIGZsb2NrLi4uIHllcw0KY2hlY2tp bmcgd2hldGhlciBPX0VYTE9DSyBpcyBkZWNsYXJlZC4uLiB5ZXMNCmNoZWNraW5nIHdoZXRo ZXIgRl9TRVRMSyBpcyBkZWNsYXJlZC4uLiB5ZXMNCmNvbmZpZ3VyZTogY3JlYXRpbmcgLi9j b25maWcuc3RhdHVzDQpjb25maWcuc3RhdHVzOiBjcmVhdGluZyBpbmZyYXN0cnVjdHVyZS9C b3hQbGF0Zm9ybS5wbQ0KY29uZmlnLnN0YXR1czogY3JlYXRpbmcgbGliL2NvbW1vbi9Cb3hD b25maWcuaA0KDQpCb3ggYnVpbGQgZW52aXJvbm1lbnQgc2V0dXAuDQoNClNlZWRpbmcgYXV0 b2dlbiBjb2RlLi4uDQpNYWtpbmcgU2VydmVyIHByb3RvY29sIGNsYXNzZXMgZnJvbSB0ZXN0 cHJvdG9jb2wudHh0Li4uDQpNYWtpbmcgQ2xpZW50IHByb3RvY29sIGNsYXNzZXMgZnJvbSB0 ZXN0cHJvdG9jb2wudHh0Li4uDQpHZW5lcmF0aW5nIFJhaWRGaWxlIGV4Y2VwdGlvbi4uLg0K R2VuZXJhdGluZyBDaXBoZXIgZXhjZXB0aW9uLi4uDQpNYWtpbmcgQ2xpZW50IHByb3RvY29s IGNsYXNzZXMgZnJvbSAuLi8uLi9iaW4vYmJzdG9yZWQvYmFja3VwcHJvdG9jb2wudHh0Li4u DQpHZW5lcmF0aW5nIEJhY2t1cFN0b3JlIGV4Y2VwdGlvbi4uLg0KR2VuZXJhdGluZyBTZXJ2 ZXIgZXhjZXB0aW9uLi4uDQpHZW5lcmF0aW5nIENvbm5lY3Rpb24gZXhjZXB0aW9uLi4uDQpH ZW5lcmF0aW5nIENvbW1vbiBleGNlcHRpb24uLi4NCkdlbmVyYXRpbmcgQ29udmVyc2lvbiBl eGNlcHRpb24uLi4NCkdlbmVyYXRpbmcgQ29tcHJlc3MgZXhjZXB0aW9uLi4uDQpNYWtpbmcg U2VydmVyIHByb3RvY29sIGNsYXNzZXMgZnJvbSBiYWNrdXBwcm90b2NvbC50eHQuLi4NCkNy ZWF0aW5nIGJ1aWx0LWluIGRvY3VtZW50YXRpb24gZm9yIGJiYWNrdXBxdWVyeS4uLg0KZG9u ZQ0KDQpTY2FubmluZyBjb2RlLi4uDQpkb25lDQoNCkdlbmVyYXRpbmcgTWFrZWZpbGVzLi4u DQpsaWIvcmFpZGZpbGUNCmxpYi9jcnlwdG8NCmxpYi9zZXJ2ZXINCmxpYi93aW4zMg0KbGli L2NvbXByZXNzDQp0ZXN0L2NvbW1vbg0KdGVzdC9jcnlwdG8NCnRlc3QvY29tcHJlc3MNCnRl c3QvYmFzaWNzZXJ2ZXINCnRlc3QvcmFpZGZpbGUNCmxpYi9iYWNrdXBjbGllbnQNCmxpYi9i YWNrdXBzdG9yZQ0KYmluL2Jic3RvcmVkDQpiaW4vYmJzdG9yZWFjY291bnRzDQpiaW4vYmJh Y2t1cG9iamR1bXANCmJpbi9iYmFja3VwZA0KYmluL2JiYWNrdXBxdWVyeQ0KYmluL2JiYWNr dXBjdGwNCnRlc3QvYmFja3Vwc3RvcmUNCnRlc3QvYmFja3Vwc3RvcmVmaXgNCnRlc3QvYmFj a3Vwc3RvcmVwYXRjaA0KdGVzdC9iYWNrdXBkaWZmDQp0ZXN0L2JiYWNrdXBkDQpsaWIvY29t bW9uDQoNClR5cGUgJ2NkIDxtb2R1bGVfZGlyPjsgbWFrZScgdG8gYnVpbGQgYSBtb2R1bGUN Cg0KQSBzdW1tYXJ5IG9mIHRoZSBidWlsZCBjb25maWd1cmF0aW9uIGlzIGJlbG93LiBCb3gg QmFja3VwIHdpbGwgZnVuY3Rpb24NCndpdGhvdXQgdGhlc2UgZmVhdHVyZXMsIGJ1dCB3aWxs IHdvcmsgYmV0dGVyIHdoZXJlIHRoZXkgYXJlIHByZXNlbnQuIFJlZmVyDQp0byB0aGUgZG9j dW1lbnRhdGlvbiBmb3IgbW9yZSBpbmZvcm1hdGlvbiBvbiBlYWNoIGZlYXR1cmUuDQoNCkxh cmdlIGZpbGVzOiAgICAgICAgIHllcw0KQmVya2VsZXkgREI6ICAgICAgICAgeWVzDQpSZWFk bGluZTogICAgICAgICAgICBubw0KRXh0ZW5kZWQgYXR0cmlidXRlczogbm8NChtdMjsvZGF0 YS9iYmRldi9ib3gvdHJ1bmsHDRtbbRtbMjNtG1syNG0bW0pqYW1lc0BoYXJ2ZXk6L2RhdGEv YmJkZXYvYm94L3RydW5rJSAbW0ttCG1ha2UNDQpta2RpciBwYXJjZWxzL2JveGJhY2t1cC0w LjA5X2F1dG9jb25mX3dpbjMyLWJhY2t1cC1jbGllbnQtRnJlZUJTRA0KKGNkIGJpbi9iYmFj a3VwZDsgbWFrZSAtRCBSRUxFQVNFKQ0KKGNkIC4uLy4uL2xpYi9jb21tb247IG1ha2UgLUQg UkVMRUFTRSAtRCBOT0RFUFMpDQpnKysgLUROREVCVUcgLU8yIC1XYWxsIC1JLi4vLi4vbGli L3dpbjMyICAgLURCT1hfVkVSU0lPTj0iXCIwLjA5X2F1dG9jb25mX3dpbjMyXCIiICAtZyAt TzIgLVdhbGwgLWMgVXRpbHMuY3BwIC1vIC4uLy4uL3JlbGVhc2UvbGliL2NvbW1vbi9VdGls cy5vDQpnKysgLUROREVCVUcgLU8yIC1XYWxsIC1JLi4vLi4vbGliL3dpbjMyICAgLURCT1hf VkVSU0lPTj0iXCIwLjA5X2F1dG9jb25mX3dpbjMyXCIiICAtZyAtTzIgLVdhbGwgLWMgRXZl bnRXYXRjaEZpbGVzeXN0ZW1PYmplY3QuY3BwIC1vIC4uLy4uL3JlbGVhc2UvbGliL2NvbW1v bi9FdmVudFdhdGNoRmlsZXN5c3RlbU9iamVjdC5vDQpnKysgLUROREVCVUcgLU8yIC1XYWxs IC1JLi4vLi4vbGliL3dpbjMyICAgLURCT1hfVkVSU0lPTj0iXCIwLjA5X2F1dG9jb25mX3dp bjMyXCIiICAtZyAtTzIgLVdhbGwgLWMgUGFydGlhbFJlYWRTdHJlYW0uY3BwIC1vIC4uLy4u L3JlbGVhc2UvbGliL2NvbW1vbi9QYXJ0aWFsUmVhZFN0cmVhbS5vDQpnKysgLUROREVCVUcg LU8yIC1XYWxsIC1JLi4vLi4vbGliL3dpbjMyICAgLURCT1hfVkVSU0lPTj0iXCIwLjA5X2F1 dG9jb25mX3dpbjMyXCIiICAtZyAtTzIgLVdhbGwgLWMgTWVtQmxvY2tTdHJlYW0uY3BwIC1v IC4uLy4uL3JlbGVhc2UvbGliL2NvbW1vbi9NZW1CbG9ja1N0cmVhbS5vDQpnKysgLUROREVC VUcgLU8yIC1XYWxsIC1JLi4vLi4vbGliL3dpbjMyICAgLURCT1hfVkVSU0lPTj0iXCIwLjA5 X2F1dG9jb25mX3dpbjMyXCIiICAtZyAtTzIgLVdhbGwgLWMgRGVidWdNZW1MZWFrRmluZGVy LmNwcCAtbyAuLi8uLi9yZWxlYXNlL2xpYi9jb21tb24vRGVidWdNZW1MZWFrRmluZGVyLm8N CmcrKyAtRE5ERUJVRyAtTzIgLVdhbGwgLUkuLi8uLi9saWIvd2luMzIgICAtREJPWF9WRVJT SU9OPSJcIjAuMDlfYXV0b2NvbmZfd2luMzJcIiIgIC1nIC1PMiAtV2FsbCAtYyBCb3hFeGNl cHRpb24uY3BwIC1vIC4uLy4uL3JlbGVhc2UvbGliL2NvbW1vbi9Cb3hFeGNlcHRpb24ubw0K ZysrIC1ETkRFQlVHIC1PMiAtV2FsbCAtSS4uLy4uL2xpYi93aW4zMiAgIC1EQk9YX1ZFUlNJ T049IlwiMC4wOV9hdXRvY29uZl93aW4zMlwiIiAgLWcgLU8yIC1XYWxsIC1jIERlYnVnQXNz ZXJ0RmFpbGVkLmNwcCAtbyAuLi8uLi9yZWxlYXNlL2xpYi9jb21tb24vRGVidWdBc3NlcnRG YWlsZWQubw0KZysrIC1ETkRFQlVHIC1PMiAtV2FsbCAtSS4uLy4uL2xpYi93aW4zMiAgIC1E Qk9YX1ZFUlNJT049IlwiMC4wOV9hdXRvY29uZl93aW4zMlwiIiAgLWcgLU8yIC1XYWxsIC1j IEJveFRpbWVUb1RleHQuY3BwIC1vIC4uLy4uL3JlbGVhc2UvbGliL2NvbW1vbi9Cb3hUaW1l VG9UZXh0Lm8NCmcrKyAtRE5ERUJVRyAtTzIgLVdhbGwgLUkuLi8uLi9saWIvd2luMzIgICAt REJPWF9WRVJTSU9OPSJcIjAuMDlfYXV0b2NvbmZfd2luMzJcIiIgIC1nIC1PMiAtV2FsbCAt YyBSZWFkR2F0aGVyU3RyZWFtLmNwcCAtbyAuLi8uLi9yZWxlYXNlL2xpYi9jb21tb24vUmVh ZEdhdGhlclN0cmVhbS5vDQpnKysgLUROREVCVUcgLU8yIC1XYWxsIC1JLi4vLi4vbGliL3dp bjMyICAgLURCT1hfVkVSU0lPTj0iXCIwLjA5X2F1dG9jb25mX3dpbjMyXCIiICAtZyAtTzIg LVdhbGwgLWMgSU9TdHJlYW0uY3BwIC1vIC4uLy4uL3JlbGVhc2UvbGliL2NvbW1vbi9JT1N0 cmVhbS5vDQpnKysgLUROREVCVUcgLU8yIC1XYWxsIC1JLi4vLi4vbGliL3dpbjMyICAgLURC T1hfVkVSU0lPTj0iXCIwLjA5X2F1dG9jb25mX3dpbjMyXCIiICAtZyAtTzIgLVdhbGwgLWMg SU9TdHJlYW1HZXRMaW5lLmNwcCAtbyAuLi8uLi9yZWxlYXNlL2xpYi9jb21tb24vSU9TdHJl YW1HZXRMaW5lLm8NCmcrKyAtRE5ERUJVRyAtTzIgLVdhbGwgLUkuLi8uLi9saWIvd2luMzIg ICAtREJPWF9WRVJTSU9OPSJcIjAuMDlfYXV0b2NvbmZfd2luMzJcIiIgIC1nIC1PMiAtV2Fs bCAtYyBGaWxlU3RyZWFtLmNwcCAtbyAuLi8uLi9yZWxlYXNlL2xpYi9jb21tb24vRmlsZVN0 cmVhbS5vDQpnKysgLUROREVCVUcgLU8yIC1XYWxsIC1JLi4vLi4vbGliL3dpbjMyICAgLURC T1hfVkVSU0lPTj0iXCIwLjA5X2F1dG9jb25mX3dpbjMyXCIiICAtZyAtTzIgLVdhbGwgLWMg RmRHZXRMaW5lLmNwcCAtbyAuLi8uLi9yZWxlYXNlL2xpYi9jb21tb24vRmRHZXRMaW5lLm8N CmcrKyAtRE5ERUJVRyAtTzIgLVdhbGwgLUkuLi8uLi9saWIvd2luMzIgICAtREJPWF9WRVJT SU9OPSJcIjAuMDlfYXV0b2NvbmZfd2luMzJcIiIgIC1nIC1PMiAtV2FsbCAtYyBDb25maWd1 cmF0aW9uLmNwcCAtbyAuLi8uLi9yZWxlYXNlL2xpYi9jb21tb24vQ29uZmlndXJhdGlvbi5v DQpnKysgLUROREVCVUcgLU8yIC1XYWxsIC1JLi4vLi4vbGliL3dpbjMyICAgLURCT1hfVkVS U0lPTj0iXCIwLjA5X2F1dG9jb25mX3dpbjMyXCIiICAtZyAtTzIgLVdhbGwgLWMgQm94VGlt ZS5jcHAgLW8gLi4vLi4vcmVsZWFzZS9saWIvY29tbW9uL0JveFRpbWUubw0KZysrIC1ETkRF QlVHIC1PMiAtV2FsbCAtSS4uLy4uL2xpYi93aW4zMiAgIC1EQk9YX1ZFUlNJT049IlwiMC4w OV9hdXRvY29uZl93aW4zMlwiIiAgLWcgLU8yIC1XYWxsIC1jIERlYnVnUHJpbnRmLmNwcCAt byAuLi8uLi9yZWxlYXNlL2xpYi9jb21tb24vRGVidWdQcmludGYubw0KZysrIC1ETkRFQlVH IC1PMiAtV2FsbCAtSS4uLy4uL2xpYi93aW4zMiAgIC1EQk9YX1ZFUlNJT049IlwiMC4wOV9h dXRvY29uZl93aW4zMlwiIiAgLWcgLU8yIC1XYWxsIC1jIENvbnZlcnNpb25TdHJpbmcuY3Bw IC1vIC4uLy4uL3JlbGVhc2UvbGliL2NvbW1vbi9Db252ZXJzaW9uU3RyaW5nLm8NCmcrKyAt RE5ERUJVRyAtTzIgLVdhbGwgLUkuLi8uLi9saWIvd2luMzIgICAtREJPWF9WRVJTSU9OPSJc IjAuMDlfYXV0b2NvbmZfd2luMzJcIiIgIC1nIC1PMiAtV2FsbCAtYyBFeGNsdWRlTGlzdC5j cHAgLW8gLi4vLi4vcmVsZWFzZS9saWIvY29tbW9uL0V4Y2x1ZGVMaXN0Lm8NCmcrKyAtRE5E RUJVRyAtTzIgLVdhbGwgLUkuLi8uLi9saWIvd2luMzIgICAtREJPWF9WRVJTSU9OPSJcIjAu MDlfYXV0b2NvbmZfd2luMzJcIiIgIC1nIC1PMiAtV2FsbCAtYyBXYWl0Rm9yRXZlbnQuY3Bw IC1vIC4uLy4uL3JlbGVhc2UvbGliL2NvbW1vbi9XYWl0Rm9yRXZlbnQubw0KZysrIC1ETkRF QlVHIC1PMiAtV2FsbCAtSS4uLy4uL2xpYi93aW4zMiAgIC1EQk9YX1ZFUlNJT049IlwiMC4w OV9hdXRvY29uZl93aW4zMlwiIiAgLWcgLU8yIC1XYWxsIC1jIFVuaXhVc2VyLmNwcCAtbyAu Li8uLi9yZWxlYXNlL2xpYi9jb21tb24vVW5peFVzZXIubw0KZysrIC1ETkRFQlVHIC1PMiAt V2FsbCAtSS4uLy4uL2xpYi93aW4zMiAgIC1EQk9YX1ZFUlNJT049IlwiMC4wOV9hdXRvY29u Zl93aW4zMlwiIiAgLWcgLU8yIC1XYWxsIC1jIENvbGxlY3RJbkJ1ZmZlclN0cmVhbS5jcHAg LW8gLi4vLi4vcmVsZWFzZS9saWIvY29tbW9uL0NvbGxlY3RJbkJ1ZmZlclN0cmVhbS5vDQpn KysgLUROREVCVUcgLU8yIC1XYWxsIC1JLi4vLi4vbGliL3dpbjMyICAgLURCT1hfVkVSU0lP Tj0iXCIwLjA5X2F1dG9jb25mX3dpbjMyXCIiICAtZyAtTzIgLVdhbGwgLWMgU3RyZWFtYWJs ZU1lbUJsb2NrLmNwcCAtbyAuLi8uLi9yZWxlYXNlL2xpYi9jb21tb24vU3RyZWFtYWJsZU1l bUJsb2NrLm8NCmcrKyAtRE5ERUJVRyAtTzIgLVdhbGwgLUkuLi8uLi9saWIvd2luMzIgICAt REJPWF9WRVJTSU9OPSJcIjAuMDlfYXV0b2NvbmZfd2luMzJcIiIgIC1nIC1PMiAtV2FsbCAt YyBOYW1lZExvY2suY3BwIC1vIC4uLy4uL3JlbGVhc2UvbGliL2NvbW1vbi9OYW1lZExvY2su bw0KZysrIC1ETkRFQlVHIC1PMiAtV2FsbCAtSS4uLy4uL2xpYi93aW4zMiAgIC1EQk9YX1ZF UlNJT049IlwiMC4wOV9hdXRvY29uZl93aW4zMlwiIiAgLWcgLU8yIC1XYWxsIC1jIGF1dG9n ZW5fQ29tbW9uRXhjZXB0aW9uLmNwcCAtbyAuLi8uLi9yZWxlYXNlL2xpYi9jb21tb24vYXV0 b2dlbl9Db21tb25FeGNlcHRpb24ubw0KZysrIC1ETkRFQlVHIC1PMiAtV2FsbCAtSS4uLy4u L2xpYi93aW4zMiAgIC1EQk9YX1ZFUlNJT049IlwiMC4wOV9hdXRvY29uZl93aW4zMlwiIiAg LWcgLU8yIC1XYWxsIC1jIGF1dG9nZW5fQ29udmVyc2lvbkV4Y2VwdGlvbi5jcHAgLW8gLi4v Li4vcmVsZWFzZS9saWIvY29tbW9uL2F1dG9nZW5fQ29udmVyc2lvbkV4Y2VwdGlvbi5vDQoo ZWNobyAtbiA+IC4uLy4uL3JlbGVhc2UvbGliL2NvbW1vbi9jb21tb24uYTsgcm0gLi4vLi4v cmVsZWFzZS9saWIvY29tbW9uL2NvbW1vbi5hKQ0KYXIgLXEgLi4vLi4vcmVsZWFzZS9saWIv Y29tbW9uL2NvbW1vbi5hIC4uLy4uL3JlbGVhc2UvbGliL2NvbW1vbi9VdGlscy5vIC4uLy4u L3JlbGVhc2UvbGliL2NvbW1vbi9FdmVudFdhdGNoRmlsZXN5c3RlbU9iamVjdC5vIC4uLy4u L3JlbGVhc2UvbGliL2NvbW1vbi9QYXJ0aWFsUmVhZFN0cmVhbS5vIC4uLy4uL3JlbGVhc2Uv bGliL2NvbW1vbi9NZW1CbG9ja1N0cmVhbS5vIC4uLy4uL3JlbGVhc2UvbGliL2NvbW1vbi9E ZWJ1Z01lbUxlYWtGaW5kZXIubyAuLi8uLi9yZWxlYXNlL2xpYi9jb21tb24vQm94RXhjZXB0 aW9uLm8gLi4vLi4vcmVsZWFzZS9saWIvY29tbW9uL0RlYnVnQXNzZXJ0RmFpbGVkLm8gLi4v Li4vcmVsZWFzZS9saWIvY29tbW9uL0JveFRpbWVUb1RleHQubyAuLi8uLi9yZWxlYXNlL2xp Yi9jb21tb24vUmVhZEdhdGhlclN0cmVhbS5vIC4uLy4uL3JlbGVhc2UvbGliL2NvbW1vbi9J T1N0cmVhbS5vIC4uLy4uL3JlbGVhc2UvbGliL2NvbW1vbi9JT1N0cmVhbUdldExpbmUubyAu Li8uLi9yZWxlYXNlL2xpYi9jb21tb24vRmlsZVN0cmVhbS5vIC4uLy4uL3JlbGVhc2UvbGli L2NvbW1vbi9GZEdldExpbmUubyAuLi8uLi9yZWxlYXNlL2xpYi9jb21tb24vQ29uZmlndXJh dGlvbi5vIC4uLy4uL3JlbGVhc2UvbGliL2NvbW1vbi9Cb3hUaW1lLm8gLi4vLi4vcmVsZWFz ZS9saWIvY29tbW9uL0RlYnVnUHJpbnRmLm8gLi4vLi4vcmVsZWFzZS9saWIvY29tbW9uL0Nv bnZlcnNpb25TdHJpbmcubyAuLi8uLi9yZWxlYXNlL2xpYi9jb21tb24vRXhjbHVkZUxpc3Qu byAuLi8uLi9yZWxlYXNlL2xpYi9jb21tb24vV2FpdEZvckV2ZW50Lm8gLi4vLi4vcmVsZWFz ZS9saWIvY29tbW9uL1VuaXhVc2VyLm8gLi4vLi4vcmVsZWFzZS9saWIvY29tbW9uL0NvbGxl Y3RJbkJ1ZmZlclN0cmVhbS5vIC4uLy4uL3JlbGVhc2UvbGliL2NvbW1vbi9TdHJlYW1hYmxl TWVtQmxvY2subyAuLi8uLi9yZWxlYXNlL2xpYi9jb21tb24vTmFtZWRMb2NrLm8gLi4vLi4v cmVsZWFzZS9saWIvY29tbW9uL2F1dG9nZW5fQ29tbW9uRXhjZXB0aW9uLm8gLi4vLi4vcmVs ZWFzZS9saWIvY29tbW9uL2F1dG9nZW5fQ29udmVyc2lvbkV4Y2VwdGlvbi5vDQphcjogY3Jl YXRpbmcgLi4vLi4vcmVsZWFzZS9saWIvY29tbW9uL2NvbW1vbi5hDQpyYW5saWIgLi4vLi4v cmVsZWFzZS9saWIvY29tbW9uL2NvbW1vbi5hDQooY2QgLi4vLi4vbGliL3NlcnZlcjsgbWFr ZSAtRCBSRUxFQVNFIC1EIE5PREVQUykNCmcrKyAtRE5ERUJVRyAtTzIgLVdhbGwgLUkuLi8u Li9saWIvd2luMzIgLUkuLi8uLi9saWIvY29tbW9uICAtREJPWF9WRVJTSU9OPSJcIjAuMDlf YXV0b2NvbmZfd2luMzJcIiIgIC1nIC1PMiAtV2FsbCAtYyBQcm90b2NvbC5jcHAgLW8gLi4v Li4vcmVsZWFzZS9saWIvc2VydmVyL1Byb3RvY29sLm8NClByb3RvY29sLmNwcDogSW4gbWVt YmVyIGZ1bmN0aW9uIGB2b2lkIFByb3RvY29sOjpSZWFkKGludDY0X3QmKSc6DQpQcm90b2Nv bC5jcHA6NDMyOiBlcnJvcjogYGJldG9oNjQnIHVuZGVjbGFyZWQgKGZpcnN0IHVzZSB0aGlz IGZ1bmN0aW9uKQ0KUHJvdG9jb2wuY3BwOjQzMjogZXJyb3I6IChFYWNoIHVuZGVjbGFyZWQg aWRlbnRpZmllciBpcyByZXBvcnRlZCBvbmx5IG9uY2UgZm9yIGVhY2ggZnVuY3Rpb24gaXQg YXBwZWFycyBpbi4pDQoqKiogRXJyb3IgY29kZSAxDQoNClN0b3AgaW4gL2RhdGEvYmJkZXYv Ym94L3RydW5rL2xpYi9zZXJ2ZXIuDQoqKiogRXJyb3IgY29kZSAxDQoNClN0b3AuDQoqKiog RXJyb3IgY29kZSAxDQoNClN0b3AgaW4gL2RhdGEvYmJkZXYvYm94L3RydW5rLg0KG10yOy9k YXRhL2JiZGV2L2JveC90cnVuawcNG1ttG1syM20bWzI0bRtbSmphbWVzQGhhcnZleTovZGF0 YS9iYmRldi9ib3gvdHJ1bmslIBtbSw0NCgpTY3JpcHQgZG9uZSBvbiBTYXQgRGVjIDI0IDEz OjIyOjA4IDIwMDUK --------------040105050301070603010706-- From boxbackup-dev at fluffy.co.uk Sat Dec 24 15:28:45 2005 From: boxbackup-dev at fluffy.co.uk (James O'Gorman) Date: Sat, 24 Dec 2005 15:28:45 +0000 Subject: [Box Backup-dev] Building in readline support Message-ID: <43AD692D.8010009@netinertia.co.uk> Hi all, I noticed from the new build system that GNU readline support can be compiled in by running ./configure --enable-gnu-readline But that this says not to include this in binary packages. I'm just after some advice on how to handle this for the FreeBSD port. I could disable it by default and add a knob that says WITH_READLINE - this in turn could then disable the ability to create a binary package (using NO_PACKAGE, or RESTRICTED, or something like that). Thoughts, anyone? James From boxbackup-dev at fluffy.co.uk Sat Dec 24 23:00:10 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Sat, 24 Dec 2005 23:00:10 +0000 Subject: [Box Backup-dev] Trunk build failure on FreeBSD/i386 5.4 In-Reply-To: <43AD4C88.8090109@netinertia.co.uk> References: <43AD4C88.8090109@netinertia.co.uk> Message-ID: <20051224230010.rosnvgom5cgo4gkg@ebourne.me.uk> James O'Gorman wrote: > Hi all, > > I just tried to build trunk on FreeBSD 5.4-RELEASE/i386 and make > failed with an error - attached is the script output. I'm no C++ > hacker so I'm not quite sure what's gone wrong! You have sys/endian.h but it does not define the 64 bit endian swapping functions htobe64() and betoh64(). Could you have a look and see if there are any 64 bit byte swapping functions, and if so where they are please? Cheers, Martin. From boxbackup-dev at fluffy.co.uk Sat Dec 24 23:08:08 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Sat, 24 Dec 2005 23:08:08 +0000 Subject: [Box Backup-dev] Building in readline support In-Reply-To: <43AD692D.8010009@netinertia.co.uk> References: <43AD692D.8010009@netinertia.co.uk> Message-ID: <20051224230808.x0oyb3y1w0kko0s4@ebourne.me.uk> James O'Gorman wrote: > I noticed from the new build system that GNU readline support can be > compiled in by running > > ./configure --enable-gnu-readline > > But that this says not to include this in binary packages. I'm just > after some advice on how to handle this for the FreeBSD port. I could > disable it by default and add a knob that says WITH_READLINE - this > in turn could then disable the ability to create a binary package > (using NO_PACKAGE, or RESTRICTED, or something like that). If you're on bsd I would expect you've got libedit or libeditline available. These should be drop in replacements for readline (but without the licensing problems) and the build system should automatically pick them up. If it doesn't then send the config.log output. Happy Christmas all! Martin. From boxbackup-dev at fluffy.co.uk Sat Dec 24 23:19:15 2005 From: boxbackup-dev at fluffy.co.uk (James O'Gorman) Date: Sat, 24 Dec 2005 23:19:15 +0000 Subject: [Box Backup-dev] Trunk build failure on FreeBSD/i386 5.4 In-Reply-To: <20051224230010.rosnvgom5cgo4gkg@ebourne.me.uk> References: <43AD4C88.8090109@netinertia.co.uk> <20051224230010.rosnvgom5cgo4gkg@ebourne.me.uk> Message-ID: <43ADD773.9060104@netinertia.co.uk> Hi Martin, On 24/12/05 23:00, Martin Ebourne wrote: > You have sys/endian.h but it does not define the 64 bit endian swapping > functions htobe64() and betoh64(). Could you have a look and see if > there are any 64 bit byte swapping functions, and if so where they are > please? Somewhat annoyingly, the function seems to be called be64toh(). Has Protocol.cpp changed since the 0.09 release? This used to compile fine, so I'm guessing the #ifdefs that were added in trunk have changed something? James From boxbackup-dev at fluffy.co.uk Sat Dec 24 23:22:37 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Sat, 24 Dec 2005 23:22:37 +0000 Subject: [Box Backup-dev] NDEBUG in Win32 release (was: COMMIT r279 - box/chris/win32/vc2005-compile-fixes/lib/backupclient) In-Reply-To: References: <20051222230804.17ED394@s0g0.pems.testserver.co.uk> Message-ID: On 23 Dec 2005, at 11:30, Chris Wilson wrote: > Hi Ben, > >> [snip] >>> +#ifndef WIN32 >>> TRACE2("Reallocating EncodingBuffer from %d to %d\n", >>> mBufferSize, NewSize); >>> +#endif >> [snip] >> >> Set NDEBUG as a preprocessor definition in your release build >> settings, and all the trace statements will not be compiled in. >> It'll also remove some code which really shouldn't be in a release >> build. > > I considered that, but I _really_ want exception logging with > source files and line numbers in these builds. Unless I hack about > with Box.h, the only way to get them seems to be compiling without - > NDEBUG. Doesn't that imply that you should be running a debug build instead? > > What's the extra code, assertions and memory leak checks? > Assertions I'm quite happy to keep, and memory leak checks don't > bother me too much unless they have a huge performance impact or > are likely to crash Box in different ways. The memory leak code is nasty and invasive, and won't necessarily give the right answers anyway. There's an argument for leaving assertions in, but the style I've tried to follow is that an ASSERT will catch the error just before it's defensively coded anyway, so it shouldn't cause a major problem. Users should not be running code compiled without NDEBUG, and if it's desirable to keep in code which defining it removes, we should be looking at changing the mechanism. Ben From boxbackup-dev at fluffy.co.uk Sat Dec 24 23:25:16 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Sat, 24 Dec 2005 23:25:16 +0000 Subject: [Box Backup-dev] Win32 port In-Reply-To: References: <2BC5083F-C0C3-420C-9331-CAEAB3DA8729@fluffy.co.uk> Message-ID: On 23 Dec 2005, at 13:50, Chris Wilson wrote: > Hi Ben, > >> I'll try and review all the changes you made soon. I'm still a bit >> dubious about the type changes, and the impact it might have on >> the POSIX side. I trust you've tried to compile it on a POSIX box? > > I'm a bit dubious about the type changes too - I had to revert one > of them because it needed to store a negative integer (in > FdGetLine). Feel free to ignore them for now, and just apply the > other changes. > > I think the typecasts are OK - they're just making the implicit > casts explicit to keep VC happy. It might be worth reviewing the > code around them to see whether the assumptions about sizes and > signedness are justified or should be made explicit with assertions > or other checks. I think it's worth reviewing the code. It really should be happy on all 'sane' compilers, and these could be bugs. On the other hand, it could just be making the code far more ugly. Ben From boxbackup-dev at fluffy.co.uk Sat Dec 24 23:30:04 2005 From: boxbackup-dev at fluffy.co.uk (James O'Gorman) Date: Sat, 24 Dec 2005 23:30:04 +0000 Subject: [Box Backup-dev] Building in readline support In-Reply-To: <20051224230808.x0oyb3y1w0kko0s4@ebourne.me.uk> References: <43AD692D.8010009@netinertia.co.uk> <20051224230808.x0oyb3y1w0kko0s4@ebourne.me.uk> Message-ID: <43ADD9FC.6080502@netinertia.co.uk> This is a multi-part message in MIME format. --------------070206070106050300080802 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 24/12/05 23:08, Martin Ebourne wrote: > If you're on bsd I would expect you've got libedit or libeditline > available. These should be drop in replacements for readline (but > without the licensing problems) and the build system should > automatically pick them up. If it doesn't then send the config.log output. There does seem to be a libedit, yes. Not quite sure if it was detected, though. I've attached the config.log. > Happy Christmas all! And to you too :-) James --------------070206070106050300080802 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="config.log" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="config.log" This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by Box Backup configure 0.09, which was generated by GNU Autoconf 2.59. Invocation command line was $ ./configure ## --------- ## ## Platform. ## ## --------- ## hostname = starbug.netinertia.co.uk uname -m = i386 uname -r = 6.0-RELEASE uname -s = FreeBSD uname -v = FreeBSD 6.0-RELEASE #0: Mon Nov 7 23:03:59 GMT 2005 root at starbug.netinertia.co.uk:/usr/obj/usr/src/sys/STARBUG /usr/bin/uname -p = i386 /bin/uname -X = unknown /bin/arch = unknown /usr/bin/arch -k = unknown /usr/convex/getsysinfo = unknown hostinfo = unknown /bin/machine = unknown /usr/bin/oslevel = unknown /bin/universe = unknown PATH: /sbin PATH: /bin PATH: /usr/sbin PATH: /usr/bin PATH: /usr/games PATH: /usr/local/sbin PATH: /usr/local/bin PATH: /usr/X11R6/bin PATH: /home/jamesog/bin ## ----------- ## ## Core tests. ## ## ----------- ## configure:1361: checking build system type configure:1379: result: i386-unknown-freebsd6.0 configure:1387: checking host system type configure:1401: result: i386-unknown-freebsd6.0 configure:1409: checking target system type configure:1423: result: i386-unknown-freebsd6.0 configure:1499: checking for g++ configure:1515: found /usr/bin/g++ configure:1525: result: g++ configure:1541: checking for C++ compiler version configure:1544: g++ --version &5 g++ (GCC) 3.4.4 [FreeBSD] 20050518 Copyright (C) 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. configure:1547: $? = 0 configure:1549: g++ -v &5 Using built-in specs. Configured with: FreeBSD/i386 system compiler Thread model: posix gcc version 3.4.4 [FreeBSD] 20050518 configure:1552: $? = 0 configure:1554: g++ -V &5 g++: `-V' option must have argument configure:1557: $? = 1 configure:1580: checking for C++ compiler default output file name configure:1583: g++ conftest.cc >&5 configure:1586: $? = 0 configure:1632: result: a.out configure:1637: checking whether the C++ compiler works configure:1643: ./a.out configure:1646: $? = 0 configure:1663: result: yes configure:1670: checking whether we are cross compiling configure:1672: result: no configure:1675: checking for suffix of executables configure:1677: g++ -o conftest conftest.cc >&5 configure:1680: $? = 0 configure:1705: result: configure:1711: checking for suffix of object files configure:1732: g++ -c conftest.cc >&5 configure:1735: $? = 0 configure:1757: result: o configure:1761: checking whether we are using the GNU C++ compiler configure:1785: g++ -c conftest.cc >&5 configure:1791: $? = 0 configure:1795: test -z || test ! -s conftest.err configure:1798: $? = 0 configure:1801: test -s conftest.o configure:1804: $? = 0 configure:1817: result: yes configure:1823: checking whether g++ accepts -g configure:1844: g++ -c -g conftest.cc >&5 configure:1850: $? = 0 configure:1854: test -z || test ! -s conftest.err configure:1857: $? = 0 configure:1860: test -s conftest.o configure:1863: $? = 0 configure:1874: result: yes configure:1916: g++ -c -g -O2 conftest.cc >&5 configure:1922: $? = 0 configure:1926: test -z || test ! -s conftest.err configure:1929: $? = 0 configure:1932: test -s conftest.o configure:1935: $? = 0 configure:1961: g++ -c -g -O2 conftest.cc >&5 conftest.cc: In function `int main()': conftest.cc:13: error: `exit' undeclared (first use this function) conftest.cc:13: error: (Each undeclared identifier is reported only once for each function it appears in.) configure:1967: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | /* end confdefs.h. */ | | int | main () | { | exit (42); | ; | return 0; | } configure:1916: g++ -c -g -O2 conftest.cc >&5 configure:1922: $? = 0 configure:1926: test -z || test ! -s conftest.err configure:1929: $? = 0 configure:1932: test -s conftest.o configure:1935: $? = 0 configure:1961: g++ -c -g -O2 conftest.cc >&5 configure:1967: $? = 0 configure:1971: test -z || test ! -s conftest.err configure:1974: $? = 0 configure:1977: test -s conftest.o configure:1980: $? = 0 configure:2004: checking whether the compiler supports exceptions configure:2033: g++ -c -g -O2 conftest.cc >&5 configure:2039: $? = 0 configure:2043: test -z || test ! -s conftest.err configure:2046: $? = 0 configure:2049: test -s conftest.o configure:2052: $? = 0 configure:2070: result: yes configure:2080: checking whether the compiler implements namespaces configure:2109: g++ -c -g -O2 conftest.cc >&5 configure:2115: $? = 0 configure:2119: test -z || test ! -s conftest.err configure:2122: $? = 0 configure:2125: test -s conftest.o configure:2128: $? = 0 configure:2146: result: yes configure:2175: checking for library containing nanosleep configure:2205: g++ -o conftest -g -O2 conftest.cc >&5 configure:2211: $? = 0 configure:2215: test -z || test ! -s conftest.err configure:2218: $? = 0 configure:2221: test -s conftest configure:2224: $? = 0 configure:2294: result: none required configure:2307: checking for zlibVersion in -lz configure:2337: g++ -o conftest -g -O2 conftest.cc -lz >&5 configure:2343: $? = 0 configure:2347: test -z || test ! -s conftest.err configure:2350: $? = 0 configure:2353: test -s conftest configure:2356: $? = 0 configure:2369: result: yes configure:2389: checking how to run the C++ preprocessor configure:2420: g++ -E conftest.cc configure:2426: $? = 0 configure:2458: g++ -E conftest.cc conftest.cc:15:28: ac_nonexistent.h: No such file or directory configure:2464: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | /* end confdefs.h. */ | #include configure:2503: result: g++ -E configure:2527: g++ -E conftest.cc configure:2533: $? = 0 configure:2565: g++ -E conftest.cc conftest.cc:15:28: ac_nonexistent.h: No such file or directory configure:2571: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | /* end confdefs.h. */ | #include configure:2615: checking for egrep configure:2625: result: grep -E configure:2630: checking for ANSI C header files configure:2655: g++ -c -g -O2 conftest.cc >&5 configure:2661: $? = 0 configure:2665: test -z || test ! -s conftest.err configure:2668: $? = 0 configure:2671: test -s conftest.o configure:2674: $? = 0 configure:2763: g++ -o conftest -g -O2 conftest.cc -lz >&5 configure:2766: $? = 0 configure:2768: ./conftest configure:2771: $? = 0 configure:2786: result: yes configure:2810: checking for sys/types.h configure:2826: g++ -c -g -O2 conftest.cc >&5 configure:2832: $? = 0 configure:2836: test -z || test ! -s conftest.err configure:2839: $? = 0 configure:2842: test -s conftest.o configure:2845: $? = 0 configure:2856: result: yes configure:2810: checking for sys/stat.h configure:2826: g++ -c -g -O2 conftest.cc >&5 configure:2832: $? = 0 configure:2836: test -z || test ! -s conftest.err configure:2839: $? = 0 configure:2842: test -s conftest.o configure:2845: $? = 0 configure:2856: result: yes configure:2810: checking for stdlib.h configure:2826: g++ -c -g -O2 conftest.cc >&5 configure:2832: $? = 0 configure:2836: test -z || test ! -s conftest.err configure:2839: $? = 0 configure:2842: test -s conftest.o configure:2845: $? = 0 configure:2856: result: yes configure:2810: checking for string.h configure:2826: g++ -c -g -O2 conftest.cc >&5 configure:2832: $? = 0 configure:2836: test -z || test ! -s conftest.err configure:2839: $? = 0 configure:2842: test -s conftest.o configure:2845: $? = 0 configure:2856: result: yes configure:2810: checking for memory.h configure:2826: g++ -c -g -O2 conftest.cc >&5 configure:2832: $? = 0 configure:2836: test -z || test ! -s conftest.err configure:2839: $? = 0 configure:2842: test -s conftest.o configure:2845: $? = 0 configure:2856: result: yes configure:2810: checking for strings.h configure:2826: g++ -c -g -O2 conftest.cc >&5 configure:2832: $? = 0 configure:2836: test -z || test ! -s conftest.err configure:2839: $? = 0 configure:2842: test -s conftest.o configure:2845: $? = 0 configure:2856: result: yes configure:2810: checking for inttypes.h configure:2826: g++ -c -g -O2 conftest.cc >&5 configure:2832: $? = 0 configure:2836: test -z || test ! -s conftest.err configure:2839: $? = 0 configure:2842: test -s conftest.o configure:2845: $? = 0 configure:2856: result: yes configure:2810: checking for stdint.h configure:2826: g++ -c -g -O2 conftest.cc >&5 configure:2832: $? = 0 configure:2836: test -z || test ! -s conftest.err configure:2839: $? = 0 configure:2842: test -s conftest.o configure:2845: $? = 0 configure:2856: result: yes configure:2810: checking for unistd.h configure:2826: g++ -c -g -O2 conftest.cc >&5 configure:2832: $? = 0 configure:2836: test -z || test ! -s conftest.err configure:2839: $? = 0 configure:2842: test -s conftest.o configure:2845: $? = 0 configure:2856: result: yes configure:2888: checking db_185.h usability configure:2900: g++ -c -g -O2 conftest.cc >&5 conftest.cc:59:20: db_185.h: No such file or directory configure:2906: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | /* end confdefs.h. */ | #include | #if HAVE_SYS_TYPES_H | # include | #endif | #if HAVE_SYS_STAT_H | # include | #endif | #if STDC_HEADERS | # include | # include | #else | # if HAVE_STDLIB_H | # include | # endif | #endif | #if HAVE_STRING_H | # if !STDC_HEADERS && HAVE_MEMORY_H | # include | # endif | # include | #endif | #if HAVE_STRINGS_H | # include | #endif | #if HAVE_INTTYPES_H | # include | #else | # if HAVE_STDINT_H | # include | # endif | #endif | #if HAVE_UNISTD_H | # include | #endif | #include configure:2929: result: no configure:2933: checking db_185.h presence configure:2943: g++ -E conftest.cc conftest.cc:25:20: db_185.h: No such file or directory configure:2949: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | /* end confdefs.h. */ | #include configure:2969: result: no configure:3004: checking for db_185.h configure:3011: result: no configure:2888: checking db4/db_185.h usability configure:2900: g++ -c -g -O2 conftest.cc >&5 conftest.cc:59:24: db4/db_185.h: No such file or directory configure:2906: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | /* end confdefs.h. */ | #include | #if HAVE_SYS_TYPES_H | # include | #endif | #if HAVE_SYS_STAT_H | # include | #endif | #if STDC_HEADERS | # include | # include | #else | # if HAVE_STDLIB_H | # include | # endif | #endif | #if HAVE_STRING_H | # if !STDC_HEADERS && HAVE_MEMORY_H | # include | # endif | # include | #endif | #if HAVE_STRINGS_H | # include | #endif | #if HAVE_INTTYPES_H | # include | #else | # if HAVE_STDINT_H | # include | # endif | #endif | #if HAVE_UNISTD_H | # include | #endif | #include configure:2929: result: no configure:2933: checking db4/db_185.h presence configure:2943: g++ -E conftest.cc conftest.cc:25:24: db4/db_185.h: No such file or directory configure:2949: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | /* end confdefs.h. */ | #include configure:2969: result: no configure:3004: checking for db4/db_185.h configure:3011: result: no configure:2888: checking db3/db_185.h usability configure:2900: g++ -c -g -O2 conftest.cc >&5 conftest.cc:59:24: db3/db_185.h: No such file or directory configure:2906: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | /* end confdefs.h. */ | #include | #if HAVE_SYS_TYPES_H | # include | #endif | #if HAVE_SYS_STAT_H | # include | #endif | #if STDC_HEADERS | # include | # include | #else | # if HAVE_STDLIB_H | # include | # endif | #endif | #if HAVE_STRING_H | # if !STDC_HEADERS && HAVE_MEMORY_H | # include | # endif | # include | #endif | #if HAVE_STRINGS_H | # include | #endif | #if HAVE_INTTYPES_H | # include | #else | # if HAVE_STDINT_H | # include | # endif | #endif | #if HAVE_UNISTD_H | # include | #endif | #include configure:2929: result: no configure:2933: checking db3/db_185.h presence configure:2943: g++ -E conftest.cc conftest.cc:25:24: db3/db_185.h: No such file or directory configure:2949: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | /* end confdefs.h. */ | #include configure:2969: result: no configure:3004: checking for db3/db_185.h configure:3011: result: no configure:2888: checking db1/db.h usability configure:2900: g++ -c -g -O2 conftest.cc >&5 conftest.cc:59:20: db1/db.h: No such file or directory configure:2906: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | /* end confdefs.h. */ | #include | #if HAVE_SYS_TYPES_H | # include | #endif | #if HAVE_SYS_STAT_H | # include | #endif | #if STDC_HEADERS | # include | # include | #else | # if HAVE_STDLIB_H | # include | # endif | #endif | #if HAVE_STRING_H | # if !STDC_HEADERS && HAVE_MEMORY_H | # include | # endif | # include | #endif | #if HAVE_STRINGS_H | # include | #endif | #if HAVE_INTTYPES_H | # include | #else | # if HAVE_STDINT_H | # include | # endif | #endif | #if HAVE_UNISTD_H | # include | #endif | #include configure:2929: result: no configure:2933: checking db1/db.h presence configure:2943: g++ -E conftest.cc conftest.cc:25:20: db1/db.h: No such file or directory configure:2949: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | /* end confdefs.h. */ | #include configure:2969: result: no configure:3004: checking for db1/db.h configure:3011: result: no configure:2888: checking db.h usability configure:2900: g++ -c -g -O2 conftest.cc >&5 configure:2906: $? = 0 configure:2910: test -z || test ! -s conftest.err configure:2913: $? = 0 configure:2916: test -s conftest.o configure:2919: $? = 0 configure:2929: result: yes configure:2933: checking db.h presence configure:2943: g++ -E conftest.cc configure:2949: $? = 0 configure:2969: result: yes configure:3004: checking for db.h configure:3011: result: yes configure:3027: checking for library containing __db185_open configure:3057: g++ -o conftest -g -O2 conftest.cc -lz >&5 /var/tmp//cc2pGPWC.o(.text+0xd): In function `main': /data/bbdev/box/trunk/conftest.cc:37: undefined reference to `__db185_open' configure:3063: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | /* end confdefs.h. */ | | /* Override any gcc2 internal prototype to avoid an error. */ | #ifdef __cplusplus | extern "C" | #endif | /* We use char because int might match the return type of a gcc2 | builtin and then its argument prototype would still apply. */ | char __db185_open (); | int | main () | { | __db185_open (); | ; | return 0; | } configure:3112: g++ -o conftest -g -O2 conftest.cc -ldb -lz >&5 /usr/bin/ld: cannot find -ldb configure:3118: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | /* end confdefs.h. */ | | /* Override any gcc2 internal prototype to avoid an error. */ | #ifdef __cplusplus | extern "C" | #endif | /* We use char because int might match the return type of a gcc2 | builtin and then its argument prototype would still apply. */ | char __db185_open (); | int | main () | { | __db185_open (); | ; | return 0; | } configure:3112: g++ -o conftest -g -O2 conftest.cc -ldb-4.4 -lz >&5 /usr/bin/ld: cannot find -ldb-4.4 configure:3118: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | /* end confdefs.h. */ | | /* Override any gcc2 internal prototype to avoid an error. */ | #ifdef __cplusplus | extern "C" | #endif | /* We use char because int might match the return type of a gcc2 | builtin and then its argument prototype would still apply. */ | char __db185_open (); | int | main () | { | __db185_open (); | ; | return 0; | } configure:3112: g++ -o conftest -g -O2 conftest.cc -ldb-4.3 -lz >&5 /usr/bin/ld: cannot find -ldb-4.3 configure:3118: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | /* end confdefs.h. */ | | /* Override any gcc2 internal prototype to avoid an error. */ | #ifdef __cplusplus | extern "C" | #endif | /* We use char because int might match the return type of a gcc2 | builtin and then its argument prototype would still apply. */ | char __db185_open (); | int | main () | { | __db185_open (); | ; | return 0; | } configure:3112: g++ -o conftest -g -O2 conftest.cc -ldb-4.2 -lz >&5 /usr/bin/ld: cannot find -ldb-4.2 configure:3118: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | /* end confdefs.h. */ | | /* Override any gcc2 internal prototype to avoid an error. */ | #ifdef __cplusplus | extern "C" | #endif | /* We use char because int might match the return type of a gcc2 | builtin and then its argument prototype would still apply. */ | char __db185_open (); | int | main () | { | __db185_open (); | ; | return 0; | } configure:3112: g++ -o conftest -g -O2 conftest.cc -ldb-4.1 -lz >&5 /usr/bin/ld: cannot find -ldb-4.1 configure:3118: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | /* end confdefs.h. */ | | /* Override any gcc2 internal prototype to avoid an error. */ | #ifdef __cplusplus | extern "C" | #endif | /* We use char because int might match the return type of a gcc2 | builtin and then its argument prototype would still apply. */ | char __db185_open (); | int | main () | { | __db185_open (); | ; | return 0; | } configure:3112: g++ -o conftest -g -O2 conftest.cc -ldb-4.0 -lz >&5 /usr/bin/ld: cannot find -ldb-4.0 configure:3118: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | /* end confdefs.h. */ | | /* Override any gcc2 internal prototype to avoid an error. */ | #ifdef __cplusplus | extern "C" | #endif | /* We use char because int might match the return type of a gcc2 | builtin and then its argument prototype would still apply. */ | char __db185_open (); | int | main () | { | __db185_open (); | ; | return 0; | } configure:3112: g++ -o conftest -g -O2 conftest.cc -ldb4 -lz >&5 /usr/bin/ld: cannot find -ldb4 configure:3118: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | /* end confdefs.h. */ | | /* Override any gcc2 internal prototype to avoid an error. */ | #ifdef __cplusplus | extern "C" | #endif | /* We use char because int might match the return type of a gcc2 | builtin and then its argument prototype would still apply. */ | char __db185_open (); | int | main () | { | __db185_open (); | ; | return 0; | } configure:3112: g++ -o conftest -g -O2 conftest.cc -ldb-3 -lz >&5 /usr/bin/ld: cannot find -ldb-3 configure:3118: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | /* end confdefs.h. */ | | /* Override any gcc2 internal prototype to avoid an error. */ | #ifdef __cplusplus | extern "C" | #endif | /* We use char because int might match the return type of a gcc2 | builtin and then its argument prototype would still apply. */ | char __db185_open (); | int | main () | { | __db185_open (); | ; | return 0; | } configure:3112: g++ -o conftest -g -O2 conftest.cc -ldb3 -lz >&5 /usr/bin/ld: cannot find -ldb3 configure:3118: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | /* end confdefs.h. */ | | /* Override any gcc2 internal prototype to avoid an error. */ | #ifdef __cplusplus | extern "C" | #endif | /* We use char because int might match the return type of a gcc2 | builtin and then its argument prototype would still apply. */ | char __db185_open (); | int | main () | { | __db185_open (); | ; | return 0; | } configure:3146: result: no configure:3152: checking for library containing dbopen configure:3182: g++ -o conftest -g -O2 conftest.cc -lz >&5 configure:3188: $? = 0 configure:3192: test -z || test ! -s conftest.err configure:3195: $? = 0 configure:3198: test -s conftest configure:3201: $? = 0 configure:3271: result: none required configure:3282: checking whether found db libraries work configure:3313: g++ -o conftest -g -O2 conftest.cc -lz >&5 configure:3316: $? = 0 configure:3318: ./conftest configure:3321: $? = 0 configure:3324: result: yes configure:3363: checking for a readline compatible library configure:3401: g++ -o conftest -g -O2 conftest.cc -lz -ledit >&5 /var/tmp//cc7M1xiE.o(.text+0xd): In function `main': /data/bbdev/box/trunk/conftest.cc:39: undefined reference to `readline' configure:3407: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | /* end confdefs.h. */ | | /* Override any gcc2 internal prototype to avoid an error. */ | #ifdef __cplusplus | extern "C" | #endif | /* We use char because int might match the return type of a gcc2 | builtin and then its argument prototype would still apply. */ | char readline (); | int | main () | { | readline (); | ; | return 0; | } configure:3401: g++ -o conftest -g -O2 conftest.cc -lz -ledit -ltermcap >&5 /var/tmp//ccTPQXBy.o(.text+0xd): In function `main': /data/bbdev/box/trunk/conftest.cc:39: undefined reference to `readline' configure:3407: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | /* end confdefs.h. */ | | /* Override any gcc2 internal prototype to avoid an error. */ | #ifdef __cplusplus | extern "C" | #endif | /* We use char because int might match the return type of a gcc2 | builtin and then its argument prototype would still apply. */ | char readline (); | int | main () | { | readline (); | ; | return 0; | } configure:3401: g++ -o conftest -g -O2 conftest.cc -lz -ledit -lcurses >&5 /var/tmp//ccjU06Sh.o(.text+0xd): In function `main': /data/bbdev/box/trunk/conftest.cc:39: undefined reference to `readline' configure:3407: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | /* end confdefs.h. */ | | /* Override any gcc2 internal prototype to avoid an error. */ | #ifdef __cplusplus | extern "C" | #endif | /* We use char because int might match the return type of a gcc2 | builtin and then its argument prototype would still apply. */ | char readline (); | int | main () | { | readline (); | ; | return 0; | } configure:3401: g++ -o conftest -g -O2 conftest.cc -lz -ledit -lncurses >&5 /var/tmp//ccjnDH2j.o(.text+0xd): In function `main': /data/bbdev/box/trunk/conftest.cc:39: undefined reference to `readline' configure:3407: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | /* end confdefs.h. */ | | /* Override any gcc2 internal prototype to avoid an error. */ | #ifdef __cplusplus | extern "C" | #endif | /* We use char because int might match the return type of a gcc2 | builtin and then its argument prototype would still apply. */ | char readline (); | int | main () | { | readline (); | ; | return 0; | } configure:3401: g++ -o conftest -g -O2 conftest.cc -lz -leditline >&5 /usr/bin/ld: cannot find -leditline configure:3407: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | /* end confdefs.h. */ | | /* Override any gcc2 internal prototype to avoid an error. */ | #ifdef __cplusplus | extern "C" | #endif | /* We use char because int might match the return type of a gcc2 | builtin and then its argument prototype would still apply. */ | char readline (); | int | main () | { | readline (); | ; | return 0; | } configure:3401: g++ -o conftest -g -O2 conftest.cc -lz -leditline -ltermcap >&5 /usr/bin/ld: cannot find -leditline configure:3407: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | /* end confdefs.h. */ | | /* Override any gcc2 internal prototype to avoid an error. */ | #ifdef __cplusplus | extern "C" | #endif | /* We use char because int might match the return type of a gcc2 | builtin and then its argument prototype would still apply. */ | char readline (); | int | main () | { | readline (); | ; | return 0; | } configure:3401: g++ -o conftest -g -O2 conftest.cc -lz -leditline -lcurses >&5 /usr/bin/ld: cannot find -leditline configure:3407: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | /* end confdefs.h. */ | | /* Override any gcc2 internal prototype to avoid an error. */ | #ifdef __cplusplus | extern "C" | #endif | /* We use char because int might match the return type of a gcc2 | builtin and then its argument prototype would still apply. */ | char readline (); | int | main () | { | readline (); | ; | return 0; | } configure:3401: g++ -o conftest -g -O2 conftest.cc -lz -leditline -lncurses >&5 /usr/bin/ld: cannot find -leditline configure:3407: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | /* end confdefs.h. */ | | /* Override any gcc2 internal prototype to avoid an error. */ | #ifdef __cplusplus | extern "C" | #endif | /* We use char because int might match the return type of a gcc2 | builtin and then its argument prototype would still apply. */ | char readline (); | int | main () | { | readline (); | ; | return 0; | } configure:3444: result: no configure:3861: checking openssl/ssl.h usability configure:3873: g++ -c -g -O2 conftest.cc >&5 configure:3879: $? = 0 configure:3883: test -z || test ! -s conftest.err configure:3886: $? = 0 configure:3889: test -s conftest.o configure:3892: $? = 0 configure:3902: result: yes configure:3906: checking openssl/ssl.h presence configure:3916: g++ -E conftest.cc configure:3922: $? = 0 configure:3942: result: yes configure:3977: checking for openssl/ssl.h configure:3984: result: yes configure:4000: checking for SSL_read in -lssl configure:4030: g++ -o conftest -g -O2 conftest.cc -lssl -lcrypto -lz >&5 configure:4036: $? = 0 configure:4040: test -z || test ! -s conftest.err configure:4043: $? = 0 configure:4046: test -s conftest configure:4049: $? = 0 configure:4062: result: yes configure:4094: checking for EVP_CipherInit_ex in -lcrypto configure:4124: g++ -o conftest -g -O2 conftest.cc -lcrypto -lssl -lz >&5 configure:4130: $? = 0 configure:4134: test -z || test ! -s conftest.err configure:4137: $? = 0 configure:4140: test -s conftest configure:4143: $? = 0 configure:4156: result: yes configure:4195: checking for dirent.h that defines DIR configure:4219: g++ -c -g -O2 conftest.cc >&5 configure:4225: $? = 0 configure:4229: test -z || test ! -s conftest.err configure:4232: $? = 0 configure:4235: test -s conftest.o configure:4238: $? = 0 configure:4249: result: yes configure:4262: checking for library containing opendir configure:4292: g++ -o conftest -g -O2 conftest.cc -lcrypto -lssl -lz >&5 configure:4298: $? = 0 configure:4302: test -z || test ! -s conftest.err configure:4305: $? = 0 configure:4308: test -s conftest configure:4311: $? = 0 configure:4381: result: none required configure:4517: checking for ANSI C header files configure:4673: result: yes configure:4683: checking for sys/wait.h that is POSIX.1 compatible configure:4714: g++ -c -g -O2 conftest.cc >&5 configure:4720: $? = 0 configure:4724: test -z || test ! -s conftest.err configure:4727: $? = 0 configure:4730: test -s conftest.o configure:4733: $? = 0 configure:4744: result: yes configure:4772: checking execinfo.h usability configure:4784: g++ -c -g -O2 conftest.cc >&5 conftest.cc:69:22: execinfo.h: No such file or directory configure:4790: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | #define HAVE_OPENSSL_SSL_H 1 | #define HAVE_LIBSSL 1 | #define HAVE_SSL 1 | #define HAVE_LIBCRYPTO 1 | #define HAVE_DIRENT_H 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_WAIT_H 1 | /* end confdefs.h. */ | #include | #if HAVE_SYS_TYPES_H | # include | #endif | #if HAVE_SYS_STAT_H | # include | #endif | #if STDC_HEADERS | # include | # include | #else | # if HAVE_STDLIB_H | # include | # endif | #endif | #if HAVE_STRING_H | # if !STDC_HEADERS && HAVE_MEMORY_H | # include | # endif | # include | #endif | #if HAVE_STRINGS_H | # include | #endif | #if HAVE_INTTYPES_H | # include | #else | # if HAVE_STDINT_H | # include | # endif | #endif | #if HAVE_UNISTD_H | # include | #endif | #include configure:4813: result: no configure:4817: checking execinfo.h presence configure:4827: g++ -E conftest.cc conftest.cc:35:22: execinfo.h: No such file or directory configure:4833: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | #define HAVE_OPENSSL_SSL_H 1 | #define HAVE_LIBSSL 1 | #define HAVE_SSL 1 | #define HAVE_LIBCRYPTO 1 | #define HAVE_DIRENT_H 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_WAIT_H 1 | /* end confdefs.h. */ | #include configure:4853: result: no configure:4888: checking for execinfo.h configure:4895: result: no configure:4772: checking netinet/in.h usability configure:4784: g++ -c -g -O2 conftest.cc >&5 configure:4790: $? = 0 configure:4794: test -z || test ! -s conftest.err configure:4797: $? = 0 configure:4800: test -s conftest.o configure:4803: $? = 0 configure:4813: result: yes configure:4817: checking netinet/in.h presence configure:4827: g++ -E conftest.cc configure:4833: $? = 0 configure:4853: result: yes configure:4888: checking for netinet/in.h configure:4895: result: yes configure:4772: checking regex.h usability configure:4784: g++ -c -g -O2 conftest.cc >&5 configure:4790: $? = 0 configure:4794: test -z || test ! -s conftest.err configure:4797: $? = 0 configure:4800: test -s conftest.o configure:4803: $? = 0 configure:4813: result: yes configure:4817: checking regex.h presence configure:4827: g++ -E conftest.cc configure:4833: $? = 0 configure:4853: result: yes configure:4888: checking for regex.h configure:4895: result: yes configure:4763: checking for sys/types.h configure:4768: result: yes configure:4772: checking sys/xattr.h usability configure:4784: g++ -c -g -O2 conftest.cc >&5 conftest.cc:72:23: sys/xattr.h: No such file or directory configure:4790: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | #define HAVE_OPENSSL_SSL_H 1 | #define HAVE_LIBSSL 1 | #define HAVE_SSL 1 | #define HAVE_LIBCRYPTO 1 | #define HAVE_DIRENT_H 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_WAIT_H 1 | #define HAVE_NETINET_IN_H 1 | #define HAVE_REGEX_H 1 | #define HAVE_SYS_TYPES_H 1 | /* end confdefs.h. */ | #include | #if HAVE_SYS_TYPES_H | # include | #endif | #if HAVE_SYS_STAT_H | # include | #endif | #if STDC_HEADERS | # include | # include | #else | # if HAVE_STDLIB_H | # include | # endif | #endif | #if HAVE_STRING_H | # if !STDC_HEADERS && HAVE_MEMORY_H | # include | # endif | # include | #endif | #if HAVE_STRINGS_H | # include | #endif | #if HAVE_INTTYPES_H | # include | #else | # if HAVE_STDINT_H | # include | # endif | #endif | #if HAVE_UNISTD_H | # include | #endif | #include configure:4813: result: no configure:4817: checking sys/xattr.h presence configure:4827: g++ -E conftest.cc conftest.cc:38:23: sys/xattr.h: No such file or directory configure:4833: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | #define HAVE_OPENSSL_SSL_H 1 | #define HAVE_LIBSSL 1 | #define HAVE_SSL 1 | #define HAVE_LIBCRYPTO 1 | #define HAVE_DIRENT_H 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_WAIT_H 1 | #define HAVE_NETINET_IN_H 1 | #define HAVE_REGEX_H 1 | #define HAVE_SYS_TYPES_H 1 | /* end confdefs.h. */ | #include configure:4853: result: no configure:4888: checking for sys/xattr.h configure:4895: result: no configure:4923: checking sys/endian.h usability configure:4935: g++ -c -g -O2 conftest.cc >&5 configure:4941: $? = 0 configure:4945: test -z || test ! -s conftest.err configure:4948: $? = 0 configure:4951: test -s conftest.o configure:4954: $? = 0 configure:4964: result: yes configure:4968: checking sys/endian.h presence configure:4978: g++ -E conftest.cc configure:4984: $? = 0 configure:5004: result: yes configure:5039: checking for sys/endian.h configure:5046: result: yes configure:4923: checking asm/byteorder.h usability configure:4935: g++ -c -g -O2 conftest.cc >&5 conftest.cc:73:27: asm/byteorder.h: No such file or directory configure:4941: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | #define HAVE_OPENSSL_SSL_H 1 | #define HAVE_LIBSSL 1 | #define HAVE_SSL 1 | #define HAVE_LIBCRYPTO 1 | #define HAVE_DIRENT_H 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_WAIT_H 1 | #define HAVE_NETINET_IN_H 1 | #define HAVE_REGEX_H 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_ENDIAN_H 1 | /* end confdefs.h. */ | #include | #if HAVE_SYS_TYPES_H | # include | #endif | #if HAVE_SYS_STAT_H | # include | #endif | #if STDC_HEADERS | # include | # include | #else | # if HAVE_STDLIB_H | # include | # endif | #endif | #if HAVE_STRING_H | # if !STDC_HEADERS && HAVE_MEMORY_H | # include | # endif | # include | #endif | #if HAVE_STRINGS_H | # include | #endif | #if HAVE_INTTYPES_H | # include | #else | # if HAVE_STDINT_H | # include | # endif | #endif | #if HAVE_UNISTD_H | # include | #endif | #include configure:4964: result: no configure:4968: checking asm/byteorder.h presence configure:4978: g++ -E conftest.cc conftest.cc:39:27: asm/byteorder.h: No such file or directory configure:4984: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | #define HAVE_OPENSSL_SSL_H 1 | #define HAVE_LIBSSL 1 | #define HAVE_SSL 1 | #define HAVE_LIBCRYPTO 1 | #define HAVE_DIRENT_H 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_WAIT_H 1 | #define HAVE_NETINET_IN_H 1 | #define HAVE_REGEX_H 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_ENDIAN_H 1 | /* end confdefs.h. */ | #include configure:5004: result: no configure:5039: checking for asm/byteorder.h configure:5046: result: no configure:5063: checking for u_int8_t configure:5087: g++ -c -g -O2 conftest.cc >&5 configure:5093: $? = 0 configure:5097: test -z || test ! -s conftest.err configure:5100: $? = 0 configure:5103: test -s conftest.o configure:5106: $? = 0 configure:5117: result: yes configure:5127: checking for u_int16_t configure:5151: g++ -c -g -O2 conftest.cc >&5 configure:5157: $? = 0 configure:5161: test -z || test ! -s conftest.err configure:5164: $? = 0 configure:5167: test -s conftest.o configure:5170: $? = 0 configure:5181: result: yes configure:5191: checking for u_int32_t configure:5215: g++ -c -g -O2 conftest.cc >&5 configure:5221: $? = 0 configure:5225: test -z || test ! -s conftest.err configure:5228: $? = 0 configure:5231: test -s conftest.o configure:5234: $? = 0 configure:5245: result: yes configure:5255: checking for u_int64_t configure:5279: g++ -c -g -O2 conftest.cc >&5 configure:5285: $? = 0 configure:5289: test -z || test ! -s conftest.err configure:5292: $? = 0 configure:5295: test -s conftest.o configure:5298: $? = 0 configure:5309: result: yes configure:5320: checking for uint8_t configure:5344: g++ -c -g -O2 conftest.cc >&5 configure:5350: $? = 0 configure:5354: test -z || test ! -s conftest.err configure:5357: $? = 0 configure:5360: test -s conftest.o configure:5363: $? = 0 configure:5374: result: yes configure:5384: checking for uint16_t configure:5408: g++ -c -g -O2 conftest.cc >&5 configure:5414: $? = 0 configure:5418: test -z || test ! -s conftest.err configure:5421: $? = 0 configure:5424: test -s conftest.o configure:5427: $? = 0 configure:5438: result: yes configure:5448: checking for uint32_t configure:5472: g++ -c -g -O2 conftest.cc >&5 configure:5478: $? = 0 configure:5482: test -z || test ! -s conftest.err configure:5485: $? = 0 configure:5488: test -s conftest.o configure:5491: $? = 0 configure:5502: result: yes configure:5512: checking for uint64_t configure:5536: g++ -c -g -O2 conftest.cc >&5 configure:5542: $? = 0 configure:5546: test -z || test ! -s conftest.err configure:5549: $? = 0 configure:5552: test -s conftest.o configure:5555: $? = 0 configure:5566: result: yes configure:5577: checking for stdbool.h that conforms to C99 configure:5630: g++ -c -g -O2 conftest.cc >&5 conftest.cc:50:3: #error bool is not defined conftest.cc:53:3: #error false is not defined conftest.cc:59:3: #error true is not defined conftest.cc:68: error: `_Bool' does not name a type conftest.cc:68: error: `_Bool' does not name a type conftest.cc:75: error: `_Bool' was not declared in this scope conftest.cc:77: error: `_Bool' was not declared in this scope conftest.cc:78: error: 'struct s' has no member named 't' conftest.cc: In function `int main()': conftest.cc:83: error: `f' undeclared (first use this function) conftest.cc:83: error: (Each undeclared identifier is reported only once for each function it appears in.) conftest.cc:83: error: `h' undeclared (first use this function) conftest.cc:83: error: `i' undeclared (first use this function) configure:5636: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | #define HAVE_OPENSSL_SSL_H 1 | #define HAVE_LIBSSL 1 | #define HAVE_SSL 1 | #define HAVE_LIBCRYPTO 1 | #define HAVE_DIRENT_H 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_WAIT_H 1 | #define HAVE_NETINET_IN_H 1 | #define HAVE_REGEX_H 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_ENDIAN_H 1 | #define HAVE_U_INT8_T 1 | #define HAVE_U_INT16_T 1 | #define HAVE_U_INT32_T 1 | #define HAVE_U_INT64_T 1 | #define HAVE_UINT8_T 1 | #define HAVE_UINT16_T 1 | #define HAVE_UINT32_T 1 | #define HAVE_UINT64_T 1 | /* end confdefs.h. */ | | #include | #ifndef bool | # error bool is not defined | #endif | #ifndef false | # error false is not defined | #endif | #if false | # error false is not 0 | #endif | #ifndef true | # error true is not defined | #endif | #if true != 1 | # error true is not 1 | #endif | #ifndef __bool_true_false_are_defined | # error __bool_true_false_are_defined is not defined | #endif | | struct s { _Bool s: 1; _Bool t; } s; | | char a[true == 1 ? 1 : -1]; | char b[false == 0 ? 1 : -1]; | char c[__bool_true_false_are_defined == 1 ? 1 : -1]; | char d[(bool) -0.5 == true ? 1 : -1]; | bool e = &s; | char f[(_Bool) -0.0 == false ? 1 : -1]; | char g[true]; | char h[sizeof (_Bool)]; | char i[sizeof s.t]; | | int | main () | { | return !a + !b + !c + !d + !e + !f + !g + !h + !i; | ; | return 0; | } configure:5660: result: no configure:5662: checking for _Bool configure:5686: g++ -c -g -O2 conftest.cc >&5 conftest.cc: In function `int main()': conftest.cc:84: error: `_Bool' undeclared (first use this function) conftest.cc:84: error: (Each undeclared identifier is reported only once for each function it appears in.) conftest.cc:84: error: expected primary-expression before ')' token conftest.cc:84: error: expected `)' before numeric constant configure:5692: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | #define HAVE_OPENSSL_SSL_H 1 | #define HAVE_LIBSSL 1 | #define HAVE_SSL 1 | #define HAVE_LIBCRYPTO 1 | #define HAVE_DIRENT_H 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_WAIT_H 1 | #define HAVE_NETINET_IN_H 1 | #define HAVE_REGEX_H 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_ENDIAN_H 1 | #define HAVE_U_INT8_T 1 | #define HAVE_U_INT16_T 1 | #define HAVE_U_INT32_T 1 | #define HAVE_U_INT64_T 1 | #define HAVE_UINT8_T 1 | #define HAVE_UINT16_T 1 | #define HAVE_UINT32_T 1 | #define HAVE_UINT64_T 1 | /* end confdefs.h. */ | #include | #if HAVE_SYS_TYPES_H | # include | #endif | #if HAVE_SYS_STAT_H | # include | #endif | #if STDC_HEADERS | # include | # include | #else | # if HAVE_STDLIB_H | # include | # endif | #endif | #if HAVE_STRING_H | # if !STDC_HEADERS && HAVE_MEMORY_H | # include | # endif | # include | #endif | #if HAVE_STRINGS_H | # include | #endif | #if HAVE_INTTYPES_H | # include | #else | # if HAVE_STDINT_H | # include | # endif | #endif | #if HAVE_UNISTD_H | # include | #endif | int | main () | { | if ((_Bool *) 0) | return 0; | if (sizeof (_Bool)) | return 0; | ; | return 0; | } configure:5716: result: no configure:5735: checking for an ANSI C-conforming const configure:5802: g++ -c -g -O2 conftest.cc >&5 configure:5808: $? = 0 configure:5812: test -z || test ! -s conftest.err configure:5815: $? = 0 configure:5818: test -s conftest.o configure:5821: $? = 0 configure:5832: result: yes configure:5842: checking whether byte ordering is bigendian configure:5869: g++ -c -g -O2 conftest.cc >&5 configure:5875: $? = 0 configure:5879: test -z || test ! -s conftest.err configure:5882: $? = 0 configure:5885: test -s conftest.o configure:5888: $? = 0 configure:5912: g++ -c -g -O2 conftest.cc >&5 conftest.cc: In function `int main()': conftest.cc:54: error: `big' undeclared (first use this function) conftest.cc:54: error: (Each undeclared identifier is reported only once for each function it appears in.) conftest.cc:54: error: expected `;' before "endian" configure:5918: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | #define HAVE_OPENSSL_SSL_H 1 | #define HAVE_LIBSSL 1 | #define HAVE_SSL 1 | #define HAVE_LIBCRYPTO 1 | #define HAVE_DIRENT_H 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_WAIT_H 1 | #define HAVE_NETINET_IN_H 1 | #define HAVE_REGEX_H 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_ENDIAN_H 1 | #define HAVE_U_INT8_T 1 | #define HAVE_U_INT16_T 1 | #define HAVE_U_INT32_T 1 | #define HAVE_U_INT64_T 1 | #define HAVE_UINT8_T 1 | #define HAVE_UINT16_T 1 | #define HAVE_UINT32_T 1 | #define HAVE_UINT64_T 1 | /* end confdefs.h. */ | #include | #include | | int | main () | { | #if BYTE_ORDER != BIG_ENDIAN | not big endian | #endif | | ; | return 0; | } configure:6053: result: no configure:6073: checking if non-aligned 16 bit word accesses fail configure:6108: g++ -o conftest -g -O2 conftest.cc -lcrypto -lssl -lz >&5 configure:6111: $? = 0 configure:6113: ./conftest configure:6116: $? = 0 configure:6131: result: no configure:6140: checking if non-aligned 32 bit word accesses fail configure:6175: g++ -o conftest -g -O2 conftest.cc -lcrypto -lssl -lz >&5 configure:6178: $? = 0 configure:6180: ./conftest configure:6183: $? = 0 configure:6198: result: no configure:6207: checking if non-aligned 64 bit word accesses fail configure:6242: g++ -o conftest -g -O2 conftest.cc -lcrypto -lssl -lz >&5 configure:6245: $? = 0 configure:6247: ./conftest configure:6250: $? = 0 configure:6265: result: no configure:6275: checking for uid_t in sys/types.h configure:6298: result: yes configure:6313: checking for mode_t configure:6337: g++ -c -g -O2 conftest.cc >&5 configure:6343: $? = 0 configure:6347: test -z || test ! -s conftest.err configure:6350: $? = 0 configure:6353: test -s conftest.o configure:6356: $? = 0 configure:6367: result: yes configure:6379: checking for off_t configure:6403: g++ -c -g -O2 conftest.cc >&5 configure:6409: $? = 0 configure:6413: test -z || test ! -s conftest.err configure:6416: $? = 0 configure:6419: test -s conftest.o configure:6422: $? = 0 configure:6433: result: yes configure:6445: checking for pid_t configure:6469: g++ -c -g -O2 conftest.cc >&5 configure:6475: $? = 0 configure:6479: test -z || test ! -s conftest.err configure:6482: $? = 0 configure:6485: test -s conftest.o configure:6488: $? = 0 configure:6499: result: yes configure:6511: checking for size_t configure:6535: g++ -c -g -O2 conftest.cc >&5 configure:6541: $? = 0 configure:6545: test -z || test ! -s conftest.err configure:6548: $? = 0 configure:6551: test -s conftest.o configure:6554: $? = 0 configure:6565: result: yes configure:6577: checking for struct stat.st_flags configure:6600: g++ -c -g -O2 conftest.cc >&5 configure:6606: $? = 0 configure:6610: test -z || test ! -s conftest.err configure:6613: $? = 0 configure:6616: test -s conftest.o configure:6619: $? = 0 configure:6676: result: yes configure:6687: checking for struct stat.st_mtimespec configure:6710: g++ -c -g -O2 conftest.cc >&5 conftest.cc: In function `int main()': conftest.cc:86: error: could not convert `ac_aggr.stat::st_mtimespec' to `bool' configure:6716: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | #define HAVE_OPENSSL_SSL_H 1 | #define HAVE_LIBSSL 1 | #define HAVE_SSL 1 | #define HAVE_LIBCRYPTO 1 | #define HAVE_DIRENT_H 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_WAIT_H 1 | #define HAVE_NETINET_IN_H 1 | #define HAVE_REGEX_H 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_ENDIAN_H 1 | #define HAVE_U_INT8_T 1 | #define HAVE_U_INT16_T 1 | #define HAVE_U_INT32_T 1 | #define HAVE_U_INT64_T 1 | #define HAVE_UINT8_T 1 | #define HAVE_UINT16_T 1 | #define HAVE_UINT32_T 1 | #define HAVE_UINT64_T 1 | #define HAVE_STRUCT_STAT_ST_FLAGS 1 | /* end confdefs.h. */ | #include | #if HAVE_SYS_TYPES_H | # include | #endif | #if HAVE_SYS_STAT_H | # include | #endif | #if STDC_HEADERS | # include | # include | #else | # if HAVE_STDLIB_H | # include | # endif | #endif | #if HAVE_STRING_H | # if !STDC_HEADERS && HAVE_MEMORY_H | # include | # endif | # include | #endif | #if HAVE_STRINGS_H | # include | #endif | #if HAVE_INTTYPES_H | # include | #else | # if HAVE_STDINT_H | # include | # endif | #endif | #if HAVE_UNISTD_H | # include | #endif | int | main () | { | static struct stat ac_aggr; | if (ac_aggr.st_mtimespec) | return 0; | ; | return 0; | } configure:6754: g++ -c -g -O2 conftest.cc >&5 configure:6760: $? = 0 configure:6764: test -z || test ! -s conftest.err configure:6767: $? = 0 configure:6770: test -s conftest.o configure:6773: $? = 0 configure:6786: result: yes configure:6797: checking for struct sockaddr_in.sin_len configure:6824: g++ -c -g -O2 conftest.cc >&5 configure:6830: $? = 0 configure:6834: test -z || test ! -s conftest.err configure:6837: $? = 0 configure:6840: test -s conftest.o configure:6843: $? = 0 configure:6904: result: yes configure:6915: checking whether INFTIM is declared configure:6940: g++ -c -g -O2 conftest.cc >&5 configure:6946: $? = 0 configure:6950: test -z || test ! -s conftest.err configure:6953: $? = 0 configure:6956: test -s conftest.o configure:6959: $? = 0 configure:6970: result: yes configure:6988: checking whether SO_PEERCRED is declared configure:7013: g++ -c -g -O2 conftest.cc >&5 conftest.cc: In function `int main()': conftest.cc:57: error: `SO_PEERCRED' undeclared (first use this function) conftest.cc:57: error: (Each undeclared identifier is reported only once for each function it appears in.) configure:7019: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | #define HAVE_OPENSSL_SSL_H 1 | #define HAVE_LIBSSL 1 | #define HAVE_SSL 1 | #define HAVE_LIBCRYPTO 1 | #define HAVE_DIRENT_H 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_WAIT_H 1 | #define HAVE_NETINET_IN_H 1 | #define HAVE_REGEX_H 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_ENDIAN_H 1 | #define HAVE_U_INT8_T 1 | #define HAVE_U_INT16_T 1 | #define HAVE_U_INT32_T 1 | #define HAVE_U_INT64_T 1 | #define HAVE_UINT8_T 1 | #define HAVE_UINT16_T 1 | #define HAVE_UINT32_T 1 | #define HAVE_UINT64_T 1 | #define HAVE_STRUCT_STAT_ST_FLAGS 1 | #define HAVE_STRUCT_STAT_ST_MTIMESPEC 1 | #define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1 | #define HAVE_DECL_INFTIM 1 | /* end confdefs.h. */ | #include | | int | main () | { | #ifndef SO_PEERCRED | char *p = (char *) SO_PEERCRED; | #endif | | ; | return 0; | } configure:7043: result: no configure:7061: checking whether time.h and sys/time.h may both be included configure:7086: g++ -c -g -O2 conftest.cc >&5 configure:7092: $? = 0 configure:7096: test -z || test ! -s conftest.err configure:7099: $? = 0 configure:7102: test -s conftest.o configure:7105: $? = 0 configure:7116: result: yes configure:7126: checking whether struct tm is in sys/time.h or time.h configure:7149: g++ -c -g -O2 conftest.cc >&5 configure:7155: $? = 0 configure:7159: test -z || test ! -s conftest.err configure:7162: $? = 0 configure:7165: test -s conftest.o configure:7168: $? = 0 configure:7179: result: time.h configure:7190: checking for struct dirent.d_type configure:7214: g++ -c -g -O2 conftest.cc >&5 configure:7220: $? = 0 configure:7224: test -z || test ! -s conftest.err configure:7227: $? = 0 configure:7230: test -s conftest.o configure:7233: $? = 0 configure:7291: result: yes configure:7303: checking whether struct dirent.d_type is valid configure:7339: g++ -o conftest -g -O2 conftest.cc -lcrypto -lssl -lz >&5 configure:7342: $? = 0 configure:7344: ./conftest configure:7347: $? = 0 configure:7362: result: yes configure:7385: checking for special C compiler options needed for large files configure:7420: g++ -c -g -O2 conftest.cc >&5 configure:7426: $? = 0 configure:7430: test -z || test ! -s conftest.err configure:7433: $? = 0 configure:7436: test -s conftest.o configure:7439: $? = 0 configure:7484: result: no configure:7490: checking for _FILE_OFFSET_BITS value needed for large files configure:7521: g++ -c -g -O2 conftest.cc >&5 configure:7527: $? = 0 configure:7531: test -z || test ! -s conftest.err configure:7534: $? = 0 configure:7537: test -s conftest.o configure:7540: $? = 0 configure:7605: result: no configure:7615: checking for _LARGE_FILES value needed for large files configure:7646: g++ -c -g -O2 conftest.cc >&5 configure:7652: $? = 0 configure:7656: test -z || test ! -s conftest.err configure:7659: $? = 0 configure:7662: test -s conftest.o configure:7665: $? = 0 configure:7730: result: no configure:7743: checking whether LLONG_MAX is declared configure:7768: g++ -c -g -O2 conftest.cc >&5 configure:7774: $? = 0 configure:7778: test -z || test ! -s conftest.err configure:7781: $? = 0 configure:7784: test -s conftest.o configure:7787: $? = 0 configure:7798: result: yes configure:7902: checking for pre-processor pragma defines configure:7919: g++ -c -g -O2 conftest.cc >&5 conftest.cc:57: error: invalid token conftest.cc:57: error: `pragma' does not name a type configure:7925: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | #define HAVE_OPENSSL_SSL_H 1 | #define HAVE_LIBSSL 1 | #define HAVE_SSL 1 | #define HAVE_LIBCRYPTO 1 | #define HAVE_DIRENT_H 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_WAIT_H 1 | #define HAVE_NETINET_IN_H 1 | #define HAVE_REGEX_H 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_ENDIAN_H 1 | #define HAVE_U_INT8_T 1 | #define HAVE_U_INT16_T 1 | #define HAVE_U_INT32_T 1 | #define HAVE_U_INT64_T 1 | #define HAVE_UINT8_T 1 | #define HAVE_UINT16_T 1 | #define HAVE_UINT32_T 1 | #define HAVE_UINT64_T 1 | #define HAVE_STRUCT_STAT_ST_FLAGS 1 | #define HAVE_STRUCT_STAT_ST_MTIMESPEC 1 | #define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1 | #define HAVE_DECL_INFTIM 1 | #define HAVE_DECL_SO_PEERCRED 0 | #define TIME_WITH_SYS_TIME 1 | #define HAVE_STRUCT_DIRENT_D_TYPE 1 | #define HAVE_VALID_DIRENT_D_TYPE 1 | /* end confdefs.h. */ | | #define TEST_DEFINE #pragma pack(1) | TEST_DEFINE | configure:7950: result: no configure:7969: checking for "/dev/urandom" configure:7984: result: yes configure:8058: checking for getmntent configure:8115: g++ -o conftest -g -O2 conftest.cc -lcrypto -lssl -lz >&5 /var/tmp//ccvuff7Q.o(.text+0x14): In function `main': /data/bbdev/box/trunk/conftest.cc:97: undefined reference to `getmntent' /var/tmp//ccvuff7Q.o(.data+0x0):/data/bbdev/box/trunk/conftest.cc:96: undefined reference to `getmntent' configure:8121: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | #define HAVE_OPENSSL_SSL_H 1 | #define HAVE_LIBSSL 1 | #define HAVE_SSL 1 | #define HAVE_LIBCRYPTO 1 | #define HAVE_DIRENT_H 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_WAIT_H 1 | #define HAVE_NETINET_IN_H 1 | #define HAVE_REGEX_H 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_ENDIAN_H 1 | #define HAVE_U_INT8_T 1 | #define HAVE_U_INT16_T 1 | #define HAVE_U_INT32_T 1 | #define HAVE_U_INT64_T 1 | #define HAVE_UINT8_T 1 | #define HAVE_UINT16_T 1 | #define HAVE_UINT32_T 1 | #define HAVE_UINT64_T 1 | #define HAVE_STRUCT_STAT_ST_FLAGS 1 | #define HAVE_STRUCT_STAT_ST_MTIMESPEC 1 | #define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1 | #define HAVE_DECL_INFTIM 1 | #define HAVE_DECL_SO_PEERCRED 0 | #define TIME_WITH_SYS_TIME 1 | #define HAVE_STRUCT_DIRENT_D_TYPE 1 | #define HAVE_VALID_DIRENT_D_TYPE 1 | #define HAVE_RANDOM_DEVICE 1 | #define RANDOM_DEVICE "/dev/urandom" | /* end confdefs.h. */ | /* Define getmntent to an innocuous variant, in case declares getmntent. | For example, HP-UX 11i declares gettimeofday. */ | #define getmntent innocuous_getmntent | | /* System header to define __stub macros and hopefully few prototypes, | which can conflict with char getmntent (); below. | Prefer to if __STDC__ is defined, since | exists even on freestanding compilers. */ | | #ifdef __STDC__ | # include | #else | # include | #endif | | #undef getmntent | | /* Override any gcc2 internal prototype to avoid an error. */ | #ifdef __cplusplus | extern "C" | { | #endif | /* We use char because int might match the return type of a gcc2 | builtin and then its argument prototype would still apply. */ | char getmntent (); | /* The GNU C library defines this for functions which it implements | to always fail with ENOSYS. Some functions are actually named | something starting with __ and the normal name is an alias. */ | #if defined (__stub_getmntent) || defined (__stub___getmntent) | choke me | #else | char (*f) () = getmntent; | #endif | #ifdef __cplusplus | } | #endif | | int | main () | { | return f != getmntent; | ; | return 0; | } configure:8146: result: no configure:8058: checking for statfs configure:8115: g++ -o conftest -g -O2 conftest.cc -lcrypto -lssl -lz >&5 configure:8121: $? = 0 configure:8125: test -z || test ! -s conftest.err configure:8128: $? = 0 configure:8131: test -s conftest configure:8134: $? = 0 configure:8146: result: yes configure:8162: checking for mntent.h configure:8178: g++ -c -g -O2 conftest.cc >&5 conftest.cc:60:20: mntent.h: No such file or directory configure:8184: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | #define HAVE_OPENSSL_SSL_H 1 | #define HAVE_LIBSSL 1 | #define HAVE_SSL 1 | #define HAVE_LIBCRYPTO 1 | #define HAVE_DIRENT_H 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_WAIT_H 1 | #define HAVE_NETINET_IN_H 1 | #define HAVE_REGEX_H 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_ENDIAN_H 1 | #define HAVE_U_INT8_T 1 | #define HAVE_U_INT16_T 1 | #define HAVE_U_INT32_T 1 | #define HAVE_U_INT64_T 1 | #define HAVE_UINT8_T 1 | #define HAVE_UINT16_T 1 | #define HAVE_UINT32_T 1 | #define HAVE_UINT64_T 1 | #define HAVE_STRUCT_STAT_ST_FLAGS 1 | #define HAVE_STRUCT_STAT_ST_MTIMESPEC 1 | #define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1 | #define HAVE_DECL_INFTIM 1 | #define HAVE_DECL_SO_PEERCRED 0 | #define TIME_WITH_SYS_TIME 1 | #define HAVE_STRUCT_DIRENT_D_TYPE 1 | #define HAVE_VALID_DIRENT_D_TYPE 1 | #define HAVE_RANDOM_DEVICE 1 | #define RANDOM_DEVICE "/dev/urandom" | #define HAVE_STATFS 1 | /* end confdefs.h. */ | #include | | #include configure:8208: result: no configure:8162: checking for sys/mnttab.h configure:8178: g++ -c -g -O2 conftest.cc >&5 conftest.cc:60:24: sys/mnttab.h: No such file or directory configure:8184: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | #define HAVE_OPENSSL_SSL_H 1 | #define HAVE_LIBSSL 1 | #define HAVE_SSL 1 | #define HAVE_LIBCRYPTO 1 | #define HAVE_DIRENT_H 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_WAIT_H 1 | #define HAVE_NETINET_IN_H 1 | #define HAVE_REGEX_H 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_ENDIAN_H 1 | #define HAVE_U_INT8_T 1 | #define HAVE_U_INT16_T 1 | #define HAVE_U_INT32_T 1 | #define HAVE_U_INT64_T 1 | #define HAVE_UINT8_T 1 | #define HAVE_UINT16_T 1 | #define HAVE_UINT32_T 1 | #define HAVE_UINT64_T 1 | #define HAVE_STRUCT_STAT_ST_FLAGS 1 | #define HAVE_STRUCT_STAT_ST_MTIMESPEC 1 | #define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1 | #define HAVE_DECL_INFTIM 1 | #define HAVE_DECL_SO_PEERCRED 0 | #define TIME_WITH_SYS_TIME 1 | #define HAVE_STRUCT_DIRENT_D_TYPE 1 | #define HAVE_VALID_DIRENT_D_TYPE 1 | #define HAVE_RANDOM_DEVICE 1 | #define RANDOM_DEVICE "/dev/urandom" | #define HAVE_STATFS 1 | /* end confdefs.h. */ | #include | | #include configure:8208: result: no configure:8162: checking for sys/mount.h configure:8178: g++ -c -g -O2 conftest.cc >&5 In file included from /usr/include/sys/mount.h:36, from conftest.cc:60: /usr/include/sys/ucred.h:68: error: `u_int' does not name a type /usr/include/sys/ucred.h:69: error: `uid_t' does not name a type /usr/include/sys/ucred.h:71: error: `gid_t' does not name a type In file included from conftest.cc:60: /usr/include/sys/mount.h:44: error: `int32_t' does not name a type /usr/include/sys/mount.h:53: error: `u_short' does not name a type /usr/include/sys/mount.h:54: error: `u_short' does not name a type /usr/include/sys/mount.h:65: error: `uint32_t' does not name a type /usr/include/sys/mount.h:66: error: `uint32_t' does not name a type /usr/include/sys/mount.h:67: error: `uint64_t' does not name a type /usr/include/sys/mount.h:68: error: `uint64_t' does not name a type /usr/include/sys/mount.h:69: error: `uint64_t' does not name a type /usr/include/sys/mount.h:70: error: `uint64_t' does not name a type /usr/include/sys/mount.h:71: error: `uint64_t' does not name a type /usr/include/sys/mount.h:72: error: `int64_t' does not name a type /usr/include/sys/mount.h:73: error: `uint64_t' does not name a type /usr/include/sys/mount.h:74: error: `int64_t' does not name a type /usr/include/sys/mount.h:75: error: `uint64_t' does not name a type /usr/include/sys/mount.h:76: error: `uint64_t' does not name a type /usr/include/sys/mount.h:77: error: `uint64_t' does not name a type /usr/include/sys/mount.h:78: error: `uint64_t' does not name a type /usr/include/sys/mount.h:79: error: `uint64_t' does not name a type /usr/include/sys/mount.h:80: error: `uint32_t' does not name a type /usr/include/sys/mount.h:81: error: `uid_t' does not name a type /usr/include/sys/mount.h:316: error: `uid_t' does not name a type /usr/include/sys/mount.h:319: error: `u_char' does not name a type /usr/include/sys/mount.h:321: error: `u_char' does not name a type /usr/include/sys/mount.h:344: error: `u_int' does not name a type /usr/include/sys/mount.h:385: error: `uint32_t' does not name a type /usr/include/sys/mount.h:392: error: `fsctlop_t' does not name a type /usr/include/sys/mount.h:395: error: `u_int32_t' does not name a type /usr/include/sys/mount.h:413: error: `u_int32_t' does not name a type /usr/include/sys/mount.h:414: error: `u_int32_t' does not name a type configure:8184: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | #define HAVE_OPENSSL_SSL_H 1 | #define HAVE_LIBSSL 1 | #define HAVE_SSL 1 | #define HAVE_LIBCRYPTO 1 | #define HAVE_DIRENT_H 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_WAIT_H 1 | #define HAVE_NETINET_IN_H 1 | #define HAVE_REGEX_H 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_ENDIAN_H 1 | #define HAVE_U_INT8_T 1 | #define HAVE_U_INT16_T 1 | #define HAVE_U_INT32_T 1 | #define HAVE_U_INT64_T 1 | #define HAVE_UINT8_T 1 | #define HAVE_UINT16_T 1 | #define HAVE_UINT32_T 1 | #define HAVE_UINT64_T 1 | #define HAVE_STRUCT_STAT_ST_FLAGS 1 | #define HAVE_STRUCT_STAT_ST_MTIMESPEC 1 | #define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1 | #define HAVE_DECL_INFTIM 1 | #define HAVE_DECL_SO_PEERCRED 0 | #define TIME_WITH_SYS_TIME 1 | #define HAVE_STRUCT_DIRENT_D_TYPE 1 | #define HAVE_VALID_DIRENT_D_TYPE 1 | #define HAVE_RANDOM_DEVICE 1 | #define RANDOM_DEVICE "/dev/urandom" | #define HAVE_STATFS 1 | /* end confdefs.h. */ | #include | | #include configure:8208: result: no configure:8220: checking for struct statfs.f_mntonname configure:8247: g++ -c -g -O2 conftest.cc >&5 configure:8253: $? = 0 configure:8257: test -z || test ! -s conftest.err configure:8260: $? = 0 configure:8263: test -s conftest.o configure:8266: $? = 0 configure:8327: result: yes configure:8339: checking for struct mntent.mnt_dir configure:8363: g++ -c -g -O2 conftest.cc >&5 conftest.cc:59:20: mntent.h: No such file or directory conftest.cc: In function `int main()': conftest.cc:64: error: aggregate `mntent ac_aggr' has incomplete type and cannot be defined configure:8369: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | #define HAVE_OPENSSL_SSL_H 1 | #define HAVE_LIBSSL 1 | #define HAVE_SSL 1 | #define HAVE_LIBCRYPTO 1 | #define HAVE_DIRENT_H 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_WAIT_H 1 | #define HAVE_NETINET_IN_H 1 | #define HAVE_REGEX_H 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_ENDIAN_H 1 | #define HAVE_U_INT8_T 1 | #define HAVE_U_INT16_T 1 | #define HAVE_U_INT32_T 1 | #define HAVE_U_INT64_T 1 | #define HAVE_UINT8_T 1 | #define HAVE_UINT16_T 1 | #define HAVE_UINT32_T 1 | #define HAVE_UINT64_T 1 | #define HAVE_STRUCT_STAT_ST_FLAGS 1 | #define HAVE_STRUCT_STAT_ST_MTIMESPEC 1 | #define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1 | #define HAVE_DECL_INFTIM 1 | #define HAVE_DECL_SO_PEERCRED 0 | #define TIME_WITH_SYS_TIME 1 | #define HAVE_STRUCT_DIRENT_D_TYPE 1 | #define HAVE_VALID_DIRENT_D_TYPE 1 | #define HAVE_RANDOM_DEVICE 1 | #define RANDOM_DEVICE "/dev/urandom" | #define HAVE_STATFS 1 | #define HAVE_STRUCT_STATFS_F_MNTONNAME 1 | /* end confdefs.h. */ | #include | | int | main () | { | static struct mntent ac_aggr; | if (ac_aggr.mnt_dir) | return 0; | ; | return 0; | } configure:8408: g++ -c -g -O2 conftest.cc >&5 conftest.cc:59:20: mntent.h: No such file or directory conftest.cc: In function `int main()': conftest.cc:64: error: aggregate `mntent ac_aggr' has incomplete type and cannot be defined configure:8414: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | #define HAVE_OPENSSL_SSL_H 1 | #define HAVE_LIBSSL 1 | #define HAVE_SSL 1 | #define HAVE_LIBCRYPTO 1 | #define HAVE_DIRENT_H 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_WAIT_H 1 | #define HAVE_NETINET_IN_H 1 | #define HAVE_REGEX_H 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_ENDIAN_H 1 | #define HAVE_U_INT8_T 1 | #define HAVE_U_INT16_T 1 | #define HAVE_U_INT32_T 1 | #define HAVE_U_INT64_T 1 | #define HAVE_UINT8_T 1 | #define HAVE_UINT16_T 1 | #define HAVE_UINT32_T 1 | #define HAVE_UINT64_T 1 | #define HAVE_STRUCT_STAT_ST_FLAGS 1 | #define HAVE_STRUCT_STAT_ST_MTIMESPEC 1 | #define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1 | #define HAVE_DECL_INFTIM 1 | #define HAVE_DECL_SO_PEERCRED 0 | #define TIME_WITH_SYS_TIME 1 | #define HAVE_STRUCT_DIRENT_D_TYPE 1 | #define HAVE_VALID_DIRENT_D_TYPE 1 | #define HAVE_RANDOM_DEVICE 1 | #define RANDOM_DEVICE "/dev/urandom" | #define HAVE_STATFS 1 | #define HAVE_STRUCT_STATFS_F_MNTONNAME 1 | /* end confdefs.h. */ | #include | | int | main () | { | static struct mntent ac_aggr; | if (sizeof ac_aggr.mnt_dir) | return 0; | ; | return 0; | } configure:8440: result: no configure:8452: checking for struct mnttab.mnt_mountp configure:8479: g++ -c -g -O2 conftest.cc >&5 conftest.cc:61:28: sys/mnttab.h: No such file or directory conftest.cc: In function `int main()': conftest.cc:67: error: aggregate `mnttab ac_aggr' has incomplete type and cannot be defined configure:8485: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | #define HAVE_OPENSSL_SSL_H 1 | #define HAVE_LIBSSL 1 | #define HAVE_SSL 1 | #define HAVE_LIBCRYPTO 1 | #define HAVE_DIRENT_H 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_WAIT_H 1 | #define HAVE_NETINET_IN_H 1 | #define HAVE_REGEX_H 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_ENDIAN_H 1 | #define HAVE_U_INT8_T 1 | #define HAVE_U_INT16_T 1 | #define HAVE_U_INT32_T 1 | #define HAVE_U_INT64_T 1 | #define HAVE_UINT8_T 1 | #define HAVE_UINT16_T 1 | #define HAVE_UINT32_T 1 | #define HAVE_UINT64_T 1 | #define HAVE_STRUCT_STAT_ST_FLAGS 1 | #define HAVE_STRUCT_STAT_ST_MTIMESPEC 1 | #define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1 | #define HAVE_DECL_INFTIM 1 | #define HAVE_DECL_SO_PEERCRED 0 | #define TIME_WITH_SYS_TIME 1 | #define HAVE_STRUCT_DIRENT_D_TYPE 1 | #define HAVE_VALID_DIRENT_D_TYPE 1 | #define HAVE_RANDOM_DEVICE 1 | #define RANDOM_DEVICE "/dev/urandom" | #define HAVE_STATFS 1 | #define HAVE_STRUCT_STATFS_F_MNTONNAME 1 | /* end confdefs.h. */ | | #include | #include | | | int | main () | { | static struct mnttab ac_aggr; | if (ac_aggr.mnt_mountp) | return 0; | ; | return 0; | } configure:8527: g++ -c -g -O2 conftest.cc >&5 conftest.cc:61:28: sys/mnttab.h: No such file or directory conftest.cc: In function `int main()': conftest.cc:67: error: aggregate `mnttab ac_aggr' has incomplete type and cannot be defined configure:8533: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | #define HAVE_OPENSSL_SSL_H 1 | #define HAVE_LIBSSL 1 | #define HAVE_SSL 1 | #define HAVE_LIBCRYPTO 1 | #define HAVE_DIRENT_H 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_WAIT_H 1 | #define HAVE_NETINET_IN_H 1 | #define HAVE_REGEX_H 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_ENDIAN_H 1 | #define HAVE_U_INT8_T 1 | #define HAVE_U_INT16_T 1 | #define HAVE_U_INT32_T 1 | #define HAVE_U_INT64_T 1 | #define HAVE_UINT8_T 1 | #define HAVE_UINT16_T 1 | #define HAVE_UINT32_T 1 | #define HAVE_UINT64_T 1 | #define HAVE_STRUCT_STAT_ST_FLAGS 1 | #define HAVE_STRUCT_STAT_ST_MTIMESPEC 1 | #define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1 | #define HAVE_DECL_INFTIM 1 | #define HAVE_DECL_SO_PEERCRED 0 | #define TIME_WITH_SYS_TIME 1 | #define HAVE_STRUCT_DIRENT_D_TYPE 1 | #define HAVE_VALID_DIRENT_D_TYPE 1 | #define HAVE_RANDOM_DEVICE 1 | #define RANDOM_DEVICE "/dev/urandom" | #define HAVE_STATFS 1 | #define HAVE_STRUCT_STATFS_F_MNTONNAME 1 | /* end confdefs.h. */ | | #include | #include | | | int | main () | { | static struct mnttab ac_aggr; | if (sizeof ac_aggr.mnt_mountp) | return 0; | ; | return 0; | } configure:8559: result: no configure:8591: checking for gcc version 3 or later configure:8609: g++ -c -g -O2 conftest.cc >&5 configure:8615: $? = 0 configure:8619: test -z || test ! -s conftest.err configure:8622: $? = 0 configure:8625: test -s conftest.o configure:8628: $? = 0 configure:8640: result: yes configure:8717: checking whether closedir returns void configure:8746: g++ -o conftest -g -O2 conftest.cc -lcrypto -lssl -lz >&5 configure:8749: $? = 0 configure:8751: ./conftest configure:8754: $? = 0 configure:8768: result: no configure:8778: checking for error_at_line configure:8799: g++ -o conftest -g -O2 conftest.cc -lcrypto -lssl -lz >&5 conftest.cc: In function `int main()': conftest.cc:97: error: `error_at_line' undeclared (first use this function) conftest.cc:97: error: (Each undeclared identifier is reported only once for each function it appears in.) configure:8805: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | #define HAVE_OPENSSL_SSL_H 1 | #define HAVE_LIBSSL 1 | #define HAVE_SSL 1 | #define HAVE_LIBCRYPTO 1 | #define HAVE_DIRENT_H 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_WAIT_H 1 | #define HAVE_NETINET_IN_H 1 | #define HAVE_REGEX_H 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_ENDIAN_H 1 | #define HAVE_U_INT8_T 1 | #define HAVE_U_INT16_T 1 | #define HAVE_U_INT32_T 1 | #define HAVE_U_INT64_T 1 | #define HAVE_UINT8_T 1 | #define HAVE_UINT16_T 1 | #define HAVE_UINT32_T 1 | #define HAVE_UINT64_T 1 | #define HAVE_STRUCT_STAT_ST_FLAGS 1 | #define HAVE_STRUCT_STAT_ST_MTIMESPEC 1 | #define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1 | #define HAVE_DECL_INFTIM 1 | #define HAVE_DECL_SO_PEERCRED 0 | #define TIME_WITH_SYS_TIME 1 | #define HAVE_STRUCT_DIRENT_D_TYPE 1 | #define HAVE_VALID_DIRENT_D_TYPE 1 | #define HAVE_RANDOM_DEVICE 1 | #define RANDOM_DEVICE "/dev/urandom" | #define HAVE_STATFS 1 | #define HAVE_STRUCT_STATFS_F_MNTONNAME 1 | #define HAVE_MOUNTS 1 | /* end confdefs.h. */ | #include | #if HAVE_SYS_TYPES_H | # include | #endif | #if HAVE_SYS_STAT_H | # include | #endif | #if STDC_HEADERS | # include | # include | #else | # if HAVE_STDLIB_H | # include | # endif | #endif | #if HAVE_STRING_H | # if !STDC_HEADERS && HAVE_MEMORY_H | # include | # endif | # include | #endif | #if HAVE_STRINGS_H | # include | #endif | #if HAVE_INTTYPES_H | # include | #else | # if HAVE_STDINT_H | # include | # endif | #endif | #if HAVE_UNISTD_H | # include | #endif | int | main () | { | error_at_line (0, 0, "", 0, ""); | ; | return 0; | } configure:8830: result: no configure:8843: checking return type of signal handlers configure:8874: g++ -c -g -O2 conftest.cc >&5 configure:8880: $? = 0 configure:8884: test -z || test ! -s conftest.err configure:8887: $? = 0 configure:8890: test -s conftest.o configure:8893: $? = 0 configure:8904: result: void configure:8912: checking whether lstat dereferences a symlink specified with a trailing slash configure:8943: g++ -o conftest -g -O2 conftest.cc -lcrypto -lssl -lz >&5 configure:8946: $? = 0 configure:8948: ./conftest configure:8951: $? = 1 configure: program exited with status 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | #define HAVE_OPENSSL_SSL_H 1 | #define HAVE_LIBSSL 1 | #define HAVE_SSL 1 | #define HAVE_LIBCRYPTO 1 | #define HAVE_DIRENT_H 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_WAIT_H 1 | #define HAVE_NETINET_IN_H 1 | #define HAVE_REGEX_H 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_ENDIAN_H 1 | #define HAVE_U_INT8_T 1 | #define HAVE_U_INT16_T 1 | #define HAVE_U_INT32_T 1 | #define HAVE_U_INT64_T 1 | #define HAVE_UINT8_T 1 | #define HAVE_UINT16_T 1 | #define HAVE_UINT32_T 1 | #define HAVE_UINT64_T 1 | #define HAVE_STRUCT_STAT_ST_FLAGS 1 | #define HAVE_STRUCT_STAT_ST_MTIMESPEC 1 | #define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1 | #define HAVE_DECL_INFTIM 1 | #define HAVE_DECL_SO_PEERCRED 0 | #define TIME_WITH_SYS_TIME 1 | #define HAVE_STRUCT_DIRENT_D_TYPE 1 | #define HAVE_VALID_DIRENT_D_TYPE 1 | #define HAVE_RANDOM_DEVICE 1 | #define RANDOM_DEVICE "/dev/urandom" | #define HAVE_STATFS 1 | #define HAVE_STRUCT_STATFS_F_MNTONNAME 1 | #define HAVE_MOUNTS 1 | #define RETSIGTYPE void | /* end confdefs.h. */ | #include | #if HAVE_SYS_TYPES_H | # include | #endif | #if HAVE_SYS_STAT_H | # include | #endif | #if STDC_HEADERS | # include | # include | #else | # if HAVE_STDLIB_H | # include | # endif | #endif | #if HAVE_STRING_H | # if !STDC_HEADERS && HAVE_MEMORY_H | # include | # endif | # include | #endif | #if HAVE_STRINGS_H | # include | #endif | #if HAVE_INTTYPES_H | # include | #else | # if HAVE_STDINT_H | # include | # endif | #endif | #if HAVE_UNISTD_H | # include | #endif | int | main () | { | struct stat sbuf; | /* Linux will dereference the symlink and fail. | That is better in the sense that it means we will not | have to compile and use the lstat wrapper. */ | exit (lstat ("conftest.sym/", &sbuf) ? 0 : 1); | ; | return 0; | } configure:8972: result: no configure:8993: checking whether stat accepts an empty string configure:9018: g++ -o conftest -g -O2 conftest.cc -lcrypto -lssl -lz >&5 configure:9021: $? = 0 configure:9023: ./conftest configure:9026: $? = 1 configure: program exited with status 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "Box Backup" | #define PACKAGE_TARNAME "box-backup" | #define PACKAGE_VERSION "0.09" | #define PACKAGE_STRING "Box Backup 0.09" | #define PACKAGE_BUGREPORT "box at fluffy.co.uk" | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define HAVE_EXCEPTIONS | #define HAVE_NAMESPACES | #define HAVE_LIBZ 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DB_H 1 | #define HAVE_DB 1 | #define DB_HEADER "db.h" | #define HAVE_OPENSSL_SSL_H 1 | #define HAVE_LIBSSL 1 | #define HAVE_SSL 1 | #define HAVE_LIBCRYPTO 1 | #define HAVE_DIRENT_H 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_WAIT_H 1 | #define HAVE_NETINET_IN_H 1 | #define HAVE_REGEX_H 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_ENDIAN_H 1 | #define HAVE_U_INT8_T 1 | #define HAVE_U_INT16_T 1 | #define HAVE_U_INT32_T 1 | #define HAVE_U_INT64_T 1 | #define HAVE_UINT8_T 1 | #define HAVE_UINT16_T 1 | #define HAVE_UINT32_T 1 | #define HAVE_UINT64_T 1 | #define HAVE_STRUCT_STAT_ST_FLAGS 1 | #define HAVE_STRUCT_STAT_ST_MTIMESPEC 1 | #define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1 | #define HAVE_DECL_INFTIM 1 | #define HAVE_DECL_SO_PEERCRED 0 | #define TIME_WITH_SYS_TIME 1 | #define HAVE_STRUCT_DIRENT_D_TYPE 1 | #define HAVE_VALID_DIRENT_D_TYPE 1 | #define HAVE_RANDOM_DEVICE 1 | #define RANDOM_DEVICE "/dev/urandom" | #define HAVE_STATFS 1 | #define HAVE_STRUCT_STATFS_F_MNTONNAME 1 | #define HAVE_MOUNTS 1 | #define RETSIGTYPE void | /* end confdefs.h. */ | #include | #if HAVE_SYS_TYPES_H | # include | #endif | #if HAVE_SYS_STAT_H | # include | #endif | #if STDC_HEADERS | # include | # include | #else | # if HAVE_STDLIB_H | # include | # endif | #endif | #if HAVE_STRING_H | # if !STDC_HEADERS && HAVE_MEMORY_H | # include | # endif | # include | #endif | #if HAVE_STRINGS_H | # include | #endif | #if HAVE_INTTYPES_H | # include | #else | # if HAVE_STDINT_H | # include | # endif | #endif | #if HAVE_UNISTD_H | # include | #endif | int | main () | { | struct stat sbuf; | exit (stat ("", &sbuf) ? 1 : 0); | ; | return 0; | } configure:9040: result: no configure:9065: checking for getpeereid configure:9122: g++ -o conftest -g -O2 conftest.cc -lcrypto -lssl -lz >&5 configure:9128: $? = 0 configure:9132: test -z || test ! -s conftest.err configure:9135: $? = 0 configure:9138: test -s conftest configure:9141: $? = 0 configure:9153: result: yes configure:9065: checking for kqueue configure:9122: g++ -o conftest -g -O2 conftest.cc -lcrypto -lssl -lz >&5 configure:9128: $? = 0 configure:9132: test -z || test ! -s conftest.err configure:9135: $? = 0 configure:9138: test -s conftest configure:9141: $? = 0 configure:9153: result: yes configure:9065: checking for lchown configure:9122: g++ -o conftest -g -O2 conftest.cc -lcrypto -lssl -lz >&5 configure:9128: $? = 0 configure:9132: test -z || test ! -s conftest.err configure:9135: $? = 0 configure:9138: test -s conftest configure:9141: $? = 0 configure:9153: result: yes configure:9065: checking for setproctitle configure:9122: g++ -o conftest -g -O2 conftest.cc -lcrypto -lssl -lz >&5 configure:9128: $? = 0 configure:9132: test -z || test ! -s conftest.err configure:9135: $? = 0 configure:9138: test -s conftest configure:9141: $? = 0 configure:9153: result: yes configure:9179: checking sys/syscall.h usability configure:9191: g++ -c -g -O2 conftest.cc >&5 configure:9197: $? = 0 configure:9201: test -z || test ! -s conftest.err configure:9204: $? = 0 configure:9207: test -s conftest.o configure:9210: $? = 0 configure:9220: result: yes configure:9224: checking sys/syscall.h presence configure:9234: g++ -E conftest.cc configure:9240: $? = 0 configure:9260: result: yes configure:9295: checking for sys/syscall.h configure:9302: result: yes configure:9170: checking for unistd.h configure:9175: result: yes configure:9320: checking for syscall configure:9377: g++ -o conftest -g -O2 conftest.cc -lcrypto -lssl -lz >&5 configure:9383: $? = 0 configure:9387: test -z || test ! -s conftest.err configure:9390: $? = 0 configure:9393: test -s conftest configure:9396: $? = 0 configure:9408: result: yes configure:9320: checking for __syscall configure:9377: g++ -o conftest -g -O2 conftest.cc -lcrypto -lssl -lz >&5 configure:9383: $? = 0 configure:9387: test -z || test ! -s conftest.err configure:9390: $? = 0 configure:9393: test -s conftest configure:9396: $? = 0 configure:9408: result: yes configure:9493: checking whether syscall lseek requires dummy parameter configure:9542: g++ -o conftest -g -O2 conftest.cc -lcrypto -lssl -lz >&5 configure:9545: $? = 0 configure:9547: ./conftest configure:9550: $? = 0 configure:9565: result: yes configure:9587: checking if we have large file support enabled configure:9617: g++ -o conftest -g -O2 conftest.cc -lcrypto -lssl -lz >&5 configure:9620: $? = 0 configure:9622: ./conftest configure:9625: $? = 0 configure:9640: result: yes configure:9655: checking for flock configure:9712: g++ -o conftest -g -O2 conftest.cc -lcrypto -lssl -lz >&5 configure:9718: $? = 0 configure:9722: test -z || test ! -s conftest.err configure:9725: $? = 0 configure:9728: test -s conftest configure:9731: $? = 0 configure:9743: result: yes configure:9753: checking whether O_EXLOCK is declared configure:9778: g++ -c -g -O2 conftest.cc >&5 configure:9784: $? = 0 configure:9788: test -z || test ! -s conftest.err configure:9791: $? = 0 configure:9794: test -s conftest.o configure:9797: $? = 0 configure:9808: result: yes configure:9826: checking whether F_SETLK is declared configure:9851: g++ -c -g -O2 conftest.cc >&5 configure:9857: $? = 0 configure:9861: test -z || test ! -s conftest.err configure:9864: $? = 0 configure:9867: test -s conftest.o configure:9870: $? = 0 configure:9881: result: yes configure:10106: creating ./config.status ## ---------------------- ## ## Running config.status. ## ## ---------------------- ## This file was extended by Box Backup config.status 0.09, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = CONFIG_HEADERS = CONFIG_LINKS = CONFIG_COMMANDS = $ ./config.status on starbug.netinertia.co.uk config.status:10810: creating infrastructure/BoxPlatform.pm config.status:10912: creating lib/common/BoxConfig.h ## ---------------- ## ## Cache variables. ## ## ---------------- ## ac_cv_type_size_t=yes ac_cv_type_u_int8_t=yes ac_cv_header_db3_db_185_h=no ac_cv_member_struct_mnttab_mnt_mountp=no ac_cv_have_decl_INFTIM=yes ac_cv_header_sys_endian_h=yes ac_cv_header_netinet_in_h=yes ac_cv_header_db4_db_185_h=no ac_cv_prog_CXXCPP='g++ -E' ac_cv_env_CXXFLAGS_value= ac_cv_c_bigendian=no ac_cv_search_dbopen='none required' ac_cv_lib_error_at_line=no ac_cv_member_struct_statfs_f_mntonname=yes ac_cv_header_stdbool_h=no ac_cv_header_stdlib_h=yes ac_cv_func___syscall=yes ac_cv_func_closedir_void=no ac_cv_env_CXXCPP_set= ac_cv_env_LDFLAGS_set= ac_cv_sys_large_files=no ac_cv_type_u_int32_t=yes ac_cv_search_opendir='none required' ac_cv_exeext= ac_cv_func_flock=yes ac_cv_header_dirent_dirent_h=yes ac_cv_header_db_185_h=no ac_cv_type_u_int16_t=yes ac_cv_func_syscall=yes ac_cv_member_struct_dirent_d_type=yes ac_cv_func_lstat_dereferences_slashed_symlink=no ac_cv_header_sys_wait_h=yes ac_cv_env_CPPFLAGS_set= ac_cv_type_u_int64_t=yes ac_cv_member_struct_mntent_mnt_dir=no ac_cv_header_asm_byteorder_h=no ac_cv_cxx_compiler_gnu=yes ac_cv_env_CXX_set= ac_cv_member_struct_stat_st_flags=yes ac_cv_cxx_exceptions=yes ac_cv_env_host_alias_set= ac_cv_func_setproctitle=yes ac_cv_func_lchown=yes ac_cv_c_const=yes ac_cv_lib_z_zlibVersion=yes ac_cv_header_execinfo_h=no ac_cv_search___db185_open=no ac_cv_have_decl_LLONG_MAX=yes ac_cv_type_mode_t=yes ac_cv_header_regex_h=yes ac_cv_header_sys_stat_h=yes ac_cv_env_build_alias_set= ac_cv_have_decl_O_EXLOCK=yes ac_cv_header_db1_db_h=no ac_cv_cxx_namespaces=yes ac_cv_func_kqueue=yes ac_cv_header_sys_mount_h=no ac_cv_header_sys_xattr_h=no vl_cv_lib_readline=no ac_cv_env_CXXCPP_value= ac_cv_env_LDFLAGS_value= ac_cv_env_target_alias_set= ac_cv_have_decl_F_SETLK=yes ac_cv_header_openssl_ssl_h=yes ac_cv_host_alias=i386-unknown-freebsd6.0 ac_cv_header_sys_types_h=yes ac_cv_header_stdc=yes ac_cv_header_time=yes ac_cv_type_uint8_t=yes ac_cv_header_strings_h=yes ac_cv_type_signal=void ac_cv_header_mntent_h=no ac_cv_header_stdint_h=yes ac_cv_header_inttypes_h=yes ac_cv_prog_egrep='grep -E' ac_cv_search_nanosleep='none required' ac_cv_header_sys_syscall_h=yes ac_cv_header_sys_mnttab_h=no ac_cv_func_statfs=yes ac_cv_header_unistd_h=yes ac_cv_header_string_h=yes ac_cv_prog_ac_ct_CXX=g++ ac_cv_build_alias=i386-unknown-freebsd6.0 ac_cv_env_CPPFLAGS_value= ac_cv_sys_largefile_CC=no ac_cv_member_struct_stat_st_mtimespec=yes ac_cv_header_memory_h=yes ac_cv_target_alias=i386-unknown-freebsd6.0 ac_cv_env_CXXFLAGS_set= ac_cv_env_CXX_value= ac_cv_func_getpeereid=yes ac_cv_header_db_h=yes ac_cv_host=i386-unknown-freebsd6.0 ac_cv_env_host_alias_value= ac_cv_file___dev_urandom_=yes ac_cv_type_off_t=yes ac_cv_type_uint32_t=yes ac_cv_lib_crypto_EVP_CipherInit_ex=yes ac_cv_prog_cxx_g=yes ac_cv_member_struct_sockaddr_in_sin_len=yes ac_cv_type_pid_t=yes ac_cv_type_uint16_t=yes ac_cv_build=i386-unknown-freebsd6.0 ac_cv_env_build_alias_value= ac_cv_struct_tm=time.h ac_cv_type__Bool=no ac_cv_func_stat_empty_string_bug=no ac_cv_func_getmntent=no ac_cv_type_uint64_t=yes ac_cv_target=i386-unknown-freebsd6.0 ac_cv_env_target_alias_value= ac_cv_type_uid_t=yes ac_cv_sys_file_offset_bits=no ac_cv_have_decl_SO_PEERCRED=no ac_cv_lib_ssl_SSL_read=yes ac_cv_objext=o ## ----------------- ## ## Output variables. ## ## ----------------- ## CPPFLAGS='' CXX='g++' CXXCPP='g++ -E' CXXFLAGS='-g -O2' CXXFLAGS_STRICT='-Wall' DEFS='-DHAVE_CONFIG_H' ECHO_C='' ECHO_N='-n' ECHO_T='' EGREP='grep -E' EXEEXT='' LDADD_RDYNAMIC='-rdynamic' LDFLAGS='' LIBOBJS=' error$U.o lstat$U.o' LIBS='-lcrypto -lssl -lz ' LTLIBOBJS=' error$U.lo lstat$U.lo' OBJEXT='o' PACKAGE_BUGREPORT='box at fluffy.co.uk' PACKAGE_NAME='Box Backup' PACKAGE_STRING='Box Backup 0.09' PACKAGE_TARNAME='box-backup' PACKAGE_VERSION='0.09' PATH_SEPARATOR=':' RANDOM_DEVICE='/dev/urandom' SHELL='/bin/sh' ac_ct_CXX='g++' bindir='${exec_prefix}/bin' build='i386-unknown-freebsd6.0' build_alias='' build_cpu='i386' build_os='freebsd6.0' build_vendor='unknown' datadir='${prefix}/share' exec_prefix='${prefix}' host='i386-unknown-freebsd6.0' host_alias='' host_cpu='i386' host_os='freebsd6.0' host_vendor='unknown' includedir='${prefix}/include' infodir='${prefix}/info' libdir='${exec_prefix}/lib' libexecdir='${exec_prefix}/libexec' localstatedir='${prefix}/var' mandir='${prefix}/man' oldincludedir='/usr/include' prefix='/usr/local' program_transform_name='s,x,x,' sbindir='${exec_prefix}/sbin' sharedstatedir='${prefix}/com' sysconfdir='${prefix}/etc' target='i386-unknown-freebsd6.0' target_alias='' target_cpu='i386' target_os='freebsd6.0' target_vendor='unknown' ## ----------- ## ## confdefs.h. ## ## ----------- ## #define DB_HEADER "db.h" #define HAVE_DB 1 #define HAVE_DB_H 1 #define HAVE_DECL_F_SETLK 1 #define HAVE_DECL_INFTIM 1 #define HAVE_DECL_O_EXLOCK 1 #define HAVE_DECL_SO_PEERCRED 0 #define HAVE_DIRENT_H 1 #define HAVE_EXCEPTIONS #define HAVE_FLOCK 1 #define HAVE_GETPEEREID 1 #define HAVE_INTTYPES_H 1 #define HAVE_KQUEUE 1 #define HAVE_LARGE_FILE_SUPPORT 1 #define HAVE_LCHOWN 1 #define HAVE_LIBCRYPTO 1 #define HAVE_LIBSSL 1 #define HAVE_LIBZ 1 #define HAVE_LSEEK_DUMMY_PARAM 1 #define HAVE_MEMORY_H 1 #define HAVE_MOUNTS 1 #define HAVE_NAMESPACES #define HAVE_NETINET_IN_H 1 #define HAVE_OPENSSL_SSL_H 1 #define HAVE_RANDOM_DEVICE 1 #define HAVE_REGEX_H 1 #define HAVE_SETPROCTITLE 1 #define HAVE_SSL 1 #define HAVE_STATFS 1 #define HAVE_STDINT_H 1 #define HAVE_STDLIB_H 1 #define HAVE_STRINGS_H 1 #define HAVE_STRING_H 1 #define HAVE_STRUCT_DIRENT_D_TYPE 1 #define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1 #define HAVE_STRUCT_STATFS_F_MNTONNAME 1 #define HAVE_STRUCT_STAT_ST_FLAGS 1 #define HAVE_STRUCT_STAT_ST_MTIMESPEC 1 #define HAVE_SYSCALL 1 #define HAVE_SYS_ENDIAN_H 1 #define HAVE_SYS_STAT_H 1 #define HAVE_SYS_SYSCALL_H 1 #define HAVE_SYS_TYPES_H 1 #define HAVE_SYS_TYPES_H 1 #define HAVE_SYS_WAIT_H 1 #define HAVE_UINT16_T 1 #define HAVE_UINT32_T 1 #define HAVE_UINT64_T 1 #define HAVE_UINT8_T 1 #define HAVE_UNISTD_H 1 #define HAVE_UNISTD_H 1 #define HAVE_U_INT16_T 1 #define HAVE_U_INT32_T 1 #define HAVE_U_INT64_T 1 #define HAVE_U_INT8_T 1 #define HAVE_VALID_DIRENT_D_TYPE 1 #define HAVE___SYSCALL 1 #define PACKAGE_BUGREPORT "box at fluffy.co.uk" #define PACKAGE_NAME "Box Backup" #define PACKAGE_STRING "Box Backup 0.09" #define PACKAGE_TARNAME "box-backup" #define PACKAGE_VERSION "0.09" #define RANDOM_DEVICE "/dev/urandom" #define RETSIGTYPE void #define STDC_HEADERS 1 #define STDC_HEADERS 1 #define TEMP_DIRECTORY_NAME "/tmp" #define TIME_WITH_SYS_TIME 1 #endif #ifdef __cplusplus extern "C" void std::exit (int) throw (); using std::exit; configure: exit 0 --------------070206070106050300080802-- From boxbackup-dev at fluffy.co.uk Sat Dec 24 23:41:20 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Sat, 24 Dec 2005 23:41:20 +0000 Subject: [Box Backup-dev] Logging In-Reply-To: <1135417943.17780.9.camel@avenin.ebourne.me.uk> References: <1135417943.17780.9.camel@avenin.ebourne.me.uk> Message-ID: <4F09FF51-C3DC-4694-AC74-2C02EA3E10BF@fluffy.co.uk> On 24 Dec 2005, at 09:52, Martin Ebourne wrote: > On Fri, 2005-12-23 at 22:23 +0000, Chris Wilson wrote: >> I'd like to propose replacing all three current logging methods with >> something like this: >> >> ... >> >> Does this seem like a reasonable plan? Does anyone have any comments, >> questions or objections? Not answering counts as acceptance in my >> book :-) > > Sounds like a great plan to me. I was going to propose something in > that > direction when converting from printf to streams. Maybe we could do > that > transition in one go. I'm OK with that kind of change, and agree that the current code is not ideal. Error reporting is not a strong point of Box Backup at the moment, which I'm afraid is a result of the project's history (it wasn't intended to be open sourced). When writing the code, I tried to use * TRACEn() for debugging output only. Errors shouldn't be reported through it, and it should only be useful to tell a developer what the code is doing. * syslog() for messages that the user should know about. * fprintf(stderr, ...) for non-daemon utilities to report errors the user should know about. A common wrapper sounds very sensible to replace the latter two and remove knowledge of the execution context from the code, but the TRACEn() should stay. If a trace statement says something a non- developer might want to know about, then it could be moved to the logging system. TRACEn() is a bit messy. The number of arguments is required to make sure it's easy to exclude them in release builds, even with annoying compilers, and not fill the executables with debugging strings, so that really should stay. But it is a bit of a mess with flags and attempting to do the appropriate thing. Simply feeding it into the new log system would sort things out nicely. I wonder whether all the object orientation and subclassing is necessary, and if it could be done with a couple of functions and a few static variables? Simplicity is good. > > log4cxx is a good place to look if you need any further inspiration on > how to do this. It does (almost?) everything you list and much more. I > doubt Ben would want to use it directly because it would introduce > more > dependencies (it itself is dependent on boost). How did you guess? I would prefer to avoid dependencies so it's easier for a user to get going. Of course, if it's a 'core' thing which would require some serious wheel reinvention (eg OpenSSL) then dependencies are fine... but logging... probably not worth dragging in boost. Ben From boxbackup-dev at fluffy.co.uk Sun Dec 25 01:06:50 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Sun, 25 Dec 2005 01:06:50 +0000 (GMT) Subject: [Box Backup-dev] Logging In-Reply-To: <1135417943.17780.9.camel@avenin.ebourne.me.uk> References: <1135417943.17780.9.camel@avenin.ebourne.me.uk> Message-ID: Hi Martin, > Sounds like a great plan to me. I was going to propose something in that > direction when converting from printf to streams. Maybe we could do that > transition in one go. That would be a good idea, although it might make the design a little more complex. Rather than using varargs, how about the Log::Log function just takes a stringstream object as a parameter? Then you could write: std::ostringstream msg; msg << "Failed to open file " << filename; Log::Log(Log::ERROR, msg); Alternatively, we could make a class of log messages that o has (overloaded) append methods, and a log(priority) method, so you could write: Log::Message msg; msg.append("Failed to open file ").append(filename); msg.log(Log::ERROR) Or even: Log::Message(Log::ERROR, "Failed to open file ", filename); where the overloaded constructors (different numbers of string arguments) call Log::Log(this) automatically? What do people prefer? I guess Ben might like the latter as it avoids the use of overloaded operator<<. > log4cxx is a good place to look if you need any further inspiration on > how to do this. It does (almost?) everything you list and much more. I > doubt Ben would want to use it directly because it would introduce more > dependencies (it itself is dependent on boost). I based this idea on Log4j, which I guess is similar to log4cxx, but also assuming that Ben wouldn't want to include the whole of log4cxx, or to bloat the logging framework more than necessary. Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Sun Dec 25 01:10:53 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Sun, 25 Dec 2005 01:10:53 +0000 (GMT) Subject: [Box Backup-dev] Logging In-Reply-To: <4F09FF51-C3DC-4694-AC74-2C02EA3E10BF@fluffy.co.uk> References: <1135417943.17780.9.camel@avenin.ebourne.me.uk> <4F09FF51-C3DC-4694-AC74-2C02EA3E10BF@fluffy.co.uk> Message-ID: Hi Ben, On Sat, 24 Dec 2005, Ben Summers wrote: > TRACEn() is a bit messy. The number of arguments is required to make sure > it's easy to exclude them in release builds, even with annoying compilers, > and not fill the executables with debugging strings, so that really should > stay. But it is a bit of a mess with flags and attempting to do the > appropriate thing. Simply feeding it into the new log system would sort > things out nicely. I'd like to be able to turn tracing on without recompiling. Is the space saving, and tiny performance gain of excluding these messages, really worth the debugging hassle? > I wonder whether all the object orientation and subclassing is > necessary, and if it could be done with a couple of functions and a few > static variables? Simplicity is good. I like simplicity too, but I also like object orientation and polymorphism. I'd like to create a framework that could in principle support other kinds of logging, such as writing a log file or sending messages over the network (to the backup server administrator or system support staff). Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Sun Dec 25 01:32:11 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Sun, 25 Dec 2005 01:32:11 +0000 (GMT) Subject: [Box Backup-dev] NDEBUG in Win32 release (was: COMMIT r279 - box/chris/win32/vc2005-compile-fixes/lib/backupclient) In-Reply-To: References: <20051222230804.17ED394@s0g0.pems.testserver.co.uk> Message-ID: Hi Ben, > Doesn't that imply that you should be running a debug build instead? Maybe, but: > The memory leak code is nasty and invasive, and won't necessarily give > the right answers anyway. Then I don't want it in user builds (it already caused me one problem when it overflowed an internal buffer). > There's an argument for leaving assertions in, but the style I've tried > to follow is that an ASSERT will catch the error just before it's > defensively coded anyway, so it shouldn't cause a major problem. I'd still like it to be logged on the builds my users run, even if it doesn't abort the program. Does your defensive coding log the error already? And are all assertions coded defensively? > Users should not be running code compiled without NDEBUG, and if it's > desirable to keep in code which defining it removes, we should be > looking at changing the mechanism. Yes, I would like exception logging with file names and line numbers in the builds I distribute to users, at least while I'm beta testing Box for Windows. Perhaps this could be integrated with the logging changes we've been talking about? Cheers, Chris. -- _ ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Sun Dec 25 12:19:10 2005 From: boxbackup-dev at fluffy.co.uk (James O'Gorman) Date: Sun, 25 Dec 2005 12:19:10 +0000 Subject: [Box Backup-dev] Trunk build failure on FreeBSD/i386 5.4 In-Reply-To: <43ADD773.9060104@netinertia.co.uk> References: <43AD4C88.8090109@netinertia.co.uk> <20051224230010.rosnvgom5cgo4gkg@ebourne.me.uk> <43ADD773.9060104@netinertia.co.uk> Message-ID: <43AE8E3E.3020306@netinertia.co.uk> (Yes, I know it's Christmas Day and I should be getting merry, but my family are boring and watching Indiana Jones...) On 24/12/05 23:19, James O'Gorman wrote: > On 24/12/05 23:00, Martin Ebourne wrote: >> You have sys/endian.h but it does not define the 64 bit endian >> swapping functions htobe64() and betoh64(). Could you have a look and >> see if there are any 64 bit byte swapping functions, and if so where >> they are please? > > Somewhat annoyingly, the function seems to be called be64toh(). Has > Protocol.cpp changed since the 0.09 release? This used to compile fine, > so I'm guessing the #ifdefs that were added in trunk have changed > something? I modified lib/common/Box.h (line 141) to change #define box_ntoh64(x) betoh64(x) to #define box_ntoh64(x) be64toh(x) And that part seems to compile fine now. However, I now get: g++ -DNDEBUG -O2 -Wall -I../../lib/win32 -I../../lib/common -I../../lib/server -I../../lib/compress -I../../lib/crypto -I../../lib/win32 -I../../lib/backupclient -DBOX_VERSION="\"0.09_autoconf_win32\"" -g -O2 -Wall -c BackupDaemon.cpp -o ../../release/bin/bbackupd/BackupDaemon.o BackupDaemon.cpp: In member function `void BackupDaemon::SetupLocations(BackupClientContext&, const Configuration&)': BackupDaemon.cpp:1271: error: aggregate `statfs s' has incomplete type and cannot be defined BackupDaemon.cpp:1272: error: `::statfs' has not been declared *** Error code 1 James From boxbackup-dev at fluffy.co.uk Sun Dec 25 18:27:32 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Sun, 25 Dec 2005 18:27:32 +0000 Subject: [Box Backup-dev] Logging In-Reply-To: References: <1135417943.17780.9.camel@avenin.ebourne.me.uk> <4F09FF51-C3DC-4694-AC74-2C02EA3E10BF@fluffy.co.uk> Message-ID: <9557B3D0-8547-4BA6-9340-DC1A1A3DDCA4@fluffy.co.uk> On 25 Dec 2005, at 01:10, Chris Wilson wrote: > Hi Ben, > > On Sat, 24 Dec 2005, Ben Summers wrote: > >> TRACEn() is a bit messy. The number of arguments is required to >> make sure it's easy to exclude them in release builds, even with >> annoying compilers, and not fill the executables with debugging >> strings, so that really should stay. But it is a bit of a mess >> with flags and attempting to do the appropriate thing. Simply >> feeding it into the new log system would sort things out nicely. > > I'd like to be able to turn tracing on without recompiling. Is the > space saving, and tiny performance gain of excluding these > messages, really worth the debugging hassle? I would want to exclude them in my release builds. Perhaps we should make each bit configurable at ./configure time, with a default set for debug and release builds which makes sense? Then people building binaries can choose the options they actually want, if they don't agree with me/the defaults. I don't think there's much extra work, if any, to accommodate everyone. > >> I wonder whether all the object orientation and subclassing is >> necessary, and if it could be done with a couple of functions and >> a few static variables? Simplicity is good. > > I like simplicity too, but I also like object orientation and > polymorphism. I'd like to create a framework that could in > principle support other kinds of logging, such as writing a log > file or sending messages over the network (to the backup server > administrator or system support staff). Unless you make a wonderful framework which supports user added logging without having to recompile, then it might be overly complicating things. The time might be better spent developing and debugging other stuff, and simplicity makes things easier to get finished. On the other hand, a lovely logging system is a good thing to have. I have no strong feelings on this, just a waryness of potential over- engineering. Ben From boxbackup-dev at fluffy.co.uk Sun Dec 25 19:09:50 2005 From: boxbackup-dev at fluffy.co.uk (Charles Lecklider) Date: Sun, 25 Dec 2005 19:09:50 +0000 Subject: [Box Backup-dev] Logging In-Reply-To: References: Message-ID: <43AEEE7E.2030608@invis.net> Chris Wilson wrote: > * All TRACE calls are changed to Log::Log(Log::TRACE, ...) How are you going to get those to compile out for a release build? The nice thing about TRACE macros is that they can be removed completely by the compiler, and I think it's important to do that for a release build. Short of wrapping every Log::TRACE call in #ifndef NDEBUG//#endif I don't see how you can do the same thing with the new system. Perhaps there's some clever C++ trick I don't know about? -C From boxbackup-dev at fluffy.co.uk Sun Dec 25 18:28:29 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Sun, 25 Dec 2005 18:28:29 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r283 - in box/trunk: . lib/common Message-ID: <20051225182829.AFB5294@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-25 18:28:26 +0000 (Sun, 25 Dec 2005) New Revision: 283 Modified: box/trunk/configure.ac box/trunk/lib/common/Box.h Log: Attempt to fix box_ntoh64 for FreeBSD which renames betoh64 to be64toh Modified: box/trunk/configure.ac =================================================================== --- box/trunk/configure.ac 2005-12-22 23:57:28 UTC (rev 282) +++ box/trunk/configure.ac 2005-12-25 18:28:26 UTC (rev 283) @@ -112,7 +112,7 @@ AC_FUNC_ERROR_AT_LINE AC_TYPE_SIGNAL AC_FUNC_STAT -AC_CHECK_FUNCS([getpeereid kqueue lchown setproctitle]) +AC_CHECK_FUNCS([be64toh getpeereid kqueue lchown setproctitle]) AX_FUNC_SYSCALL AX_CHECK_SYSCALL_LSEEK Modified: box/trunk/lib/common/Box.h =================================================================== --- box/trunk/lib/common/Box.h 2005-12-22 23:57:28 UTC (rev 282) +++ box/trunk/lib/common/Box.h 2005-12-25 18:28:26 UTC (rev 283) @@ -138,7 +138,11 @@ #ifdef HAVE_SYS_ENDIAN_H #include #define box_hton64(x) htobe64(x) - #define box_ntoh64(x) betoh64(x) + #ifdef HAVE_BE64TOH + #define box_ntoh64(x) be64toh(x) + #else + #define box_ntoh64(x) betoh64(x) + #endif #elif HAVE_ASM_BYTEORDER_H #include #define box_hton64(x) __cpu_to_be64(x) From boxbackup-dev at fluffy.co.uk Sun Dec 25 18:41:58 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Sun, 25 Dec 2005 18:41:58 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r284 - box/trunk/infrastructure/m4 Message-ID: <20051225184158.8285594@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-25 18:41:55 +0000 (Sun, 25 Dec 2005) New Revision: 284 Modified: box/trunk/infrastructure/m4/ax_check_mount_point.m4 Log: Fix FreeBSD not finding sys/mount.h Modified: box/trunk/infrastructure/m4/ax_check_mount_point.m4 =================================================================== --- box/trunk/infrastructure/m4/ax_check_mount_point.m4 2005-12-25 18:28:26 UTC (rev 283) +++ box/trunk/infrastructure/m4/ax_check_mount_point.m4 2005-12-25 18:41:55 UTC (rev 284) @@ -19,10 +19,18 @@ AC_DEFUN([AX_CHECK_MOUNT_POINT], [ AC_CHECK_FUNCS([getmntent statfs]) - AC_CHECK_HEADERS([mntent.h sys/mnttab.h sys/mount.h],,, [[#include ]]) + AC_CHECK_HEADERS([sys/param.h]) + AC_CHECK_HEADERS([mntent.h sys/mnttab.h sys/mount.h],,, [[ + #include + #ifdef HAVE_SYS_PARAM_H + #include + #endif + ]]) # BSD AC_CHECK_MEMBERS([struct statfs.f_mntonname],,, [[ - #include + #ifdef HAVE_SYS_PARAM_H + #include + #endif #include ]]) # Linux From boxbackup-dev at fluffy.co.uk Sun Dec 25 19:36:00 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Sun, 25 Dec 2005 19:36:00 +0000 Subject: [Box Backup-dev] Trunk build failure on FreeBSD/i386 5.4 In-Reply-To: <43AE8E3E.3020306@netinertia.co.uk> References: <43AD4C88.8090109@netinertia.co.uk> <20051224230010.rosnvgom5cgo4gkg@ebourne.me.uk> <43ADD773.9060104@netinertia.co.uk> <43AE8E3E.3020306@netinertia.co.uk> Message-ID: <20051225193600.c8bxtk6qs00s0oks@ebourne.me.uk> James O'Gorman wrote: > I modified lib/common/Box.h (line 141) to change > #define box_ntoh64(x) betoh64(x) > to > #define box_ntoh64(x) be64toh(x) > > And that part seems to compile fine now. However, I now get: > > BackupDaemon.cpp:1272: error: `::statfs' has not been declared > *** Error code 1 Can you see if r284 fixes both of those issues? Cheers, Martin. From boxbackup-dev at fluffy.co.uk Sun Dec 25 19:44:32 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Sun, 25 Dec 2005 19:44:32 +0000 Subject: [Box Backup-dev] Logging In-Reply-To: <43AEEE7E.2030608@invis.net> References: <43AEEE7E.2030608@invis.net> Message-ID: <59294C45-D1F4-422F-9AE3-D581E7F53C76@fluffy.co.uk> On 25 Dec 2005, at 19:09, Charles Lecklider wrote: > Chris Wilson wrote: > > >> * All TRACE calls are changed to Log::Log(Log::TRACE, ...) > > How are you going to get those to compile out for a release build? The > nice thing about TRACE macros is that they can be removed > completely by > the compiler, and I think it's important to do that for a release > build. > > Short of wrapping every Log::TRACE call in #ifndef NDEBUG//#endif I > don't see how you can do the same thing with the new system. Perhaps > there's some clever C++ trick I don't know about? There isn't. The best way is to modify the existing macros to use the underlying logging system, and still compile them out in release builds (unless the user has configured them to stay in.) Using streams for generating the log messages will of course always construct the argument before logging, even if it's discarded by the call. I suspect this won't be too much of a problem, except on low powered embedded systems. I would quite like this to be able to fit into the hacked firmware of those consumer network connected hard discs and work acceptably on that low powered CPU. Ben From boxbackup-dev at fluffy.co.uk Sun Dec 25 20:11:25 2005 From: boxbackup-dev at fluffy.co.uk (Charles Lecklider) Date: Sun, 25 Dec 2005 20:11:25 +0000 Subject: [Box Backup-dev] Logging In-Reply-To: <59294C45-D1F4-422F-9AE3-D581E7F53C76@fluffy.co.uk> References: <43AEEE7E.2030608@invis.net> <59294C45-D1F4-422F-9AE3-D581E7F53C76@fluffy.co.uk> Message-ID: <43AEFCED.2030800@invis.net> Ben Summers wrote: > > On 25 Dec 2005, at 19:09, Charles Lecklider wrote: > >> Chris Wilson wrote: >> >> >>> * All TRACE calls are changed to Log::Log(Log::TRACE, ...) >> >> >> How are you going to get those to compile out for a release build? The >> nice thing about TRACE macros is that they can be removed completely by >> the compiler, and I think it's important to do that for a release build. >> >> Short of wrapping every Log::TRACE call in #ifndef NDEBUG//#endif I >> don't see how you can do the same thing with the new system. Perhaps >> there's some clever C++ trick I don't know about? > > > There isn't. The best way is to modify the existing macros to use the > underlying logging system, and still compile them out in release builds > (unless the user has configured them to stay in.) Oh. Other than the joyous OO nature of a load of static calls, I'm not sure I see the point of a class then.... No matter - I'm not writing this bit, so as long as TRACE can be compiled out in the end I don't mind. > Using streams for generating the log messages will of course always > construct the argument before logging, even if it's discarded by the > call. I suspect this won't be too much of a problem, except on low > powered embedded systems. I would quite like this to be able to fit > into the hacked firmware of those consumer network connected hard discs > and work acceptably on that low powered CPU. That sounds like a big step backwards to me. I'm all for having a cleaner shinier OO logging interface, but only if *all* the TRACE can go away for release - unnecessary memcpy()'s on a VIA C3 quickly get expensive. -C From boxbackup-dev at fluffy.co.uk Sun Dec 25 20:39:34 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Sun, 25 Dec 2005 20:39:34 +0000 Subject: [Box Backup-dev] Logging In-Reply-To: <43AEFCED.2030800@invis.net> References: <43AEEE7E.2030608@invis.net> <59294C45-D1F4-422F-9AE3-D581E7F53C76@fluffy.co.uk> <43AEFCED.2030800@invis.net> Message-ID: <20051225203934.tz7qef3y84kwow4k@ebourne.me.uk> There seems to have been a huge amount of discussion on here about logging. I'm not replying to any specific message because they all have points. I'm pretty sure we can come up with something that satisfies everyone's requirements, although it will include iostream using <<. ;) Here's an example line from one of my projects. It's using log4cxx, but we can do something just the same, and since we only want a small subset of the functionality, it shouldn't be hard. LOG4CXX_DEBUG(s_log, "Incoming event: " << time << ", " << sourceType << ", " << sourceName << ", " << payload); This is a macro, so it can be defined to NULL and therefore have zero impact in release builds. It could expand to many things, but one possibility would be: #define BOX_DEBUG(logger, stuff) \ do { \ std::ostringstream line; \ line << stuff; \ logger.write(BOX_DEBUG_LEVEL, __FUNCTION__, __LINE__, line.str()); } while(0) Another would be: #define BOX_DEBUG(logger, stuff) \ do { \ logger.stream(BOX_DEBUG_LEVEL) << stuff; \ } while(0) For maximum performance while still being able to disable certain levels at run time this would do: #define BOX_DEBUG(logger, stuff) \ do { \ if(logger.active(BOX_DEBUG_LEVEL)) \ { \ std::ostringstream line; \ line << stuff; \ logger.write(BOX_DEBUG_LEVEL, __FUNCTION__, __LINE__, line.str()); } \ } while(0) Then separate macros for each of BOX_INFO, BOX_ERROR, BOX_FATAL. Only the debug one has to compile out, and even that can be made conditional with configure.ac. We loose the TRACEn where the n really isn't nice at all. As to the objects and over engineering. Really we only need a few small classes with a couple of virtual methods in each. There's no need to make this hugely complicated. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Sun Dec 25 21:11:29 2005 From: boxbackup-dev at fluffy.co.uk (James O'Gorman) Date: Sun, 25 Dec 2005 21:11:29 +0000 Subject: [Box Backup-dev] Trunk build failure on FreeBSD/i386 5.4 In-Reply-To: <20051225193600.c8bxtk6qs00s0oks@ebourne.me.uk> References: <43AD4C88.8090109@netinertia.co.uk> <20051224230010.rosnvgom5cgo4gkg@ebourne.me.uk> <43ADD773.9060104@netinertia.co.uk> <43AE8E3E.3020306@netinertia.co.uk> <20051225193600.c8bxtk6qs00s0oks@ebourne.me.uk> Message-ID: <43AF0B01.6050707@netinertia.co.uk> Hi Martin, On 25/12/05 19:36, Martin Ebourne wrote: > Can you see if r284 fixes both of those issues? The second issue seems to be fixed, but autoconf didn't seem to pick up be64toh (it was #undef and commented out in lib/common/BoxConfig.h). (I had to manually edit BoxConfig.h to test the second fix.) Ben - does OpenBSD use be64toh or betoh64? NetBSD seems to be the same as FreeBSD, so I assume OpenBSD will be the same? James From boxbackup-dev at fluffy.co.uk Sun Dec 25 21:39:55 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Sun, 25 Dec 2005 21:39:55 +0000 Subject: [Box Backup-dev] Trunk build failure on FreeBSD/i386 5.4 In-Reply-To: <43AF0B01.6050707@netinertia.co.uk> References: <43AD4C88.8090109@netinertia.co.uk> <20051224230010.rosnvgom5cgo4gkg@ebourne.me.uk> <43ADD773.9060104@netinertia.co.uk> <43AE8E3E.3020306@netinertia.co.uk> <20051225193600.c8bxtk6qs00s0oks@ebourne.me.uk> <43AF0B01.6050707@netinertia.co.uk> Message-ID: <20051225213955.tmgvi37w0sk0oc8g@ebourne.me.uk> On Sun, 2005-12-25 at 21:11 +0000, James O'Gorman wrote: > Hi Martin, > > On 25/12/05 19:36, Martin Ebourne wrote: > > Can you see if r284 fixes both of those issues? > > The second issue seems to be fixed, but autoconf didn't seem to pick > up be64toh (it was #undef and commented out in > lib/common/BoxConfig.h). (I had to manually edit BoxConfig.h to test > the second fix.) > > Ben - does OpenBSD use be64toh or betoh64? NetBSD seems to be the > same as FreeBSD, so I assume OpenBSD will be the same? OpenBSD uses betoh64, hence the issue. Can you mail me the config.log so I can see why the test didn't work. Maybe because it's a macro only. Might be better to mail me the config.log directly because it's quite big. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Mon Dec 26 00:53:01 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Mon, 26 Dec 2005 00:53:01 +0000 Subject: [Box Backup-dev] Building in readline support In-Reply-To: <43ADD9FC.6080502@netinertia.co.uk> References: <43AD692D.8010009@netinertia.co.uk> <20051224230808.x0oyb3y1w0kko0s4@ebourne.me.uk> <43ADD9FC.6080502@netinertia.co.uk> Message-ID: <20051226005301.4y1yuul6o4sg88ss@ebourne.me.uk> On Sat, 2005-12-24 at 23:30 +0000, James O'Gorman wrote: > On 24/12/05 23:08, Martin Ebourne wrote: > > If you're on bsd I would expect you've got libedit or libeditline > > available. These should be drop in replacements for readline (but > > without the licensing problems) and the build system should > > automatically pick them up. If it doesn't then send the config.log > output. > > There does seem to be a libedit, yes. Not quite sure if it was > detected, though. I've attached the config.log. I've now installed libedit on my machine (linux) and box detected that and worked perfectly straight away. I'm using the version 2.9 from here (which is derived from NetBSD): http://www.thrysoee.dk/editline/ So we need to work out why it didn't like your libedit. The problem appears to be a missing 'readline' function definition in the .so. Could you 'nm -D' libedit.so and paste the output. Also check you've got the header files etc. The full list of none documentation libedit files from my system is: /usr/include/editline /usr/include/editline/readline.h /usr/include/histedit.h /usr/lib64/libedit.la /usr/lib64/libedit.so /usr/lib64/libedit.so.0 /usr/lib64/libedit.so.0.0.14 Cheers, Martin. From boxbackup-dev at fluffy.co.uk Mon Dec 26 01:09:38 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Mon, 26 Dec 2005 01:09:38 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r285 - box/chris Message-ID: <20051226010938.E3DC994@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-26 01:09:36 +0000 (Mon, 26 Dec 2005) New Revision: 285 Added: box/chris/logging/ Log: * http://bbdev.fluffy.co.uk/svn/box/chris/logging - Created a branch for the new logging code Copied: box/chris/logging (from rev 284, box/trunk) From boxbackup-dev at fluffy.co.uk Mon Dec 26 10:48:40 2005 From: boxbackup-dev at fluffy.co.uk (James O'Gorman) Date: Mon, 26 Dec 2005 10:48:40 +0000 Subject: [Box Backup-dev] Building in readline support In-Reply-To: <20051226005301.4y1yuul6o4sg88ss@ebourne.me.uk> References: <43AD692D.8010009@netinertia.co.uk> <20051224230808.x0oyb3y1w0kko0s4@ebourne.me.uk> <43ADD9FC.6080502@netinertia.co.uk> <20051226005301.4y1yuul6o4sg88ss@ebourne.me.uk> Message-ID: <43AFCA88.2090808@netinertia.co.uk> This is a multi-part message in MIME format. --------------060008070100050809000305 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 26/12/05 00:53, Martin Ebourne wrote: > I've now installed libedit on my machine (linux) and box detected that > and worked perfectly straight away. I'm using the version 2.9 from here > (which is derived from NetBSD): > > http://www.thrysoee.dk/editline/ > > So we need to work out why it didn't like your libedit. The problem > appears to be a missing 'readline' function definition in the .so. Could > you 'nm -D' libedit.so and paste the output. Attached. > Also check you've got the header files etc. The full list of none > documentation libedit files from my system is: > > /usr/include/editline > /usr/include/editline/readline.h > /usr/include/histedit.h > /usr/lib64/libedit.la > /usr/lib64/libedit.so > /usr/lib64/libedit.so.0 > /usr/lib64/libedit.so.0.0.14 According to man 3 editline, #include is required. This exists in /usr/include but instead of an editline subdir there is a readline subdir, which contains readline.h: jamesog at starbug:/data/bbdev/box/trunk> ls -1 /usr/include/readline/ chardefs.h history.h keymaps.h readline.h rlconf.h rlstdc.h rltypedefs.h tilde.h /usr/lib contains: jamesog at starbug:/data/bbdev/box/trunk> ls -l /usr/lib/lib{edit,read}* -r--r--r-- 1 root wheel 90890 Nov 3 08:09 /usr/lib/libedit.a lrwxrwxrwx 1 root wheel 17 Nov 7 20:48 /usr/lib/libedit.so@ -> /lib/libedit.so.5 -r--r--r-- 1 root wheel 263058 Nov 3 08:10 /usr/lib/libreadline.a lrwxrwxrwx 1 root wheel 21 Nov 7 20:48 /usr/lib/libreadline.so@ -> /lib/libreadline.so.6 And /lib: jamesog at starbug:/data/bbdev/box/trunk> ls -1 /lib/lib{edit,read}* /lib/libedit.so.5 /lib/libreadline.so.6 It seems to be libedit.so.4 and libreadline.so.5 for FreeBSD 5.4 and libedit.so.5, libreadline.so.6 for FreeBSD 6.0, if that makes any difference. James --------------060008070100050809000305 Content-Type: application/octet-stream; x-mac-type="0"; x-mac-creator="0"; name="nm-libedit.so.out" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="nm-libedit.so.out" ICAgICAgICAgVSBfQ3VycmVudFJ1bmVMb2NhbGUKMDAwMTNkNjQgQSBfRFlOQU1JQwogICAg ICAgICBVIF9EZWZhdWx0UnVuZUxvY2FsZQowMDAxM2UyOCBBIF9HTE9CQUxfT0ZGU0VUX1RB QkxFXwogICAgICAgICB3IF9Kdl9SZWdpc3RlckNsYXNzZXMKICAgICAgICAgVSBfX19ydW5l dHlwZQogICAgICAgICBVIF9fX3RvbG93ZXIKICAgICAgICAgVSBfX190b3VwcGVyCiAgICAg ICAgIFUgX19hc3NlcnQKMDAwMTNmOWMgQSBfX2Jzc19zdGFydAogICAgICAgICB3IF9fY3hh X2ZpbmFsaXplCiAgICAgICAgIHcgX19kZXJlZ2lzdGVyX2ZyYW1lX2luZm8KICAgICAgICAg VSBfX2Vycm9yCiAgICAgICAgIFUgX19pc3RocmVhZGVkCiAgICAgICAgIHcgX19yZWdpc3Rl cl9mcmFtZV9pbmZvCjAwMDEzZjljIEEgX2VkYXRhCjAwMDEzZmM0IEEgX2VuZAowMDAwZjQ4 YyBUIF9maW5pCjAwMDAyMjljIFQgX2luaXQKICAgICAgICAgVSBhYm9ydAogICAgICAgICBV IGNmZ2V0aXNwZWVkCiAgICAgICAgIFUgY2ZnZXRvc3BlZWQKICAgICAgICAgVSBjZnNldGlz cGVlZAogICAgICAgICBVIGNmc2V0b3NwZWVkCiAgICAgICAgIFUgY2xvc2UKMDAwMDkwNTQg VCBlbF9iZWVwCjAwMDAzOGQ0IFQgZWxfZGF0YV9nZXQKMDAwMDM4YzQgVCBlbF9kYXRhX3Nl dAowMDAwMzI1NCBUIGVsX2RlbGV0ZXN0cgowMDAwYTdhOCBUIGVsX2VuZAowMDAwMzdlMCBU IGVsX2dldAowMDAwYWYxYyBUIGVsX2dldGMKMDAwMGIwNzQgVCBlbF9nZXRzCjAwMDA5ZGYw IFQgZWxfaW5pdAowMDAwMzFkOCBUIGVsX2luc2VydHN0cgowMDAwMzhlMCBUIGVsX2xpbmUK MDAwMDU4NDAgVCBlbF9wYXJzZQowMDAwOTg5NCBUIGVsX3B1c2gKMDAwMGE3OGMgVCBlbF9y ZXNldAowMDAwNmU5NCBUIGVsX3Jlc2l6ZQowMDAwYzk0MCBUIGVsX3NldAowMDAwNTlhNCBU IGVsX3NvdXJjZQogICAgICAgICBVIGV4ZWNscAogICAgICAgICBVIGV4aXQKICAgICAgICAg VSBmY2htb2QKICAgICAgICAgVSBmY2xvc2UKICAgICAgICAgVSBmY250bAogICAgICAgICBV IGZmbHVzaAogICAgICAgICBVIGZnZXRsbgogICAgICAgICBVIGZpbGVubwogICAgICAgICBV IGZvcGVuCiAgICAgICAgIFUgZm9yawogICAgICAgICBVIGZwcmludGYKICAgICAgICAgVSBm cHV0YwogICAgICAgICBVIGZwdXRzCiAgICAgICAgIFUgZnJlZQogICAgICAgICBVIGZ3cml0 ZQogICAgICAgICBVIGdldGVudgowMDAwZTQ4OCBUIGhpc3RvcnkKMDAwMGU0NDAgVCBoaXN0 b3J5X2VuZAowMDAwZTM4YyBUIGhpc3RvcnlfaW5pdAogICAgICAgICBVIGlvY3RsCiAgICAg ICAgIFUgaXNzZXR1Z2lkCiAgICAgICAgIFUga2lsbAogICAgICAgICBVIGxzZWVrCiAgICAg ICAgIFUgbWFsbG9jCiAgICAgICAgIFUgbWVtY3B5CiAgICAgICAgIFUgbWVtc2V0CiAgICAg ICAgIFUgbWtzdGVtcAogICAgICAgICBVIHJlYWQKICAgICAgICAgVSByZWFsbG9jCiAgICAg ICAgIFUgcmVnY29tcAogICAgICAgICBVIHJlZ2V4ZWMKICAgICAgICAgVSByZWdmcmVlCiAg ICAgICAgIFUgc2lnYWRkc2V0CiAgICAgICAgIFUgc2lnZW1wdHlzZXQKICAgICAgICAgVSBz aWduYWwKICAgICAgICAgVSBzaWdwcm9jbWFzawogICAgICAgICBVIHN0cmNocgogICAgICAg ICBVIHN0cmNtcAogICAgICAgICBVIHN0cmNweQogICAgICAgICBVIHN0cmNzcG4KICAgICAg ICAgVSBzdHJkdXAKICAgICAgICAgVSBzdHJsY2F0CiAgICAgICAgIFUgc3RybGNweQogICAg ICAgICBVIHN0cm5jbXAKICAgICAgICAgVSBzdHJuY3B5CiAgICAgICAgIFUgc3Ryc3RyCiAg ICAgICAgIFUgc3RydG9sCiAgICAgICAgIFUgc3RydW52aXMKICAgICAgICAgVSBzdHJ2aXMK ICAgICAgICAgVSB0Y2dldGF0dHIKICAgICAgICAgVSB0Y3NldGF0dHIKICAgICAgICAgVSB0 Z2V0ZW50CiAgICAgICAgIFUgdGdldGZsYWcKICAgICAgICAgVSB0Z2V0bnVtCiAgICAgICAg IFUgdGdldHN0cgogICAgICAgICBVIHRnb3RvCjAwMDBlZjE0IFQgdG9rX2VuZAowMDAwZWUx YyBUIHRva19pbml0CjAwMDBlZjU0IFQgdG9rX2xpbmUKMDAwMGVlZWMgVCB0b2tfcmVzZXQK MDAwMGY0MDggVCB0b2tfc3RyCiAgICAgICAgIFUgdHB1dHMKICAgICAgICAgVSB1bmxpbmsK ICAgICAgICAgVSB3YWl0cGlkCiAgICAgICAgIFUgd3JpdGUK --------------060008070100050809000305-- From boxbackup-dev at fluffy.co.uk Tue Dec 27 00:23:40 2005 From: boxbackup-dev at fluffy.co.uk (James O'Gorman) Date: Tue, 27 Dec 2005 00:23:40 +0000 Subject: [Box Backup-dev] Trunk build failure on FreeBSD/i386 5.4 In-Reply-To: <20051225213955.tmgvi37w0sk0oc8g@ebourne.me.uk> References: <43AD4C88.8090109@netinertia.co.uk> <20051224230010.rosnvgom5cgo4gkg@ebourne.me.uk> <43ADD773.9060104@netinertia.co.uk> <43AE8E3E.3020306@netinertia.co.uk> <20051225193600.c8bxtk6qs00s0oks@ebourne.me.uk> <43AF0B01.6050707@netinertia.co.uk> <20051225213955.tmgvi37w0sk0oc8g@ebourne.me.uk> Message-ID: <43B0898C.7010505@netinertia.co.uk> On 25/12/05 21:39, Martin Ebourne wrote: > Can you mail me the config.log so I can see why the test didn't work. > Maybe because it's a macro only. > > Might be better to mail me the config.log directly because it's quite > big. Which address should I be sending to? I tried martin at zepler.org (which was the sender address for this particular mail) but it's stuck in Exim's mailq at the moment and I've had a 'delayed 24 hours' notice. James From boxbackup-dev at fluffy.co.uk Mon Dec 26 10:52:01 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Mon, 26 Dec 2005 10:52:01 +0000 Subject: [Box Backup-dev] COMMIT r285 - box/chris In-Reply-To: <20051226010938.E3DC994@s0g0.pems.testserver.co.uk> References: <20051226010938.E3DC994@s0g0.pems.testserver.co.uk> Message-ID: <1135594321.4142.6.camel@avenin.ebourne.me.uk> On Mon, 2005-12-26 at 01:09 +0000, subversion at fluffy.co.uk wrote: > Author: chris > Date: 2005-12-26 01:09:36 +0000 (Mon, 26 Dec 2005) > New Revision: 285 > > Added: > box/chris/logging/ > Log: > * http://bbdev.fluffy.co.uk/svn/box/chris/logging > - Created a branch for the new logging code Would it be ok to submit a class level design for review? Nothing fancy (this isn't work :)), just something so we can comment if required. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Wed Dec 28 07:35:19 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 28 Dec 2005 07:35:19 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r286 - in box/trunk: . lib/common Message-ID: <20051228073519.2253594@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-28 07:35:17 +0000 (Wed, 28 Dec 2005) New Revision: 286 Modified: box/trunk/configure.ac box/trunk/lib/common/Box.h Log: Don't use betoh64/be64tonh to avoid name hassle Modified: box/trunk/configure.ac =================================================================== --- box/trunk/configure.ac 2005-12-26 01:09:36 UTC (rev 285) +++ box/trunk/configure.ac 2005-12-28 07:35:17 UTC (rev 286) @@ -112,7 +112,7 @@ AC_FUNC_ERROR_AT_LINE AC_TYPE_SIGNAL AC_FUNC_STAT -AC_CHECK_FUNCS([be64toh getpeereid kqueue lchown setproctitle]) +AC_CHECK_FUNCS([getpeereid kqueue lchown setproctitle]) AX_FUNC_SYSCALL AX_CHECK_SYSCALL_LSEEK Modified: box/trunk/lib/common/Box.h =================================================================== --- box/trunk/lib/common/Box.h 2005-12-26 01:09:36 UTC (rev 285) +++ box/trunk/lib/common/Box.h 2005-12-28 07:35:17 UTC (rev 286) @@ -137,12 +137,10 @@ #else #ifdef HAVE_SYS_ENDIAN_H #include + // betoh64 (OpenBSD) is sometimes called be64toh (FreeBSD, NetBSD). + // Rather than check for it just reuse htobe64 since they are symmetrical #define box_hton64(x) htobe64(x) - #ifdef HAVE_BE64TOH - #define box_ntoh64(x) be64toh(x) - #else - #define box_ntoh64(x) betoh64(x) - #endif + #define box_ntoh64(x) htobe64(x) #elif HAVE_ASM_BYTEORDER_H #include #define box_hton64(x) __cpu_to_be64(x) From boxbackup-dev at fluffy.co.uk Wed Dec 28 07:37:39 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 28 Dec 2005 07:37:39 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r287 - box/trunk/lib/common Message-ID: <20051228073739.177CF94@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-28 07:37:37 +0000 (Wed, 28 Dec 2005) New Revision: 287 Modified: box/trunk/lib/common/ Log: Fix svn:ignore for BoxConfig.h, missed from r260 Property changes on: box/trunk/lib/common ___________________________________________________________________ Name: svn:ignore - autogen_CommonException.cpp autogen_CommonException.h autogen_ConversionException.cpp autogen_ConversionException.h config.h config.h.in Makefile + autogen_CommonException.cpp autogen_CommonException.h autogen_ConversionException.cpp autogen_ConversionException.h BoxConfig.h BoxConfig.h.in Makefile From boxbackup-dev at fluffy.co.uk Wed Dec 28 11:38:06 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 28 Dec 2005 11:38:06 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r288 - in box/trunk: . bin/bbackupd infrastructure/m4 Message-ID: <20051228113806.BCDFE94@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-28 11:38:04 +0000 (Wed, 28 Dec 2005) New Revision: 288 Added: box/trunk/infrastructure/m4/ax_compare_version.m4 box/trunk/infrastructure/m4/ax_path_bdb.m4 box/trunk/infrastructure/m4/ax_split_version.m4 Modified: box/trunk/bin/bbackupd/BackupClientInodeToIDMap.cpp box/trunk/configure.ac Log: Now supports Berkeley DB versions >= 4.1 in addition to 1.x. The versions inbetween are not supported because they require code changes and I don't have them available to test against. Modified: box/trunk/bin/bbackupd/BackupClientInodeToIDMap.cpp =================================================================== --- box/trunk/bin/bbackupd/BackupClientInodeToIDMap.cpp 2005-12-28 07:37:37 UTC (rev 287) +++ box/trunk/bin/bbackupd/BackupClientInodeToIDMap.cpp 2005-12-28 11:38:04 UTC (rev 288) @@ -14,7 +14,7 @@ #include #include #include - #include DB_HEADER + #include #include #endif @@ -65,7 +65,7 @@ #ifndef BACKIPCLIENTINODETOIDMAP_IN_MEMORY_IMPLEMENTATION if(dbp != 0) { -#ifdef BERKELY_V4 +#if BDB_VERSION_MAJOR >= 3 dbp->close(0); #else dbp->close(dbp); @@ -94,7 +94,7 @@ ASSERT(!mEmpty); // Open the database file -#ifdef BERKELY_V4 +#if BDB_VERSION_MAJOR >= 3 dbp = new Db(0,0); dbp->set_pagesize(1024); /* Page size: 1K. */ dbp->set_cachesize(0, 32 * 1024, 0); @@ -146,7 +146,7 @@ #ifndef BACKIPCLIENTINODETOIDMAP_IN_MEMORY_IMPLEMENTATION if(dbp != 0) { -#ifdef BERKELY_V4 +#if BDB_VERSION_MAJOR >= 3 if(dbp->close(0) != 0) #else if(dbp->close(dbp) != 0) @@ -188,7 +188,7 @@ rec.mObjectID = ObjectID; rec.mInDirectory = InDirectory; -#ifdef BERKELY_V4 +#if BDB_VERSION_MAJOR >= 3 Dbt key(&InodeRef, sizeof(InodeRef)); Dbt data(&rec, sizeof(rec)); @@ -250,7 +250,7 @@ THROW_EXCEPTION(BackupStoreException, InodeMapNotOpen); } -#ifdef BERKELY_V4 +#if BDB_VERSION_MAJOR >= 3 Dbt key(&InodeRef, sizeof(InodeRef)); Dbt data(0, 0); switch(dbp->get(NULL, &key, &data, 0)) @@ -280,7 +280,7 @@ } // Check for sensible return -#ifdef BERKELY_V4 +#if BDB_VERSION_MAJOR >= 3 if(key.get_data() == 0 || data.get_size() != sizeof(IDBRecord)) { // Assert in debug version Modified: box/trunk/configure.ac =================================================================== --- box/trunk/configure.ac 2005-12-28 07:37:37 UTC (rev 287) +++ box/trunk/configure.ac 2005-12-28 11:38:04 UTC (rev 288) @@ -32,15 +32,27 @@ if test "$target_os" != "mingw32" -a "$target_os" != "winnt"; then AC_SEARCH_LIBS([nanosleep], [rt], [ac_have_nanosleep=yes], - [AC_MSG_ERROR([[Cannot find a short sleep function (nanosleep)]])]) + [AC_MSG_ERROR([[cannot find a short sleep function (nanosleep)]])]) fi -AC_CHECK_LIB([z], [zlibVersion],, [AC_MSG_ERROR([[Cannot find zlib]])]) -AX_CHECK_BDB_V1 +AC_CHECK_LIB([z], [zlibVersion],, [AC_MSG_ERROR([[cannot find zlib]])]) VL_LIB_READLINE have_libreadline=no test "x$vl_cv_lib_readline" != "xno" && have_libreadline=yes +## Check for Berkely DB. Restrict to certain versions +AX_PATH_BDB(, [ + LIBS="$BDB_LIBS $LIBS" + LDFLAGS="$BDB_LDFLAGS $LDFLAGS" + CPPFLAGS="$CPPFLAGS $BDB_CPPFLAGS" + AX_COMPARE_VERSION([$BDB_VERSION],[ge],[4.1],, + [AX_COMPARE_VERSION([$BDB_VERSION],[lt],[2],, + [AC_MSG_ERROR([[only Berkely DB versions 1.x or at least 4.1 are currently supported]])] + )] + ) + AX_SPLIT_VERSION([BDB_VERSION], [$BDB_VERSION]) +]) + ## Check for Open SSL, use old versions only if explicitly requested AX_CHECK_SSL(, [AC_MSG_ERROR([[OpenSSL is not installed but is required]])]) AC_ARG_ENABLE( @@ -178,7 +190,7 @@ to the documentation for more information on each feature. Large files: $have_large_file_support -Berkeley DB: $ac_have_bdb +Berkeley DB: $ax_path_bdb_ok Readline: $have_libreadline Extended attributes: $ac_cv_header_sys_xattr_h EOC @@ -204,8 +216,3 @@ libedit or libeditline instead.]]) ;; esac - -if test "x$ac_have_bdb" != "xyes"; then - echo - AC_MSG_WARN([[db is not installed -- will run in reduced efficiency mode without it]]) -fi Added: box/trunk/infrastructure/m4/ax_compare_version.m4 =================================================================== --- box/trunk/infrastructure/m4/ax_compare_version.m4 2005-12-28 07:37:37 UTC (rev 287) +++ box/trunk/infrastructure/m4/ax_compare_version.m4 2005-12-28 11:38:04 UTC (rev 288) @@ -0,0 +1,162 @@ +dnl @synopsis AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +dnl +dnl This macro compares two version strings. It is used heavily in the +dnl macro _AX_PATH_BDB for library checking. Due to the various number +dnl of minor-version numbers that can exist, and the fact that string +dnl comparisons are not compatible with numeric comparisons, this is +dnl not necessarily trivial to do in a autoconf script. This macro +dnl makes doing these comparisons easy. +dnl +dnl The six basic comparisons are available, as well as checking +dnl equality limited to a certain number of minor-version levels. +dnl +dnl The operator OP determines what type of comparison to do, and can +dnl be one of: +dnl +dnl eq - equal (test A == B) +dnl ne - not equal (test A != B) +dnl le - less than or equal (test A <= B) +dnl ge - greater than or equal (test A >= B) +dnl lt - less than (test A < B) +dnl gt - greater than (test A > B) +dnl +dnl Additionally, the eq and ne operator can have a number after it to +dnl limit the test to that number of minor versions. +dnl +dnl eq0 - equal up to the length of the shorter version +dnl ne0 - not equal up to the length of the shorter version +dnl eqN - equal up to N sub-version levels +dnl neN - not equal up to N sub-version levels +dnl +dnl When the condition is true, shell commands ACTION-IF-TRUE are run, +dnl otherwise shell commands ACTION-IF-FALSE are run. The environment +dnl variable 'ax_compare_version' is always set to either 'true' or +dnl 'false' as well. +dnl +dnl Examples: +dnl +dnl AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8]) +dnl AX_COMPARE_VERSION([3.15],[lt],[3.15.8]) +dnl +dnl would both be true. +dnl +dnl AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8]) +dnl AX_COMPARE_VERSION([3.15],[gt],[3.15.8]) +dnl +dnl would both be false. +dnl +dnl AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8]) +dnl +dnl would be true because it is only comparing two minor versions. +dnl +dnl AX_COMPARE_VERSION([3.15.7],[eq0],[3.15]) +dnl +dnl would be true because it is only comparing the lesser number of +dnl minor versions of the two values. +dnl +dnl Note: The characters that separate the version numbers do not +dnl matter. An empty string is the same as version 0. OP is evaluated +dnl by autoconf, not configure, so must be a string, not a variable. +dnl +dnl The author would like to acknowledge Guido Draheim whose advice +dnl about the m4_case and m4_ifvaln functions make this macro only +dnl include the portions necessary to perform the specific comparison +dnl specified by the OP argument in the final configure script. +dnl +dnl @category Misc +dnl @author Tim Toolan +dnl @version 2004-03-01 +dnl @license GPLWithACException + +dnl ######################################################################### +AC_DEFUN([AX_COMPARE_VERSION], [ + # Used to indicate true or false condition + ax_compare_version=false + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + AS_VAR_PUSHDEF([A],[ax_compare_version_A]) + A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ + -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/[[^0-9]]//g'` + + AS_VAR_PUSHDEF([B],[ax_compare_version_B]) + B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ + -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/[[^0-9]]//g'` + + dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary + dnl # then the first line is used to determine if the condition is true. + dnl # The sed right after the echo is to remove any indented white space. + m4_case(m4_tolower($2), + [lt],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"` + ], + [gt],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"` + ], + [le],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"` + ], + [ge],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"` + ],[ + dnl Split the operator from the subversion count if present. + m4_bmatch(m4_substr($2,2), + [0],[ + # A count of zero means use the length of the shorter version. + # Determine the number of characters in A and B. + ax_compare_version_len_A=`echo "$A" | awk '{print(length)}'` + ax_compare_version_len_B=`echo "$B" | awk '{print(length)}'` + + # Set A to no more than B's length and B to no more than A's length. + A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"` + B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"` + ], + [[0-9]+],[ + # A count greater than zero means use only that many subversions + A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` + B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` + ], + [.+],[ + AC_WARNING( + [illegal OP numeric parameter: $2]) + ],[]) + + # Pad zeros at end of numbers to make same length. + ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`" + B="$B`echo $A | sed 's/./0/g'`" + A="$ax_compare_version_tmp_A" + + # Check for equality or inequality as necessary. + m4_case(m4_tolower(m4_substr($2,0,2)), + [eq],[ + test "x$A" = "x$B" && ax_compare_version=true + ], + [ne],[ + test "x$A" != "x$B" && ax_compare_version=true + ],[ + AC_WARNING([illegal OP parameter: $2]) + ]) + ]) + + AS_VAR_POPDEF([A])dnl + AS_VAR_POPDEF([B])dnl + + dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE. + if test "$ax_compare_version" = "true" ; then + m4_ifvaln([$4],[$4],[:])dnl + m4_ifvaln([$5],[else $5])dnl + fi +]) dnl AX_COMPARE_VERSION Added: box/trunk/infrastructure/m4/ax_path_bdb.m4 =================================================================== --- box/trunk/infrastructure/m4/ax_path_bdb.m4 2005-12-28 07:37:37 UTC (rev 287) +++ box/trunk/infrastructure/m4/ax_path_bdb.m4 2005-12-28 11:38:04 UTC (rev 288) @@ -0,0 +1,580 @@ +dnl @synopsis AX_PATH_BDB([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl +dnl This macro finds the latest version of Berkeley DB on the system, +dnl and ensures that the header file and library versions match. If +dnl MINIMUM-VERSION is specified, it will ensure that the library found +dnl is at least that version. +dnl +dnl It determines the name of the library as well as the path to the +dnl header file and library. It will check both the default environment +dnl as well as the default Berkeley DB install location. When found, it +dnl sets BDB_LIBS, BDB_CPPFLAGS, and BDB_LDFLAGS to the necessary +dnl values to add to LIBS, CPPFLAGS, and LDFLAGS, as well as setting +dnl BDB_VERSION to the version found. HAVE_DB_H is defined also. +dnl +dnl The option --with-bdb-dir=DIR can be used to specify a specific +dnl Berkeley DB installation to use. +dnl +dnl An example of it's use is: +dnl +dnl AX_PATH_BDB([3],[ +dnl LIBS="$BDB_LIBS $LIBS" +dnl LDFLAGS="$BDB_LDFLAGS $LDFLAGS" +dnl CPPFLAGS="$CPPFLAGS $BDB_CPPFLAGS" +dnl ]) +dnl +dnl which will locate the latest version of Berkeley DB on the system, +dnl and ensure that it is version 3.0 or higher. +dnl +dnl Details: This macro does not use either AC_CHECK_HEADERS or +dnl AC_CHECK_LIB because, first, the functions inside the library are +dnl sometimes renamed to contain a version code that is only available +dnl from the db.h on the system, and second, because it is common to +dnl have multiple db.h and libdb files on a system it is important to +dnl make sure the ones being used correspond to the same version. +dnl Additionally, there are many different possible names for libdb +dnl when installed by an OS distribution, and these need to be checked +dnl if db.h does not correspond to libdb. +dnl +dnl When cross compiling, only header versions are verified since it +dnl would be difficult to check the library version. Additionally the +dnl default Berkeley DB installation locations /usr/local/BerkeleyDB* +dnl are not searched for higher versions of the library. +dnl +dnl The format for the list of library names to search came from the +dnl Cyrus IMAP distribution, although they are generated dynamically +dnl here, and only for the version found in db.h. +dnl +dnl The macro AX_COMPARE_VERSION is required to use this macro, and +dnl should be available from the Autoconf Macro Archive. +dnl +dnl The author would like to acknowledge the generous and valuable +dnl feedback from Guido Draheim, without which this macro would be far +dnl less robust, and have poor and inconsistent cross compilation +dnl support. +dnl +dnl Changes: +dnl +dnl 1/5/05 applied patch from Rafa Rzepecki to eliminate compiler +dnl warning about unused variable, argv +dnl +dnl @category InstalledPackages +dnl @author Tim Toolan +dnl @version 2005-01-17 +dnl @license GPLWithACException + +dnl ######################################################################### +AC_DEFUN([AX_PATH_BDB], [ + dnl # Used to indicate success or failure of this function. + ax_path_bdb_ok=no + + # Add --with-bdb-dir option to configure. + AC_ARG_WITH([bdb-dir], + [AC_HELP_STRING([--with-bdb-dir=DIR], + [Berkeley DB installation directory])]) + + # Check if --with-bdb-dir was specified. + if test "x$with_bdb_dir" = "x" ; then + # No option specified, so just search the system. + AX_PATH_BDB_NO_OPTIONS([$1], [HIGHEST], [ + ax_path_bdb_ok=yes + ]) + else + # Set --with-bdb-dir option. + ax_path_bdb_INC="$with_bdb_dir/include" + ax_path_bdb_LIB="$with_bdb_dir/lib" + + dnl # Save previous environment, and modify with new stuff. + ax_path_bdb_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="-I$ax_path_bdb_INC $CPPFLAGS" + + ax_path_bdb_save_LDFLAGS=$LDFLAGS + LDFLAGS="-L$ax_path_bdb_LIB $LDFLAGS" + + # Check for specific header file db.h + AC_MSG_CHECKING([db.h presence in $ax_path_bdb_INC]) + if test -f "$ax_path_bdb_INC/db.h" ; then + AC_MSG_RESULT([yes]) + # Check for library + AX_PATH_BDB_NO_OPTIONS([$1], [ENVONLY], [ + ax_path_bdb_ok=yes + BDB_CPPFLAGS="-I$ax_path_bdb_INC" + BDB_LDFLAGS="-L$ax_path_bdb_LIB" + ]) + else + AC_MSG_RESULT([no]) + AC_MSG_NOTICE([no usable Berkeley DB not found]) + fi + + dnl # Restore the environment. + CPPFLAGS="$ax_path_bdb_save_CPPFLAGS" + LDFLAGS="$ax_path_bdb_save_LDFLAGS" + + fi + + dnl # Execute ACTION-IF-FOUND / ACTION-IF-NOT-FOUND. + if test "$ax_path_bdb_ok" = "yes" ; then + m4_ifvaln([$2],[$2],[:])dnl + m4_ifvaln([$3],[else $3])dnl + fi + +]) dnl AX_PATH_BDB + +dnl ######################################################################### +dnl Check for berkeley DB of at least MINIMUM-VERSION on system. +dnl +dnl The OPTION argument determines how the checks occur, and can be one of: +dnl +dnl HIGHEST - Check both the environment and the default installation +dnl directories for Berkeley DB and choose the version that +dnl is highest. (default) +dnl ENVFIRST - Check the environment first, and if no satisfactory +dnl library is found there check the default installation +dnl directories for Berkeley DB which is /usr/local/BerkeleyDB* +dnl ENVONLY - Check the current environment only. +dnl +dnl Requires AX_PATH_BDB_PATH_GET_VERSION, AX_PATH_BDB_PATH_FIND_HIGHEST, +dnl AX_PATH_BDB_ENV_CONFIRM_LIB, AX_PATH_BDB_ENV_GET_VERSION, and +dnl AX_COMPARE_VERSION macros. +dnl +dnl Result: sets ax_path_bdb_no_options_ok to yes or no +dnl sets BDB_LIBS, BDB_CPPFLAGS, BDB_LDFLAGS, BDB_VERSION +dnl +dnl AX_PATH_BDB_NO_OPTIONS([MINIMUM-VERSION], [OPTION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +AC_DEFUN([AX_PATH_BDB_NO_OPTIONS], [ + dnl # Used to indicate success or failure of this function. + ax_path_bdb_no_options_ok=no + + # Values to add to environment to use Berkeley DB. + BDB_VERSION='' + BDB_LIBS='' + BDB_CPPFLAGS='' + BDB_LDFLAGS='' + + # Check cross compilation here. + if test "x$cross_compiling" = "xyes" ; then + # If cross compiling, can't use AC_RUN_IFELSE so do these tests. + # The AC_PREPROC_IFELSE confirms that db.h is preprocessable, + # and extracts the version number from it. + AC_MSG_CHECKING([for db.h]) + + AS_VAR_PUSHDEF([HEADER_VERSION],[ax_path_bdb_no_options_HEADER_VERSION])dnl + HEADER_VERSION='' + AC_PREPROC_IFELSE([ + AC_LANG_SOURCE([[ +#include +AX_PATH_BDB_STUFF DB_VERSION_MAJOR,DB_VERSION_MINOR,DB_VERSION_PATCH + ]]) + ],[ + # Extract version from preprocessor output. + HEADER_VERSION=`eval "$ac_cpp conftest.$ac_ext" 2> /dev/null \ + | grep AX_PATH_BDB_STUFF | sed 's/[[^0-9,]]//g;s/,/./g;1q'` + ],[]) + + if test "x$HEADER_VERSION" = "x" ; then + AC_MSG_RESULT([no]) + else + AC_MSG_RESULT([$HEADER_VERSION]) + + # Check that version is high enough. + AX_COMPARE_VERSION([$HEADER_VERSION],[ge],[$1],[ + # get major and minor version numbers + AS_VAR_PUSHDEF([MAJ],[ax_path_bdb_no_options_MAJOR])dnl + MAJ=`echo $HEADER_VERSION | sed 's,\..*,,'` + AS_VAR_PUSHDEF([MIN],[ax_path_bdb_no_options_MINOR])dnl + MIN=`echo $HEADER_VERSION | sed 's,^[[0-9]]*\.,,;s,\.[[0-9]]*$,,'` + + dnl # Save LIBS. + ax_path_bdb_no_options_save_LIBS="$LIBS" + + # Check that we can link with the library. + AC_SEARCH_LIBS([db_version], + [db db-$MAJ.$MIN db$MAJ.$MIN db$MAJ$MIN db-$MAJ db$MAJ],[ + # Sucessfully found library. + ax_path_bdb_no_options_ok=yes + BDB_VERSION=$HEADER_VERSION + + # Extract library from LIBS + ax_path_bdb_no_options_LEN=` \ + echo "x$ax_path_bdb_no_options_save_LIBS" \ + | awk '{print(length)}'` + BDB_LIBS=`echo "x$LIBS " \ + | sed "s/.\{$ax_path_bdb_no_options_LEN\}\$//;s/^x//;s/ //g"` + ],[]) + + dnl # Restore LIBS + LIBS="$ax_path_bdb_no_options_save_LIBS" + + AS_VAR_POPDEF([MAJ])dnl + AS_VAR_POPDEF([MIN])dnl + ]) + fi + + AS_VAR_POPDEF([HEADER_VERSION])dnl + else + # Not cross compiling. + # Check version of Berkeley DB in the current environment. + AX_PATH_BDB_ENV_GET_VERSION([ + AX_COMPARE_VERSION([$ax_path_bdb_env_get_version_VERSION],[ge],[$1],[ + # Found acceptable version in current environment. + ax_path_bdb_no_options_ok=yes + BDB_VERSION="$ax_path_bdb_env_get_version_VERSION" + BDB_LIBS="$ax_path_bdb_env_get_version_LIBS" + ]) + ]) + + # Determine if we need to search /usr/local/BerkeleyDB* + ax_path_bdb_no_options_DONE=no + if test "x$2" = "xENVONLY" ; then + ax_path_bdb_no_options_DONE=yes + elif test "x$2" = "xENVFIRST" ; then + ax_path_bdb_no_options_DONE=$ax_path_bdb_no_options_ok + fi + + if test "$ax_path_bdb_no_options_DONE" = "no" ; then + ax_compare_version=false + # Check for highest in /usr/local/BerkeleyDB* + AX_PATH_BDB_PATH_FIND_HIGHEST([ + if test "$ax_path_bdb_no_options_ok" = "yes" ; then + # If we already have an acceptable version use this if higher. + AX_COMPARE_VERSION( + [$ax_path_bdb_path_find_highest_VERSION],[gt],[$BDB_VERSION]) + else + # Since we didn't have an acceptable version check if this one is. + AX_COMPARE_VERSION( + [$ax_path_bdb_path_find_highest_VERSION],[ge],[$1]) + fi + ]) + + dnl # If result from _AX_COMPARE_VERSION is true we want this version. + if test "$ax_compare_version" = "true" ; then + ax_path_bdb_no_options_ok=yes + BDB_LIBS="-ldb" + if test "x$ax_path_bdb_path_find_highest_DIR" != x ; then + BDB_CPPFLAGS="-I$ax_path_bdb_path_find_highest_DIR/include" + BDB_LDFLAGS="-L$ax_path_bdb_path_find_highest_DIR/lib" + fi + BDB_VERSION="$ax_path_bdb_path_find_highest_VERSION" + fi + fi + fi + + dnl # Execute ACTION-IF-FOUND / ACTION-IF-NOT-FOUND. + if test "$ax_path_bdb_no_options_ok" = "yes" ; then + AC_MSG_NOTICE([using Berkeley DB version $BDB_VERSION]) + AC_DEFINE([HAVE_DB_H],[1], + [Define to 1 if you have the header file.]) + m4_ifvaln([$3],[$3])dnl + else + AC_MSG_NOTICE([no Berkeley DB version $1 or higher found]) + m4_ifvaln([$4],[$4])dnl + fi +]) dnl AX_PATH_BDB_NO_OPTIONS + +dnl ######################################################################### +dnl Check the default installation directory for Berkeley DB which is +dnl of the form /usr/local/BerkeleyDB* for the highest version. +dnl +dnl Result: sets ax_path_bdb_path_find_highest_ok to yes or no, +dnl sets ax_path_bdb_path_find_highest_VERSION to version, +dnl sets ax_path_bdb_path_find_highest_DIR to directory. +dnl +dnl AX_PATH_BDB_PATH_FIND_HIGHEST([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +AC_DEFUN([AX_PATH_BDB_PATH_FIND_HIGHEST], [ + dnl # Used to indicate success or failure of this function. + ax_path_bdb_path_find_highest_ok=no + + AS_VAR_PUSHDEF([VERSION],[ax_path_bdb_path_find_highest_VERSION])dnl + VERSION='' + + ax_path_bdb_path_find_highest_DIR='' + + # find highest verison in default install directory for Berkeley DB + AS_VAR_PUSHDEF([CURDIR],[ax_path_bdb_path_find_highest_CURDIR])dnl + AS_VAR_PUSHDEF([CUR_VERSION],[ax_path_bdb_path_get_version_VERSION])dnl + + for CURDIR in `ls -d /usr/local/BerkeleyDB* 2> /dev/null` + do + AX_PATH_BDB_PATH_GET_VERSION([$CURDIR],[ + AX_COMPARE_VERSION([$CUR_VERSION],[gt],[$VERSION],[ + ax_path_bdb_path_find_highest_ok=yes + ax_path_bdb_path_find_highest_DIR="$CURDIR" + VERSION="$CUR_VERSION" + ]) + ]) + done + + AS_VAR_POPDEF([VERSION])dnl + AS_VAR_POPDEF([CUR_VERSION])dnl + AS_VAR_POPDEF([CURDIR])dnl + + dnl # Execute ACTION-IF-FOUND / ACTION-IF-NOT-FOUND. + if test "$ax_path_bdb_path_find_highest_ok" = "yes" ; then + m4_ifvaln([$1],[$1],[:])dnl + m4_ifvaln([$2],[else $2])dnl + fi + +]) dnl AX_PATH_BDB_PATH_FIND_HIGHEST + +dnl ######################################################################### +dnl Checks for Berkeley DB in specified directory's lib and include +dnl subdirectories. +dnl +dnl Result: sets ax_path_bdb_path_get_version_ok to yes or no, +dnl sets ax_path_bdb_path_get_version_VERSION to version. +dnl +dnl AX_PATH_BDB_PATH_GET_VERSION(BDB-DIR, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +AC_DEFUN([AX_PATH_BDB_PATH_GET_VERSION], [ + dnl # Used to indicate success or failure of this function. + ax_path_bdb_path_get_version_ok=no + + # Indicate status of checking for Berkeley DB header. + AC_MSG_CHECKING([in $1/include for db.h]) + ax_path_bdb_path_get_version_got_header=no + test -f "$1/include/db.h" && ax_path_bdb_path_get_version_got_header=yes + AC_MSG_RESULT([$ax_path_bdb_path_get_version_got_header]) + + # Indicate status of checking for Berkeley DB library. + AC_MSG_CHECKING([in $1/lib for library -ldb]) + + ax_path_bdb_path_get_version_VERSION='' + + if test -d "$1/include" && test -d "$1/lib" && + test "$ax_path_bdb_path_get_version_got_header" = "yes" ; then + dnl # save and modify environment + ax_path_bdb_path_get_version_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="-I$1/include $CPPFLAGS" + + ax_path_bdb_path_get_version_save_LIBS="$LIBS" + LIBS="$LIBS -ldb" + + ax_path_bdb_path_get_version_save_LDFLAGS="$LDFLAGS" + LDFLAGS="-L$1/lib $LDFLAGS" + + # Compile and run a program that compares the version defined in + # the header file with a version defined in the library function + # db_version. + AC_RUN_IFELSE([ + AC_LANG_SOURCE([[ +#include +#include +int main(int argc,char **argv) +{ + int major,minor,patch; + (void) argv; + db_version(&major,&minor,&patch); + if (argc > 1) + printf("%d.%d.%d\n",DB_VERSION_MAJOR,DB_VERSION_MINOR,DB_VERSION_PATCH); + if (DB_VERSION_MAJOR == major && DB_VERSION_MINOR == minor && + DB_VERSION_PATCH == patch) + return 0; + else + return 1; +} + ]]) + ],[ + # Program compiled and ran, so get version by adding argument. + ax_path_bdb_path_get_version_VERSION=`./conftest$ac_exeext x` + ax_path_bdb_path_get_version_ok=yes + ],[],[]) + + dnl # restore environment + CPPFLAGS="$ax_path_bdb_path_get_version_save_CPPFLAGS" + LIBS="$ax_path_bdb_path_get_version_save_LIBS" + LDFLAGS="$ax_path_bdb_path_get_version_save_LDFLAGS" + fi + + dnl # Finally, execute ACTION-IF-FOUND / ACTION-IF-NOT-FOUND. + if test "$ax_path_bdb_path_get_version_ok" = "yes" ; then + AC_MSG_RESULT([$ax_path_bdb_path_get_version_VERSION]) + m4_ifvaln([$2],[$2])dnl + else + AC_MSG_RESULT([no]) + m4_ifvaln([$3],[$3])dnl + fi +]) dnl AX_PATH_BDB_PATH_GET_VERSION + +############################################################################# +dnl Checks if version of library and header match specified version. +dnl Only meant to be used by AX_PATH_BDB_ENV_GET_VERSION macro. +dnl +dnl Requires AX_COMPARE_VERSION macro. +dnl +dnl Result: sets ax_path_bdb_env_confirm_lib_ok to yes or no. +dnl +dnl AX_PATH_BDB_ENV_CONFIRM_LIB(VERSION, [LIBNAME]) +AC_DEFUN([AX_PATH_BDB_ENV_CONFIRM_LIB], [ + dnl # Used to indicate success or failure of this function. + ax_path_bdb_env_confirm_lib_ok=no + + dnl # save and modify environment to link with library LIBNAME + ax_path_bdb_env_confirm_lib_save_LIBS="$LIBS" + LIBS="$LIBS $2" + + # Compile and run a program that compares the version defined in + # the header file with a version defined in the library function + # db_version. + AC_RUN_IFELSE([ + AC_LANG_SOURCE([[ +#include +#include +int main(int argc,char **argv) +{ + int major,minor,patch; + (void) argv; + db_version(&major,&minor,&patch); + if (argc > 1) + printf("%d.%d.%d\n",DB_VERSION_MAJOR,DB_VERSION_MINOR,DB_VERSION_PATCH); + if (DB_VERSION_MAJOR == major && DB_VERSION_MINOR == minor && + DB_VERSION_PATCH == patch) + return 0; + else + return 1; +} + ]]) + ],[ + # Program compiled and ran, so get version by giving an argument, + # which will tell the program to print the output. + ax_path_bdb_env_confirm_lib_VERSION=`./conftest$ac_exeext x` + + # If the versions all match up, indicate success. + AX_COMPARE_VERSION([$ax_path_bdb_env_confirm_lib_VERSION],[eq],[$1],[ + ax_path_bdb_env_confirm_lib_ok=yes + ]) + ],[],[]) + + dnl # restore environment + LIBS="$ax_path_bdb_env_confirm_lib_save_LIBS" + +]) dnl AX_PATH_BDB_ENV_CONFIRM_LIB + +############################################################################# +dnl Finds the version and library name for Berkeley DB in the +dnl current environment. Tries many different names for library. +dnl +dnl Requires AX_PATH_BDB_ENV_CONFIRM_LIB macro. +dnl +dnl Result: set ax_path_bdb_env_get_version_ok to yes or no, +dnl set ax_path_bdb_env_get_version_VERSION to the version found, +dnl and ax_path_bdb_env_get_version_LIBNAME to the library name. +dnl +dnl AX_PATH_BDB_ENV_GET_VERSION([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +AC_DEFUN([AX_PATH_BDB_ENV_GET_VERSION], [ + dnl # Used to indicate success or failure of this function. + ax_path_bdb_env_get_version_ok=no + + ax_path_bdb_env_get_version_VERSION='' + ax_path_bdb_env_get_version_LIBS='' + + AS_VAR_PUSHDEF([HEADER_VERSION],[ax_path_bdb_env_get_version_HEADER_VERSION])dnl + AS_VAR_PUSHDEF([TEST_LIBNAME],[ax_path_bdb_env_get_version_TEST_LIBNAME])dnl + + # Indicate status of checking for Berkeley DB library. + AC_MSG_CHECKING([for db.h]) + + # Compile and run a program that determines the Berkeley DB version + # in the header file db.h. + HEADER_VERSION='' + AC_RUN_IFELSE([ + AC_LANG_SOURCE([[ +#include +#include +int main(int argc,char **argv) +{ + (void) argv; + if (argc > 1) + printf("%d.%d.%d\n",DB_VERSION_MAJOR,DB_VERSION_MINOR,DB_VERSION_PATCH); + return 0; +} + ]]) + ],[ + # Program compiled and ran, so get version by adding an argument. + HEADER_VERSION=`./conftest$ac_exeext x` + AC_MSG_RESULT([$HEADER_VERSION]) + ],[AC_MSG_RESULT([no])],[AC_MSG_RESULT([no])]) + + # Have header version, so try to find corresponding library. + # Looks for library names in the order: + # nothing, db, db-X.Y, dbX.Y, dbXY, db-X, dbX + # and stops when it finds the first one that matches the version + # of the header file. + if test "x$HEADER_VERSION" != "x" ; then + AC_MSG_CHECKING([for library containing Berkeley DB $HEADER_VERSION]) + + AS_VAR_PUSHDEF([MAJOR],[ax_path_bdb_env_get_version_MAJOR])dnl + AS_VAR_PUSHDEF([MINOR],[ax_path_bdb_env_get_version_MINOR])dnl + + # get major and minor version numbers + MAJOR=`echo $HEADER_VERSION | sed 's,\..*,,'` + MINOR=`echo $HEADER_VERSION | sed 's,^[[0-9]]*\.,,;s,\.[[0-9]]*$,,'` + + # see if it is already specified in LIBS + TEST_LIBNAME='' + AX_PATH_BDB_ENV_CONFIRM_LIB([$HEADER_VERSION], [$TEST_LIBNAME]) + + if test "$ax_path_bdb_env_confirm_lib_ok" = "no" ; then + # try format "db" + TEST_LIBNAME='-ldb' + AX_PATH_BDB_ENV_CONFIRM_LIB([$HEADER_VERSION], [$TEST_LIBNAME]) + fi + + if test "$ax_path_bdb_env_confirm_lib_ok" = "no" ; then + # try format "db-X.Y" + TEST_LIBNAME="-ldb-${MAJOR}.$MINOR" + AX_PATH_BDB_ENV_CONFIRM_LIB([$HEADER_VERSION], [$TEST_LIBNAME]) + fi + + if test "$ax_path_bdb_env_confirm_lib_ok" = "no" ; then + # try format "dbX.Y" + TEST_LIBNAME="-ldb${MAJOR}.$MINOR" + AX_PATH_BDB_ENV_CONFIRM_LIB([$HEADER_VERSION], [$TEST_LIBNAME]) + fi + + if test "$ax_path_bdb_env_confirm_lib_ok" = "no" ; then + # try format "dbXY" + TEST_LIBNAME="-ldb$MAJOR$MINOR" + AX_PATH_BDB_ENV_CONFIRM_LIB([$HEADER_VERSION], [$TEST_LIBNAME]) + fi + + if test "$ax_path_bdb_env_confirm_lib_ok" = "no" ; then + # try format "db-X" + TEST_LIBNAME="-ldb-$MAJOR" + AX_PATH_BDB_ENV_CONFIRM_LIB([$HEADER_VERSION], [$TEST_LIBNAME]) + fi + + if test "$ax_path_bdb_env_confirm_lib_ok" = "no" ; then + # try format "dbX" + TEST_LIBNAME="-ldb$MAJOR" + AX_PATH_BDB_ENV_CONFIRM_LIB([$HEADER_VERSION], [$TEST_LIBNAME]) + fi + + dnl # Found a valid library. + if test "$ax_path_bdb_env_confirm_lib_ok" = "yes" ; then + if test "x$TEST_LIBNAME" = "x" ; then + AC_MSG_RESULT([none required]) + else + AC_MSG_RESULT([$TEST_LIBNAME]) + fi + ax_path_bdb_env_get_version_VERSION="$HEADER_VERSION" + ax_path_bdb_env_get_version_LIBS="$TEST_LIBNAME" + ax_path_bdb_env_get_version_ok=yes + else + AC_MSG_RESULT([no]) + fi + + AS_VAR_POPDEF([MAJOR])dnl + AS_VAR_POPDEF([MINOR])dnl + fi + + AS_VAR_POPDEF([HEADER_VERSION])dnl + AS_VAR_POPDEF([TEST_LIBNAME])dnl + + dnl # Execute ACTION-IF-FOUND / ACTION-IF-NOT-FOUND. + if test "$ax_path_bdb_env_confirm_lib_ok" = "yes" ; then + m4_ifvaln([$1],[$1],[:])dnl + m4_ifvaln([$2],[else $2])dnl + fi + +]) dnl BDB_ENV_GET_VERSION + +############################################################################# Added: box/trunk/infrastructure/m4/ax_split_version.m4 =================================================================== --- box/trunk/infrastructure/m4/ax_split_version.m4 2005-12-28 07:37:37 UTC (rev 287) +++ box/trunk/infrastructure/m4/ax_split_version.m4 2005-12-28 11:38:04 UTC (rev 288) @@ -0,0 +1,19 @@ +dnl @synopsis AX_SPLIT_VERSION(DEFINE, VERSION) +dnl +dnl Splits a version number in the format MAJOR.MINOR.POINT into it's +dnl separate components and AC_DEFINES _MAJOR etc with the values. +dnl +dnl @category Automake +dnl @author Martin Ebourne +dnl @version +dnl @license AllPermissive + +AC_DEFUN([AX_SPLIT_VERSION],[ + ax_major_version=`echo "$2" | sed 's/\([[^.]][[^.]]*\).*/\1/'` + ax_minor_version=`echo "$2" | sed 's/[[^.]][[^.]]*.\([[^.]][[^.]]*\).*/\1/'` + ax_point_version=`echo "$2" | sed 's/[[^.]][[^.]]*.[[^.]][[^.]]*.\(.*\)/\1/'` + + AC_DEFINE_UNQUOTED([$1_MAJOR], [$ax_major_version], [Define to major version for $1]) + AC_DEFINE_UNQUOTED([$1_MINOR], [$ax_minor_version], [Define to minor version for $1]) + AC_DEFINE_UNQUOTED([$1_POINT], [$ax_point_version], [Define to point version for $1]) +]) From boxbackup-dev at fluffy.co.uk Wed Dec 28 13:12:53 2005 From: boxbackup-dev at fluffy.co.uk (Ben Summers) Date: Wed, 28 Dec 2005 13:12:53 +0000 Subject: [Box Backup-dev] Fwd: report from Fedora Core 4 user References: <20051228042835.3554e52b.ben@emerose.org> Message-ID: Begin forwarded message: > I got a few warnings like > > BackupDaemon.cpp: In member function ___void BackupDaemon::Run2()___: > BackupDaemon.cpp:734: warning: format ___%lld___ expects type > ___long long int___, but argument 3 has type ___int64_t___ > BackupDaemon.cpp:734: warning: format ___%lld___ expects type > ___long long int___, but argument 4 has type ___int64_t___ > BackupDaemon.cpp:734: warning: format ___%lld___ expects type > ___long long int___, but argument 5 has type ___int64_t___ > BackupDaemon.cpp: In member function ___void > BackupDaemon::DeleteUnusedRootDirEntries(BackupClientContext&)___: > BackupDaemon.cpp:1822: warning: format ___%08llx___ expects type > ___long long unsigned int___, but argument 4 has type ___long int___ > > but nothing serious. Shall I ask for more details? (checkout as of this morning) Ben From boxbackup-dev at fluffy.co.uk Wed Dec 28 13:28:42 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Wed, 28 Dec 2005 13:28:42 +0000 Subject: [Box Backup-dev] Fwd: report from Fedora Core 4 user In-Reply-To: References: <20051228042835.3554e52b.ben@emerose.org> Message-ID: <1135776522.20422.1.camel@avenin.ebourne.me.uk> On Wed, 2005-12-28 at 13:12 +0000, Ben Summers wrote: > > I got a few warnings like > > > > BackupDaemon.cpp: In member function ___void BackupDaemon::Run2()___: > > BackupDaemon.cpp:734: warning: format ___%lld___ expects type > > ___long long int___, but argument 3 has type ___int64_t___ > > BackupDaemon.cpp:734: warning: format ___%lld___ expects type > > ___long long int___, but argument 4 has type ___int64_t___ > > BackupDaemon.cpp:734: warning: format ___%lld___ expects type > > ___long long int___, but argument 5 has type ___int64_t___ > > BackupDaemon.cpp: In member function ___void > > BackupDaemon::DeleteUnusedRootDirEntries(BackupClientContext&)___: > > BackupDaemon.cpp:1822: warning: format ___%08llx___ expects type > > ___long long unsigned int___, but argument 4 has type ___long int___ > > > > but nothing serious. > > Shall I ask for more details? (checkout as of this morning) Yeah, I get possibly hundreds of those. That's what I plan to fix with streams. Using #ifdef as per the merged win32 changes is not viable in the medium-long term. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Wed Dec 28 13:47:11 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Wed, 28 Dec 2005 13:47:11 +0000 Subject: [Box Backup-dev] Building in readline support In-Reply-To: <43AFCA88.2090808@netinertia.co.uk> References: <43AD692D.8010009@netinertia.co.uk> <20051224230808.x0oyb3y1w0kko0s4@ebourne.me.uk> <43ADD9FC.6080502@netinertia.co.uk> <20051226005301.4y1yuul6o4sg88ss@ebourne.me.uk> <43AFCA88.2090808@netinertia.co.uk> Message-ID: <1135777631.29779.10.camel@avenin.ebourne.me.uk> On Mon, 2005-12-26 at 10:48 +0000, James O'Gorman wrote: > On 26/12/05 00:53, Martin Ebourne wrote: > According to man 3 editline, #include is required. This > exists in /usr/include but instead of an editline subdir there is a > readline subdir, which contains readline.h: >From looking at the cvs repositories I can see that NetBSD has had readline emulation in its libedit for 5 years, and although FreeBSD sync with NetBSD it appears they have not copied that functionality across. Looks like OpenBSD might be similar. Darwin appears to have the emulation. Your libedit is clearly lacking the readline emulation. One option would be to modify box to be able to work with the editline interface, though I'm not planning to do that. I've looked at the licensing issue again and it is unclear. If box is linked statically against readline then that is definitely a licence violation. If it is linked dynamically (as usual) then that is not clear cut. GNU say that is also a violation, and a number of companies (eg. MySQL) rely on exactly that to force their customers to buy licenses. However some people disagree, and I've just noticed that redhat ship PostgreSQL (bsd licence) dynamically linked against readline in Fedora. Given the confusion (and RedHat's lead) I'll probably set the RPM up to link against readline. Feel free to do as you please for FreeBSD. Unless others disagree I'll leave the current configure warning in Box to distance it from readline. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Wed Dec 28 13:16:19 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 28 Dec 2005 13:16:19 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r289 - in box/trunk: . distribution/boxbackup Message-ID: <20051228131619.3CED294@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-28 13:16:17 +0000 (Wed, 28 Dec 2005) New Revision: 289 Removed: box/trunk/VERSION.txt Modified: box/trunk/distribution/boxbackup/VERSION.txt Log: Fix VERSION.txt Deleted: box/trunk/VERSION.txt =================================================================== --- box/trunk/VERSION.txt 2005-12-28 11:38:04 UTC (rev 288) +++ box/trunk/VERSION.txt 2005-12-28 13:16:17 UTC (rev 289) @@ -1,2 +0,0 @@ -0.09_autoconf_win32 -boxbackup Modified: box/trunk/distribution/boxbackup/VERSION.txt =================================================================== --- box/trunk/distribution/boxbackup/VERSION.txt 2005-12-28 11:38:04 UTC (rev 288) +++ box/trunk/distribution/boxbackup/VERSION.txt 2005-12-28 13:16:17 UTC (rev 289) @@ -1,2 +1,2 @@ -0.08 +0.09_trunk boxbackup From boxbackup-dev at fluffy.co.uk Wed Dec 28 13:31:42 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 28 Dec 2005 13:31:42 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r290 - box/trunk/infrastructure Message-ID: <20051228133142.4E0F194@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-28 13:31:41 +0000 (Wed, 28 Dec 2005) New Revision: 290 Removed: box/trunk/infrastructure/tests/ Log: Removed dynamic tests, not used since autoconf From boxbackup-dev at fluffy.co.uk Wed Dec 28 13:32:18 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 28 Dec 2005 13:32:18 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r291 - box/trunk Message-ID: <20051228133218.138AE94@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-28 13:32:17 +0000 (Wed, 28 Dec 2005) New Revision: 291 Added: box/trunk/VERSION.txt Log: Putting this back now I see why we've got two Added: box/trunk/VERSION.txt =================================================================== --- box/trunk/VERSION.txt 2005-12-28 13:31:41 UTC (rev 290) +++ box/trunk/VERSION.txt 2005-12-28 13:32:17 UTC (rev 291) @@ -0,0 +1,2 @@ +0.09_trunk +boxbackup From boxbackup-dev at fluffy.co.uk Wed Dec 28 14:04:37 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 28 Dec 2005 14:04:37 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r292 - in box/trunk: distribution distribution/boxbackup infrastructure Message-ID: <20051228140437.7618694@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-28 14:04:35 +0000 (Wed, 28 Dec 2005) New Revision: 292 Modified: box/trunk/distribution/COMMON-MANIFEST.txt box/trunk/distribution/boxbackup/DISTRIBUTION-MANIFEST.txt box/trunk/infrastructure/makedistribution.pl Log: Fix make distribution Modified: box/trunk/distribution/COMMON-MANIFEST.txt =================================================================== --- box/trunk/distribution/COMMON-MANIFEST.txt 2005-12-28 13:32:17 UTC (rev 291) +++ box/trunk/distribution/COMMON-MANIFEST.txt 2005-12-28 14:04:35 UTC (rev 292) @@ -15,10 +15,15 @@ MKDIR infrastructure infrastructure/buildenv-testmain-template.cpp infrastructure/makebuildenv.pl -infrastructure/BoxPlatform.pm +infrastructure/BoxPlatform.pm.in infrastructure/makeparcels.pl -MKDIR infrastructure/tests -infrastructure/tests/common_tests.pl +configure.ac +NO-LICENSE config.sub +config.sub +NO-LICENSE config.guess +config.guess +bootstrap parcels.txt -configure runtest.pl +NO-LICENSE-IN-DIR infrastructure/m4 +infrastructure/m4 Modified: box/trunk/distribution/boxbackup/DISTRIBUTION-MANIFEST.txt =================================================================== --- box/trunk/distribution/boxbackup/DISTRIBUTION-MANIFEST.txt 2005-12-28 13:32:17 UTC (rev 291) +++ box/trunk/distribution/boxbackup/DISTRIBUTION-MANIFEST.txt 2005-12-28 14:04:35 UTC (rev 292) @@ -3,9 +3,11 @@ test/raidfile/testfiles lib/backupclient lib/backupstore +lib/win32 bin/bbstored bin/bbstoreaccounts bin/bbackupd +bin/bbackupd/win32 bin/bbackupquery bin/bbackupctl bin/bbackupobjdump Modified: box/trunk/infrastructure/makedistribution.pl =================================================================== --- box/trunk/infrastructure/makedistribution.pl 2005-12-28 13:32:17 UTC (rev 291) +++ box/trunk/infrastructure/makedistribution.pl 2005-12-28 14:04:35 UTC (rev 292) @@ -78,6 +78,10 @@ { replace_version_in($dst); } + elsif($src eq 'NO-LICENSE') + { + $no_license{$dst} = 1; + } elsif(-d $src) { $modules_included{$_} = 1; @@ -205,8 +209,8 @@ } } - # make sure perl scripts are marked as executable, and other things aren't - if($ext eq 'pl' || $ext eq '') + # copy executable bit from src + if(-x $fn) { system 'chmod','a+x',"$base_name/$dst_fn" } From boxbackup-dev at fluffy.co.uk Wed Dec 28 14:10:54 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 28 Dec 2005 14:10:54 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r293 - box/trunk/distribution/boxbackup/contrib/rpm Message-ID: <20051228141054.497BC94@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-28 14:10:52 +0000 (Wed, 28 Dec 2005) New Revision: 293 Modified: box/trunk/distribution/boxbackup/contrib/rpm/boxbackup.spec Log: Change to list email address Modified: box/trunk/distribution/boxbackup/contrib/rpm/boxbackup.spec =================================================================== --- box/trunk/distribution/boxbackup/contrib/rpm/boxbackup.spec 2005-12-28 14:04:35 UTC (rev 292) +++ box/trunk/distribution/boxbackup/contrib/rpm/boxbackup.spec 2005-12-28 14:10:52 UTC (rev 293) @@ -3,7 +3,7 @@ # Detect distribution. So far we only special-case SUSE. If you need to make # any distro specific changes to get the package building on your system -# please email them to martin at zepler.org +# please email them to boxbackup-dev at fluffy.co.uk #%define is_fc %(test -e %{_sysconfdir}/fedora-release && echo 1 || echo 0) #%define is_mdk %(test -e %{_sysconfdir}/mandrake-release && echo 1 || echo 0) #%define is_rh %(test -e %{_sysconfdir}/redhat-release && echo 1 || echo 0) @@ -25,7 +25,7 @@ Release: 1 License: BSD Group: Applications/Archiving -Packager: Martin Ebourne +Packager: Martin Ebourne URL: http://www.fluffy.co.uk/boxbackup/ Source0: %{ident}.tgz Requires: openssl >= 0.9.7a From boxbackup-dev at fluffy.co.uk Wed Dec 28 15:09:21 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Wed, 28 Dec 2005 15:09:21 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r294 - box/trunk/distribution/boxbackup/contrib/rpm Message-ID: <20051228150921.1C09F94@s0g0.pems.testserver.co.uk> Author: martin Date: 2005-12-28 15:09:19 +0000 (Wed, 28 Dec 2005) New Revision: 294 Modified: box/trunk/distribution/boxbackup/contrib/rpm/boxbackup.spec Log: Use %configure macro in rpm spec file Modified: box/trunk/distribution/boxbackup/contrib/rpm/boxbackup.spec =================================================================== --- box/trunk/distribution/boxbackup/contrib/rpm/boxbackup.spec 2005-12-28 14:10:52 UTC (rev 293) +++ box/trunk/distribution/boxbackup/contrib/rpm/boxbackup.spec 2005-12-28 15:09:19 UTC (rev 294) @@ -72,7 +72,8 @@ %setup -q %build -./configure +test -e configure || ./bootstrap +%configure make @@ -194,6 +195,9 @@ %{_sbindir}/raidfile-config %changelog +* Wed Dec 28 2005 Martin Ebourne +- Box now uses autoconf so use configure macro + * Fri Oct 1 2004 Martin Ebourne - 0.08-3 - Moved most of the exes to /usr/sbin - SUSE updates from Chris Smith From boxbackup-dev at fluffy.co.uk Thu Dec 29 12:45:35 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Thu, 29 Dec 2005 12:45:35 +0000 Subject: [Box Backup-dev] COMMIT r285 - box/chris In-Reply-To: <1135594321.4142.6.camel@avenin.ebourne.me.uk> References: <20051226010938.E3DC994@s0g0.pems.testserver.co.uk> <1135594321.4142.6.camel@avenin.ebourne.me.uk> Message-ID: <1135860335.5670.13.camel@localhost> Hi Martin, > Would it be ok to submit a class level design for review? Nothing fancy > (this isn't work :)), just something so we can comment if required. I'm planning to implement: A BOX_LOG(level, stuff) macro similar to the one you proposed, using iostreams. Macros BOX_TRACE, BOX_DEBUG, BOX_INFO, BOX_WARNING, BOX_ERROR, BOX_FATAL which supply the LEVEL argument to BOX_LOG. BOX_TRACE is completely compiled out of non-debug builds. An abstract Logger class with two methods, Log(level, std::string), and Filter(level). Implementations for Console and Syslog. A hidden static std::vector of enabled loggers, which can be added and removed with static methods like Log::Syslog(bool), Log::Console(bool), and also Log::Add(Logger&) and Log::Remove(Logger&) for custom loggers. A hidden static boolean to disable all logging temporarily, and a class which you can create on the stack to disable logging and have it re-enabled automatically when the class is destroyed. A critical section on Win32 to prevent the vector of loggers from being concurrently modified and used. Do you need more detail? Cheers, Chris. -- ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Fri Dec 30 22:27:57 2005 From: boxbackup-dev at fluffy.co.uk (Martin Ebourne) Date: Fri, 30 Dec 2005 22:27:57 +0000 Subject: New logging design (was Re: [Box Backup-dev] COMMIT r285 - box/chris) In-Reply-To: <1135860335.5670.13.camel@localhost> References: <20051226010938.E3DC994@s0g0.pems.testserver.co.uk> <1135594321.4142.6.camel@avenin.ebourne.me.uk> <1135860335.5670.13.camel@localhost> Message-ID: <1135981677.10032.18.camel@avenin.ebourne.me.uk> On Thu, 2005-12-29 at 12:45 +0000, Chris Wilson wrote: > I'm planning to implement: > > A BOX_LOG(level, stuff) macro similar to the one you proposed, using > iostreams. > > Macros BOX_TRACE, BOX_DEBUG, BOX_INFO, BOX_WARNING, BOX_ERROR, BOX_FATAL > which supply the LEVEL argument to BOX_LOG. BOX_TRACE is completely > compiled out of non-debug builds. I'm not sure why both TRACE and DEBUG are needed, nor why you'd use one over the other. Have you plans for using these for specific things? > An abstract Logger class with two methods, Log(level, std::string), and > Filter(level). Implementations for Console and Syslog. Ok. I take it Filter() sets the minimum level that will be logged? Since this is on each Logger class I presume it will be possible to set the level differently for each output method? > A hidden static std::vector of enabled loggers, which can be > added and removed with static methods like Log::Syslog(bool), > Log::Console(bool), and also Log::Add(Logger&) and Log::Remove(Logger&) > for custom loggers. I take it that the Log class will also have a static Log method that calls the Log methods on the underlying Logger objects? > A hidden static boolean to disable all logging temporarily, and a class > which you can create on the stack to disable logging and have it > re-enabled automatically when the class is destroyed. Is this needed for a specific purpose? > A critical section on Win32 to prevent the vector of loggers from being > concurrently modified and used. > > Do you need more detail? No, that's the level I was interested in. Looks good. Another question - I notice you branched for this off trunk again. But you've also got another branch for the visual c stuff. What state is that in - is it ready to be merged yet? Thinking you're just going to end up creating yourself conflicts given the intrusiveness of the logger change. Cheers, Martin. From boxbackup-dev at fluffy.co.uk Sat Dec 31 01:16:02 2005 From: boxbackup-dev at fluffy.co.uk (Chris Wilson) Date: Sat, 31 Dec 2005 01:16:02 +0000 Subject: New logging design (was Re: [Box Backup-dev] COMMIT r285 - box/chris) In-Reply-To: <1135981677.10032.18.camel@avenin.ebourne.me.uk> References: <20051226010938.E3DC994@s0g0.pems.testserver.co.uk> <1135594321.4142.6.camel@avenin.ebourne.me.uk> <1135860335.5670.13.camel@localhost> <1135981677.10032.18.camel@avenin.ebourne.me.uk> Message-ID: <1135991762.5670.41.camel@localhost> Hi Martin, > I'm not sure why both TRACE and DEBUG are needed, nor why you'd use one > over the other. Have you plans for using these for specific things? No, I didn't have any specific plans, I'll drop the DEBUG level. > Ok. I take it Filter() sets the minimum level that will be logged? Since > this is on each Logger class I presume it will be possible to set the > level differently for each output method? Yes, that was my intention. If you run box with "increased verbosity" from the command line, you probably want more detail on the console, but not necessarily in the Windows event log. Similarly for a command-line "quiet" option. On the other hand, a single global level would be easier to implement. > I take it that the Log class will also have a static Log method that > calls the Log methods on the underlying Logger objects? Actually, I was thinking that the global function would access the vector of loggers directly to dispatch the log messages, and a static method wouldn't be necessary, but it would be a cleaner alternative design (I've only just learned about static methods in C++). I don't expect anyone to call it directly, but through the BOX_* macros. > > A hidden static boolean to disable all logging temporarily, and a class > > which you can create on the stack to disable logging and have it > > re-enabled automatically when the class is destroyed. > > Is this needed for a specific purpose? I have a general idea in mind, but no specific cases where I'd use it (yet), so I'll leave it out. I was thinking that some messages get double-logged on Win32 because function A (which knows the filename) calls function B (which knows the error code) and you need both pieces of information for debugging. Perhaps it would be better to add temporarily a special filtering logger to the vector, that captures the log messages and prevents them being dispatched to the other loggers? > Another question - I notice you branched for this off trunk again. But > you've also got another branch for the visual c stuff. What state is > that in - is it ready to be merged yet? Thinking you're just going to > end up creating yourself conflicts given the intrusiveness of the > logger change. I'd like to merge everything except the type changes, which need to be reviewed. I'm happy to sort out any conflicts, but I might delete the logging branch I took the other day and take a fresh one if trunk ends up changing significantly. Thanks for your comments! Cheers, Chris. -- ___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software | From boxbackup-dev at fluffy.co.uk Sat Dec 31 14:04:48 2005 From: boxbackup-dev at fluffy.co.uk (boxbackup-dev at fluffy.co.uk) Date: Sat, 31 Dec 2005 14:04:48 +0000 (GMT) Subject: [Box Backup-dev] COMMIT r295 - in box/chris/boxi: . bin/bbackupctl bin/bbackupd bin/bbackupobjdump bin/bbackupquery bin/bbstoreaccounts bin/bbstored distribution distribution/boxbackup distribution/boxbackup/contrib/rpm infrastructure infrastructure/m4 lib/backupclient lib/backupstore lib/common lib/compress lib/crypto lib/raidfile lib/server lib/win32 test/backupdiff test/backupstore test/backupstorefix test/backupstorepatch test/basicserver test/bbackupd test/common test/compress test/crypto test/raidfile Message-ID: <20051231140448.930E394@s0g0.pems.testserver.co.uk> Author: chris Date: 2005-12-31 14:04:39 +0000 (Sat, 31 Dec 2005) New Revision: 295 Added: box/chris/boxi/VERSION.txt box/chris/boxi/infrastructure/m4/ax_compare_version.m4 box/chris/boxi/infrastructure/m4/ax_path_bdb.m4 box/chris/boxi/infrastructure/m4/ax_split_version.m4 Removed: box/chris/boxi/VERSION.txt Modified: box/chris/boxi/ box/chris/boxi/bin/bbackupctl/ box/chris/boxi/bin/bbackupd/ box/chris/boxi/bin/bbackupd/BackupClientContext.cpp box/chris/boxi/bin/bbackupd/BackupClientInodeToIDMap.cpp box/chris/boxi/bin/bbackupd/BackupDaemon.cpp box/chris/boxi/bin/bbackupd/BackupDaemon.h box/chris/boxi/bin/bbackupd/CommandSocketManager.cpp box/chris/boxi/bin/bbackupobjdump/ box/chris/boxi/bin/bbackupquery/ box/chris/boxi/bin/bbackupquery/BackupQueries.cpp box/chris/boxi/bin/bbstoreaccounts/ box/chris/boxi/bin/bbstored/ box/chris/boxi/bin/bbstored/BBStoreDHousekeeping.cpp box/chris/boxi/configure.ac box/chris/boxi/distribution/COMMON-MANIFEST.txt box/chris/boxi/distribution/boxbackup/DISTRIBUTION-MANIFEST.txt box/chris/boxi/distribution/boxbackup/VERSION.txt box/chris/boxi/distribution/boxbackup/contrib/rpm/boxbackup.spec box/chris/boxi/infrastructure/ box/chris/boxi/infrastructure/m4/ax_check_bdb_v1.m4 box/chris/boxi/infrastructure/m4/ax_check_mount_point.m4 box/chris/boxi/infrastructure/makedistribution.pl box/chris/boxi/lib/backupclient/ box/chris/boxi/lib/backupclient/BackupStoreFile.h box/chris/boxi/lib/backupstore/ box/chris/boxi/lib/common/ box/chris/boxi/lib/common/Box.h box/chris/boxi/lib/common/BoxPlatform.h box/chris/boxi/lib/common/BoxTime.cpp box/chris/boxi/lib/common/BoxTime.h box/chris/boxi/lib/common/BoxTimeToText.cpp box/chris/boxi/lib/common/ConversionString.cpp box/chris/boxi/lib/common/Utils.cpp box/chris/boxi/lib/compress/ box/chris/boxi/lib/crypto/ box/chris/boxi/lib/raidfile/ box/chris/boxi/lib/server/ box/chris/boxi/lib/win32/ box/chris/boxi/test/backupdiff/ box/chris/boxi/test/backupdiff/testbackupdiff.cpp box/chris/boxi/test/backupstore/ box/chris/boxi/test/backupstorefix/ box/chris/boxi/test/backupstorepatch/ box/chris/boxi/test/basicserver/ box/chris/boxi/test/bbackupd/ box/chris/boxi/test/bbackupd/testbbackupd.cpp box/chris/boxi/test/common/ box/chris/boxi/test/compress/ box/chris/boxi/test/crypto/ box/chris/boxi/test/raidfile/ Log: Merged trunk fixes from revisions 226-294 into Boxi tree Property changes on: box/chris/boxi ___________________________________________________________________ Name: svn:ignore + aclocal.m4 autom4te.cache config.log config.status configure debug ExceptionCodes.txt local Makefile parcels release Deleted: box/chris/boxi/VERSION.txt =================================================================== --- box/chris/boxi/VERSION.txt 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/VERSION.txt 2005-12-31 14:04:39 UTC (rev 295) @@ -1,2 +0,0 @@ -0.09_autoconf_win32 -boxbackup Copied: box/chris/boxi/VERSION.txt (from rev 294, box/trunk/VERSION.txt) =================================================================== --- box/trunk/VERSION.txt 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/VERSION.txt 2005-12-31 14:04:39 UTC (rev 295) @@ -0,0 +1,2 @@ +0.09_boxi +boxbackup Property changes on: box/chris/boxi/bin/bbackupctl ___________________________________________________________________ Name: svn:ignore + Makefile Property changes on: box/chris/boxi/bin/bbackupd ___________________________________________________________________ Name: svn:ignore + Makefile Modified: box/chris/boxi/bin/bbackupd/BackupClientContext.cpp =================================================================== --- box/chris/boxi/bin/bbackupd/BackupClientContext.cpp 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/bin/bbackupd/BackupClientContext.cpp 2005-12-31 14:04:39 UTC (rev 295) @@ -202,7 +202,7 @@ if(mClientStoreMarker == ClientStoreMarker_NotKnown) { // Yes, choose one, the current time will do - int64_t marker = GetCurrentBoxTime(); + box_time_t marker = GetCurrentBoxTime(); // Set it on the store mpConnection->QuerySetClientStoreMarker(marker); Modified: box/chris/boxi/bin/bbackupd/BackupClientInodeToIDMap.cpp =================================================================== --- box/chris/boxi/bin/bbackupd/BackupClientInodeToIDMap.cpp 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/bin/bbackupd/BackupClientInodeToIDMap.cpp 2005-12-31 14:04:39 UTC (rev 295) @@ -14,7 +14,7 @@ #include #include #include - #include DB_HEADER + #include #include #endif @@ -65,7 +65,7 @@ #ifndef BACKIPCLIENTINODETOIDMAP_IN_MEMORY_IMPLEMENTATION if(dbp != 0) { -#ifdef BERKELY_V4 +#if BDB_VERSION_MAJOR >= 3 dbp->close(0); #else dbp->close(dbp); @@ -94,7 +94,7 @@ ASSERT(!mEmpty); // Open the database file -#ifdef BERKELY_V4 +#if BDB_VERSION_MAJOR >= 3 dbp = new Db(0,0); dbp->set_pagesize(1024); /* Page size: 1K. */ dbp->set_cachesize(0, 32 * 1024, 0); @@ -146,7 +146,7 @@ #ifndef BACKIPCLIENTINODETOIDMAP_IN_MEMORY_IMPLEMENTATION if(dbp != 0) { -#ifdef BERKELY_V4 +#if BDB_VERSION_MAJOR >= 3 if(dbp->close(0) != 0) #else if(dbp->close(dbp) != 0) @@ -188,7 +188,7 @@ rec.mObjectID = ObjectID; rec.mInDirectory = InDirectory; -#ifdef BERKELY_V4 +#if BDB_VERSION_MAJOR >= 3 Dbt key(&InodeRef, sizeof(InodeRef)); Dbt data(&rec, sizeof(rec)); @@ -250,7 +250,7 @@ THROW_EXCEPTION(BackupStoreException, InodeMapNotOpen); } -#ifdef BERKELY_V4 +#if BDB_VERSION_MAJOR >= 3 Dbt key(&InodeRef, sizeof(InodeRef)); Dbt data(0, 0); switch(dbp->get(NULL, &key, &data, 0)) @@ -280,7 +280,7 @@ } // Check for sensible return -#ifdef BERKELY_V4 +#if BDB_VERSION_MAJOR >= 3 if(key.get_data() == 0 || data.get_size() != sizeof(IDBRecord)) { // Assert in debug version Modified: box/chris/boxi/bin/bbackupd/BackupDaemon.cpp =================================================================== --- box/chris/boxi/bin/bbackupd/BackupDaemon.cpp 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/bin/bbackupd/BackupDaemon.cpp 2005-12-31 14:04:39 UTC (rev 295) @@ -64,7 +64,7 @@ #include "MemLeakFindOn.h" -#define MAX_SLEEP_TIME ((unsigned int)1024) +static const time_t MAX_SLEEP_TIME = 1024; // Make the actual sync period have a little bit of extra time, up to a 64th of the main sync period. // This prevents repetative cycles of load on the server @@ -441,16 +441,16 @@ // Setup various timings // How often to connect to the store (approximate) - box_time_t updateStoreInterval = SecondsToBoxTime((uint32_t)conf.GetKeyValueInt("UpdateStoreInterval")); + box_time_t updateStoreInterval = SecondsToBoxTime(conf.GetKeyValueInt("UpdateStoreInterval")); // But are we connecting automatically? bool automaticBackup = conf.GetKeyValueBool("AutomaticBackup"); // The minimum age a file needs to be before it will be considered for uploading - box_time_t minimumFileAge = SecondsToBoxTime((uint32_t)conf.GetKeyValueInt("MinimumFileAge")); + box_time_t minimumFileAge = SecondsToBoxTime(conf.GetKeyValueInt("MinimumFileAge")); // The maximum time we'll wait to upload a file, regardless of how often it's modified - box_time_t maxUploadWait = SecondsToBoxTime((uint32_t)conf.GetKeyValueInt("MaxUploadWait")); + box_time_t maxUploadWait = SecondsToBoxTime(conf.GetKeyValueInt("MaxUploadWait")); // Adjust by subtracting the minimum file age, so is relative to sync period end in comparisons maxUploadWait = (maxUploadWait > minimumFileAge)?(maxUploadWait - minimumFileAge):(0); @@ -487,7 +487,8 @@ // Pause a while, but no more than MAX_SLEEP_TIME seconds (use the conditional because times are unsigned) box_time_t requiredDelay = (nextSyncTime < currentTime)?(0):(nextSyncTime - currentTime); // If there isn't automatic backup happening, set a long delay. And limit delays at the same time. - if(!automaticBackup || requiredDelay > SecondsToBoxTime((uint32_t)MAX_SLEEP_TIME)) requiredDelay = SecondsToBoxTime((uint32_t)MAX_SLEEP_TIME); + if(!automaticBackup || requiredDelay > SecondsToBoxTime(MAX_SLEEP_TIME)) + requiredDelay = SecondsToBoxTime(MAX_SLEEP_TIME); // Only do the delay if there is a delay required if(requiredDelay > 0) @@ -502,7 +503,7 @@ else { // No command socket or connection, just do a normal sleep - int sleepSeconds = BoxTimeToSeconds(requiredDelay); + time_t sleepSeconds = BoxTimeToSeconds(requiredDelay); ::sleep((sleepSeconds <= 0)?1:sleepSeconds); } } @@ -527,7 +528,7 @@ if(d > 0) { // Script has asked for a delay - nextSyncTime = GetCurrentBoxTime() + SecondsToBoxTime((uint32_t)d); + nextSyncTime = GetCurrentBoxTime() + SecondsToBoxTime(d); } else { @@ -567,7 +568,7 @@ // files which are modified after the scan run started. // Of course, they may be eligable to be synced again the next time round, // but this should be OK, because the changes only upload should upload no data. - syncPeriodEndExtended += SecondsToBoxTime((uint32_t)(356*24*3600)); + syncPeriodEndExtended += SecondsToBoxTime((time_t)(356*24*3600)); } // Do sync @@ -593,7 +594,7 @@ params.mMaxUploadWait = maxUploadWait; params.mFileTrackingSizeThreshold = conf.GetKeyValueInt("FileTrackingSizeThreshold"); params.mDiffingUploadSizeThreshold = conf.GetKeyValueInt("DiffingUploadSizeThreshold"); - params.mMaxFileTimeInFuture = SecondsToBoxTime((uint32_t)conf.GetKeyValueInt("MaxFileTimeInFuture")); + params.mMaxFileTimeInFuture = SecondsToBoxTime(conf.GetKeyValueInt("MaxFileTimeInFuture")); params.mpCommandSocket = mpCommandSocketInfo; // Set store marker @@ -1137,7 +1138,7 @@ ASSERT(mUnusedRootDirEntries.size() > 0); // Time to delete them mDeleteUnusedRootDirEntriesAfter = - GetCurrentBoxTime() + SecondsToBoxTime((uint32_t)BACKUP_DELETE_UNUSED_ROOT_ENTRIES_AFTER); + GetCurrentBoxTime() + SecondsToBoxTime(BACKUP_DELETE_UNUSED_ROOT_ENTRIES_AFTER); } } @@ -1423,40 +1424,6 @@ { mpCommandSocketInfo->SendStateUpdate(mState); } - - char newState[64]; - char newStateSize = sprintf(newState, "state %d\n", State); - -#ifdef WIN32 - #warning FIX ME: race condition - // what happens if the socket is closed by the other thread before - // we can write to it? Null pointer deref at best. - if (mpCommandSocketInfo && - mpCommandSocketInfo->mListeningSocket.IsConnected()) - { - try - { - mpCommandSocketInfo->mListeningSocket.Write(newState, newStateSize); - } - catch(...) - { - CloseCommandConnection(); - } - } -#else - if(mpCommandSocketInfo != 0 && mpCommandSocketInfo->mpConnectedSocket.get() != 0) - { - // Something connected to the command socket, tell it about the new state - try - { - mpCommandSocketInfo->mpConnectedSocket->Write(newState, newStateSize); - } - catch(...) - { - CloseCommandConnection(); - } - } -#endif } Modified: box/chris/boxi/bin/bbackupd/BackupDaemon.h =================================================================== --- box/chris/boxi/bin/bbackupd/BackupDaemon.h 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/bin/bbackupd/BackupDaemon.h 2005-12-31 14:04:39 UTC (rev 295) @@ -19,6 +19,10 @@ #include "BackupClientContext.h" #include "BackupClientDirectoryRecord.h" +#ifndef WIN32 + #include +#endif + class Configuration; class BackupClientInodeToIDMap; class ExcludeList; Modified: box/chris/boxi/bin/bbackupd/CommandSocketManager.cpp =================================================================== --- box/chris/boxi/bin/bbackupd/CommandSocketManager.cpp 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/bin/bbackupd/CommandSocketManager.cpp 2005-12-31 14:04:39 UTC (rev 295) @@ -7,7 +7,9 @@ // // -------------------------------------------------------------------------- -#include +#ifndef WIN32 + #include +#endif #include "Box.h" #include "IOStreamGetLine.h" Property changes on: box/chris/boxi/bin/bbackupobjdump ___________________________________________________________________ Name: svn:ignore + Makefile Property changes on: box/chris/boxi/bin/bbackupquery ___________________________________________________________________ Name: svn:ignore + autogen_Documentation.cpp Makefile Modified: box/chris/boxi/bin/bbackupquery/BackupQueries.cpp =================================================================== --- box/chris/boxi/bin/bbackupquery/BackupQueries.cpp 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/bin/bbackupquery/BackupQueries.cpp 2005-12-31 14:04:39 UTC (rev 295) @@ -979,7 +979,7 @@ { // Files modified after this time shouldn't be on the server, so report errors slightly differently params.mLatestFileUploadTime = FileModificationTime(st) - - SecondsToBoxTime((uint32_t)mrConfiguration.GetKeyValueInt("MinimumFileAge")); + - SecondsToBoxTime(mrConfiguration.GetKeyValueInt("MinimumFileAge")); } else { Property changes on: box/chris/boxi/bin/bbstoreaccounts ___________________________________________________________________ Name: svn:ignore + Makefile Property changes on: box/chris/boxi/bin/bbstored ___________________________________________________________________ Name: svn:ignore + autogen_BackupProtocolServer.cpp autogen_BackupProtocolServer.h Makefile Modified: box/chris/boxi/bin/bbstored/BBStoreDHousekeeping.cpp =================================================================== --- box/chris/boxi/bin/bbstored/BBStoreDHousekeeping.cpp 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/bin/bbstored/BBStoreDHousekeeping.cpp 2005-12-31 14:04:39 UTC (rev 295) @@ -33,7 +33,7 @@ { // Get the time between housekeeping runs const Configuration &rconfig(GetConfiguration()); - int64_t housekeepingInterval = SecondsToBoxTime((uint32_t)rconfig.GetKeyValueInt("TimeBetweenHousekeeping")); + int64_t housekeepingInterval = SecondsToBoxTime(rconfig.GetKeyValueInt("TimeBetweenHousekeeping")); int64_t lastHousekeepingRun = 0; @@ -108,7 +108,7 @@ // Calculate how long should wait before doing the next housekeeping run timeNow = GetCurrentBoxTime(); - int64_t secondsToGo = BoxTimeToSeconds((lastHousekeepingRun + housekeepingInterval) - timeNow); + time_t secondsToGo = BoxTimeToSeconds((lastHousekeepingRun + housekeepingInterval) - timeNow); if(secondsToGo < 1) secondsToGo = 1; if(secondsToGo > 60) secondsToGo = 60; int32_t millisecondsToGo = ((int)secondsToGo) * 1000; Modified: box/chris/boxi/configure.ac =================================================================== --- box/chris/boxi/configure.ac 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/configure.ac 2005-12-31 14:04:39 UTC (rev 295) @@ -4,11 +4,10 @@ AC_PREREQ(2.59) AC_INIT([Box Backup], 0.09, [box at fluffy.co.uk]) AC_CONFIG_SRCDIR([lib/common/Box.h]) -AC_CONFIG_HEADERS([lib/common/config.h]) +AC_CONFIG_HEADERS([lib/common/BoxConfig.h]) touch install-sh AC_CANONICAL_SYSTEM -# echo "Build target OS: '$target_os'" test -s install-sh || rm install-sh ### Checks for programs. @@ -30,18 +29,30 @@ ### Checks for libraries. + if test "$target_os" != "mingw32" -a "$target_os" != "winnt"; then -AC_SEARCH_LIBS([nanosleep], [rt], [ac_have_nanosleep=yes], - [AC_MSG_ERROR([[Cannot find a short sleep function (nanosleep)]])]) + AC_SEARCH_LIBS([nanosleep], [rt], [ac_have_nanosleep=yes], + [AC_MSG_ERROR([[cannot find a short sleep function (nanosleep)]])]) fi - -AC_CHECK_LIB([z], [zlibVersion],, [AC_MSG_ERROR([[Cannot find zlib]])]) -AX_CHECK_BDB_V1 +AC_CHECK_LIB([z], [zlibVersion],, [AC_MSG_ERROR([[cannot find zlib]])]) VL_LIB_READLINE have_libreadline=no test "x$vl_cv_lib_readline" != "xno" && have_libreadline=yes +## Check for Berkely DB. Restrict to certain versions +AX_PATH_BDB(, [ + LIBS="$BDB_LIBS $LIBS" + LDFLAGS="$BDB_LDFLAGS $LDFLAGS" + CPPFLAGS="$CPPFLAGS $BDB_CPPFLAGS" + AX_COMPARE_VERSION([$BDB_VERSION],[ge],[4.1],, + [AX_COMPARE_VERSION([$BDB_VERSION],[lt],[2],, + [AC_MSG_ERROR([[only Berkely DB versions 1.x or at least 4.1 are currently supported]])] + )] + ) + AX_SPLIT_VERSION([BDB_VERSION], [$BDB_VERSION]) +]) + ## Check for Open SSL, use old versions only if explicitly requested AX_CHECK_SSL(, [AC_MSG_ERROR([[OpenSSL is not installed but is required]])]) AC_ARG_ENABLE( @@ -66,6 +77,7 @@ AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([execinfo.h netinet/in.h regex.h sys/types.h sys/xattr.h]) +AC_CHECK_HEADERS([sys/endian.h asm/byteorder.h]) ### Checks for typedefs, structures, and compiler characteristics. @@ -95,12 +107,14 @@ AC_SYS_LARGEFILE AX_CHECK_LLONG_MINMAX AX_CHECK_DEFINE_PRAGMA - if test "$target_os" != "mingw32"; then -AX_RANDOM_DEVICE + AX_RANDOM_DEVICE fi - -AX_CHECK_MOUNT_POINT([],[]) +AX_CHECK_MOUNT_POINT(,[ + if test "$target_os" != "mingw32" -a "$target_os" != "winnt"; then + AC_MSG_ERROR([[cannot work out how to discover mount points on your platform]]) + fi + ]) AX_CHECK_MALLOC_WORKAROUND @@ -134,6 +148,13 @@ AC_CHECK_FUNCS([flock]) AC_CHECK_DECLS([O_EXLOCK],,, [[#include ]]) AC_CHECK_DECLS([F_SETLK],,, [[#include ]]) +if test "x$ac_cv_func_flock" != "xyes" && \ + test "x$ac_cv_have_decl_O_EXLOCK" != "xyes" && \ + test "x$ac_cv_have_decl_F_SETLK" != "xyes" && \ + test "$target_os" != "mingw32" -a "$target_os" != "winnt" +then + AC_MSG_ERROR([[cannot work out how to do file locking on your platform]]) +fi ## Get tmpdir temp_directory_name="/tmp" @@ -148,7 +169,7 @@ [static-bin], [AC_HELP_STRING([--enable-static-bin], [Link binaries with static libraries])]) if test "x$enable_static_bin" = "xyes"; then - AC_CHECK_LIB([ssl],[SSL_read],[],[],[crypto]) + AC_CHECK_LIB([ssl],[SSL_read],,, [crypto]) LIBS="-Wl,-Bstatic $LIBS -Wl,-Bdynamic" fi @@ -169,7 +190,7 @@ to the documentation for more information on each feature. Large files: $have_large_file_support -Berkeley DB: $ac_have_bdb +Berkeley DB: $ax_path_bdb_ok Readline: $have_libreadline Extended attributes: $ac_cv_header_sys_xattr_h EOC @@ -195,8 +216,3 @@ libedit or libeditline instead.]]) ;; esac - -if test "x$ac_have_bdb" != "xyes"; then - echo - AC_MSG_WARN([[db is not installed -- will run in reduced efficiency mode without it]]) -fi Modified: box/chris/boxi/distribution/COMMON-MANIFEST.txt =================================================================== --- box/chris/boxi/distribution/COMMON-MANIFEST.txt 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/distribution/COMMON-MANIFEST.txt 2005-12-31 14:04:39 UTC (rev 295) @@ -15,10 +15,15 @@ MKDIR infrastructure infrastructure/buildenv-testmain-template.cpp infrastructure/makebuildenv.pl -infrastructure/BoxPlatform.pm +infrastructure/BoxPlatform.pm.in infrastructure/makeparcels.pl -MKDIR infrastructure/tests -infrastructure/tests/common_tests.pl +configure.ac +NO-LICENSE config.sub +config.sub +NO-LICENSE config.guess +config.guess +bootstrap parcels.txt -configure runtest.pl +NO-LICENSE-IN-DIR infrastructure/m4 +infrastructure/m4 Modified: box/chris/boxi/distribution/boxbackup/DISTRIBUTION-MANIFEST.txt =================================================================== --- box/chris/boxi/distribution/boxbackup/DISTRIBUTION-MANIFEST.txt 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/distribution/boxbackup/DISTRIBUTION-MANIFEST.txt 2005-12-31 14:04:39 UTC (rev 295) @@ -3,9 +3,11 @@ test/raidfile/testfiles lib/backupclient lib/backupstore +lib/win32 bin/bbstored bin/bbstoreaccounts bin/bbackupd +bin/bbackupd/win32 bin/bbackupquery bin/bbackupctl bin/bbackupobjdump Modified: box/chris/boxi/distribution/boxbackup/VERSION.txt =================================================================== --- box/chris/boxi/distribution/boxbackup/VERSION.txt 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/distribution/boxbackup/VERSION.txt 2005-12-31 14:04:39 UTC (rev 295) @@ -1,2 +1,2 @@ -0.08 +0.09_trunk boxbackup Modified: box/chris/boxi/distribution/boxbackup/contrib/rpm/boxbackup.spec =================================================================== --- box/chris/boxi/distribution/boxbackup/contrib/rpm/boxbackup.spec 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/distribution/boxbackup/contrib/rpm/boxbackup.spec 2005-12-31 14:04:39 UTC (rev 295) @@ -3,7 +3,7 @@ # Detect distribution. So far we only special-case SUSE. If you need to make # any distro specific changes to get the package building on your system -# please email them to martin at zepler.org +# please email them to boxbackup-dev at fluffy.co.uk #%define is_fc %(test -e %{_sysconfdir}/fedora-release && echo 1 || echo 0) #%define is_mdk %(test -e %{_sysconfdir}/mandrake-release && echo 1 || echo 0) #%define is_rh %(test -e %{_sysconfdir}/redhat-release && echo 1 || echo 0) @@ -25,7 +25,7 @@ Release: 1 License: BSD Group: Applications/Archiving -Packager: Martin Ebourne +Packager: Martin Ebourne URL: http://www.fluffy.co.uk/boxbackup/ Source0: %{ident}.tgz Requires: openssl >= 0.9.7a @@ -72,7 +72,8 @@ %setup -q %build -./configure +test -e configure || ./bootstrap +%configure make @@ -194,6 +195,9 @@ %{_sbindir}/raidfile-config %changelog +* Wed Dec 28 2005 Martin Ebourne +- Box now uses autoconf so use configure macro + * Fri Oct 1 2004 Martin Ebourne - 0.08-3 - Moved most of the exes to /usr/sbin - SUSE updates from Chris Smith Property changes on: box/chris/boxi/infrastructure ___________________________________________________________________ Name: svn:ignore + BoxPlatform.pm Modified: box/chris/boxi/infrastructure/m4/ax_check_bdb_v1.m4 =================================================================== --- box/chris/boxi/infrastructure/m4/ax_check_bdb_v1.m4 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/infrastructure/m4/ax_check_bdb_v1.m4 2005-12-31 14:04:39 UTC (rev 295) @@ -18,9 +18,9 @@ [ac_bdb_header=$ac_header; break], [ac_bdb_header=""]) if test "x$ac_bdb_header" != x; then AC_SEARCH_LIBS([__db185_open], - [db db-4.3 db-4.2 db-4.1 db-4.0 db-3], + [db db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db4 db-3 db3], [ac_have_bdb=yes], - [AC_SEARCH_LIBS([dbopen], [db-1 db], [ac_have_bdb=yes])]) + [AC_SEARCH_LIBS([dbopen], [db-1 db1 db], [ac_have_bdb=yes])]) fi if test "x$ac_have_bdb" = "xyes"; then AC_MSG_CHECKING([whether found db libraries work]) Modified: box/chris/boxi/infrastructure/m4/ax_check_mount_point.m4 =================================================================== --- box/chris/boxi/infrastructure/m4/ax_check_mount_point.m4 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/infrastructure/m4/ax_check_mount_point.m4 2005-12-31 14:04:39 UTC (rev 295) @@ -19,10 +19,18 @@ AC_DEFUN([AX_CHECK_MOUNT_POINT], [ AC_CHECK_FUNCS([getmntent statfs]) - AC_CHECK_HEADERS([mntent.h sys/mnttab.h sys/mount.h],,, [[#include ]]) + AC_CHECK_HEADERS([sys/param.h]) + AC_CHECK_HEADERS([mntent.h sys/mnttab.h sys/mount.h],,, [[ + #include + #ifdef HAVE_SYS_PARAM_H + #include + #endif + ]]) # BSD AC_CHECK_MEMBERS([struct statfs.f_mntonname],,, [[ - #include + #ifdef HAVE_SYS_PARAM_H + #include + #endif #include ]]) # Linux Copied: box/chris/boxi/infrastructure/m4/ax_compare_version.m4 (from rev 294, box/trunk/infrastructure/m4/ax_compare_version.m4) Copied: box/chris/boxi/infrastructure/m4/ax_path_bdb.m4 (from rev 294, box/trunk/infrastructure/m4/ax_path_bdb.m4) Copied: box/chris/boxi/infrastructure/m4/ax_split_version.m4 (from rev 294, box/trunk/infrastructure/m4/ax_split_version.m4) Modified: box/chris/boxi/infrastructure/makedistribution.pl =================================================================== --- box/chris/boxi/infrastructure/makedistribution.pl 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/infrastructure/makedistribution.pl 2005-12-31 14:04:39 UTC (rev 295) @@ -78,6 +78,10 @@ { replace_version_in($dst); } + elsif($src eq 'NO-LICENSE') + { + $no_license{$dst} = 1; + } elsif(-d $src) { $modules_included{$_} = 1; @@ -205,8 +209,8 @@ } } - # make sure perl scripts are marked as executable, and other things aren't - if($ext eq 'pl' || $ext eq '') + # copy executable bit from src + if(-x $fn) { system 'chmod','a+x',"$base_name/$dst_fn" } Property changes on: box/chris/boxi/lib/backupclient ___________________________________________________________________ Name: svn:ignore + autogen_BackupProtocolClient.cpp autogen_BackupProtocolClient.h autogen_BackupStoreException.cpp autogen_BackupStoreException.h Makefile Modified: box/chris/boxi/lib/backupclient/BackupStoreFile.h =================================================================== --- box/chris/boxi/lib/backupclient/BackupStoreFile.h 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/lib/backupclient/BackupStoreFile.h 2005-12-31 14:04:39 UTC (rev 295) @@ -123,19 +123,20 @@ uint8_t *a = (uint8_t*)malloc((Size) + (BACKUPSTOREFILE_CODING_BLOCKSIZE * 3)); if(a == 0) return 0; // Align to main block size - ASSERT(sizeof(uint32_t) == sizeof(void*)); // make sure casting the right pointer size, will need to fix on platforms with 64 bit pointers - uint32_t adjustment = BACKUPSTOREFILE_CODING_BLOCKSIZE - (((uint32_t)(long)a) % BACKUPSTOREFILE_CODING_BLOCKSIZE); + ASSERT(sizeof(unsigned long) >= sizeof(void*)); // make sure casting the right pointer size + uint8_t adjustment = BACKUPSTOREFILE_CODING_BLOCKSIZE + - (uint8_t)(((unsigned long)a) % BACKUPSTOREFILE_CODING_BLOCKSIZE); uint8_t *b = (a + adjustment); // Store adjustment - *b = (uint8_t)adjustment; + *b = adjustment; // Return offset return b + BACKUPSTOREFILE_CODING_OFFSET; } inline static void CodingChunkFree(void *Block) { // Check alignment is as expected - ASSERT(sizeof(uint32_t) == sizeof(void*)); // make sure casting the right pointer size, will need to fix on platforms with 64 bit pointers - ASSERT((((uint32_t)(long)Block) % BACKUPSTOREFILE_CODING_BLOCKSIZE) == BACKUPSTOREFILE_CODING_OFFSET); + ASSERT(sizeof(unsigned long) >= sizeof(void*)); // make sure casting the right pointer size + ASSERT((uint8_t)(((unsigned long)Block) % BACKUPSTOREFILE_CODING_BLOCKSIZE) == BACKUPSTOREFILE_CODING_OFFSET); uint8_t *a = (uint8_t*)Block; a -= BACKUPSTOREFILE_CODING_OFFSET; // Adjust downwards... Property changes on: box/chris/boxi/lib/backupstore ___________________________________________________________________ Name: svn:ignore + Makefile Property changes on: box/chris/boxi/lib/common ___________________________________________________________________ Name: svn:ignore + autogen_CommonException.cpp autogen_CommonException.h autogen_ConversionException.cpp autogen_ConversionException.h BoxConfig.h BoxConfig.h.in Makefile Modified: box/chris/boxi/lib/common/Box.h =================================================================== --- box/chris/boxi/lib/common/Box.h 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/lib/common/Box.h 2005-12-31 14:04:39 UTC (rev 295) @@ -114,6 +114,10 @@ // extra macros for converting to network byte order +#ifdef HAVE_NETINET_IN_H + #include +#endif + // Always define a swap64 function, as it's useful. inline uint64_t box_swap64(uint64_t x) { @@ -131,13 +135,21 @@ #define box_hton64(x) (x) #define box_ntoh64(x) (x) #else - #define box_hton64(x) box_swap64(x) - #define box_ntoh64(x) box_swap64(x) + #ifdef HAVE_SYS_ENDIAN_H + #include + // betoh64 (OpenBSD) is sometimes called be64toh (FreeBSD, NetBSD). + // Rather than check for it just reuse htobe64 since they are symmetrical + #define box_hton64(x) htobe64(x) + #define box_ntoh64(x) htobe64(x) + #elif HAVE_ASM_BYTEORDER_H + #include + #define box_hton64(x) __cpu_to_be64(x) + #define box_ntoh64(x) __be64_to_cpu(x) + #else + #define box_hton64(x) box_swap64(x) + #define box_ntoh64(x) box_swap64(x) + #endif #endif -#ifdef HAVE_NETINET_IN_H - #include -#endif - #endif // BOX__H Modified: box/chris/boxi/lib/common/BoxPlatform.h =================================================================== --- box/chris/boxi/lib/common/BoxPlatform.h 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/lib/common/BoxPlatform.h 2005-12-31 14:04:39 UTC (rev 295) @@ -21,7 +21,7 @@ #define PLATFORM_DEV_NULL "/dev/null" -#include "config.h" +#include "BoxConfig.h" #ifdef WIN32 // need msvcrt version 6.1 or higher for _gmtime64() Modified: box/chris/boxi/lib/common/BoxTime.cpp =================================================================== --- box/chris/boxi/lib/common/BoxTime.cpp 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/lib/common/BoxTime.cpp 2005-12-31 14:04:39 UTC (rev 295) @@ -25,8 +25,7 @@ // -------------------------------------------------------------------------- box_time_t GetCurrentBoxTime() { - ASSERT(sizeof(uint32_t) == sizeof(time_t)); - return SecondsToBoxTime((uint32_t)time(0)); + return SecondsToBoxTime(time(0)); } Modified: box/chris/boxi/lib/common/BoxTime.h =================================================================== --- box/chris/boxi/lib/common/BoxTime.h 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/lib/common/BoxTime.h 2005-12-31 14:04:39 UTC (rev 295) @@ -23,19 +23,15 @@ box_time_t GetCurrentBoxTime(); -inline box_time_t SecondsToBoxTime(uint32_t Seconds) +inline box_time_t SecondsToBoxTime(time_t Seconds) { return ((box_time_t)Seconds * MICRO_SEC_IN_SEC_LL); } -inline box_time_t SecondsToBoxTime(uint64_t Seconds) +inline time_t BoxTimeToSeconds(box_time_t Time) { - return ((box_time_t)Seconds * MICRO_SEC_IN_SEC_LL); -} -inline box_time_t BoxTimeToSeconds(box_time_t Time) -{ return Time / MICRO_SEC_IN_SEC_LL; } -inline box_time_t BoxTimeToMilliSeconds(box_time_t Time) +inline uint64_t BoxTimeToMilliSeconds(box_time_t Time) { return Time / MILLI_SEC_IN_NANO_SEC_LL; } Modified: box/chris/boxi/lib/common/BoxTimeToText.cpp =================================================================== --- box/chris/boxi/lib/common/BoxTimeToText.cpp 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/lib/common/BoxTimeToText.cpp 2005-12-31 14:04:39 UTC (rev 295) @@ -29,7 +29,7 @@ { #ifdef WIN32 struct tm *time; - box_time_t bob = BoxTimeToSeconds(Time); + time_t bob = BoxTimeToSeconds(Time); __time64_t winTime = bob; @@ -46,7 +46,7 @@ time->tm_mon + 1, time->tm_mday, time->tm_hour, time->tm_min, time->tm_sec); #else // ! WIN32 - time_t timeInSecs = (time_t)BoxTimeToSeconds(Time); + time_t timeInSecs = BoxTimeToSeconds(Time); struct tm time; gmtime_r(&timeInSecs, &time); Modified: box/chris/boxi/lib/common/ConversionString.cpp =================================================================== --- box/chris/boxi/lib/common/ConversionString.cpp 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/lib/common/ConversionString.cpp 2005-12-31 14:04:39 UTC (rev 295) @@ -72,11 +72,17 @@ { case 32: { - // No extra checking needed, if this assert holds true - ASSERT(sizeof(long) == sizeof(int32_t)); + // No extra checking needed if long is an int32 + if(sizeof(long) > sizeof(int32_t)) + { + if(r <= (0 - 0x7fffffffL) || r > 0x7fffffffL) + { + THROW_EXCEPTION(ConversionException, IntOverflowInConvertFromString) + } + } + break; } - break; - + case 16: { if(r <= (0 - 0x7fff) || r > 0x7fff) Modified: box/chris/boxi/lib/common/Utils.cpp =================================================================== --- box/chris/boxi/lib/common/Utils.cpp 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/lib/common/Utils.cpp 2005-12-31 14:04:39 UTC (rev 295) @@ -76,7 +76,9 @@ for(i = 0; i < size; i++) printf("%s\n", strings[i]); +#ifndef MEMLEAKFINDER_MALLOC_MONITORING_DEFINED free (strings); +#endif } #endif Property changes on: box/chris/boxi/lib/compress ___________________________________________________________________ Name: svn:ignore + autogen_CompressException.cpp autogen_CompressException.h Makefile Property changes on: box/chris/boxi/lib/crypto ___________________________________________________________________ Name: svn:ignore + autogen_CipherException.cpp autogen_CipherException.h Makefile Property changes on: box/chris/boxi/lib/raidfile ___________________________________________________________________ Name: svn:ignore + autogen_RaidFileException.cpp autogen_RaidFileException.h Makefile Property changes on: box/chris/boxi/lib/server ___________________________________________________________________ Name: svn:ignore + autogen_ConnectionException.cpp autogen_ConnectionException.h autogen_ServerException.cpp autogen_ServerException.h Makefile Property changes on: box/chris/boxi/lib/win32 ___________________________________________________________________ Name: svn:ignore + Makefile Property changes on: box/chris/boxi/test/backupdiff ___________________________________________________________________ Name: svn:ignore + _main.cpp Makefile _t _t-gdb Modified: box/chris/boxi/test/backupdiff/testbackupdiff.cpp =================================================================== --- box/chris/boxi/test/backupdiff/testbackupdiff.cpp 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/test/backupdiff/testbackupdiff.cpp 2005-12-31 14:04:39 UTC (rev 295) @@ -487,7 +487,7 @@ 2000 /* object ID of the file diffing from */, blockindex, IOStream::TimeOutInfinite, 0, 0)); encoded->CopyStreamTo(out); - TEST_THAT(time(0) < (beginTime + 20)); + TEST_THAT(time(0) < (beginTime + 40)); } // Remove zero-files to save disk space remove("testfiles/zero.0"); Property changes on: box/chris/boxi/test/backupstore ___________________________________________________________________ Name: svn:ignore + _main.cpp Makefile _t _t-gdb Property changes on: box/chris/boxi/test/backupstorefix ___________________________________________________________________ Name: svn:ignore + _main.cpp Makefile _t _t-gdb Property changes on: box/chris/boxi/test/backupstorepatch ___________________________________________________________________ Name: svn:ignore + _main.cpp Makefile _t _t-gdb Property changes on: box/chris/boxi/test/basicserver ___________________________________________________________________ Name: svn:ignore + autogen_TestProtocolClient.cpp autogen_TestProtocolClient.h autogen_TestProtocolServer.cpp autogen_TestProtocolServer.h _main.cpp Makefile _t _t-gdb Property changes on: box/chris/boxi/test/bbackupd ___________________________________________________________________ Name: svn:ignore + _main.cpp Makefile _t _t-gdb Modified: box/chris/boxi/test/bbackupd/testbbackupd.cpp =================================================================== --- box/chris/boxi/test/bbackupd/testbbackupd.cpp 2005-12-28 15:09:19 UTC (rev 294) +++ box/chris/boxi/test/bbackupd/testbbackupd.cpp 2005-12-31 14:04:39 UTC (rev 295) @@ -452,7 +452,7 @@ fclose(f); // and then move the time backwards! struct timeval times[2]; - BoxTimeToTimeval(SecondsToBoxTime((uint32_t)(365*24*60*60)), times[1]); + BoxTimeToTimeval(SecondsToBoxTime((time_t)(365*24*60*60)), times[1]); times[0] = times[1]; TEST_THAT(::utimes("testfiles/TestDir1/sub23/rand.h", times) == 0); } @@ -646,7 +646,7 @@ fclose(f); // and then move the time forwards! struct timeval times[2]; - BoxTimeToTimeval(GetCurrentBoxTime() + SecondsToBoxTime((uint32_t)(365*24*60*60)), times[1]); + BoxTimeToTimeval(GetCurrentBoxTime() + SecondsToBoxTime((time_t)(365*24*60*60)), times[1]); times[0] = times[1]; TEST_THAT(::utimes("testfiles/TestDir1/sub23/in-the-future", times) == 0); } Property changes on: box/chris/boxi/test/common ___________________________________________________________________ Name: svn:ignore + _main.cpp Makefile _t _t-gdb Property changes on: box/chris/boxi/test/compress ___________________________________________________________________ Name: svn:ignore + _main.cpp Makefile _t _t-gdb Property changes on: box/chris/boxi/test/crypto ___________________________________________________________________ Name: svn:ignore + _main.cpp Makefile _t _t-gdb Property changes on: box/chris/boxi/test/raidfile ___________________________________________________________________ Name: svn:ignore + _main.cpp Makefile _t _t-gdb