Mercurial > hg > nginx
comparison src/event/ngx_event.c @ 8481:0d2b2664b41c quic
QUIC: added "quic" listen parameter.
The parameter allows processing HTTP/0.9-2 over QUIC.
Also, introduced ngx_http_quic_module and moved QUIC settings there
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Tue, 21 Jul 2020 23:09:22 +0300 |
parents | 38c0898b6df7 |
children | 279ad36f2f4b |
comparison
equal
deleted
inserted
replaced
8480:f537f99b86ee | 8481:0d2b2664b41c |
---|---|
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 #if (NGX_QUIC) | |
272 | |
271 ngx_connection_t *c; | 273 ngx_connection_t *c; |
272 | 274 |
273 c = rev->data; | 275 c = rev->data; |
274 | 276 |
275 if (c->qs) { | 277 if (c->qs) { |
281 rev->active = 0; | 283 rev->active = 0; |
282 } | 284 } |
283 | 285 |
284 return NGX_OK; | 286 return NGX_OK; |
285 } | 287 } |
288 | |
289 #endif | |
286 | 290 |
287 if (ngx_event_flags & NGX_USE_CLEAR_EVENT) { | 291 if (ngx_event_flags & NGX_USE_CLEAR_EVENT) { |
288 | 292 |
289 /* kqueue, epoll */ | 293 /* kqueue, epoll */ |
290 | 294 |
360 if (ngx_send_lowat(c, lowat) == NGX_ERROR) { | 364 if (ngx_send_lowat(c, lowat) == NGX_ERROR) { |
361 return NGX_ERROR; | 365 return NGX_ERROR; |
362 } | 366 } |
363 } | 367 } |
364 | 368 |
369 #if (NGX_QUIC) | |
370 | |
365 if (c->qs) { | 371 if (c->qs) { |
366 | 372 |
367 if (!wev->active && !wev->ready) { | 373 if (!wev->active && !wev->ready) { |
368 wev->active = 1; | 374 wev->active = 1; |
369 | 375 |
371 wev->active = 0; | 377 wev->active = 0; |
372 } | 378 } |
373 | 379 |
374 return NGX_OK; | 380 return NGX_OK; |
375 } | 381 } |
382 | |
383 #endif | |
376 | 384 |
377 if (ngx_event_flags & NGX_USE_CLEAR_EVENT) { | 385 if (ngx_event_flags & NGX_USE_CLEAR_EVENT) { |
378 | 386 |
379 /* kqueue, epoll */ | 387 /* kqueue, epoll */ |
380 | 388 |
942 ngx_int_t | 950 ngx_int_t |
943 ngx_send_lowat(ngx_connection_t *c, size_t lowat) | 951 ngx_send_lowat(ngx_connection_t *c, size_t lowat) |
944 { | 952 { |
945 int sndlowat; | 953 int sndlowat; |
946 | 954 |
955 #if (NGX_QUIC) | |
947 if (c->qs) { | 956 if (c->qs) { |
948 return NGX_OK; | 957 return NGX_OK; |
949 } | 958 } |
959 #endif | |
950 | 960 |
951 #if (NGX_HAVE_LOWAT_EVENT) | 961 #if (NGX_HAVE_LOWAT_EVENT) |
952 | 962 |
953 if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) { | 963 if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) { |
954 c->write->available = lowat; | 964 c->write->available = lowat; |