On 16 September 2011 21:07, <libs...@git.stuge.se> wrote: > - Log ----------------------------------------------------------------- > commit 30e28817f2b7d834447ab5cb1ec920c11181a52d > Author: Daniel Stenberg <dan...@haxx.se> > Commit: Daniel Stenberg <dan...@haxx.se> > > sftp_read: use a state variable to avoid bad writes > > When a channel_write call has gotten an EAGAIN back, we try harder to > continue the same write in the subsequent invoke. > > diff --git a/src/sftp.c b/src/sftp.c > index 45e0439..357b87b 100644 > --- a/src/sftp.c > +++ b/src/sftp.c ... > @@ -1207,11 +1215,14 @@ static ssize_t sftp_read(LIBSSH2_SFTP_HANDLE * > handle, char *buffer, > rc = _libssh2_channel_write(channel, 0, > &chunk->packet[chunk->sent], > chunk->lefttosend); > + sftp->read_state = libssh2_NB_state_idle; > if(rc < 0) { > if(rc != LIBSSH2_ERROR_EAGAIN) > /* error */ > return rc; > eagain++; > + fprintf(stderr, "bing\n"); > + sftp->read_state = libssh2_NB_state_sent; > break; > }
Did you really mean to include fprintf(stderr, "bing\n") here? Alex _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel