summaryrefslogtreecommitdiff
path: root/lib/common
Commit message (Collapse)AuthorAge
* Fix NamedLock release on Windows.Chris Wilson2015-05-16
| | | | | | On Windows we can't delete the file while it's open, and we don't need to, because we opened it for exclusive use, so another process can't lock it between us unlocking and deleting it.
* Fix lock race condition by unlinking before closing the file handle.Chris Wilson2015-05-04
|
* Add extra logging for acquiring and releasing NamedLocks.Chris Wilson2015-05-04
|
* Add command-line option to limit log messages to certain file(s).Chris Wilson2015-05-04
| | | | | E.g. you can run with -L NamedLock.cpp to only show messages logged in that file. You can also repeat it to only show messages from certain files.
* Define BOX_SOCKET_ERROR_MESSAGE, replace more BOX_LOG_SOCKET_ERROR calls ↵Chris Wilson2015-04-15
| | | | with it.
* Add ability to run commands in context with TEST_CHECK_THROWS_AND_OR.Chris Wilson2015-04-15
| | | | | Allows the exception message to be captured before it goes out of scope.
* Add a static GetMessage() to get exception message for a known subtype code.Chris Wilson2015-04-15
|
* Fix file locking on Windows.Chris Wilson2015-04-13
| | | | | NamedLock simply didn't work before. This may cause test failures, but the tests are already failing on Windows, and must be fixed.
* Improve error logging in win32 emu library.Chris Wilson2015-04-06
| | | | | | Consistently capture the last Windows error code in the global variable winerrno. Add logging macros that report the Windows error message for this error code.
* Catch setitimer() failure, throw exceptions with descriptive messages in ↵Chris Wilson2015-04-06
| | | | Timer.cpp.
* Whitespace and semicolon-after-macro fixes.Chris Wilson2015-04-06
|
* Add missing timeouts to Archive reads.Chris Wilson2015-04-06
| | | | Allows Archive to be used safely on network streams.
* Fix BOX_SYSLOG macro to provide a category.Chris Wilson2015-02-25
|
* Reduce verbosity of testcommon by hiding some log messages.Chris Wilson2015-02-25
|
* Reduce test output noise by hiding some error messages in tests.Chris Wilson2015-02-25
| | | | | Should make the Travis logs shorter and more readable.
* Don't redirect logging to stderr any more.Chris Wilson2015-01-04
| | | | | | We have more fine-grained control over logging now, including ability to log to a file in bbackupquery and all daemons, and users can't redirect stderr on Windows. https://www.boxbackup.org/ticket/50
* Add missing include file for PATH_MAX.Chris Wilson2015-01-02
|
* Fix error logging when file open fails on Windows.Chris Wilson2015-01-02
| | | | | | We need to use the saved Windows error code from GetLastError(), rather than calling it again, because another system call has run in the mean time and GetLastError() will now return 0.
* Write memory leak report files to current working directory saved at startup.Chris Wilson2015-01-02
| | | | | | Fixes tests broken by changing current directory, for example in bbackupquery, which meant that the report file was written in the wrong place and couldn't be found by the test, causing a failure.
* Fix more compile errors on MinGWChris Wilson2014-12-26
|
* Make memleakfinder_setup_exit_report() take a std::string, for C++ style.Chris Wilson2014-12-22
|
* Replace Write(const char *) with Write(const std::string&).Chris Wilson2014-12-22
| | | | | This is better for C++ style and potential missing null termination.
* Add a TEST_LINE_OR macro to compare strings and execute a command if no equal.Chris Wilson2014-12-21
|
* Fix computation of fractional second part of ShortSleep().Chris Wilson2014-12-21
| | | | | | | Reduce precision in log messages from microseconds to milliseconds. Log the amount of time actually slept in ShortSleep().
* Reduce detail on logging box_time_ts from microseconds to milliseconds.Chris Wilson2014-12-21
| | | | | | There's not much point logging with higher precision when no normal platform will deliver it.
* Add logging for functions that trigger bbackupd using bbackupctl.Chris Wilson2014-12-21
|
* Remove unused files.Chris Wilson2014-12-15
|
* Fix compile on platforms without execinfo.hChris Wilson2014-12-06
|
* Add option to truncate log file at start of every backup.Chris Wilson2014-11-16
| | | | Prevents backup log files from becoming too large.
* 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.
* Fix formatting of subsecond timestamps in log messagesChris Wilson2014-09-18
|
* Add check for tracking the same memory block twiceChris Wilson2014-09-18
|
* Increase built-in backtrace length from 10 to 20.Chris Wilson2014-09-04
| | | | Helps track down missing network operation timeouts.
* 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.
* 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.
* 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.
* Add missing timeouts for network operations.Chris Wilson2014-08-15
|
* 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.
* 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.
* 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.
* Improve error messages when FileHandleGuard fails to open a file.Chris Wilson2014-04-09
| | | | | Use the standard macros to report file error messages in the standard format, including a filename and message in the exception.
* Add a capturing logger.Chris Wilson2014-04-09
| | | | Useful in testing whether code logs the expected messages or not.
* Add a guard that can temporarily add a Logger to the logging system.Chris Wilson2014-04-09
| | | | This is very useful with the forthcoming Capture logger.