Subject: Re: writing to channel limited to 2 Mb?

Re: writing to channel limited to 2 Mb?

From: Przemysław Szczygielski <qus123_at_gmail.com>
Date: Wed, 10 Aug 2011 19:56:34 +0200

Wait, wait? What do you mean no payload was sent? I can see in my debug
output how following 4096 byte packets get properly sent by writeData(const
char* buff, qint64 len). Then when about 2Mb of bytes is sent the attached
procedure will show:

QxtSshChannel::writeData ******FKUP!!!! ssh wrote less than it should!!!
(171/4096) // 171 is just some value, which shows that the packet fot
partially written! All following packets don't get written at all
QxtSshChannel::writeData ******FKUP!!!! ssh wrote less than it should!!!
(0/4096)
QxtSshChannel::writeData ******FKUP!!!! ssh wrote less than it should!!!
(0/4096)
QxtSshChannel::writeData ******FKUP!!!! ssh wrote less than it should!!!
(0/4096)
QxtSshChannel::writeData ******FKUP!!!! ssh wrote less than it should!!!
(0/4096)
.
.
.

Which shows clearly that writeData gets a buffer of 4096, but
libssh2_channel_write_ex at some point decides not to write it.

So this also answers your question - after ret is 0 I keep writing packets,
but I do this because I discovered only today, that writing to ssh channel
fails. So I don't really know what else should I do ;-)

W dniu 10 sierpnia 2011 19:43 użytkownik Daniel Stenberg
<daniel_at_haxx.se>napisał:

> On Wed, 10 Aug 2011, Przemysław Szczygielski wrote:
>
> I am writing small amounts of data (not more than 4096 bytes) to ssh
>> channel, using libssh2_channel_write_ex. Up to 2Mb sent, the function
>> returns actual bytes written. But around 2Mb (the boundary is not constant,
>> but it fails around 2093051, 2080764, 2083684 or 2092906) it begins
>> returning 0 and of course - no data reaches destination.
>>
>
> 0 is not an error and is not the end of the stream though. It just meant
> that no payload data was sent.
>
> What do you do after you get the 0 return code?
>
> --
>
> / daniel.haxx.se
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
>
>

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2011-08-10