On Fri, Feb 16, 2001 at 09:34:09PM -0000, [EMAIL PROTECTED] 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/

Reply via email to