diff src/event/ngx_event.c @ 8215:38c0898b6df7 quic

HTTP/3.
author Roman Arutyunyan <arut@nginx.com>
date Fri, 13 Mar 2020 19:36:33 +0300
parents f1720934c45b
children 0d2b2664b41c
line wrap: on
line diff
--- a/src/event/ngx_event.c
+++ b/src/event/ngx_event.c
@@ -268,6 +268,22 @@ ngx_process_events_and_timers(ngx_cycle_
 ngx_int_t
 ngx_handle_read_event(ngx_event_t *rev, ngx_uint_t flags)
 {
+    ngx_connection_t  *c;
+
+    c = rev->data;
+
+    if (c->qs) {
+
+        if (!rev->active && !rev->ready) {
+            rev->active = 1;
+
+        } else if (rev->active && (rev->ready || (flags & NGX_CLOSE_EVENT))) {
+            rev->active = 0;
+        }
+
+        return NGX_OK;
+    }
+
     if (ngx_event_flags & NGX_USE_CLEAR_EVENT) {
 
         /* kqueue, epoll */
@@ -338,14 +354,26 @@ ngx_handle_write_event(ngx_event_t *wev,
 {
     ngx_connection_t  *c;
 
+    c = wev->data;
+
     if (lowat) {
-        c = wev->data;
-
         if (ngx_send_lowat(c, lowat) == NGX_ERROR) {
             return NGX_ERROR;
         }
     }
 
+    if (c->qs) {
+
+        if (!wev->active && !wev->ready) {
+            wev->active = 1;
+
+        } else if (wev->active && wev->ready) {
+            wev->active = 0;
+        }
+
+        return NGX_OK;
+    }
+
     if (ngx_event_flags & NGX_USE_CLEAR_EVENT) {
 
         /* kqueue, epoll */
@@ -916,6 +944,10 @@ ngx_send_lowat(ngx_connection_t *c, size
 {
     int  sndlowat;
 
+    if (c->qs) {
+        return NGX_OK;
+    }
+
 #if (NGX_HAVE_LOWAT_EVENT)
 
     if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {