]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUG] session: clear BF_READ_ATTACHED before next I/O
authorWilly Tarreau <w@1wt.eu>
Fri, 4 Jun 2010 09:40:20 +0000 (11:40 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 4 Jun 2010 12:49:52 +0000 (14:49 +0200)
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

index 3f08a6a3d78e1fc62ab379dd376f99de91cf5380..5229c7fe2940385f8d49cb3e67896bcfdfae2c24 100644 (file)
@@ -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);