Changeset 2303


Ignore:
Timestamp:
30/09/2008 22:07:36 (3 years ago)
Author:
chris
Message:

Additional debugging for protocol stream deadlock reported by
Matt Brown.

Location:
box/trunk/lib/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/lib/server/Protocol.cpp

    r1471 r2303  
    750750                         
    751751                        // Send final byte to finish the stream 
     752                        BOX_TRACE("Sending end of stream byte"); 
    752753                        uint8_t endOfStream = ProtocolStreamHeader_EndOfStream; 
    753754                        mrStream.Write(&endOfStream, 1); 
     755                        BOX_TRACE("Sent end of stream byte"); 
    754756                } 
    755757                catch(...) 
     
    789791        if(BytesInBlock == 0) 
    790792        { 
     793                BOX_TRACE("Zero size block, not sending anything"); 
    791794                return 0; 
    792795        } 
     
    814817        } 
    815818        ASSERT(header > 0); 
     819        BOX_TRACE("Sending header byte " << header << " plus " << writeSize << 
     820                " bytes to stream"); 
    816821         
    817822        // Store the header 
     
    821826        mrStream.Write(Block - 1, writeSize + 1); 
    822827         
     828        BOX_TRACE("Sent " << (writeSize+1) << " bytes to stream"); 
    823829        // move the remainer to the beginning of the block for the next time round 
    824830        if(writeSize != BytesInBlock) 
  • box/trunk/lib/server/ProtocolUncertainStream.cpp

    r2127 r2303  
    7878                        } 
    7979                         
     80                        BOX_TRACE("Reading " << toRead << " bytes from stream"); 
     81         
    8082                        // Read it 
    8183                        int r = mrSource.Read(((uint8_t*)pBuffer) + read, toRead, Timeout); 
     
    8385                        if(r == 0) 
    8486                        { 
     87                                BOX_TRACE("Read " << r << " bytes from " 
     88                                        "stream, returning"); 
    8589                                return read; 
    8690                        } 
     
    9397                        if(r != toRead) 
    9498                        { 
     99                                BOX_TRACE("Read " << r << " bytes from " 
     100                                        "stream, returning"); 
    95101                                return read; 
    96102                        } 
     
    103109                        { 
    104110                                // 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"); 
    105114                                return read; 
    106115                        } 
     
    111120                                // All done. 
    112121                                mFinished = true; 
     122                                BOX_TRACE("Stream finished, returning with " << 
     123                                        read << " bytes read this time"); 
    113124                                return read; 
    114125                        } 
     
    128139                                THROW_EXCEPTION(ServerException, ProtocolUncertainStreamBadBlockHeader)  
    129140                        } 
     141 
     142                        BOX_TRACE("Next block has " << 
     143                                mBytesLeftInCurrentBlock << "bytes"); 
    130144                } 
    131145        } 
Note: See TracChangeset for help on using the changeset viewer.