httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@algroup.co.uk>
Subject Re: Inconsistent file and network I/O APIs
Date Wed, 16 Feb 2000 23:14:04 GMT
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?

Presumably it is needed when the platform doesn't actually implement
writev? Coz then you may need a context to allocate memory to
reconstruct packets, right?

Cheers,

Ben.

--
SECURE HOSTING AT THE BUNKER! http://www.thebunker.net/hosting.htm

http://www.apache-ssl.org/ben.html

Y19100 no-prize winner!
http://www.ntk.net/index.cgi?back=2000/now0121.txt

Mime
View raw message