Changeset 2303
- Timestamp:
- 30/09/2008 22:07:36 (3 years ago)
- Location:
- box/trunk/lib/server
- Files:
-
- 2 edited
-
Protocol.cpp (modified) (4 diffs)
-
ProtocolUncertainStream.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/lib/server/Protocol.cpp
r1471 r2303 750 750 751 751 // Send final byte to finish the stream 752 BOX_TRACE("Sending end of stream byte"); 752 753 uint8_t endOfStream = ProtocolStreamHeader_EndOfStream; 753 754 mrStream.Write(&endOfStream, 1); 755 BOX_TRACE("Sent end of stream byte"); 754 756 } 755 757 catch(...) … … 789 791 if(BytesInBlock == 0) 790 792 { 793 BOX_TRACE("Zero size block, not sending anything"); 791 794 return 0; 792 795 } … … 814 817 } 815 818 ASSERT(header > 0); 819 BOX_TRACE("Sending header byte " << header << " plus " << writeSize << 820 " bytes to stream"); 816 821 817 822 // Store the header … … 821 826 mrStream.Write(Block - 1, writeSize + 1); 822 827 828 BOX_TRACE("Sent " << (writeSize+1) << " bytes to stream"); 823 829 // move the remainer to the beginning of the block for the next time round 824 830 if(writeSize != BytesInBlock) -
box/trunk/lib/server/ProtocolUncertainStream.cpp
r2127 r2303 78 78 } 79 79 80 BOX_TRACE("Reading " << toRead << " bytes from stream"); 81 80 82 // Read it 81 83 int r = mrSource.Read(((uint8_t*)pBuffer) + read, toRead, Timeout); … … 83 85 if(r == 0) 84 86 { 87 BOX_TRACE("Read " << r << " bytes from " 88 "stream, returning"); 85 89 return read; 86 90 } … … 93 97 if(r != toRead) 94 98 { 99 BOX_TRACE("Read " << r << " bytes from " 100 "stream, returning"); 95 101 return read; 96 102 } … … 103 109 { 104 110 // Didn't get the byte, return now 111 BOX_TRACE("Read 0 bytes of block header, " 112 "returning with " << read << " bytes " 113 "read this time"); 105 114 return read; 106 115 } … … 111 120 // All done. 112 121 mFinished = true; 122 BOX_TRACE("Stream finished, returning with " << 123 read << " bytes read this time"); 113 124 return read; 114 125 } … … 128 139 THROW_EXCEPTION(ServerException, ProtocolUncertainStreamBadBlockHeader) 129 140 } 141 142 BOX_TRACE("Next block has " << 143 mBytesLeftInCurrentBlock << "bytes"); 130 144 } 131 145 }
Note: See TracChangeset
for help on using the changeset viewer.
