mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-09 15:30:17 +00:00
BUG/MINOR: stream_interface: don't call chk_snd() on polled events
As explained in previous patch, we incorrectly call chk_snd() when performing a read even if the write event is already subscribed to poll(). This is counter-productive because we're almost sure to get an EAGAIN. A quick test shows that this fix halves the number of failed splice() calls without adding any extra work on other syscalls. This could have been tagged as an improvement, but since this behaviour made the analysis of previous bug more complex, it still qualifies as a fix.
This commit is contained in:
parent
61d39a0e2a
commit
5007d2aa33
@ -807,6 +807,14 @@ static void stream_int_chk_snd_conn(struct stream_interface *si)
|
||||
!(si->flags & SI_FL_WAIT_DATA)) /* not waiting for data */
|
||||
return;
|
||||
|
||||
if (si->conn->flags & (CO_FL_DATA_WR_ENA|CO_FL_CURR_WR_ENA)) {
|
||||
/* already subscribed to write notifications, will be called
|
||||
* anyway, so let's avoid calling it especially if the reader
|
||||
* is not ready.
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(si->conn->flags & (CO_FL_HANDSHAKE|CO_FL_WAIT_L4_CONN|CO_FL_WAIT_L6_CONN))) {
|
||||
/* Before calling the data-level operations, we have to prepare
|
||||
* the polling flags to ensure we properly detect changes.
|
||||
|
Loading…
Reference in New Issue
Block a user