summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAge
* Whitespace, comment and readability fixesChris Wilson2014-10-31
|
* Refactor StartClient and StopClient out of testbbackupd.Chris Wilson2014-10-31
| | | | Use them in testbackupstorefix to reduce code duplication.
* Fix inability to access locations starting with a slash.Chris Wilson2014-09-18
| | | | | | Thanks to Jean-Yves Moulin for reporting this issue. When bbackupd is configured to create locations whose names contain a slash, it was impossible to escape it, and thus to enter the directory in bbackupquery to inspect or restore it.
* optlen could become bigger than sizeof(info) in future and that's OKChris Wilson2014-09-18
|
* Add check for trying to ReceiveStream when no stream availableChris Wilson2014-09-18
|
* Update comment to match current method nameChris Wilson2014-09-18
|
* Fix formatting of subsecond timestamps in log messagesChris Wilson2014-09-18
|
* Add check for tracking the same memory block twiceChris Wilson2014-09-18
|
* Whitespace fixesChris Wilson2014-09-18
|
* Improve exception message if a Daemon is used without being configured firstChris Wilson2014-09-18
|
* Increase built-in backtrace length from 10 to 20.Chris Wilson2014-09-04
| | | | Helps track down missing network operation timeouts.
* Major refactor of testbbackupd.Chris Wilson2014-09-04
| | | | | | | Split single monolithic test into many smaller ones, which can be run separately. Allows easier testing of new features in isolation. Merged back changes from the test refactor branch to reduce diffs.
* Add missing timeouts in StreamableMemBlock::Set and testbbackupd.Chris Wilson2014-09-04
| | | | | Reduces warnings about network operations with no timeout. May prevent some hangs that might have occurred waiting forever for network data in the past.
* Add a std::string GetLine() to IOStreamGetLine.Chris Wilson2014-09-04
| | | | This is needed by the refactored bbackupd tests.
* Fix error in BufferedStream::StreamDataLeft.Chris Wilson2014-09-04
| | | | | | | | StreamDataLeft() incorrectly returned false when there was still data buffered, which made IOStream::CopyStreamTo stop copying early, resulting in incomplete files when copying data out of a BufferedStream. This meant that tests involving a local protocol, where a BufferedStream was copied directly to a RaidFile, resulted in corrupted files that would not verify.
* Fix tests broken by changing working directory.Chris Wilson2014-09-04
| | | | | | | | | | | Store the current working directory at the beginning of the first test, and restore it at the beginning of every subsequent test. Improve cleanup after tests: delete and recreate the bbackupd state directory. Remove check for reference counts and account errors from tearDown, because they are too hard to retrofit to testbbackupd, and already copied into testbackupstore tearDown.
* Improve directory cache messages in BackupStoreContext.Chris Wilson2014-09-04
| | | | May help to debug issues with directory cache invalidation in future.
* Handle raidfile versioning better on low time accuracy systems.Chris Wilson2014-09-04
| | | | | | | | | We simulate a 1 second accuracy clock in DEBUG mode on all systems, to help catch corner cases in tests. This now applies to both RAID and non-RAID files. We always add file size to the version number to help detect changes, especially in such cases. In RELEASE builds, we use as much accuracy from the clock as we can get, as well as file size.
* Catch exceptions while executing store commands, and return an error message.Chris Wilson2014-09-04
| | | | | | | | | This will allow the client to eventually have more information about what went wrong on the server, if the server admin agrees, and makes test debugging easier. Backport some additional testbackupstore tests from the test refactor branch. Merged back changes from the test refactor branch to reduce diffs.
* Add EstimatedBytesToUpload to NotifyFileUploadingPatch.Chris Wilson2014-09-04
| | | | Merged back changes from the test refactor branch to reduce diffs.
* Refactor Timer reschedule to avoid second scan over timer list.Chris Wilson2014-09-04
| | | | Merged back changes from the test refactor branch to reduce diffs.
* Refactor FileStream exception throwing.Chris Wilson2014-09-04
| | | | | | Avoid duplicate reporting, and include a message in the exceptions thrown. Merged back changes from the test refactor branch to reduce diffs.
* Changed many uses of BackupProtocolClient to BackupProtocolCallable.Chris Wilson2014-09-04
| | | | | | Makes way for more use of local protocol objects and protocol subclasses. Merged back changes from the test refactor branch to reduce diffs.
* Define setup and teardown functions and macros, and use them.Chris Wilson2014-09-04
| | | | Merged back changes from the test refactor branch to reduce diffs.
* Backport Timers::Cleanup that's safe to use in test cleanup.Chris Wilson2014-09-04
| | | | | | | | | | Allows it not to throw an exception if timers weren't initialised when cleanup was requested. Normally we want an exception thrown, but not while we're cleaning up a test that might have failed with timers uninitialised. More timers fixes after cleanup no-exception option. Merged back changes from the test refactor branch to reduce diffs.
* Simplify code with macros, update comments and fix whitespace.Chris Wilson2014-09-04
| | | | | | Hopefully all of these changes are inconsequential. Merged back changes from the test refactor branch to reduce diffs.
* Define some functions to reduce duplication in testbbackupd.Chris Wilson2014-09-04
| | | | | | | | | Merged back changes from the test refactor branch to reduce diffs. Fix wrong setting of log level in compare() function. We want to only show errors if we expect mismatches, and show warnings if we didn't expect mismatches. I had it the other way around before.
* Fix timing issue with bbackupd test for recovery after error.Chris Wilson2014-08-24
| | | | | | | For some reason the timing changed and the test was no longer waiting for the same length of time as bbackupd, causing it to fail. Merged back changes from the test refactor branch to reduce diffs.
* Fix poll timeout calculation for infinite timeouts.Chris Wilson2014-08-15
|
* Trivial white space fixes.Chris Wilson2014-08-15
|
* Whitespace fixes.Chris Wilson2014-08-15
|
* Add missing timeouts for network operations.Chris Wilson2014-08-15
|
* Improve readability of block checksum match message.Chris Wilson2014-08-15
| | | | Mute the mismatch message, as there are just too many of them.
* Fix deadlock waiting for read or write on closed connection.Chris Wilson2014-08-15
| | | | | | | | If the system is suspended then it may not realise that a TCP connection has been closed, while waiting for data to arrive on it. We didn't used to apply a timeout to this read operation. Now we use the connection's default timeout on all read and write operations. Network operations that don't pass a timeout will be logged with a backtrace, so that they can be fixed.
* Compile fix for backwards compatibility code.Chris Wilson2014-08-15
|
* Add a TEST_PROTOCOL_ERROR_OR assertion.Chris Wilson2014-08-15
| | | | | | | | Similar to TEST_COMMAND_RETURNS_ERROR_OR, but allows any command or sequence to cause the error, without direct access to the command message. Refactor so that TEST_COMMAND_RETURNS_ERROR_OR calls TEST_PROTOCOL_ERROR_OR to make the assertion on the last error seen by the protocol.
* Remove ServerException.h and the exception code aliases that it defines.Chris Wilson2014-08-15
| | | | We don't really need these, so clean up by removing them.
* Whitespace, wrapping, comments and dead code cleanups.Chris Wilson2014-08-15
| | | | | | | | Conflicts: bin/bbackupd/BackupDaemon.cpp bin/bbackupd/BackupDaemon.h test/bbackupd/testbbackupd.cpp
* Trailing whitespace fixes.Chris Wilson2014-08-15
| | | | | | Conflicts: bin/bbackupd/BackupClientDirectoryRecord.cpp
* Whitespace fixes.Chris Wilson2014-04-29
|
* Add a ToString method to IOStream and some subclasses.Chris Wilson2014-04-29
| | | | | Useful to help debug problems such as invalid file headers when the source of the stream might not be too obvious.
* Fix error when modifying a directory with missing entry in parent.Chris Wilson2014-04-29
| | | | This is hopefully the cause of the segfaults reported by Brendon Baumgartner.
* Add a comment explaining why we can't move detached dirs back into place.Chris Wilson2014-04-29
|
* Don't just eat the exception, rethrow it after logging details.Chris Wilson2014-04-25
|
* Add debugging code for when SendStream() fails during client command.Chris Wilson2014-04-18
| | | | | | | | | Will hopefully help to debug Brendon Baumgartner's issue with backups not completing and repeating over and over, due to this error: > Apr 18 11:14:09 hosting bbackupd[18990]: WARNING: Exception thrown: > ServerException(Protocol_BadUsage) (Sending a stream with a definite > size of zero is not allowed in the protocol) at Protocol.cpp:703
* Fix compilation on Debian 7 (Wheezy) by including bsd/unistd.h.Chris Wilson2014-04-12
| | | | | | | If libedit is installed then -ledit will be detected and added to the link line, which makes the test for getpeereid pass. Then SocketStream.cpp tries to use it, but that won't work unless we include bsd/unistd.h where the prototype is declared.
* Add missing BackgroundTask headerChris Wilson2014-04-12
|
* Poll command socket regularly during file uploads.Chris Wilson2014-04-09
| | | | | Makes the daemon responsive to polling and commands, even during a file upload operation.
* Refactor logging option processing out of Daemon class.Chris Wilson2014-04-09
| | | | Allows command-line tools to reuse the same option processing.
* Improve error message when fatal exception aborts a command-line tool.Chris Wilson2014-04-09
| | | | | Report the exception message details if it's a BoxException, so it's more user friendly.