curl / Mailing Lists / curl-library / Single Mail

curl-library

RE: sftp upload request hangs with a high latency server using multi interface

From: Ketul Barot via curl-library <curl-library_at_cool.haxx.se>
Date: Tue, 19 Feb 2019 15:09:35 +0000

First of all thank you for helping me debug this issue. As you mentioned about curl timeouts, I would like to say that this issue I am hitting when I abort from the transfer and call curl_multi_remove_handle (as mentioned in my original post) and this is where this gets stucked and does this calling SSH_SESSION_DISCONNECT. I am not sure if curl provides timeouts in this case (curl_multi_remove_handle).

I am not sure if I can build libssh2 application for my device but I can give it a shot.

Thanks,
Ketul
From: Daniel Stenberg <daniel_at_haxx.se>
Sent: Saturday, February 16, 2019 10:00 AM
To: Ketul Barot via curl-library <curl-library_at_cool.haxx.se>
Cc: Ketul Barot <kbarot_at_parallelwireless.com>
Subject: RE: sftp upload request hangs with a high latency server using multi interface

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<http://daniel.haxx.se>

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-02-19