You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by kf...@collab.net on 2005/11/26 19:16:10 UTC

Re: Streams: EOF detection

Erik Huelsmann <eh...@gmail.com> writes:
> On 11/26/05, Erik Huelsmann <eh...@gmail.com> wrote:
> > I'm trying to write a stream implementation and I need to know the
> > criterion for detecting the stream I'm relaying.
> >
> > Now, the headers for streams say that a partially satisfied read
> > (without error) means an EOF condition was found.  Reading the
> > implementation for svn_stream_copy, it keeps reading the stream until
> > a non-satisfied read is encountered (returned bytes == 0).
> 
> Hmm. Reading the implementation again, I see I'm wrong here.
> svn_stream_copy does it exactly as documented in the headers.
> 
> > 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?

Need more context to answer, I think.  Is this a new stream
implementation for Subversion, or a usage of Subversion's streams... ?
(If not, we should probably take it off-list.)

I think Subversion's strategy is sane, for a high-level stream
implementation that fits over a lower-level network layer or something
similar.  If I were implementing a socket API in a kernel, I might
make it give back a bit more information about what happened on a
short read, though :-).

-Karl

-- 
www.collab.net  <>  CollabNet  |  Distributed Development On Demand

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org