Mercurial > hg > nginx
comparison src/event/quic/ngx_event_quic_streams.c @ 8886:66b4ff373dd9 quic
QUIC: refactored OCSP validation in preparation for 0-RTT support.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 26 Oct 2021 17:43:10 +0300 |
parents | 1ead7d64e993 |
children | b4c7853b0488 |
comparison
equal
deleted
inserted
replaced
8885:da112e7f8de6 | 8886:66b4ff373dd9 |
---|---|
14 | 14 |
15 | 15 |
16 static ngx_quic_stream_t *ngx_quic_create_client_stream(ngx_connection_t *c, | 16 static ngx_quic_stream_t *ngx_quic_create_client_stream(ngx_connection_t *c, |
17 uint64_t id); | 17 uint64_t id); |
18 static ngx_int_t ngx_quic_init_stream(ngx_quic_stream_t *qs); | 18 static ngx_int_t ngx_quic_init_stream(ngx_quic_stream_t *qs); |
19 static void ngx_quic_init_streams_handler(ngx_connection_t *c); | |
19 static ngx_quic_stream_t *ngx_quic_create_stream(ngx_connection_t *c, | 20 static ngx_quic_stream_t *ngx_quic_create_stream(ngx_connection_t *c, |
20 uint64_t id); | 21 uint64_t id); |
21 static void ngx_quic_empty_handler(ngx_event_t *ev); | 22 static void ngx_quic_empty_handler(ngx_event_t *ev); |
22 static ssize_t ngx_quic_stream_recv(ngx_connection_t *c, u_char *buf, | 23 static ssize_t ngx_quic_stream_recv(ngx_connection_t *c, u_char *buf, |
23 size_t size); | 24 size_t size); |
367 | 368 |
368 return NGX_OK; | 369 return NGX_OK; |
369 } | 370 } |
370 | 371 |
371 | 372 |
372 void | 373 ngx_int_t |
373 ngx_quic_init_streams(ngx_connection_t *c) | 374 ngx_quic_init_streams(ngx_connection_t *c) |
375 { | |
376 ngx_int_t rc; | |
377 ngx_quic_connection_t *qc; | |
378 | |
379 qc = ngx_quic_get_connection(c); | |
380 | |
381 if (qc->streams.initialized) { | |
382 return NGX_OK; | |
383 } | |
384 | |
385 rc = ngx_ssl_ocsp_validate(c); | |
386 | |
387 if (rc == NGX_ERROR) { | |
388 return NGX_ERROR; | |
389 } | |
390 | |
391 if (rc == NGX_AGAIN) { | |
392 c->ssl->handler = ngx_quic_init_streams_handler; | |
393 return NGX_OK; | |
394 } | |
395 | |
396 ngx_quic_init_streams_handler(c); | |
397 | |
398 return NGX_OK; | |
399 } | |
400 | |
401 | |
402 static void | |
403 ngx_quic_init_streams_handler(ngx_connection_t *c) | |
374 { | 404 { |
375 ngx_queue_t *q; | 405 ngx_queue_t *q; |
376 ngx_quic_stream_t *qs; | 406 ngx_quic_stream_t *qs; |
377 ngx_quic_connection_t *qc; | 407 ngx_quic_connection_t *qc; |
378 | 408 |