summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/event/quic/ngx_event_quic.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/src/event/quic/ngx_event_quic.c b/src/event/quic/ngx_event_quic.c
index f38b15910..22317db25 100644
--- a/src/event/quic/ngx_event_quic.c
+++ b/src/event/quic/ngx_event_quic.c
@@ -1878,21 +1878,13 @@ ngx_quic_max_udp_payload(ngx_connection_t *c)
static void
ngx_quic_input_handler(ngx_event_t *rev)
{
- ssize_t n;
ngx_int_t rc;
- ngx_buf_t b;
+ ngx_buf_t *b;
ngx_connection_t *c;
ngx_quic_connection_t *qc;
- static u_char buf[NGX_QUIC_MAX_UDP_PAYLOAD_SIZE];
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, rev->log, 0, "quic input handler");
- ngx_memzero(&b, sizeof(ngx_buf_t));
- b.start = buf;
- b.end = buf + sizeof(buf);
- b.pos = b.last = b.start;
- b.memory = 1;
-
c = rev->data;
qc = ngx_quic_get_connection(c);
@@ -1911,21 +1903,13 @@ ngx_quic_input_handler(ngx_event_t *rev)
return;
}
- n = c->recv(c, b.start, b.end - b.start);
-
- if (n == NGX_AGAIN) {
+ if (!rev->ready) {
if (qc->closing) {
ngx_quic_close_connection(c, NGX_OK);
}
return;
}
- if (n == NGX_ERROR) {
- c->read->eof = 1;
- ngx_quic_close_connection(c, NGX_ERROR);
- return;
- }
-
if (qc->tp.disable_active_migration) {
if (c->socklen != qc->socklen
|| ngx_memcmp(c->sockaddr, qc->sockaddr, c->socklen) != 0)
@@ -1936,10 +1920,11 @@ ngx_quic_input_handler(ngx_event_t *rev)
}
}
- b.last += n;
- qc->received += n;
+ b = c->udp->buffer;
+
+ qc->received += (b->last - b->pos);
- rc = ngx_quic_input(c, &b, NULL);
+ rc = ngx_quic_input(c, b, NULL);
if (rc == NGX_ERROR) {
ngx_quic_close_connection(c, NGX_ERROR);