httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Reid" <dr...@jetnet.co.uk>
Subject Re: cvs commit: apache-2.0/src/lib/apr/threadproc/beos proc.c
Date Sat, 22 Apr 2000 20:56:59 GMT
No writev for sockets until the new network stack :(

I'll add the check tomorrow when I get back from Edinburgh (yet another
early morning!!!).  Ta.

d.
----- Original Message -----
From: "Greg Stein" <gstein@lyra.org>
To: <new-httpd@apache.org>
Sent: Saturday, April 22, 2000 8:20 PM
Subject: Re: cvs commit: apache-2.0/src/lib/apr/threadproc/beos proc.c


> On 22 Apr 2000 dreid@locus.apache.org wrote:
> >...
> >    ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec,
> >                          ap_size_t nvec, ap_ssize_t *nbytes)
> >    {
> >        int bytes;
> >   -    if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) {
> >   -        (*nbytes) = 0;
> >   -        return errno;
> >   -    }
> >   -    else {
> >   -        (*nbytes) = bytes;
> >   -        return APR_SUCCESS;
> >   -    }
> >   +    *nbytes = vec[0].iov_len;
> >   +    return ap_write(thefile, vec[0].iov_base, nbytes);
> >    }
>
> One of two things for this:
>
> 1) if writev() *is* available for BeOS, then it should be used if/when
>    possible. For example, test for unbuffered output and call writev.
>    The performance will be much better.
>
> 2) keep the above, but add the following check:
>
>      if (nvec == 0) {
>          *nbytes = 0;
>          return APR_SUCCESS;
>      }
>
>    (you don't want the vec[0] if len(vec) == 0)
>
>
> Cheers,
> -g
>
> --
> Greg Stein, http://www.lyra.org/
>
>
>
>



Mime
View raw message