[FIX] smac.py's handle_read is naughty, was Re: [ZODB-Dev] Problem with large transactions combined with authentication mode

Jeremy Hylton jeremy at zope.com
Wed Dec 17 17:55:16 EST 2003


On Tue, 2003-12-16 at 17:47, Christian Robottom Reis wrote:
> The issue seems to be related to state being set to 1 over runs, which
> causes has_mac to never be one for that case, even when we *did* have a
> mac header. Now I have no idea *why* state is 1 over runs, but I would
> really like to know.

Good analysis!  handle_read() is going to consume some arbitrary amount
of input from the socket.  The state indicates whether the next read
should find a message header or a message body.  There's no way to
predict what state (ahem) the object is left in after a particular
handle_read() call.  The has_mac flag is also part of the state, so your
patch is right on.

This code is so complicated, but I'm not inclined to invest much effort
in trying to improve it.  If we're lucky, we'll drop asyncore instead.

Jeremy





More information about the ZODB-Dev mailing list