]> granicus.if.org Git - apache/commitdiff
Make http_filter go a little faster. Remove unused #define.
authorGreg Ames <gregames@apache.org>
Thu, 12 Oct 2000 19:30:11 +0000 (19:30 +0000)
committerGreg Ames <gregames@apache.org>
Thu, 12 Oct 2000 19:30:11 +0000 (19:30 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86570 13f79535-47bb-0310-9956-ffa450edef68

modules/http/http_protocol.c

index 814c12e6d320292249e93cf977c97abdff47d0ac..b2cf2f913c2d2237cd23b73f4423166440818193 100644 (file)
@@ -862,7 +862,6 @@ typedef struct http_filter_ctx {
 
 apr_status_t http_filter(ap_filter_t *f, ap_bucket_brigade *b, apr_ssize_t length)
 {
-#define ASCII_CR '\015'
 #define ASCII_LF '\012'
     ap_bucket *e;
     char *buff;
@@ -917,15 +916,12 @@ apr_status_t http_filter(ap_filter_t *f, ap_bucket_brigade *b, apr_ssize_t lengt
             return rv;
         }
 
-        pos = buff;
-        while (pos < buff + len) {
-            if (*pos == ASCII_LF) {
-                e->split(e, pos - buff + 1);
-                bb = ap_brigade_split(b, AP_BUCKET_NEXT(e));
-                ctx->b = bb;
-                return APR_SUCCESS;
-            }
-            pos++;
+        pos = memchr(buff, ASCII_LF, len);
+        if (pos != NULL) {
+            e->split(e, pos - buff + 1);
+            bb = ap_brigade_split(b, AP_BUCKET_NEXT(e));
+            ctx->b = bb;
+            return APR_SUCCESS;
         }
     }
     return APR_SUCCESS;