Thank you for confirmation that this combination works. But lets clarify what you do -- you are sending every X minutes the ignore or keepalive messages to keep the channel open, but even though you are getting disconnects after 30 minutes. I do not think this is anything in libssh. What are you running in the channels? Port forwarding? Some long-running commands transmitting or not transmitting data? Shells? How does this disconnect look like? Could it be the default value of $TMOUT in bash? Or something on the network layer terminating long-running connections?
Needs Triage (15)
Fri, Feb 14
Thu, Feb 13
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.
Wed, Feb 12
Hello! Thank you a lot! You are absolutely right, idiotsandopensource and ansasaki! The problem is with mbedtls.lib. So need to wait when it will fixed ^3^
Tue, Feb 11
This is not libssh's fault. Yesterday vcpkg master changed and new master branch is broken. Only reason I know this because I was setting up vcpkg with another programmer and called it a day. Next morning I get a it no work and all our automated builds broke.
This is caused by a idiot programmer and I swear it must have happened in 48 hour window because THIS SHIT did not happen. I went to vcpkg to not have to explain open source stupid shit to other engineers that don't need to know about cmake pearl and other stupid shit.
I just use default package which coming from vcpkg. By default it's coming with mbedtls => so it's mbedcrypto.lib.
I don't use any flags cause I think that default package should work.
This is probably caused by the lack of threading support in the crypto library.
I've proposed https://gitlab.com/libssh/libssh-mirror/-/merge_requests/93 for fixing this by removing the static from those variables.
I am sorry for a delay.
Thu, Jan 30
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.
Wed, Jan 29
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 ?
the ssh_send_keepalive() does really only the sending. But the return value is ignored since 59ada799. But if the sending failed, the session state should be modified to reflect this if I am right. The response is handled as any other message in ssh_handle_packets() if I am right. The response is anyway SSH_MSG_REQUEST_FAILURE.
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.
Tue, Jan 28
Please, check the RFC 4253 describing this message: https://tools.ietf.org/html/rfc4253#section-11.2
Just one query .
If we are using ssh_send_ignore . Do we get response from the client for the same ?
If not then is there an api other than ssh_send_ignore which sends the message and gets back response from the client.
I need to get the response of the client (either they have received the message or not).
Mon, Jan 27
Thanks a lot @Jakuje .
I tried as per your recommendation and it works for me.
Thu, Jan 23
Thanks, commit 9a10cef92086d3b22fa4acd9999cf908b7fa7e48 works.