summaryrefslogtreecommitdiffhomepage
path: root/src/event/quic/ngx_event_quic_output.c
diff options
context:
space:
mode:
authorVladimir Homutov <vl@nginx.com>2022-05-31 11:05:22 +0400
committerVladimir Homutov <vl@nginx.com>2022-05-31 11:05:22 +0400
commit30ff0778544b4366867ac7ba8e3431b082f31ab4 (patch)
treeaa9730b4cc87e2777d0868ac47827a7b574d415b /src/event/quic/ngx_event_quic_output.c
parent664cb29f5240768988cfa02834bebfddeb32cfc9 (diff)
downloadnginx-30ff0778544b4366867ac7ba8e3431b082f31ab4.tar.gz
nginx-30ff0778544b4366867ac7ba8e3431b082f31ab4.tar.bz2
QUIC: avoided pool usage in token calculation.
Diffstat (limited to 'src/event/quic/ngx_event_quic_output.c')
-rw-r--r--src/event/quic/ngx_event_quic_output.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/event/quic/ngx_event_quic_output.c b/src/event/quic/ngx_event_quic_output.c
index c656c527e..ee64d555e 100644
--- a/src/event/quic/ngx_event_quic_output.c
+++ b/src/event/quic/ngx_event_quic_output.c
@@ -1009,10 +1009,14 @@ ngx_quic_send_retry(ngx_connection_t *c, ngx_quic_conf_t *conf,
u_char buf[NGX_QUIC_RETRY_BUFFER_SIZE];
u_char dcid[NGX_QUIC_SERVER_CID_LEN];
+ u_char tbuf[NGX_QUIC_TOKEN_BUF_SIZE];
expires = ngx_time() + NGX_QUIC_RETRY_TOKEN_LIFETIME;
- if (ngx_quic_new_token(c, c->sockaddr, c->socklen, conf->av_token_key,
+ token.data = tbuf;
+ token.len = NGX_QUIC_TOKEN_BUF_SIZE;
+
+ if (ngx_quic_new_token(c->log, c->sockaddr, c->socklen, conf->av_token_key,
&token, &inpkt->dcid, expires, 1)
!= NGX_OK)
{
@@ -1075,11 +1079,16 @@ ngx_quic_send_new_token(ngx_connection_t *c, ngx_quic_path_t *path)
ngx_quic_frame_t *frame;
ngx_quic_connection_t *qc;
+ u_char tbuf[NGX_QUIC_TOKEN_BUF_SIZE];
+
qc = ngx_quic_get_connection(c);
expires = ngx_time() + NGX_QUIC_NEW_TOKEN_LIFETIME;
- if (ngx_quic_new_token(c, path->sockaddr, path->socklen,
+ token.data = tbuf;
+ token.len = NGX_QUIC_TOKEN_BUF_SIZE;
+
+ if (ngx_quic_new_token(c->log, path->sockaddr, path->socklen,
qc->conf->av_token_key, &token, NULL, expires, 0)
!= NGX_OK)
{