From: Willy Tarreau Date: Fri, 4 Jun 2010 09:40:20 +0000 (+0200) Subject: [BUG] session: clear BF_READ_ATTACHED before next I/O X-Git-Tag: v1.5-dev8~609 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6eebb3;p=thirdparty%2Fhaproxy.git [BUG] session: clear BF_READ_ATTACHED before next I/O The BF_READ_ATTACHED flag was created to wake analysers once after a connection was established. It turns out that this flag is never cleared once set, so even if there is no event, some analysers are still evaluated for no reason. The bug was introduced with commit ea38854d34675d5472319c453b7027af42fe8aab. It may cause slightly increased CPU usages during data transfers, maybe even quite noticeable once when transferring transfer-encoded data, due to the fact that the request analysers are being checked for every chunk. This fix must be backported in 1.4 after all non-reg tests have been completed. --- diff --git a/src/session.c b/src/session.c index 3f08a6a3d7..5229c7fe29 100644 --- a/src/session.c +++ b/src/session.c @@ -1521,8 +1521,8 @@ resync_stream_interface: if (s->req->cons->state == SI_ST_EST && !s->req->cons->iohandler) s->req->cons->update(s->req->cons); - s->req->flags &= ~(BF_READ_NULL|BF_READ_PARTIAL|BF_WRITE_NULL|BF_WRITE_PARTIAL); - s->rep->flags &= ~(BF_READ_NULL|BF_READ_PARTIAL|BF_WRITE_NULL|BF_WRITE_PARTIAL); + s->req->flags &= ~(BF_READ_NULL|BF_READ_PARTIAL|BF_WRITE_NULL|BF_WRITE_PARTIAL|BF_READ_ATTACHED); + s->rep->flags &= ~(BF_READ_NULL|BF_READ_PARTIAL|BF_WRITE_NULL|BF_WRITE_PARTIAL|BF_READ_ATTACHED); s->si[0].prev_state = s->si[0].state; s->si[1].prev_state = s->si[1].state; s->si[0].flags &= ~(SI_FL_ERR|SI_FL_EXP);