Page MenuHomePhabricator
Feed Advanced Search

Feb 13 2020

Vishalearnz added a comment to T212: ServerAliveInterval & ClientAliveInterval not present in libssh version 0.9.0.

Thanks Jakuje , Although I am able to use the above two api's to get the status of the connection.
But even after that there is a hard reset which causes the session to be terminated after 30 mins , even though keep alive is being sent.

Feb 13 2020, 10:34 AM · Restricted Project

Jan 30 2020

Vishalearnz added a comment to T212: ServerAliveInterval & ClientAliveInterval not present in libssh version 0.9.0.

In my scenario I need to handle the response i.e if for a keepalive request I donot get a correct response . I need to terminate the session .
But going by what you wrote above " no explicit action should be needed from the calling program" , I am understanding that ssh_send_keepalive() internally calls the following sequence ssh_global_request()-> ssh_handle_packets_termination()->ssh_handle_packets() .
But I need to capture the response which ssh_send_keepalive() doesnot provide me any means to get it.
Also all the other api's like
ssh_global_request(), ssh_handle_packets_termination(), ssh_handle_packets() are not exposed to external world so I cant use it inside my code.

Jan 30 2020, 7:45 AM · Restricted Project

Jan 29 2020

Vishalearnz added a comment to T212: ServerAliveInterval & ClientAliveInterval not present in libssh version 0.9.0.

ssh_handle_packets() is not an exposed api . I am unable to use it , also this macro(SSH_MSG_REQUEST_FAILURE) I cant find in the codebase of libssh . So what should I use ?

Jan 29 2020, 12:30 PM · Restricted Project
Vishalearnz added a comment to T212: ServerAliveInterval & ClientAliveInterval not present in libssh version 0.9.0.

I tried using ssh_send_keepalive() but it doesnot serve the purpose . Here I was monitoring the return value of the function (ssh_send_keepalive) .
I first started client and server . In my scenario server shall initiate the connection which it did and this keep alive function was set to send every 30 sec . for which the ssh_send_keepalive() was returning SSH_OK.
But when I killed the client . It was expected that the ssh_send_keepalive() should send back SSH_ERROR but instead it kept on sending back SSH_OK . This means this api is only sending the message but not monitoring the response.
I also checked in libssh code the above function always sends SSH_OK irrespective of any condition , it internally calls ssh_global_request() which is not an exposed API , so I cant use it to check.

Jan 29 2020, 9:49 AM · Restricted Project

Jan 28 2020

Vishalearnz added a comment to T212: ServerAliveInterval & ClientAliveInterval not present in libssh version 0.9.0.

Just one query .
If we are using ssh_send_ignore . Do we get response from the client for the same ?
(Because as I understand correctly .
The ssh_send_ignore returns SSH_OK if sent successfully else error. It doesnot states
if client has received it and responded.)

Jan 28 2020, 8:25 AM · Restricted Project

Jan 27 2020

Vishalearnz added a comment to T212: ServerAliveInterval & ClientAliveInterval not present in libssh version 0.9.0.

Thanks a lot @Jakuje .
I tried as per your recommendation and it works for me.

Jan 27 2020, 11:04 AM · Restricted Project

Jan 23 2020

Vishalearnz created T212: ServerAliveInterval & ClientAliveInterval not present in libssh version 0.9.0.
Jan 23 2020, 7:16 AM · Restricted Project