diff options
author | Chris Wilson <chris+github@qwirx.com> | 2008-10-03 22:10:38 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2008-10-03 22:10:38 +0000 |
commit | 5b9160c04441b1d6d3512f66cbe648bab7a96b85 (patch) | |
tree | 1609cf4d353059a1664406adda0025020f951c1c /lib | |
parent | de6cab33c2825c298e7a489b8cae89c0f9e810cb (diff) |
More debugging, log type of stream received and fix logging of header byte.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/server/Protocol.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/server/Protocol.cpp b/lib/server/Protocol.cpp index 77b3269a..41f60e5a 100644 --- a/lib/server/Protocol.cpp +++ b/lib/server/Protocol.cpp @@ -670,9 +670,18 @@ std::auto_ptr<IOStream> Protocol::ReceiveStream() InformStreamReceiving(streamSize); // Return a stream object - return std::auto_ptr<IOStream>((streamSize == ProtocolStream_SizeUncertain)? - ((IOStream*)(new ProtocolUncertainStream(mrStream))) - :((IOStream*)(new PartialReadStream(mrStream, streamSize)))); + if(streamSize == ProtocolStream_SizeUncertain) + { + BOX_TRACE("Receiving stream, size uncertain"); + return std::auto_ptr<IOStream>( + new ProtocolUncertainStream(mrStream)); + } + else + { + BOX_TRACE("Receiving stream, size " << streamSize << " bytes"); + return std::auto_ptr<IOStream>( + new PartialReadStream(mrStream, streamSize)); + } } // -------------------------------------------------------------------------- @@ -816,8 +825,8 @@ int Protocol::SendStreamSendBlock(uint8_t *Block, int BytesInBlock) } } ASSERT(header > 0); - BOX_TRACE("Sending header byte " << header << " plus " << writeSize << - " bytes to stream"); + BOX_TRACE("Sending header byte " << (int)header << " plus " << + writeSize << " bytes to stream"); // Store the header Block[-1] = header; |