]> granicus.if.org Git - apache/commitdiff
bucket length parameter is apr_size_t, which isn't always signed,
authorJeff Trawick <trawick@apache.org>
Tue, 19 Nov 2002 19:32:38 +0000 (19:32 +0000)
committerJeff Trawick <trawick@apache.org>
Tue, 19 Nov 2002 19:32:38 +0000 (19:32 +0000)
so be careful when comparing with the special value -1

Submitted by: Allan Edwards <ake@us.ibm.com>
Reviewed by: Jeff Trawick

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

modules/experimental/mod_cache.c
modules/http/http_core.c
server/protocol.c

index 93a0c60709f2cdf8916cef4914fc6e1c7dd14757..8906b260f9996abc2aec94366915f3f6ecf4bd0a 100644 (file)
@@ -627,7 +627,7 @@ static int cache_in_filter(ap_filter_t *f, apr_bucket_brigade *in)
                     unresolved_length = 1;
                     continue;
                 }
-                if (e->length < 0) {
+                if (e->length == (apr_size_t)-1) {
                     break;
                 }
                 size += e->length;
index d55e893aa68870e108095a7d66474f4160829a25..63d046596f1088059b4d27661597e53f3c4a07e4 100644 (file)
@@ -167,7 +167,7 @@ static apr_status_t chunk_filter(ap_filter_t *f, apr_bucket_brigade *b)
             if (APR_BUCKET_IS_FLUSH(e)) {
                 flush = e;
             }
-            else if (e->length == -1) {
+            else if (e->length == (apr_size_t)-1) {
                 /* unknown amount of data (e.g. a pipe) */
                 const char *data;
                 apr_size_t len;
index e92ff2be686f6e480f3e40d10a886856c10f7717..baf8bded66ece9338ad221b9c89b95bf2b27abb0 100644 (file)
@@ -1236,7 +1236,7 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_content_length_filter(
             eos = 1;
             break;
         }
-        if (e->length == -1) {
+        if (e->length == (apr_size_t)-1) {
             apr_size_t len;
             const char *ignored;
             apr_status_t rv;