httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: cvs commit: apache-2.0/src/lib/apr/threadproc/beos proc.c
Date Sat, 22 Apr 2000 19:20:09 GMT
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