From: Michael Wallner Date: Sun, 11 Feb 2007 17:44:17 +0000 (+0000) Subject: - fix requests for the first byte only X-Git-Tag: RELEASE_1_5_0~7 X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=commitdiff_plain;h=76e122adc1282ee43b222d5f3dbec2a11fe29ca5 - fix requests for the first byte only --- diff --git a/http_headers_api.c b/http_headers_api.c index bdee9a3..87af758 100644 --- a/http_headers_api.c +++ b/http_headers_api.c @@ -253,13 +253,21 @@ PHP_HTTP_API http_range_status _http_get_request_ranges(HashTable *ranges, size_ switch (begin) { /* "0-12345" */ case -10: - /* "0-" */ - if (end == -1) { - return RANGE_NO; - } - /* "0-0" or overflow */ - if (end == -10 || length <= (size_t) end) { - return RANGE_ERR; + switch (end) { + /* "0-" */ + case -1: + return RANGE_NO; + + /* "0-0" */ + case -10: + end = 0; + break; + + default: + if (length <= (size_t) end) { + return RANGE_ERR; + } + break; } begin = 0; break;