Daniel Stenberg wrote: >> I think it would be nice to return EAGAIN if we read 0 bytes from >> transport. > > I don't. EAGAIN is only ever introduced in the transport layer when > there's actually an EAGAIN from the socket layer. Introducing it > elsewhere has always only introduced badness in the past and we've > had to backpedal out from that several times.
It seems to me that the semantics are correct in this case. > For example, EAGAIN implies that you need to call the same function > again to make it "finish" what was previously started while 0 means > that it wasn't abruptly stopped in the middle of something that > needs to be continued but that other functions may very well be > used. Except sftp_read() returning 0 means EOF, unlike for the channel functions. Just use EAGAIN and avoid recreating the complexity inside the SFTP layer when the above layer handles the case anyway. //Peter _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel