From 813bcfa9c470c6797c23e3fd1eaa28bb5d42dc3c Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Thu, 12 Oct 2000 19:30:11 +0000 Subject: [PATCH] Make http_filter go a little faster. Remove unused #define. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86570 13f79535-47bb-0310-9956-ffa450edef68 --- modules/http/http_protocol.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index 814c12e6d3..b2cf2f913c 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -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; -- 2.50.1