X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=http_message_api.c;h=7fe5aecb73d6a7f96aa8188a7c004e1b058f1d0c;hb=28baf7ddd547d83881952cfd1720cc4b3c342d79;hp=0cd1e8bdac76f3bca7304af833fce2ea645b487d;hpb=cc85d45513bc32669f3ed26601f80ce7d27eb3a1;p=m6w6%2Fext-http diff --git a/http_message_api.c b/http_message_api.c index 0cd1e8b..7fe5aec 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; } } } @@ -259,7 +259,7 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char # endif /* HTTP_HAVE_ZLIB */ } - if (decoded && decoded_len) { + if (decoded) { zval *len; char *tmp; int tmp_len;