diff options
author | Roman Arutyunyan <arut@nginx.com> | 2020-08-11 10:41:39 +0300 |
---|---|---|
committer | Roman Arutyunyan <arut@nginx.com> | 2020-08-11 10:41:39 +0300 |
commit | 68c5d80ee5381db9ea20e2ef247153e300fe837c (patch) | |
tree | cfa29b25d2eb2a9239e4c280fd0d604db8f5995b /src/http/ngx_http_request.c | |
parent | e4ca695700b996f1347662a2666881fdc09ea703 (diff) | |
download | nginx-68c5d80ee5381db9ea20e2ef247153e300fe837c.tar.gz nginx-68c5d80ee5381db9ea20e2ef247153e300fe837c.zip |
QUIC: fixed ngx_http_test_reading() for QUIC streams.
Previously this function generated an error trying to figure out if client shut
down the write end of the connection. The reason for this error was that a
QUIC stream has no socket descriptor. However checking for eof is not the
right thing to do for an HTTP/3 QUIC stream since HTTP/3 clients are expected
to shut down the write end of the stream after sending the request.
Now the function handles QUIC streams separately. It checks if c->read->error
is set. The error flags for c->read and c->write are now set for all streams
when closing the QUIC connection instead of setting the pending_eof flag.
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r-- | src/http/ngx_http_request.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index 54e5e2866..30a22fa22 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -3022,6 +3022,19 @@ ngx_http_test_reading(ngx_http_request_t *r) #endif +#if (NGX_HTTP_QUIC) + + if (c->qs) { + if (c->read->error) { + err = 0; + goto closed; + } + + return; + } + +#endif + #if (NGX_HAVE_KQUEUE) if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) { |