]> git.kaiwu.me - nginx.git/commitdiff
HTTP/2: lingering close changed to handle NGX_AGAIN.
authorRuslan Ermilov <ru@nginx.com>
Mon, 1 Feb 2021 13:42:50 +0000 (16:42 +0300)
committerRuslan Ermilov <ru@nginx.com>
Mon, 1 Feb 2021 13:42:50 +0000 (16:42 +0300)
This part somehow slipped away from c5840ca2063d.

While it is not expected to be needed in case of lingering close,
it is good to keep it for correctness (see 2b5528023f6b).

src/http/v2/ngx_http_v2.c

index 77b60d42e2fbf9f8f44313969f943276d5557387..7c1ba597f2df370cb60159253c333d5f56a71917 100644 (file)
@@ -807,6 +807,10 @@ ngx_http_v2_lingering_close_handler(ngx_event_t *rev)
 
         ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, "lingering read: %z", n);
 
+        if (n == NGX_AGAIN) {
+            break;
+        }
+
         if (n == NGX_ERROR || n == 0) {
             ngx_http_close_connection(c);
             return;