X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_message_api.c;h=6dd20673b081addab2c92fa72902d6cfa93b7ce1;hp=0cd1e8bdac76f3bca7304af833fce2ea645b487d;hb=266dd631dcb4e0652522ad4884ee8a40b88532ec;hpb=cc85d45513bc32669f3ed26601f80ce7d27eb3a1 diff --git a/http_message_api.c b/http_message_api.c index 0cd1e8b..6dd2067 100644 --- a/http_message_api.c +++ b/http_message_api.c @@ -175,7 +175,7 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char /* message has content-length header */ if (c = http_message_header(msg, "Content-Length")) { - unsigned long len = strtoul(Z_STRVAL_P(c), NULL, 10); + ulong len = strtoul(Z_STRVAL_P(c), NULL, 10); if (len > remaining) { http_error_ex(HE_NOTICE, HTTP_E_MALFORMED_HEADERS, "The Content-Length header pretends a larger body than actually received (expected %lu bytes; got %lu bytes)", len, remaining); len = remaining; @@ -204,7 +204,7 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char } if (end >= start && (!total || end < total)) { phpstr_from_string_ex(PHPSTR(msg), body, len); - continue_at = body + (end + 1 - start); + continue_at = body + len; } } }