hlen = (f->level == ssl_encryption_application) ? NGX_QUIC_MAX_SHORT_HEADER
: NGX_QUIC_MAX_LONG_HEADER;
hlen += EVP_GCM_TLS_TAG_LEN;
+ hlen -= NGX_QUIC_MAX_CID_LEN - qc->scid.len;
do {
len = 0;
* send more than three times the data it receives;
*/
- if (((c->sent + len + f->len) / 3) > qc->received) {
+ if (((c->sent + hlen + len + f->len) / 3) > qc->received) {
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
"quic hit amplification limit"
" received %uz sent %O",
#define NGX_QUIC_STREAM_BUFSIZE 65536
-#define NGX_QUIC_SERVER_CID_LEN 20
+#define NGX_QUIC_MAX_CID_LEN 20
+#define NGX_QUIC_SERVER_CID_LEN NGX_QUIC_MAX_CID_LEN
#define NGX_QUIC_SR_TOKEN_LEN 16