Return-Path: Delivered-To: apmail-apache-cvs-archive@apache.org Received: (qmail 96755 invoked by uid 500); 10 Oct 2000 03:35:12 -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 96744 invoked by uid 500); 10 Oct 2000 03:35:12 -0000 Delivered-To: apmail-apache-2.0-cvs@apache.org Date: 10 Oct 2000 03:35:12 -0000 Message-ID: <20001010033512.96740.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_core.c rbb 00/10/09 20:35:12 Modified: src CHANGES src/include httpd.h src/main http_core.c Log: Back out the change to move the core_output_filters brigade to the conn_rec. Since all requests on a given connection use the same core_output_filter, the ctx in that filter has the correct lifetime Revision Changes Path 1.266 +6 -0 apache-2.0/src/CHANGES Index: CHANGES =================================================================== RCS file: /home/cvs/apache-2.0/src/CHANGES,v retrieving revision 1.265 retrieving revision 1.266 diff -u -r1.265 -r1.266 --- CHANGES 2000/10/09 22:08:48 1.265 +++ CHANGES 2000/10/10 03:35:10 1.266 @@ -1,5 +1,11 @@ Changes with Apache 2.0a8 + *) Back out the change that moved the brigade from the core_output_filters + ctx to the conn_rec. Since all requests over a given connection + go through the same core_output_filter, the ctx pointer has the + correct lifetime. + [Ryan Bloom] + *) Fix another bug in the send_the_file() read/write loop. A partial send by apr_send would cause unsent data in the read buffer to get clobbered. Complete making send_the_file handle partial 1.97 +0 -3 apache-2.0/src/include/httpd.h Index: httpd.h =================================================================== RCS file: /home/cvs/apache-2.0/src/include/httpd.h,v retrieving revision 1.96 retrieving revision 1.97 diff -u -r1.96 -r1.97 --- httpd.h 2000/10/09 14:15:32 1.96 +++ httpd.h 2000/10/10 03:35:11 1.97 @@ -910,9 +910,6 @@ /** A list of output filters to be used for this connection * @defvar ap_filter_t *filters */ struct ap_filter_t *output_filters; - /** Location to store data about to be written to the client. - * @defvar ap_bucket_brigade *client_data */ - struct ap_bucket_brigade *client_data; /** bytes left to read in the current request body */ long remaining; }; 1.160 +12 -5 apache-2.0/src/main/http_core.c Index: http_core.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_core.c,v retrieving revision 1.159 retrieving revision 1.160 diff -u -r1.159 -r1.160 --- http_core.c 2000/10/10 02:14:11 1.159 +++ http_core.c 2000/10/10 03:35:11 1.160 @@ -3340,6 +3340,9 @@ * is to send the headers if they haven't already been sent, and then send * the actual data. */ +typedef struct CORE_OUTPUT_FILTER_CTX { + ap_bucket_brigade *b; +} core_output_filter_ctx_t; #define MAX_IOVEC_TO_WRITE 16 static int core_output_filter(ap_filter_t *f, ap_bucket_brigade *b) { @@ -3348,6 +3351,7 @@ apr_ssize_t bytes_sent = 0, nbytes; ap_bucket *e; conn_rec *c = f->c; + core_output_filter_ctx_t *ctx = f->ctx; apr_ssize_t nvec = 0; apr_ssize_t nvec_trailers= 0; @@ -3358,11 +3362,14 @@ apr_ssize_t flen = 0; apr_off_t foffset = 0; + if (ctx == NULL) { + f->ctx = ctx = apr_pcalloc(c->pool, sizeof(core_output_filter_ctx_t)); + } /* If we have a saved brigade, concatenate the new brigade to it */ - if (c->client_data) { - AP_BRIGADE_CONCAT(c->client_data, b); - b = c->client_data; - c->client_data = NULL; + if (ctx->b) { + AP_BRIGADE_CONCAT(ctx->b, b); + b = ctx->b; + ctx->b = NULL; } /* Hijack any bytes in BUFF and prepend it to the brigade. */ @@ -3420,7 +3427,7 @@ * buffer the brigade or send the brigade out on the network */ if (!fd && (!more) && (nbytes < MIN_SIZE_TO_WRITE) && (e->type != AP_BUCKET_EOS)) { - ap_save_brigade(f, &c->client_data, &b); + ap_save_brigade(f, &ctx->b, &b); return APR_SUCCESS; } if (fd) {