]> git.kaiwu.me - nginx.git/commitdiff
Events: fixed eventport handling in ngx_handle_read_event().
authorMaxim Dounin <mdounin@mdounin.ru>
Fri, 5 Mar 2021 14:16:15 +0000 (17:16 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Fri, 5 Mar 2021 14:16:15 +0000 (17:16 +0300)
The "!rev->ready" test seems to be a typo, introduced in the original
commit (719:f30b1a75fd3b).  The ngx_handle_write_event() code properly
tests for "rev->ready" instead.

Due to this typo, read events might be unexpectedly removed during
proxying after an event on the other part of the proxied connection.
Catched by mail proxying tests.

src/event/ngx_event.c

index 402a7f5e28e4c5382e3ad7ddfa5dbdbe625a3d38..ed7b30bf3c0ba2145b4704fad9aaf35658c658ba 100644 (file)
@@ -318,7 +318,7 @@ ngx_handle_read_event(ngx_event_t *rev, ngx_uint_t flags)
             return NGX_OK;
         }
 
-        if (rev->oneshot && !rev->ready) {
+        if (rev->oneshot && rev->ready) {
             if (ngx_del_event(rev, NGX_READ_EVENT, 0) == NGX_ERROR) {
                 return NGX_ERROR;
             }