]> granicus.if.org Git - apache/commitdiff
Replace atol() calls which should return long long with apr_atoll() calls.
authorWilfredo Sanchez <wsanchez@apache.org>
Wed, 24 Jul 2002 20:47:28 +0000 (20:47 +0000)
committerWilfredo Sanchez <wsanchez@apache.org>
Wed, 24 Jul 2002 20:47:28 +0000 (20:47 +0000)
Submitted by: Shantonu Sen <ssen@apple.com>

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96179 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/dav/main/mod_dav.c
modules/experimental/mod_cache.c
modules/http/http_protocol.c
modules/mappers/mod_negotiation.c

diff --git a/CHANGES b/CHANGES
index 004e1d8ce1b597548d899868233acd56ad15c952..c48c9a8a39ff13e901e1d43985795f3e68857da3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,10 @@
 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".
index 81fef1bb4d3ccb1daeb5f1500d725e4b55620944..7ec2b0bde3bd64d758a5651ba968d48309bb56ad 100644 (file)
@@ -761,12 +761,11 @@ static int dav_parse_range(request_rec *r,
 
     *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;
     }
@@ -2319,7 +2318,7 @@ static int process_mkcol_body(request_rec *r)
             return HTTP_BAD_REQUEST;
         }
 
-        r->remaining = atol(lenp);
+        r->remaining = apr_atoll(lenp);
     }
 
     if (r->read_chunked || r->remaining > 0) {
index 65329276f7962b33c7e93266ae7d43f29d41a5fc..ced7cf3290019f0016df9f177f5620831ebc417f 100644 (file)
@@ -577,7 +577,7 @@ static int cache_in_filter(ap_filter_t *f, apr_bucket_brigade *in)
         const char* cl;
         cl = apr_table_get(r->headers_out, "Content-Length");
         if (cl) {
-            size = atol(cl);
+            size = apr_atoll(cl);
         }
         else {
 
index c34df2240746f3ba52af9774af9291d1f36b495f..92b3db42e7eecf765ebf8a72445ce0a61f9913ce 100644 (file)
@@ -2719,15 +2719,15 @@ static int parse_byterange(char *range, apr_off_t clength,
 
     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;
index 1912e96e77e5b007b97bf222768a4eac123ab9f0..efc9b94b64c2b3ac08822697de4b5f4207368a22 100644 (file)
@@ -948,7 +948,7 @@ static int read_type_map(apr_file_t **map, negotiation_state *neg, request_rec *
                 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)) {