Subject: Re: [PATCH] Follow RFC4253 section 11.4

Re: [PATCH] Follow RFC4253 section 11.4

From: Steven Dake <sdake_at_redhat.com>
Date: Fri, 02 Mar 2012 11:56:15 -0700

On 03/02/2012 10:41 AM, Steven Dake wrote:
> On 03/01/2012 03:37 PM, Peter Stuge wrote:
>> Henrik Nordström wrote:
>>>> This might already be managed within libssh2 though, that
>>>> keepalives are never sent in the middle of another request.
>>>
>>> In blocking mode keepalives are by default sent in the middle of other
>>> requests by _libssh2_wait_socket.
>>>
>>> And applications is very likely to do use libss2_keepalive_send in
>>> similar manner in non-blocking mode.
>>
>> I see. Then the code that receives packets must be changed to take
>> care of those responses as well.
>>
>>
>>> Also be warned that libssh2_keepalive_send corrupts transport if
>>> only part of the keep-alive message can be sent.
>>
>> Good fun.
>>
>
> To address this in my code which is nonblocking, should I avoid sending
> keepalive_send while a channel operation is in progress? Currently the
> nonblocking app sends the keepalive based upon a timer set by the return
> from the previous keepalive_send.
>
>
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

Short note,

I put my libbsh2_keepalive_config code after the key setup and no longer
receive the MSG UNIMPLEMENTED packet. As a result, this is user error.
 Hope others find this information helpful when developing their own apps.

Even after properly registering with keepalive_config, the keepalive
messages still return MSG_REQUEST_FAILURE if want reply is set.

Regards
-steve
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2012-03-02