httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@ibm.net>
Subject Re: cvs commit: apache-2.0/src/lib/apr/file_io/win32 readwrite.c
Date Sun, 18 Jun 2000 12:29:03 GMT
> From: "Brian Havard" <brianh@kheldar.apana.org.au>
> Date: Sun, 18 Jun 2000 15:21:20 +1000 (EST)
> 
> On 17 Jun 2000 21:14:10 -0000, trawick@locus.apache.org wrote:
> 
> >trawick     00/06/17 14:14:10
> >
> >  Modified:    src/lib/apr/file_io/win32 readwrite.c
> >  Log:
> >  Win32 changes to ap_read() and ap_fgets():
> >  
> >  . ap_read() wasn't checking for *nbytes <= 0 on entry; it now handles
> >    it like the Unix code
> 
> Shouldn't be necessary, the while loop's size > 0 condition should handle a
> 0 length read properly.

Looking the same is nice too :)  I guess I picked the wrong one to
establish the standard.  I'll remove it from both Win32 and Unix when
I get a chance.

> >  . ap_read() returns APR_EOF if it hits eof before giving the caller any
> >    data
> 
> Did we reach a consesus on this? I didn't see one.

Win32 and Unix now work the same, and that behavior is the same as
stdio, the Unix syscall read(), the Win32 syscall (ReadFile() or
whatever), the OS/2 syscall DosRead(), etc.  That sounds like a pretty
good consensus to me.

I really don't think that this is a case where it is helpful to create
a new programming paradigm.

> >  . ap_fgets() clobbered the '\n'
> 
> I see that as a good thing. When would you actually want it?

It is the only way to know that what was read in wasn't a complete
line.  That is required.

It is also the way that the Unix ap_fgets() code always worked.  It is
also the way that stdio works.

-- 
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
     http://www.geocities.com/SiliconValley/Park/9289/
          Born in Roswell... married an alien...

Mime
View raw message