Subject: Re: sftp_read problems with large buffer

Re: sftp_read problems with large buffer

From: Peter Stuge <peter_at_stuge.se>
Date: Tue, 4 Aug 2009 17:11:34 +0200

Peter Stuge wrote:
> > select(4, [3], NULL, NULL, NULL) = 1 (in [3])
> > recv(3, "\342\261\354\263\243\250i@\367\375\372ylHm\36\364\300\216J\316\1\241@>\252r\227\10\335\270\372\22"...,
> > 16384, MSG_NOSIGNAL) = 1408
> > select(4, NULL, NULL, NULL, NULL
>
> Good find. This is a bug. The fd_set must not be empty.

> > Are any changes likely candidates for having caused this?
>
> This is a bug near calls to select(), it looks just like there is a
> loop around a select() call which does not properly re-initialize the
> fd_sets before the second select() call.

And this is surely also what causes Mike's problem in
http://libssh2.haxx.se/mail/libssh2-devel-archive-2009-07/0173.shtml

//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2009-08-04