Changes with Apache 2.0.40
+ *) Replace usage of atol() to parse strings when we might want a
+ larger-than-long value with apr_atoll(), which returns long long.
+ This allows HTTPD to deal with larger files correctly.
+ [Shantonu Sen <ssen@apple.com>]
+
*) mod_ext_filter: Ignore any content-type parameters when checking if
the response should be filtered. Previously, "intype=text/html"
wouldn't match something like "text/html;charset=8859_1".
*dash = *slash = '\0';
- /* ### atol may not be large enough for the apr_off_t */
- *range_start = atol(range + 6);
- *range_end = atol(dash + 1);
+ *range_start = apr_atoll(range + 6);
+ *range_end = apr_atoll(dash + 1);
if (*range_end < *range_start
- || (slash[1] != '*' && atol(slash + 1) <= *range_end)) {
+ || (slash[1] != '*' && apr_atoll(slash + 1) <= *range_end)) {
/* invalid range. ignore it (per S14.16 of RFC2616) */
return 0;
}
return HTTP_BAD_REQUEST;
}
- r->remaining = atol(lenp);
+ r->remaining = apr_atoll(lenp);
}
if (r->read_chunked || r->remaining > 0) {
const char* cl;
cl = apr_table_get(r->headers_out, "Content-Length");
if (cl) {
- size = atol(cl);
+ size = apr_atoll(cl);
}
else {
if ((dash == range)) {
/* In the form "-5" */
- *start = clength - atol(dash + 1);
+ *start = clength - apr_atoll(dash + 1);
*end = clength - 1;
}
else {
*dash = '\0';
dash++;
- *start = atol(range);
+ *start = apr_atoll(range);
if (*dash) {
- *end = atol(dash);
+ *end = apr_atoll(dash);
}
else { /* "5-" */
*end = clength - 1;
has_content = 1;
}
else if (!strncmp(buffer, "content-length:", 15)) {
- mime_info.bytes = atol(body);
+ mime_info.bytes = apr_atoll((char *)body);
has_content = 1;
}
else if (!strncmp(buffer, "content-language:", 17)) {