From a6eebb372d8ed27e2d0ac39a005e11930e8f4593 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 4 Jun 2010 11:40:20 +0200 Subject: [PATCH] [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. --- src/session.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/session.c b/src/session.c index 3f08a6a3d..5229c7fe2 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);