• A
    Fix c->reply_bytes computation in setDeferredMultiBulkLength() · 6fe9c402
    antirez 提交于
    In order to implement reply buffer limits introduced in 2.6 and useful
    to close the connection under user-selected circumastances of big output
    buffers (for instance slow consumers in pub/sub, a blocked slave, and so
    forth) Redis takes a counter with the amount of used memory in objects
    inside the output list stored into c->reply.
    
    The computation was broken in the function setDeferredMultiBulkLength(),
    in the case the object was glued with the next one. This caused the
    c->reply_bytes field to go out of sync, be subtracted more than needed,
    and wrap back near to ULONG_MAX values.
    
    This commit fixes this bug and adds an assertion that is able to trap
    this class of problems.
    
    This problem was discovered looking at the INFO output of an unrelated
    issue (issue #547).
    6fe9c402
networking.c 45.6 KB