From 955188d37d53946c439817997a5431cbe5b943ed Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Mon, 22 Oct 2018 21:34:21 +0200 Subject: [PATCH] BUG/MEDIUM: stream-int: don't set SI_FL_WAIT_ROOM on CF_READ_DONTWAIT With the previous connection model, when we purposely decided to stop receiving in order to avoid polling after a complete request was received for example, it was needed to set SI_FL_WAIT_ROOM to prevent receive polling from being re-armed. Now with the new subscription-based model there is no such thing anymore and there is noone to remove this flag either. Thus if a request takes more than one packet to come in or spans over too many packets, this flag will cause it to wait forever. Let's simply remove this flag now. This patch should not be backported since older versions still need that this flag is set here to stop receiving. --- src/stream_interface.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/stream_interface.c b/src/stream_interface.c index 04eedf2be..59827ecad 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -1207,15 +1207,8 @@ int si_cs_recv(struct conn_stream *cs) break; } - if ((ic->flags & CF_READ_DONTWAIT) || --read_poll <= 0) { - /* - * This used to be __conn_xprt_done_recv() - * This was changed to accomodate with the mux code, - * but we may have lost a worthwhile optimization. - */ - si->flags |= SI_FL_WAIT_ROOM; + if ((ic->flags & CF_READ_DONTWAIT) || --read_poll <= 0) break; - } /* if too many bytes were missing from last read, it means that * it's pointless trying to read again because the system does