You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by rb...@covalent.net on 2000/07/15 17:52:24 UTC

Fullrw.c

>  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.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Re: Fullrw.c

Posted by Greg Stein <gs...@lyra.org>.
On Sat, Jul 15, 2000 at 08:52:24AM -0700, rbb@covalent.net 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).

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/