Subject: Re: Problem with large write buffer

Re: Problem with large write buffer

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 14 May 2009 23:27:00 +0200 (CEST)

On Tue, 12 May 2009, Daniele Pianu wrote:

> I'm working on a strem library which implements various kind of streams. All
> SSH based streams are implemented using your great libssh2 library ;) Now
> I'm trying to implement the SFTP protocol, but I've some problem when
> uploading large files. This example partially reproduces the problem:

When I run the app with strace, the last lines are telling:

send(4,
"\347\214T\272u\335\213]\306\276\310\344K\353\360\25\273\310+\377;|D\244\371\352i\310\273FKO"...,
32820, MSG_NOSIGNAL) = 32820
send(4, "\270U'3\303\220\3257nu6\330\337\3r\373\351\314J\307\352<\220
\212\352a\221:H\n@"..., 32820, MSG_NOSIGNAL) = 32820
send(4,
"\352\"\3\360\304)\210\4U\312\230\360\205V\vs?r\245r\230\276\273\202\273\271\340\336\277hQ4"...,
84, MSG_NOSIGNAL) = 84
recv(4, 0x885f12c, 16384, MSG_NOSIGNAL) = -1 EAGAIN (Resource temporarily
unavailable)
select(5, [4], NULL, NULL, NULL)

... and then it hangs. Clearly there's a flaw here. It does a recv() but it
returns EAGAIN and then nothing more seems to come from the server so it hangs
on the select() call. Quite likely because the server already sent it and the
recv() was done in error.

-- 
  / daniel.haxx.se
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
Received on 2009-05-14