comparison src/event/quic/ngx_event_quic_streams.c @ 8855:9ae239d2547d quic

QUIC: separate event handling functions. The functions ngx_quic_handle_read_event() and ngx_quic_handle_write_event() are added. Previously this code was a part of ngx_handle_read_event() and ngx_handle_write_event(). The change simplifies ngx_handle_read_event() and ngx_handle_write_event() by moving QUIC-related code to a QUIC source file.
author Roman Arutyunyan <arut@nginx.com>
date Thu, 09 Sep 2021 16:55:00 +0300
parents 486c6a9be111
children a2cef164a924
comparison
equal deleted inserted replaced
8854:7416d3b2fac5 8855:9ae239d2547d
1468 ngx_quic_queue_frame(qc, frame); 1468 ngx_quic_queue_frame(qc, frame);
1469 } 1469 }
1470 1470
1471 return NGX_OK; 1471 return NGX_OK;
1472 } 1472 }
1473
1474
1475 ngx_int_t
1476 ngx_quic_handle_read_event(ngx_event_t *rev, ngx_uint_t flags)
1477 {
1478 if (!rev->active && !rev->ready) {
1479 rev->active = 1;
1480
1481 } else if (rev->active && (rev->ready || (flags & NGX_CLOSE_EVENT))) {
1482 rev->active = 0;
1483 }
1484
1485 return NGX_OK;
1486 }
1487
1488
1489 ngx_int_t
1490 ngx_quic_handle_write_event(ngx_event_t *wev, size_t lowat)
1491 {
1492 if (!wev->active && !wev->ready) {
1493 wev->active = 1;
1494
1495 } else if (wev->active && wev->ready) {
1496 wev->active = 0;
1497 }
1498
1499 return NGX_OK;
1500 }