On Fri, 15 Feb 2019, Ketul Barot via curl-library wrote:
I added the timeout function call and it is not working. Meaning, it is not
timing out after 2 Sec. I believe part of the reason is that the case
SSH_SESSION_DISCONNECT is called repeatedly and so the timeout function is
getting called every time.
Ah sorry, I misunderstood. I thought it got stuck in libssh2.
This then sounds like a bug in libssh2 that makes it never really complete the
disconnect procedure. It is curious that this would act any differently
depending on RTT.
(from the a follow-up mail)
If that is the case can we implement some kind of timeout inside
*_disconnect function such that if it is not able to flush the data out for
some reason just disconnect the session.
Well, curl already has a timeout option (or actually, several) so you can
already make it timeout the transfer if this goes on for too long. I don't
think we can detect this situation to know that this is a special known
problematic state that we should avoid that way.
A way to dig further on this problem would be to build an application using
libssh2 directly (without curl) and see if that reproduces this issue, as then
we know where the underlying problem is.
--
/ daniel.haxx.se
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html