diff --git a/src/session.c b/src/session.c index 515a275c0..aa7945786 100644 --- a/src/session.c +++ b/src/session.c @@ -1331,10 +1331,12 @@ resync_stream_interface: /* first, let's check if the request buffer needs to shutdown(write), which may * happen either because the input is closed or because we want to force a close - * once the server has begun to respond. + * once the server has begun to respond. Note that we only apply it once we're + * connected, so that we still support queuing of a request with input already + * closed. */ if (unlikely((s->req->flags & (BF_SHUTW|BF_SHUTW_NOW|BF_HIJACK|BF_AUTO_CLOSE|BF_SHUTR)) == - (BF_AUTO_CLOSE|BF_SHUTR))) + (BF_AUTO_CLOSE|BF_SHUTR) && s->req->cons->state >= SI_ST_EST)) buffer_shutw_now(s->req); /* shutdown(write) pending */