Mercurial > hg > nginx
comparison src/event/quic/ngx_event_quic_output.c @ 9026:3550b00d9dc8 quic
QUIC: avoided pool usage in token calculation.
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Tue, 31 May 2022 11:05:22 +0400 |
parents | e50f77a2d0b0 |
children | def8e398d7c5 |
comparison
equal
deleted
inserted
replaced
9025:e50f77a2d0b0 | 9026:3550b00d9dc8 |
---|---|
1007 ngx_str_t res, token; | 1007 ngx_str_t res, token; |
1008 ngx_quic_header_t pkt; | 1008 ngx_quic_header_t pkt; |
1009 | 1009 |
1010 u_char buf[NGX_QUIC_RETRY_BUFFER_SIZE]; | 1010 u_char buf[NGX_QUIC_RETRY_BUFFER_SIZE]; |
1011 u_char dcid[NGX_QUIC_SERVER_CID_LEN]; | 1011 u_char dcid[NGX_QUIC_SERVER_CID_LEN]; |
1012 u_char tbuf[NGX_QUIC_TOKEN_BUF_SIZE]; | |
1012 | 1013 |
1013 expires = ngx_time() + NGX_QUIC_RETRY_TOKEN_LIFETIME; | 1014 expires = ngx_time() + NGX_QUIC_RETRY_TOKEN_LIFETIME; |
1014 | 1015 |
1015 if (ngx_quic_new_token(c, c->sockaddr, c->socklen, conf->av_token_key, | 1016 token.data = tbuf; |
1017 token.len = NGX_QUIC_TOKEN_BUF_SIZE; | |
1018 | |
1019 if (ngx_quic_new_token(c->log, c->sockaddr, c->socklen, conf->av_token_key, | |
1016 &token, &inpkt->dcid, expires, 1) | 1020 &token, &inpkt->dcid, expires, 1) |
1017 != NGX_OK) | 1021 != NGX_OK) |
1018 { | 1022 { |
1019 return NGX_ERROR; | 1023 return NGX_ERROR; |
1020 } | 1024 } |
1073 time_t expires; | 1077 time_t expires; |
1074 ngx_str_t token; | 1078 ngx_str_t token; |
1075 ngx_quic_frame_t *frame; | 1079 ngx_quic_frame_t *frame; |
1076 ngx_quic_connection_t *qc; | 1080 ngx_quic_connection_t *qc; |
1077 | 1081 |
1082 u_char tbuf[NGX_QUIC_TOKEN_BUF_SIZE]; | |
1083 | |
1078 qc = ngx_quic_get_connection(c); | 1084 qc = ngx_quic_get_connection(c); |
1079 | 1085 |
1080 expires = ngx_time() + NGX_QUIC_NEW_TOKEN_LIFETIME; | 1086 expires = ngx_time() + NGX_QUIC_NEW_TOKEN_LIFETIME; |
1081 | 1087 |
1082 if (ngx_quic_new_token(c, path->sockaddr, path->socklen, | 1088 token.data = tbuf; |
1089 token.len = NGX_QUIC_TOKEN_BUF_SIZE; | |
1090 | |
1091 if (ngx_quic_new_token(c->log, path->sockaddr, path->socklen, | |
1083 qc->conf->av_token_key, &token, NULL, expires, 0) | 1092 qc->conf->av_token_key, &token, NULL, expires, 0) |
1084 != NGX_OK) | 1093 != NGX_OK) |
1085 { | 1094 { |
1086 return NGX_ERROR; | 1095 return NGX_ERROR; |
1087 } | 1096 } |