INN commit: trunk/innfeed (connection.c)

Russ Allbery Russ_Allbery at isc.org
Tue Jul 5 00:37:38 UTC 2005


    Date: Monday, July 4, 2005 @ 17:37:36
  Author: eagle
Revision: 7382

In all of the response handlers that idle the connection if there's nothing
left in the queue, don't idle if there are writes pending.  The cases where
this could possibly trigger are obscure and involve the remote peer doing
evil things, but the rest of the code handles it correctly and we were still
seeing assertion failures, indicating that evil may be happening.

In issueStreamingCommands, make certain that there are no pending writes
before idling the connection.

Add the code to ihaveBodyDone that was already in commandWriteDone to idle
the connection if the queue is empty in case we'd had to defer the idle in
the response handler due to an unfinished write.

Whenever doSomeWrites is called with writes still pending, add a work
callback to do the write at the next opportunity.  This should eliminate a
temporary connection deadlock state on flushing, where the response to the
IHAVE body arrived before we finished writing it.  Before, doSomeWrites
would have failed to call issueQUIT because writes were still pending, and
then after the writes complete, there's no code to go back and issue it
until the read timeout expires.

Modified:
  trunk/innfeed/connection.c

--------------+
 connection.c |   41 +++++++++++++++++++++++++++--------------
 1 files changed, 27 insertions(+), 14 deletions(-)


More information about the inn-committers mailing list