[nginx] Events: fixed eventport handling in ngx_handle_read_event().

Maxim Dounin mdounin at mdounin.ru
Fri Mar 5 15:31:36 UTC 2021


details:   https://hg.nginx.org/nginx/rev/9ca8fb98ef1c
branches:  
changeset: 7788:9ca8fb98ef1c
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Fri Mar 05 17:16:15 2021 +0300
description:
Events: fixed eventport handling in ngx_handle_read_event().

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.

diffstat:

 src/event/ngx_event.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 7ce28b4cc57e -r 9ca8fb98ef1c src/event/ngx_event.c
--- a/src/event/ngx_event.c	Fri Mar 05 17:16:13 2021 +0300
+++ b/src/event/ngx_event.c	Fri Mar 05 17:16:15 2021 +0300
@@ -318,7 +318,7 @@ ngx_handle_read_event(ngx_event_t *rev, 
             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;
             }


More information about the nginx-devel mailing list