httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject Re: Inconsistent file and network I/O APIs
Date Wed, 16 Feb 2000 23:10:00 GMT

sendv is wrong.  The POSIX implementation isn't suficient for the same
reason the posix read/write and send/recv aren't sufficient, not all
platforms implement them, and some of the platforms that do implement them
don't do it well at all.  I see no difference between the reason for
abstracting out the read/write calls and the reason for abstracting out
the writev call.  If we are going to abstract out writev, then the type
also needs to be abstracted, because a platform may implement writev-like
function with another syntax and/or type expected.  Remember, thatin APR,
we are designing for a maximum number of platforms, not just the ones we
know of.  I have already heard of one platform that APR isn't general
enough for, and I am trying to ensure that doesn't happen often.  

Yes, I know that is a pipe dream, but it's my dream, and I'm damn proud of
it  ;-)

Ryan

On Wed, 16 Feb 2000, Bill Stoddard wrote:

> Consider...
> ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, ap_int32_t
> nvec, ap_int32_t *nbytes); /* socket API */
> 
> ap_status_t ap_writev(ap_file_t *, const ap_iovec_t *, ap_ssize_t *); /*
> File API */
> 
> Notice that ap_sendv() passes a struct iovec*, but ap_writev() passes an
> ap_iovec_t*.
> 
> ap_iovec_t is defined thusly:
> 
>     struct iovec_t {
>         ap_context_t *cntxt;
>         struct iovec *theiov;
>     };
> 
> Why do we need to extend struct iovec (a POSIX structure) by wrappering it
> in ap_iovec_t? Why do we need the context in the ap_iovec_t? AFAIK, we only
> use this APR definition once, in mod_rewrite where we call ap_make_iovec()
> to convert a struct iovec to an ap_iovec_t before calling ap_sendv().
> 
> I just don't get the point of this. The POSIX definition is sufficient, why
> do we need to complicate things?
> 
> BTW, file i/o through the IOL is broken now because of this. I'll fix it and
> my preference is to eliminate usage of ap_iovec_t in the file i/o routines.
> 
> Bill
> ________________________________________________
> Bill Stoddard stoddard@raleigh.ibm.com
> 
> Come to the first official Apache Software Foundation
> Conference!  <http://ApacheCon.Com/>
> 
> 
> 
> 


Come to the first official Apache Software Foundation
Conference!!!   <http://ApacheCon.Com/>

_______________________________________________________________________________
Ryan Bloom                        	rbb@ntrnet.net
2121 Stonehenge Dr. Apt #3
Raleigh, NC 27615		Ryan Bloom -- thinker, adventurer, artist,
				     writer, but mostly, friend.
-------------------------------------------------------------------------------



Mime
View raw message