-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Closed
Description
I did this
I am sending two parallel requests with huge URLs (about 5k symbols) to a remote Nginx server by one connection, exceeding its http2_max_field_size (4kb by default).
I expected the following
I expect curl to return an error after receiving a GOAWAY from server.
What seems to actually happen
- Curl sends two parallel requests to Nginx
- Nginx fails to process first request and returns
GOAWAYwithENHANCE_YOUR_CALMerror code. - Nghttp2 seems to ignore the error code and only calls on_stream_close() with
REFUSED_STREAMerror code for stream related to the second request (which is partially correct since Nginx didn't try to process it). - After this, curl receives TLS close notify and decides to retry both requests, because the connection they run on is marked as reused.
- Since both requests are "bad" for Nginx, curl will keep failing to finish them even if it tries to change the order the requests are processed.
Versions
libcurl 7.65.2
Nginx 1.10.3, 1.12., 1.14.
Logs
libcurl logs (with DEBUG_HTTP2 and CURLOPT_VERBOSE)
https://gist.github.com/selivni/880049e63a23f2fe7a69536c06e62c86
How to reproduce
I reproduced the issue using this piece of c++ code, this Nginx config, and this URL.
If you change NUM_REQUESTS value to 1, everything will work fine and curl will successfully fail the request with "Empty reply from server" error.
Operating system
I've been able to reproduce this on Android and Darwin (Catalina 10.15.3) with Nginx running on Ubuntu 16.04.6.