[BUG] http: body parsing must consider the start of message

When parsing body for URL parameters, we must not consider that
data are available from buf->data but from buf->data + msg->som.
This is not a problem right now but may become with keep-alive.
This commit is contained in:
Willy Tarreau 2009-12-27 22:47:25 +01:00
parent aec571c2bb
commit 7c96f678fa
2 changed files with 3 additions and 3 deletions

View File

@ -248,8 +248,8 @@ struct server *get_server_ph_post(struct session *s)
const char *params = req->data + msg->sov;
const char *p = params;
if (len > req->l - msg->sov)
len = req->l - msg->sov;
if (len > req->l - (msg->sov - msg->som))
len = req->l - (msg->sov - msg->som);
if (len == 0)
return NULL;

View File

@ -2970,7 +2970,7 @@ int http_process_request_body(struct session *s, struct buffer *req, int an_bit)
if (msg->hdr_content_len < limit)
limit = msg->hdr_content_len;
if (req->l - msg->sov >= limit) /* we have enough bytes now */
if (req->l - (msg->sov - msg->som) >= limit) /* we have enough bytes now */
goto http_end;
missing_data: