[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Streams: EOF detection

From: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2005-11-26 21:26:26 CET

On Sat, 2005-11-26 at 20:48 +0100, Erik Huelsmann wrote:
> > I think the latter condition is saner, since I think to be told that
> > there are socket reads which are successful, but only return part of
> > the requested data without meaning to signal EOF.
> >
> > What'll be the official 'verdict'?
>
> Well, I guess the question about the strategy remains. Which one is saner?

Sanity is not really the issue. The issue is just what use cases we're
making most convenient and what use cases we're making possible.

If I want to read a fixed amount of data, then having a full-read
interface is more convenient because I don't need a loop. I just say
how much data I want to read, and if I didn't get it, the stream was
closed prematurely and I error out.

If I want to do a read without blocking, I need a partial-read
interface. svn streams are not trying to handle this case (all of our
APIs are blocking, for better or for worse), so there is no need to
inconvenience callers who want a fixed amount of data.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Nov 26 21:27:28 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.