diff options
| author | Vladimir Homutov <vl@nginx.com> | 2020-04-13 14:57:58 +0300 |
|---|---|---|
| committer | Vladimir Homutov <vl@nginx.com> | 2020-04-13 14:57:58 +0300 |
| commit | 76e99f668d0e84273da0dcfdd5a65a7199b4bb2e (patch) | |
| tree | 4328c6b26c1d29a4504ba54e362bf8e4399b102d /src | |
| parent | fbf6494f5fef81a402b58f695edd2b285b27c53a (diff) | |
| download | nginx-76e99f668d0e84273da0dcfdd5a65a7199b4bb2e.tar.gz nginx-76e99f668d0e84273da0dcfdd5a65a7199b4bb2e.tar.bz2 | |
Cleaned up magic numbers in ngx_quic_output_frames().
Diffstat (limited to 'src')
| -rw-r--r-- | src/event/ngx_event_quic.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/event/ngx_event_quic.c b/src/event/ngx_event_quic.c index 7937f5ae3..157fb0da6 100644 --- a/src/event/ngx_event_quic.c +++ b/src/event/ngx_event_quic.c @@ -161,7 +161,7 @@ static void ngx_quic_queue_frame(ngx_quic_connection_t *qc, static ngx_int_t ngx_quic_output(ngx_connection_t *c); static ngx_int_t ngx_quic_output_frames(ngx_connection_t *c, - ngx_quic_send_ctx_t *ctx, ngx_uint_t nsi); + ngx_quic_send_ctx_t *ctx); static void ngx_quic_free_frames(ngx_connection_t *c, ngx_queue_t *frames); static ngx_int_t ngx_quic_send_frames(ngx_connection_t *c, ngx_queue_t *frames); @@ -1693,7 +1693,7 @@ ngx_quic_output(ngx_connection_t *c) qc = c->quic; for (i = 0; i < NGX_QUIC_SEND_CTX_LAST; i++) { - if (ngx_quic_output_frames(c, &qc->send_ctx[i], i) != NGX_OK) { + if (ngx_quic_output_frames(c, &qc->send_ctx[i]) != NGX_OK) { return NGX_ERROR; } } @@ -1712,8 +1712,7 @@ ngx_quic_output(ngx_connection_t *c) static ngx_int_t -ngx_quic_output_frames(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx, - ngx_uint_t nsi) +ngx_quic_output_frames(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx) { size_t len, hlen, n; ngx_int_t rc; @@ -1727,13 +1726,14 @@ ngx_quic_output_frames(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx, return NGX_OK; } - hlen = (nsi == 2) ? NGX_QUIC_MAX_SHORT_HEADER - : NGX_QUIC_MAX_LONG_HEADER; + q = ngx_queue_head(&ctx->frames); + f = ngx_queue_data(q, ngx_quic_frame_t, queue); + /* all frames in same send_ctx share same level */ + hlen = (f->level == ssl_encryption_application) ? NGX_QUIC_MAX_SHORT_HEADER + : NGX_QUIC_MAX_LONG_HEADER; hlen += EVP_GCM_TLS_TAG_LEN; - q = ngx_queue_head(&ctx->frames); - do { len = 0; ngx_queue_init(&range); |
