]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
First, use addition to test against an unsigned for chunk_start after
authorWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 11 Apr 2002 03:56:26 +0000 (03:56 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 11 Apr 2002 03:56:26 +0000 (03:56 +0000)
  we are certain chunk_start is a positive value.  Second, ap_bread
  is prototyped as an -int- ... not a size_t, not an off_t.
  These changes eliminate all mismatch type/sign errors on Win32.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@94600 13f79535-47bb-0310-9956-ffa450edef68

src/modules/proxy/proxy_util.c

index f138aaea5671a698095c9d3cc355a6611596dac8..1c43bc21bdf0388559c4a8b0a190280ee782e356 100644 (file)
@@ -525,7 +525,7 @@ long int ap_proxy_send_fb(BUFF *f, request_rec *r, cache_req *c, off_t len, int
             if (remaining == 0) {
                 /* get the chunk size from the stream */
                 chunk_start = ap_getline(buf, buf_size, f, 0);
-                if ((chunk_start <= 0) || (chunk_start >= (buf_size - 1)) || !ap_isxdigit(*buf)) {
+                if ((chunk_start <= 0) || ((size_t)chunk_start + 1 >= buf_size) || !ap_isxdigit(*buf)) {
                     n = -1;
                 }
                 /* parse the chunk size */
@@ -544,7 +544,7 @@ long int ap_proxy_send_fb(BUFF *f, request_rec *r, cache_req *c, off_t len, int
 
             /* read the chunk */
             if (remaining > 0) {
-                n = ap_bread(f, buf, MIN((off_t)buf_size, remaining));
+                n = ap_bread(f, buf, MIN((int)buf_size, (int)remaining));
                 if (n > -1) {
                     remaining -= n;
                 }
@@ -572,7 +572,8 @@ long int ap_proxy_send_fb(BUFF *f, request_rec *r, cache_req *c, off_t len, int
                 n = ap_bread(f, buf, buf_size);
             }
             else {
-                n = ap_bread(f, buf, MIN((off_t)buf_size, len - total_bytes_rcvd));
+                n = ap_bread(f, buf, MIN((int)buf_size, 
+                                         (int)(len - total_bytes_rcvd)));
             }
         }