From: Willy Tarreau Date: Tue, 29 Aug 2017 14:40:59 +0000 (+0200) Subject: BUG/MINOR: stream-int: don't check the CO_FL_CURR_WR_ENA flag X-Git-Tag: v1.8-dev3~150 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8ff5a8d87fa99f3e9bbc2b7d68f922fcc0fedd31;p=thirdparty%2Fhaproxy.git BUG/MINOR: stream-int: don't check the CO_FL_CURR_WR_ENA flag The stream interface chk_snd() code checks if the connection has already subscribed to write events in order to avoid attempting a useless write() which will fail. But it used to check both the CO_FL_CURR_WR_ENA and the CO_FL_DATA_WR_ENA flags, while the former may only be present without the latterif either the other side just disabled writing did not synchronize yet (which is harmless) or if it's currently performing a handshake, which is being checked by the next condition and will be better dealt with by properly subscribing to the data events. This code was added back in 1.5-dev20 to limit the number of useless calls to splice() but both flags were checked at once while only CO_FL_DATA_WR_ENA was needed. This bug seems to have no impact other than making code changes more painful. This fix may be backported down to 1.5 though is unlikely to be needed there. --- diff --git a/src/stream_interface.c b/src/stream_interface.c index 12485e603f..a57828389e 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -947,7 +947,7 @@ static void stream_int_chk_snd_conn(struct stream_interface *si) !(si->flags & SI_FL_WAIT_DATA)) /* not waiting for data */ return; - if (conn->flags & (CO_FL_DATA_WR_ENA|CO_FL_CURR_WR_ENA)) { + if (conn->flags & CO_FL_DATA_WR_ENA) { /* already subscribed to write notifications, will be called * anyway, so let's avoid calling it especially if the reader * is not ready.