[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: asynchronous channel write


On 13.01.20 22:54, Torsten Kuehnel wrote:

> Looks to me your loop does not cope with partial writes correctly as
> you pass the initial (channel, buf, len) parameters unmodified in
> subsequent calls to ssh_channel_write, shall your innermost do {...}
> loop iterate more than once.
>
> Shouldn't you increment your buf pointer by the bytes already sent, or
> does libssh keep track of the write progress and does this for you ?

Hi Torsten,

yes you are right! After reading the source of ssh_channel_write() I
totally agree. The buf argument is a const char* so it can't be modified
through ssh_channel_write()...

I'm really suprised that we never had an issue with this... We tested
the code extensively.

Maybe the implementation changed? I wrote it for V0.8.90...

I will check this.

Thanks!
Till


Follow-Ups:
Re: asynchronous channel writeTorsten Kuehnel <tdkuehnel@xxxxxxxxxxxxxxxxxxxxx>
References:
asynchronous channel writeTorsten Kuehnel <tdkuehnel@xxxxxxxxxxxxxxxxxxxxx>
Re: asynchronous channel writeg4-lisz@xxxxxxxxxxxx
Re: asynchronous channel writeTorsten Kuehnel <tdkuehnel@xxxxxxxxxxxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org