httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <>
Subject Re: Fullrw.c
Date Sat, 15 Jul 2000 21:11:51 GMT
On Sat, Jul 15, 2000 at 08:52:24AM -0700, wrote:
> >  add ap_full_read() and ap_full_write(). they guarantee to read/write
> >the
> >      full buffer unless an error occurs.
> >  use the new functions in SDBM and DAV. [and Subversion]
> >  Win32 and OS/2 can directly include/use file_io/unix/fullrw.c since it
> >is
> >      written in terms of other APR functions.
> Do we really need these functions?  This really doesn't seem like
> something that APR needs.  It is more of a function that other programs
> may need, and will want to implement on their own.

Yup. These functions were duplicated in three places, so I'd say empirical
evidence says we need them :-).

It falls out of the stated behavior of ap_read/ap_write for files. They
don't make any guarantees that the requested data will be read/written in
full. Therefore, an application is always going to have to create a loop
when it wants to read/write a buffer of data.

In some applications, partial read/write can be fine. In others, it is the
wrong semantic.

ap_full_read/write() gives us the alternate file semantics -- that an app
can be guaranteed that all the data is read/written (subject to errors).


Greg Stein,

View raw message