Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
curl_multi_socket_action with large posts won't multiplex properly #3436
I did this
I'm performing multiple concurrent requests to a HTTP/2 server, each with a large POST body. The server execution takes exactly 1 second (because
Code: https://gist.github.com/TvdW/c41cb1e74feb0c5f79be83f9d330a74b - argv refers to the server to test with, I've been using https://home.xifon.eu/sleep/1000 which runs a http2 server that sleeps for exactly one second. When commenting out the "BAD" section (thus allowing the "GOOD" section to run), the difference can be seen.
I expected the following
Doing 10 concurrent requests that each take one second should take one second total.
Some further debugging shows that when I get the fd_set from curl_multi_fdset, it differs from the ones passed to me via
The code looks like it uses libcurl wrongly. It uses a mix of event-based and non event-based functions in a way I'm not convinced is fine. It should wait only for the sockets told about by the socket callback and it should not use
Thanks for checking. I'm not using
The timeout logic is indeed broken but should be sufficient for the purpose of demonstrating the issue.
That's a fair question. Here's the output of h2load:
In other words, the server is able to handle 10 concurrent requests in 1 second, despite all being executed over the same connection. Each request takes one second.
The code I posted (
Swapping the event loop code for