summaryrefslogtreecommitdiff
path: root/lib/server
Commit message (Collapse)AuthorAge
* 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
* 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.
* Refactor logging option processing out of Daemon class.Chris Wilson2014-04-09
| | | | Allows command-line tools to reuse the same option processing.
* Add a static GetMessage() to BackupProtocolError.Chris Wilson2014-04-09
| | | | | | | | | Allows retrieving the error message for a given code, when we no longer have the protocol object handy. Conflicts: lib/server/makeprotocol.pl.in
* Whitespace, comments and log messages cleanups.Chris Wilson2014-03-02
|
* Always flush any incoming stream on server side.Chris Wilson2014-03-02
| | | | | | | | | | Otherwise the protocol might be broken and can't be used any more, even if we made an effort to return an Error reply instead of throwing an exception. This used to not be a problem because an Error reply would terminate the connection anyway, but it no longer does. So if the client also didn't terminate, but tried to handle the exception and keep using the connection, then it might find that its next command fails because the protocol is broken.
* Use static_cast instead of C-style casts, for C++ style and safety.Chris Wilson2014-03-02
|
* Fix whitespace and comments, remove redundant code in protocol generator.Chris Wilson2014-03-02
|
* Add convenience macro for testing commands that return errors.Chris Wilson2014-03-02
|
* Fix memory leak in local protocol.Chris Wilson2014-03-02
| | | | | When a command fails with an error, and CheckReply throws an exception, the mStreamsToSend were not deleted.
* Add information about last exchange when wrong type of object received.Chris Wilson2014-03-02
| | | | | | | | | | Helps with debugging ConnectionException::Protocol_StreamWhenObjExpected and ConnectionException::Protocol_ObjWhenStreamExpected errors, which may be caused by a command returning an error message and failing to consume any uploaded streams first. Add extra debugging in ProtocolLocal objects to detect when this happens during the command itself, which helps with debugging.
* SpellingChris Wilson2014-03-02
|
* Make Protocol take control of the socket object passed in.Chris Wilson2014-03-01
| | | | | | | | | | | | | We pass a std::auto_ptr<SocketStream> to every Protocol subclass when we construct it, and it takes control of this object. This reduces the risk of: * accidentally reusing the same SocketStream for multiple Protocols (it happened to me in testbackupstore); * holding onto a reference to the SocketStream; * allowing a locally-scoped SocketStream to go out of scope and be released while still being referenced by a live Protocol.
* Don't write #include statements for empty filenames.Chris Wilson2014-02-07
|
* Rename $cmd_class to $cmd_classes.Chris Wilson2014-02-07
| | | | Makes code easier to read.
* Add ReceiveStream to protocol callable base class.Chris Wilson2014-02-07
| | | | | So we can call it on either a Client or a Local protocol object, without having to know which it is, or cast it.
* Fix getopt header confusion.Chris Wilson2013-09-30
| | | | | | | | Our copy of getopt.h in lib/win32 was beating the system getopt.h in the search path, and providing different definitions, which clang picked up. Renamed our getopt.h to bsd_getopt.h, and added a box_getopt.h to decide whether to include this one instead of the system getopt.h.
* Set process title on Windows.Chris Wilson2013-08-25
| | | | | | Thanks to Arnaud for submitting the patch: "I propose a little patch to enable the SetProcessTitle function on windows system."
* Pass std::auto_ptr objects to Protocol for upload.Chris Wilson2013-08-22
| | | | | | | | | | | Passing raw pointers is bad C++ style, and dangerous, because Protocol will free the passed-in pointers after uploading them, so we should not keep using them. Reduce code duplication in BackupClientDirectoryRecord patch/normal upload. Return a std::auto_ptr<BackupStoreFileEncodeStream> instead of a std::auto_ptr<IOStream> from BackupStoreFile::EncodeFile* functions.
* Add a ToString() method on protocol objects, to help with debugging them.Chris Wilson2013-08-21
|
* Fix missing space in log message.Chris Wilson2012-11-17
|
* Fix typo.Chris Wilson2012-06-07
|
* Defend against exceptions during logging, e.g. CipherException if filename ↵Chris Wilson2012-04-28
| | | | decrypt fails.
* Move LogError out of server/SSLLib so we can use it in Crypto.Chris Wilson2012-04-28
|
* Hopefully fix TcpNice setsockopt/struct tcp_info compile errors on Windows.Chris Wilson2012-03-16
|
* Initialise the EWMA rate average to 0, and comment on variables in log message.Chris Wilson2012-02-12
|
* Add experimental "TCP Nice" mode, disabled by default.Chris Wilson2012-02-12
|
* Store more details in protocol exceptions to help with debugging.Chris Wilson2012-02-02
|
* Catch trying to send a zero-length stream, which will cause an assertion ↵Chris Wilson2012-01-22
| | | | failure on the other side.
* Improve logging of socket errors (create, bind, accept, and poll)Chris Wilson2012-01-22
|
* Split option processing out of Daemon::Main() to ease use of Daemon class in ↵Chris Wilson2012-01-22
| | | | tests.
* Add remote host and port to post-login login message, requested by Pete Jalajas.Chris Wilson2011-12-13
|
* Improve error message on bbackupd command socket bind failure, thanks to ↵Chris Wilson2011-10-31
| | | | Christophe.
* Avoid recompiling everything on MSVC when BoxVersion.h changes.Chris Wilson2011-10-25
|
* Output the names of protocol files being written.Chris Wilson2011-08-28
|
* Finish renaming auto-generated classes to fix compilation errors.Chris Wilson2011-08-28
|
* Combine client and server protocols to make way for an offline/local protocol.Chris Wilson2011-08-27
| | | | | Rename ProtocolObject to Message.
* Link lib/server with qdbm and include the QDBM version in the daemon banner.Chris Wilson2011-04-22
|
* Include <process.h> to get a definition for getpid() from the Windows CRT,Chris Wilson2011-04-20
| | | | | to replace the emulated one in emu.cpp.
* Pass a C++ string instead of a char pointer for efficiency.Chris Wilson2011-03-27
|
* Finish enabling the file logging option for daemons.Chris Wilson2010-11-17
|
* Add log file logging to all daemons.Chris Wilson2010-11-17
|
* Fix compile on Debian Squeeze with libbsd-dev and libedit-dev installed,Chris Wilson2010-09-13
| | | | | | thanks to Dave Bamford for reporting and debugging. (merges [2734] from 0.11)
* Log the invalid log level.Chris Wilson2010-08-31
|
* It's not an error to be interrupted by a signal while waiting for an Chris Wilson2010-08-27
| | | | | | incoming connection. This is the normal way to shut down or reload bbackupd.
* Replace BOX_FILE_BBACKUPD_DEFAULT_CONFIG with Chris Wilson2010-06-06
| | | | | BOX_GET_DEFAULT_BBACKUPD_CONFIG_FILE.
* Run Perl scripts quietly during make.Chris Wilson2010-01-24
|