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.
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;
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: