Mercurial > hg > nginx-quic
comparison src/event/quic/ngx_event_quic_migration.c @ 8438:5186ee5a94b9 quic
QUIC: simplified sending 1-RTT only frames.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Wed, 05 May 2021 19:32:49 +0300 |
parents | d5f93733c17d |
children | 4715f3e669f1 |
comparison
equal
deleted
inserted
replaced
8437:d5f93733c17d | 8438:5186ee5a94b9 |
---|---|
20 static ngx_quic_path_t *ngx_quic_alloc_path(ngx_connection_t *c); | 20 static ngx_quic_path_t *ngx_quic_alloc_path(ngx_connection_t *c); |
21 | 21 |
22 | 22 |
23 ngx_int_t | 23 ngx_int_t |
24 ngx_quic_handle_path_challenge_frame(ngx_connection_t *c, | 24 ngx_quic_handle_path_challenge_frame(ngx_connection_t *c, |
25 ngx_quic_header_t *pkt, ngx_quic_path_challenge_frame_t *f) | 25 ngx_quic_path_challenge_frame_t *f) |
26 { | 26 { |
27 off_t max, pad; | 27 off_t max, pad; |
28 ssize_t sent; | 28 ssize_t sent; |
29 ngx_quic_path_t *path; | 29 ngx_quic_path_t *path; |
30 ngx_quic_frame_t frame, *fp; | 30 ngx_quic_frame_t frame, *fp; |
31 ngx_quic_socket_t *qsock; | 31 ngx_quic_socket_t *qsock; |
32 ngx_quic_connection_t *qc; | 32 ngx_quic_connection_t *qc; |
33 | 33 |
34 qc = ngx_quic_get_connection(c); | 34 qc = ngx_quic_get_connection(c); |
35 | 35 |
36 frame.level = pkt->level; | 36 frame.level = ssl_encryption_application; |
37 frame.type = NGX_QUIC_FT_PATH_RESPONSE; | 37 frame.type = NGX_QUIC_FT_PATH_RESPONSE; |
38 frame.u.path_response = *f; | 38 frame.u.path_response = *f; |
39 | 39 |
40 /* | 40 /* |
41 * A PATH_RESPONSE frame MUST be sent on the network path where the | 41 * A PATH_RESPONSE frame MUST be sent on the network path where the |
68 fp = ngx_quic_alloc_frame(c); | 68 fp = ngx_quic_alloc_frame(c); |
69 if (fp == NULL) { | 69 if (fp == NULL) { |
70 return NGX_ERROR; | 70 return NGX_ERROR; |
71 } | 71 } |
72 | 72 |
73 fp->level = pkt->level; | 73 fp->level = ssl_encryption_application; |
74 fp->type = NGX_QUIC_FT_PING; | 74 fp->type = NGX_QUIC_FT_PING; |
75 | 75 |
76 ngx_quic_queue_frame(qc, fp); | 76 ngx_quic_queue_frame(qc, fp); |
77 } | 77 } |
78 | 78 |
80 } | 80 } |
81 | 81 |
82 | 82 |
83 ngx_int_t | 83 ngx_int_t |
84 ngx_quic_handle_path_response_frame(ngx_connection_t *c, | 84 ngx_quic_handle_path_response_frame(ngx_connection_t *c, |
85 ngx_quic_header_t *pkt, ngx_quic_path_challenge_frame_t *f) | 85 ngx_quic_path_challenge_frame_t *f) |
86 { | 86 { |
87 ngx_queue_t *q; | 87 ngx_queue_t *q; |
88 ngx_quic_path_t *path, *prev; | 88 ngx_quic_path_t *path, *prev; |
89 ngx_quic_connection_t *qc; | 89 ngx_quic_connection_t *qc; |
90 | 90 |
555 | 555 |
556 if (!qc->path_validation.timer_set) { | 556 if (!qc->path_validation.timer_set) { |
557 ngx_add_timer(&qc->path_validation, pto); | 557 ngx_add_timer(&qc->path_validation, pto); |
558 } | 558 } |
559 | 559 |
560 | |
561 return NGX_OK; | 560 return NGX_OK; |
562 } | 561 } |
563 | 562 |
564 | 563 |
565 static ngx_int_t | 564 static ngx_int_t |