comparison 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
comparison
equal deleted inserted replaced
8214:6fd2cce50fe2 8215:38c0898b6df7
266 266
267 267
268 ngx_int_t 268 ngx_int_t
269 ngx_handle_read_event(ngx_event_t *rev, ngx_uint_t flags) 269 ngx_handle_read_event(ngx_event_t *rev, ngx_uint_t flags)
270 { 270 {
271 ngx_connection_t *c;
272
273 c = rev->data;
274
275 if (c->qs) {
276
277 if (!rev->active && !rev->ready) {
278 rev->active = 1;
279
280 } else if (rev->active && (rev->ready || (flags & NGX_CLOSE_EVENT))) {
281 rev->active = 0;
282 }
283
284 return NGX_OK;
285 }
286
271 if (ngx_event_flags & NGX_USE_CLEAR_EVENT) { 287 if (ngx_event_flags & NGX_USE_CLEAR_EVENT) {
272 288
273 /* kqueue, epoll */ 289 /* kqueue, epoll */
274 290
275 if (!rev->active && !rev->ready) { 291 if (!rev->active && !rev->ready) {
336 ngx_int_t 352 ngx_int_t
337 ngx_handle_write_event(ngx_event_t *wev, size_t lowat) 353 ngx_handle_write_event(ngx_event_t *wev, size_t lowat)
338 { 354 {
339 ngx_connection_t *c; 355 ngx_connection_t *c;
340 356
357 c = wev->data;
358
341 if (lowat) { 359 if (lowat) {
342 c = wev->data;
343
344 if (ngx_send_lowat(c, lowat) == NGX_ERROR) { 360 if (ngx_send_lowat(c, lowat) == NGX_ERROR) {
345 return NGX_ERROR; 361 return NGX_ERROR;
346 } 362 }
363 }
364
365 if (c->qs) {
366
367 if (!wev->active && !wev->ready) {
368 wev->active = 1;
369
370 } else if (wev->active && wev->ready) {
371 wev->active = 0;
372 }
373
374 return NGX_OK;
347 } 375 }
348 376
349 if (ngx_event_flags & NGX_USE_CLEAR_EVENT) { 377 if (ngx_event_flags & NGX_USE_CLEAR_EVENT) {
350 378
351 /* kqueue, epoll */ 379 /* kqueue, epoll */
913 941
914 ngx_int_t 942 ngx_int_t
915 ngx_send_lowat(ngx_connection_t *c, size_t lowat) 943 ngx_send_lowat(ngx_connection_t *c, size_t lowat)
916 { 944 {
917 int sndlowat; 945 int sndlowat;
946
947 if (c->qs) {
948 return NGX_OK;
949 }
918 950
919 #if (NGX_HAVE_LOWAT_EVENT) 951 #if (NGX_HAVE_LOWAT_EVENT)
920 952
921 if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) { 953 if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
922 c->write->available = lowat; 954 c->write->available = lowat;