[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 a335420..915abc2 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -2855,7 +2855,8 @@
/* 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;
}
}