Changeset 3069 for box


Ignore:
Timestamp:
22/01/2012 16:39:12 (4 months ago)
Author:
chris
Message:

Catch trying to send a zero-length stream, which will cause an assertion failure on the other side.

File:
1 edited

Legend:

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

    r2983 r3069  
    688688                // Can't send this using the fixed size header 
    689689                uncertainSize = true; 
     690        } 
     691 
     692        if(streamSize == 0) 
     693        { 
     694                // Server protocol will throw an assertion failure if we 
     695                // try to send a stream whose size is definitely zero: 
     696                // ASSERT FAILED: [BytesToRead > 0] at PartialReadStream.cpp:31 
     697                // so catch this on the client side to help debugging 
     698                THROW_EXCEPTION_MESSAGE(ServerException, Protocol_BadUsage, 
     699                        "Sending a stream with a definite size of zero " 
     700                        "is not allowed in the protocol"); 
    690701        } 
    691702         
Note: See TracChangeset for help on using the changeset viewer.