Daniel Stenberg wrote:
>> I think it would be nice to return EAGAIN if we read 0 bytes from
> 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
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.
Received on 2012-02-09