From: Willy Tarreau Date: Thu, 7 Jan 2010 23:26:50 +0000 (+0100) Subject: [MINOR] http redirect: use proper call to return last response X-Git-Tag: v1.4-dev6~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea65e68cc8b9c1de6f07c2109274793fe98fe0e8;p=thirdparty%2Fhaproxy.git [MINOR] http redirect: use proper call to return last response During a redirect, we used to send the last chunk of response with stream_int_cond_close(). But this is wrong in case of pipeline, because if the response already contains something, this function will refrain from touching the buffer. Use a concatenation function instead. Also, this call might still fail when the buffer is full, we need a second fix to refrain from parsing an HTTP request as long as the response buffer is full, otherwise we may not even be able to return a pending redirect or an error code. --- diff --git a/src/proto_http.c b/src/proto_http.c index a3354207ac..915abc2444 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -2855,7 +2855,8 @@ int http_process_req_common(struct session *s, struct buffer *req, int an_bit, s /* keep-alive not possible */ memcpy(rdr.str + rdr.len, "\r\nConnection: close\r\n\r\n", 23); rdr.len += 23; - stream_int_cond_close(req->prod, &rdr); + buffer_write(req->prod->ob, rdr.str, rdr.len); + stream_int_cond_close(req->prod, NULL); goto return_prx_cond; } }