From e412a4d819445678b93b86cd5c9d87d148b7724e Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 18 Apr 2014 22:25:41 +0000 Subject: Add debugging code for when SendStream() fails during client command. 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 --- lib/server/makeprotocol.pl.in | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib/server/makeprotocol.pl.in') diff --git a/lib/server/makeprotocol.pl.in b/lib/server/makeprotocol.pl.in index 8765c301..ab6211dd 100755 --- a/lib/server/makeprotocol.pl.in +++ b/lib/server/makeprotocol.pl.in @@ -1105,8 +1105,6 @@ __E my $has_stream = obj_is_type($cmd,'StreamWithCommand'); my $argextra = $has_stream?', std::auto_ptr apDataStream':''; my $send_stream_extra = ''; - my $send_stream_method = $writing_client ? "SendStream" - : "SendStreamAfterCommand"; print CPP <<__E; std::auto_ptr<$reply_class> $server_or_client_class\::Query(const $request_class &rQuery$argextra) @@ -1119,7 +1117,15 @@ __E { $send_stream_extra = <<__E; // Send stream after the command - SendStream(*apDataStream); + try + { + SendStream(*apDataStream); + } + catch (BoxException &e) + { + BOX_WARNING("Failed to send stream after command: " << + rQuery.ToString() << ": " << e.what()); + } __E } -- cgit v1.2.3