Buy commercial curl support from WolfSSL. We help you work
out your issues, debug your libcurl applications, use the API, port to new
platforms, add new features and more. With a team lead by the curl founder
himself.
Re: Potential hang problem on paused upload transfer when it is marked for closing
- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]
From: Dmitry Karpov via curl-library <curl-library_at_lists.haxx.se>
Date: Wed, 29 Nov 2023 19:26:52 +0000
> I can't think of a situation where keeping the pause bit can actually serve a purpose when the upload itself is already done.
This can happen in some bi-directional "upgrade" scenarios where sending is paused until some "upgrade" handshake is completed,
but server rejects the handshake and closes the connection.
In my case it occurred for a WebSocket transfer when the server rejected WS handshake and closed the connection.
> Will you make a PR for it?
Sure, will do.
Thanks!
Dmitry Karpov
-----Original Message-----
From: Daniel Stenberg <daniel_at_haxx.se>
Sent: Wednesday, November 29, 2023 1:16 AM
To: Dmitry Karpov via curl-library <curl-library_at_lists.haxx.se>
Cc: Dmitry Karpov <dkarpov_at_roku.com>
Subject: [EXTERNAL] Re: Potential hang problem on paused upload transfer when it is marked for closing
On Tue, 28 Nov 2023, Dmitry Karpov via curl-library wrote:
> It looks like clearing just the KEEP_SEND in the "keepon" flags wasn't
> enough to unpause and finish the transfer. I am wondering if the
> KEEP_SEND_PAUSE flag should be also cleared in this case?
...
> It worked out in my case, but maybe there are some other implications
> which I don't see with this solution.
I can't think of a situation where keeping the pause bit can actually serve a purpose when the upload itself is already done. I think this seems like a reasonable fix. Especially since it fixes your problem.
Will you make a PR for it?
Date: Wed, 29 Nov 2023 19:26:52 +0000
> I can't think of a situation where keeping the pause bit can actually serve a purpose when the upload itself is already done.
This can happen in some bi-directional "upgrade" scenarios where sending is paused until some "upgrade" handshake is completed,
but server rejects the handshake and closes the connection.
In my case it occurred for a WebSocket transfer when the server rejected WS handshake and closed the connection.
> Will you make a PR for it?
Sure, will do.
Thanks!
Dmitry Karpov
-----Original Message-----
From: Daniel Stenberg <daniel_at_haxx.se>
Sent: Wednesday, November 29, 2023 1:16 AM
To: Dmitry Karpov via curl-library <curl-library_at_lists.haxx.se>
Cc: Dmitry Karpov <dkarpov_at_roku.com>
Subject: [EXTERNAL] Re: Potential hang problem on paused upload transfer when it is marked for closing
On Tue, 28 Nov 2023, Dmitry Karpov via curl-library wrote:
> It looks like clearing just the KEEP_SEND in the "keepon" flags wasn't
> enough to unpause and finish the transfer. I am wondering if the
> KEEP_SEND_PAUSE flag should be also cleared in this case?
...
> It worked out in my case, but maybe there are some other implications
> which I don't see with this solution.
I can't think of a situation where keeping the pause bit can actually serve a purpose when the upload itself is already done. I think this seems like a reasonable fix. Especially since it fixes your problem.
Will you make a PR for it?
-- / daniel.haxx.se | Commercial curl support up to 24x7 is available! | Private help, bug fixes, support, ports, new features | https://curl.se/support.html -- Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library Etiquette: https://curl.se/mail/etiquette.htmlReceived on 2023-11-29