Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 66700 invoked by uid 500); 6 Dec 2000 23:10:21 -0000 Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Precedence: bulk Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list new-httpd@apache.org Received: (qmail 66446 invoked from network); 6 Dec 2000 23:10:13 -0000 X-Authentication-Warning: kurgan.lyra.org: gstein set sender to gstein@lyra.org using -f Date: Wed, 6 Dec 2000 15:12:41 -0800 From: Greg Stein To: new-httpd@apache.org Subject: Re: cvs commit: httpd-2.0/server/mpm/perchild perchild.c Message-ID: <20001206151241.C27235@lyra.org> Mail-Followup-To: new-httpd@apache.org References: <20001206211207.13318.qmail@locus.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <20001206211207.13318.qmail@locus.apache.org>; from rbb@locus.apache.org on Wed, Dec 06, 2000 at 09:12:07PM -0000 X-URL: http://www.lyra.org/greg/ X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N On Wed, Dec 06, 2000 at 09:12:07PM -0000, rbb@locus.apache.org wrote: >... > @@ -1349,9 +1349,12 @@ > perchild_server_conf *sconf = (perchild_server_conf *) > ap_get_module_config(r->server->module_config, > &mpm_perchild_module); > - char *foo = sconf->buffer; > - int len = strlen(sconf->buffer); > + char *foo; > + int len; > > + apr_get_userdata((void **)&foo, "PERCHILD_BUFFER", r->connection->pool); > + len = strlen(foo); Couldn't that content be binary data? The strlen() isn't going to work in that case. [ it could be binary on a file upload or a PUT ] >... > @@ -1467,11 +1467,18 @@ > return rv; > } > > + > AP_BRIGADE_FOREACH(e, b) { > - const char *str; > + char *buffer = NULL; > + const char *str; > apr_size_t len; > + > + apr_get_userdata((void **)&buffer, "PERCHILD_BUFFER", f->c->pool); > + > ap_bucket_read(e, &str, &len, AP_NONBLOCK_READ); > - apr_pstrcat(f->r->pool, sconf->buffer, str); > + apr_pstrcat(f->c->pool, buffer, str); > + > + apr_set_userdata(&buffer, "PERCHILD_BUFFER", apr_null_cleanup, f->c->pool); That set should probably be apr_set_userdata(buffer, ...) (no ampersand). The apr_pstrcat() will also be a bit wonky with binary data. [not to mention that the result value from the call isn't being used] Finally: who places the buffer into the userdata in the first place? Cheers, -g -- Greg Stein, http://www.lyra.org/