]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[OPTIM] stream_sock_read must check for null-reads more often
authorWilly Tarreau <w@1wt.eu>
Thu, 28 Aug 2008 07:47:43 +0000 (09:47 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 2 Nov 2008 09:19:06 +0000 (10:19 +0100)
commit2bea3a115525bfa172b90fce43833a25b95aea73
tree20668275c66de31b5c1a7f696318df64075034c8
parent3a16b2c9cd672f2f2b32f5dd267e0e22f02c18bc
[OPTIM] stream_sock_read must check for null-reads more often

With small HTTP messages, stream_sock_read() tends to wake the
task up for a message read without indicating that it may be
the last one. The reason is that level-triggered pollers generally
don't report HUP with data, but only afterwards, so stream_sock_read
has no chance to detect this condition and needs a respin.

So now we return on incomplete buffers only when the buffer is known
as a streamer, because here it generally makes sense. The net result
is that the number of calls in a single HTTP session has dropped
from 5 to 3, with one less wake up and several less calls to
stream_sock_data_update().
src/stream_sock.c