Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 89797 invoked by uid 500); 17 Feb 2001 01:04:41 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 89778 invoked from network); 17 Feb 2001 01:04:38 -0000 X-Authentication-Warning: kurgan.lyra.org: gstein set sender to gstein@lyra.org using -f Date: Fri, 16 Feb 2001 17:07:08 -0800 From: Greg Stein To: dev@apr.apache.org Subject: Re: cvs commit: apr/network_io/unix sendrecv.c Message-ID: <20010216170708.T27443@lyra.org> Mail-Followup-To: dev@apr.apache.org References: <20010216213409.23463.qmail@apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <20010216213409.23463.qmail@apache.org>; from trawick@apache.org on Fri, Feb 16, 2001 at 09:34:09PM -0000 X-URL: http://www.lyra.org/greg/ X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N On Fri, Feb 16, 2001 at 09:34:09PM -0000, trawick@apache.org wrote: >... > + /* HP-UX can only send one header iovec and one footer iovec; try to > + * only allocate storage to combine input iovecs when we really have to > + */ >... > + /* XXX: BUHHH? wow, what a memory leak! */ > + headerbuf = hdtrarray[0].iov_base = apr_palloc(sock->cntxt, headerlen); Use a subpool. Create if/when you need to do this apr_palloc() (or the one for the trailers). Toss on exit from the function (watch out for early exit). >... > do { > + if (nbytes) { /* any bytes to send from the file? */ > + rc = sendfile(sock->socketdes, /* socket */ > + file->filedes, /* file descriptor to send */ > + *offset, /* where in the file to start */ > + nbytes, /* number of bytes to send from file */ > + hdtrarray, /* Headers/footers */ > + flags); /* undefined, set to 0 */ > + } > + else { /* we can't call sendfile() for trailers only */ > + rc = write(sock->socketdes, hdtrarray[1].iov_base, hdtrarray[1].iov_len); > + } > + } while (rc == -1 && errno == EINTR); If nbytes==0, then where/how are the headers sent? I just see the trailers. Cheers, -g -- Greg Stein, http://www.lyra.org/