From: Willy Tarreau Date: Fri, 24 Aug 2012 10:53:56 +0000 (+0200) Subject: MAJOR: stream-interface: fix splice not to call chk_snd by itself X-Git-Tag: v1.5-dev12~70 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2c052083e636065e6c94f7faae170f88b965d158;p=thirdparty%2Fhaproxy.git MAJOR: stream-interface: fix splice not to call chk_snd by itself In recent splice fixes we made splice call chk_snd, but this was due to inappropriate checks in conn_notify_si() which prevented the chk_snd() call from being performed. Now that this has been fixed, remove this duplicate code. --- diff --git a/src/stream_interface.c b/src/stream_interface.c index 3123859f60..2c0364fa55 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -1160,33 +1160,7 @@ void si_conn_recv_cb(struct connection *conn) goto out_error; if (conn->flags & CO_FL_WAIT_ROOM) { - /* We might have some data the consumer is waiting for. - * We can do fast-forwarding, but we avoid doing this for partial - * buffers, because it is very likely that it will be done again - * immediately afterwards once the following data is parsed (eg: - * HTTP chunking). - */ - if (((b->flags & (BF_READ_PARTIAL|BF_OUT_EMPTY)) == BF_READ_PARTIAL) && - (b->pipe /* always try to send spliced data */ || - (b->buf.i == 0 && (b->cons->flags & SI_FL_WAIT_DATA)))) { - int last_len = b->pipe ? b->pipe->data : 0; - - si_chk_snd(b->cons); - - /* check if the consumer has freed some space */ - if (!(b->flags & BF_FULL) && - (!last_len || !b->pipe || b->pipe->data < last_len)) - si->flags &= ~SI_FL_WAIT_ROOM; - } - - if (si->flags & SI_FL_WAIT_ROOM) { - conn_data_stop_recv(conn); - b->rex = TICK_ETERNITY; - } - else if ((b->flags & (BF_SHUTR|BF_READ_PARTIAL|BF_FULL|BF_DONT_READ|BF_READ_NOEXP)) == BF_READ_PARTIAL) { - if (tick_isset(b->rex)) - b->rex = tick_add_ifset(now_ms, b->rto); - } + si->flags |= SI_FL_WAIT_ROOM; } else if (conn->flags & CO_FL_WAIT_DATA) { /* we don't automatically ask for polling if we have