Return-Path: Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 40771 invoked by uid 500); 20 Jan 2002 11:43:38 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 40760 invoked by uid 500); 20 Jan 2002 11:43:37 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Date: 20 Jan 2002 11:43:37 -0000 Message-ID: <20020120114337.34030.qmail@icarus.apache.org> From: jerenkrantz@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/server core.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N jerenkrantz 02/01/20 03:43:37 Modified: server core.c Log: Make core_input_filter use the new apr_brigade_split_line function. Revision Changes Path 1.133 +12 -33 httpd-2.0/server/core.c Index: core.c =================================================================== RCS file: /home/cvs/httpd-2.0/server/core.c,v retrieving revision 1.132 retrieving revision 1.133 diff -u -r1.132 -r1.133 --- core.c 20 Jan 2002 11:37:07 -0000 1.132 +++ core.c 20 Jan 2002 11:43:37 -0000 1.133 @@ -3167,40 +3167,19 @@ } /* we are reading a single LF line, e.g. the HTTP headers */ - while (!APR_BRIGADE_EMPTY(ctx->b)) { - const char *pos; + rv = apr_brigade_split_line(b, ctx->b, block, HUGE_STRING_LEN); + /* We should treat EAGAIN here the same as we do for EOF (brigade is + * empty). We do this by returning whatever we have read. This may + * or may not be bogus, but is consistent (for now) with EOF logic. + */ + if (APR_STATUS_IS_EAGAIN(rv) || rv == APR_SUCCESS) { + apr_off_t total; - e = APR_BRIGADE_FIRST(ctx->b); - rv = apr_bucket_read(e, &str, &len, block); - - /* We should treat EAGAIN here the same as we do for EOF (brigade is - * empty). We do this by returning whatever we have read. This may - * or may not be bogus, but is consistent (for now) with EOF logic. - */ - if (APR_STATUS_IS_EAGAIN(rv)) { - break; - } - else if (rv != APR_SUCCESS) { - return rv; - } - - pos = memchr(str, APR_ASCII_LF, len); - /* We found a match. */ - if (pos != NULL) { - apr_bucket_split(e, pos - str + 1); - APR_BUCKET_REMOVE(e); - APR_BRIGADE_INSERT_TAIL(b, e); - *readbytes += pos - str; - return APR_SUCCESS; - } - APR_BUCKET_REMOVE(e); - APR_BRIGADE_INSERT_TAIL(b, e); - *readbytes += len; - /* We didn't find an APR_ASCII_LF within the predefined maximum - * line length. */ - if (*readbytes >= HUGE_STRING_LEN) { - break; - } + apr_brigade_length(b, 1, &total); + *readbytes = total; + } + else { + return rv; } return APR_SUCCESS;