Return-Path: Delivered-To: apmail-apache-cvs-archive@apache.org Received: (qmail 10252 invoked by uid 500); 17 Oct 2000 18:40:32 -0000 Mailing-List: contact apache-cvs-help@apache.org; run by ezmlm Precedence: bulk Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list apache-cvs@apache.org Received: (qmail 10179 invoked by uid 500); 17 Oct 2000 18:40:14 -0000 Delivered-To: apmail-apache-2.0-cvs@apache.org Date: 17 Oct 2000 18:40:04 -0000 Message-ID: <20001017184004.9992.qmail@locus.apache.org> From: rbb@locus.apache.org To: apache-2.0-cvs@apache.org Subject: cvs commit: apache-2.0/src/main http_protocol.c rbb 00/10/17 11:40:01 Modified: src/main http_protocol.c Log: Remove brigade_bgets. Getting the chunk header is now done by getline. Revision Changes Path 1.186 +2 -38 apache-2.0/src/main/http_protocol.c Index: http_protocol.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v retrieving revision 1.185 retrieving revision 1.186 diff -u -r1.185 -r1.186 --- http_protocol.c 2000/10/17 17:53:09 1.185 +++ http_protocol.c 2000/10/17 18:39:56 1.186 @@ -839,39 +839,6 @@ return AP_HTTP_METHODS[methnum]; } -static apr_status_t brigade_bgets(ap_bucket_brigade *bb, - int remove_buckets, - char *line, - apr_ssize_t max_line_size) -{ - const char *buf; - apr_ssize_t len; - ap_bucket *e = AP_BRIGADE_FIRST(bb), *old; - - while (e != AP_BRIGADE_SENTINEL(bb)) { - ap_bucket_read(e, &buf, &len, 0); - if (len + 2 >= max_line_size) { /* overflow */ - return APR_EINVAL; /* what a stupid choice */ - } - memcpy(line, buf, len); - line += len; - max_line_size -= len; - old = e; - e = AP_BUCKET_NEXT(e); - if (remove_buckets) { - AP_BUCKET_REMOVE(old); - ap_bucket_destroy(old); - } - } - --line; /* point at '\n' */ - AP_DEBUG_ASSERT(*line == '\n'); - if (*(line - 1) == '\r') { - --line; - } - *line = '\0'; - return APR_SUCCESS; -} - struct dechunk_ctx { apr_ssize_t chunk_size; apr_ssize_t bytes_delivered; @@ -880,6 +847,7 @@ }; static long get_chunk_size(char *); +static int getline(char *s, int n, conn_rec *c, int fold); apr_status_t dechunk_filter(ap_filter_t *f, ap_bucket_brigade *bb, apr_ssize_t length) @@ -903,11 +871,7 @@ */ char line[30]; - if ((rv = ap_get_brigade(f->next, bb, AP_GET_LINE)) != APR_SUCCESS) { - return rv; - } - if ((rv = brigade_bgets(bb, ctx->remove_chunk_proto, - line, sizeof(line))) != APR_SUCCESS) { + if ((rv = getline(line, sizeof(line), f->c, 0)) < 0) { return rv; } switch(ctx->state) {