-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove handle when pipelining enabled corrupts data #2101
Comments
Possibly related to this known bug: Disabling HTTP Pipelining |
@bagder As you may see we're not cancel Pipelining. We just remove curl_easy handle from curl_multi.
|
I haven't investigated the issue closely, but I would still presume the problems to be very similar. When a handle is used for pipelining it needs to be removed (or cancelled) with care. I'm not even entirely sure what we should consider the correct behavior to be if that handle is in fact used in the pipeline. I suppose the entire connection needs to be killed and the other transfers involved in the pipeline has to be cancelled. |
@bagder Now i see your point. Since using pipelining we can't say to the other side "stop sending us this file", the only way to stop transmission of cancelled data is to close connection. |
Right, since when you remove handle A that is associated with a pipeline, handle B's request may already have been sent and is queued for a response on the same connection after A's response so when you remove A (before its entire response has been received), you need to disconnect the connection since there won't be anyone around anymore to read the A response, but you also then kill the connection for handle B, whose response hasn't even arrived yet. |
Ok, seems we have to remove canceling from our downloading queue, for tasks that are already added into curl_multi. Could I suggest to add some warning printed in verbose mode? Like "hey, when you remove curl_easy from pipelined curl_multi you'll probably screw your other curl_easy handlers". |
I suppose an ideal solution would be to do the removal but to save enough for the moment to let handle B get its response and then once handle A is completely off the hook remove the rest.
I would prefer an attempt to a real fix... |
Now mentioned in the KNOWN_BUGS's 1.2 section. Closing until someone works on this. |
I did this
Our app downloads only visible tiles and cancels tile download task when some tile is out of view. Recently we changed app to use piping connections. With some chance curl corrupted tiles. Seems curl_multi called write function for wrong curl_easy with data from cancelled curls.
I expected the following
No data should be sent to write functions after curl_easy_cleanup call.
curl/libcurl version
curl 7.56.1
operating system
iOS 11.1
macOS 10.12
Our minimal test example below. Put breakpoint on line 59.
The text was updated successfully, but these errors were encountered: