Fix bug where partially received messages data would be dropped,

causing a parse error when the rest of the message arrived.
This commit is contained in:
Josh Elsasser 2007-06-11 01:07:28 +00:00
parent ce5da16e2d
commit ecda8e78c3
1 changed files with 2 additions and 1 deletions

View File

@ -359,7 +359,8 @@ msg_default ( enum ipc_msg msgid, benc_val_t * val, int64_t tag, void * arg );
}
else if( 0 < res )
{
if( res > [_buf length])
assert( res <= [_buf length]);
if( res < [_buf length])
{
memmove( [_buf mutableBytes], [_buf bytes] + res,
[_buf length] - res );