MEDIUM: http: don't reject anymore message bodies not containing the url param

http_process_request_body() currently expects a request body containing
exactly an expected message body. This was done in order to support load
balancing on a unique POST parameter but the way it's done still suffers
from some limitations. One of them is that there is no guarantee that the
accepted message will contain the appropriate string if it starts with
another parameter. But at the same time it will reject a message when the
buffer is full.

So as a first step, we don't reject anymore message bodies that fill the
buffer.
This commit is contained in:
Willy Tarreau 2014-04-10 11:50:37 +02:00
parent dad3d1d402
commit 31a19957d6

View File

@ -4357,11 +4357,11 @@ int http_process_request_body(struct session *s, struct channel *req, int an_bit
goto http_end; goto http_end;
missing_data: missing_data:
/* we get here if we need to wait for more data */ /* we get here if we need to wait for more data. If the buffer is full,
if (buffer_full(req->buf, global.tune.maxrewrite)) { * we have the maximum we can expect.
session_inc_http_err_ctr(s); */
goto return_bad_req; if (buffer_full(req->buf, global.tune.maxrewrite))
} goto http_end;
if ((req->flags & CF_READ_TIMEOUT) || tick_is_expired(req->analyse_exp, now_ms)) { if ((req->flags & CF_READ_TIMEOUT) || tick_is_expired(req->analyse_exp, now_ms)) {
txn->status = 408; txn->status = 408;
@ -4375,7 +4375,7 @@ int http_process_request_body(struct session *s, struct channel *req, int an_bit
} }
/* we get here if we need to wait for more data */ /* we get here if we need to wait for more data */
if (!(req->flags & (CF_SHUTR | CF_READ_ERROR)) && !buffer_full(req->buf, global.tune.maxrewrite)) { if (!(req->flags & (CF_SHUTR | CF_READ_ERROR))) {
/* Not enough data. We'll re-use the http-request /* Not enough data. We'll re-use the http-request
* timeout here. Ideally, we should set the timeout * timeout here. Ideally, we should set the timeout
* relative to the accept() date. We just set the * relative to the accept() date. We just set the