From nobody Wed Jan 19 13:31:33 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CC746196E8E8; Wed, 19 Jan 2022 13:31:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jf6455D32z4mfh; Wed, 19 Jan 2022 13:31:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642599093; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MBHt0gAlE06dMmCqoieTW1EWcxLTkc+ZQFXplOyfP3E=; b=S6io427hIJuA1SFu188VkxMoAtyFcV1cM+za7O2ZeKX3g0QVnkCXdcRo2ua9zSEFU4WUNB 1aZhRHz4ihRmCxaHEALuK+Gy6xr/m1P8/ew345hbLQHQNY2VBpS+JQjSncMlOEvY1XuhIn aP8bktq7kRnmcUaZqgWEiuyu2XKBPi/PkllXJqkMmS1hpBG8Sbs2DNbo3FCEONAajnM3d4 fHe80dB8HRcSENJGyM3DNX/J1kHbO87olmSe2yFCoVmeaYdfES6ZJ1nE4wCUVZ6WPX+RcT 2NIenB2Dy11aGW4kswUct9Zr6dHiImeWKys+bO3BHz4GcLp26eEhm6eCB7eBug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9335015C8C; Wed, 19 Jan 2022 13:31:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20JDVXjR039902; Wed, 19 Jan 2022 13:31:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20JDVXAL039901; Wed, 19 Jan 2022 13:31:33 GMT (envelope-from git) Date: Wed, 19 Jan 2022 13:31:33 GMT Message-Id: <202201191331.20JDVXAL039901@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: "Sergey A. Osokin" Subject: git: f9a2f32279b0 - main - www/nginx-devel: update HTTPv3/QUIC patch to the recent commit List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osa X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f9a2f32279b075d36a16ae85664c4b7ead61410c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642599093; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MBHt0gAlE06dMmCqoieTW1EWcxLTkc+ZQFXplOyfP3E=; b=jOx+Drv6Aq92j+gCDJAdoUfQgPa6BrC/J6shq7b9RBlfCcVrVd420DkfrFK28vmo0nucV9 lVw0WShYFvljT9f6ywpN24zt9YogFgjd8GPSve9RapfQh8ozbsD+TTq6h7rht6SY9xgCnV vuFTHLeioqn8GExQXkTi8GvGlfhNz3mS6yMBuuohHlZh1VcvhhxiYa90/5AakDXZAVjk6a aYhE1JW4JL24Bx0jYlsZ5vaeo2gTya5Q5QsjhxZeJZFp1uWtBiz4iJDnJjzoQZ+nY+pRNf yB3ZOABD/r28zH0bfojTrDKIOwECyLI/OcBaWLI96Mw4sjMrHQSZpuhCXxDTjQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642599093; a=rsa-sha256; cv=none; b=ZYBXEj8eep4nlZVgck/+bIre5SYI8X2o5gRVHtq2Zk42dhnglTMohbFeTNA+SEJaLqLMKZ LJCVcTDKcTVESlmvTy3h6ul1r/ycfZ+S4ot8pwOiPfOt6Ph3iyoLc3Ojmz9+1imLB9MhhL NC/kqMq1WyS8smP02NkKrsn9jIqbgAxwRqpUUTac+lCzBM+R0dTNKAdQqkvGYL0+6l3IZ4 uoEKSqxTx6RBxKucEmfOIHwc+WWIzeTOwaCpY4RXC1EwklLfMHH/rnDjypMRXNJoio5UOi 5sjAAmyNDfUV4sRlkBw1O4YuAWp5Y5q0wwR3zszhtS9uDslJlEBWQlgh95TI4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by osa: URL: https://cgit.FreeBSD.org/ports/commit/?id=f9a2f32279b075d36a16ae85664c4b7ead61410c commit f9a2f32279b075d36a16ae85664c4b7ead61410c Author: Sergey A. Osokin AuthorDate: 2022-01-19 13:30:48 +0000 Commit: Sergey A. Osokin CommitDate: 2022-01-19 13:31:27 +0000 www/nginx-devel: update HTTPv3/QUIC patch to the recent commit Bump PORTREVISION. --- www/nginx-devel/Makefile | 2 +- www/nginx-devel/files/extra-patch-httpv3 | 130 +++++++++++++++---------------- 2 files changed, 64 insertions(+), 68 deletions(-) diff --git a/www/nginx-devel/Makefile b/www/nginx-devel/Makefile index 8ef92331e4f2..2ce4b8b4fce2 100644 --- a/www/nginx-devel/Makefile +++ b/www/nginx-devel/Makefile @@ -2,7 +2,7 @@ PORTNAME?= nginx PORTVERSION= 1.21.5 -PORTREVISION= 9 +PORTREVISION= 10 CATEGORIES= www MASTER_SITES= https://nginx.org/download/ \ LOCAL/osa diff --git a/www/nginx-devel/files/extra-patch-httpv3 b/www/nginx-devel/files/extra-patch-httpv3 index 492a7272a828..4c5a4cae03df 100644 --- a/www/nginx-devel/files/extra-patch-httpv3 +++ b/www/nginx-devel/files/extra-patch-httpv3 @@ -6432,7 +6432,7 @@ diff --git a/src/event/quic/ngx_event_quic_frames.c b/src/event/quic/ngx_event_q new file mode 100644 --- /dev/null +++ b/src/event/quic/ngx_event_quic_frames.c -@@ -0,0 +1,806 @@ +@@ -0,0 +1,811 @@ + +/* + * Copyright (C) Nginx, Inc. @@ -6456,6 +6456,8 @@ new file mode 100644 +static ngx_buf_t *ngx_quic_alloc_buf(ngx_connection_t *c); +static void ngx_quic_free_buf(ngx_connection_t *c, ngx_buf_t *b); +static ngx_buf_t *ngx_quic_clone_buf(ngx_connection_t *c, ngx_buf_t *b); ++static ngx_int_t ngx_quic_split_chain(ngx_connection_t *c, ngx_chain_t *cl, ++ off_t offset); + + +static ngx_buf_t * @@ -6594,6 +6596,38 @@ new file mode 100644 +} + + ++static ngx_int_t ++ngx_quic_split_chain(ngx_connection_t *c, ngx_chain_t *cl, off_t offset) ++{ ++ ngx_buf_t *b, *tb; ++ ngx_chain_t *tail; ++ ++ b = cl->buf; ++ ++ tail = ngx_alloc_chain_link(c->pool); ++ if (tail == NULL) { ++ return NGX_ERROR; ++ } ++ ++ tb = ngx_quic_clone_buf(c, b); ++ if (tb == NULL) { ++ return NGX_ERROR; ++ } ++ ++ tail->buf = tb; ++ ++ tb->pos += offset; ++ ++ b->last = tb->pos; ++ b->last_buf = 0; ++ ++ tail->next = cl->next; ++ cl->next = tail; ++ ++ return NGX_OK; ++} ++ ++ +ngx_quic_frame_t * +ngx_quic_alloc_frame(ngx_connection_t *c) +{ @@ -6803,7 +6837,7 @@ new file mode 100644 +{ + off_t n; + ngx_buf_t *b; -+ ngx_chain_t *out, *cl, **ll; ++ ngx_chain_t *out, **ll; + + out = *chain; + @@ -6822,7 +6856,11 @@ new file mode 100644 + n = b->last - b->pos; + + if (n > limit) { -+ goto split; ++ if (ngx_quic_split_chain(c, *ll, limit) != NGX_OK) { ++ return NGX_CHAIN_ERROR; ++ } ++ ++ n = limit; + } + + limit -= n; @@ -6832,29 +6870,6 @@ new file mode 100644 + *ll = NULL; + + return out; -+ -+split: -+ -+ cl = ngx_alloc_chain_link(c->pool); -+ if (cl == NULL) { -+ return NGX_CHAIN_ERROR; -+ } -+ -+ cl->buf = ngx_quic_clone_buf(c, b); -+ if (cl->buf == NULL) { -+ return NGX_CHAIN_ERROR; -+ } -+ -+ cl->buf->pos += limit; -+ b->last = cl->buf->pos; -+ b->last_buf = 0; -+ -+ ll = &(*ll)->next; -+ cl->next = *ll; -+ *ll = NULL; -+ *chain = cl; -+ -+ return out; +} + + @@ -6913,12 +6928,16 @@ new file mode 100644 + +ngx_chain_t * +ngx_quic_write_chain(ngx_connection_t *c, ngx_chain_t **chain, ngx_chain_t *in, -+ off_t limit, off_t offset) ++ off_t limit, off_t offset, size_t *size) +{ + off_t n; + u_char *p; + ngx_buf_t *b; -+ ngx_chain_t *cl, *sl; ++ ngx_chain_t *cl; ++ ++ if (size) { ++ *size = 0; ++ } + + while (in && limit) { + cl = *chain; @@ -6945,20 +6964,10 @@ new file mode 100644 + } + + if (b->sync && offset > 0) { -+ /* split hole at offset */ -+ -+ b->sync = 0; -+ -+ sl = ngx_quic_read_chain(c, &cl, offset); -+ if (cl == NGX_CHAIN_ERROR) { ++ if (ngx_quic_split_chain(c, cl, offset) != NGX_OK) { + return NGX_CHAIN_ERROR; + } + -+ sl->buf->sync = 1; -+ cl->buf->sync = 1; -+ -+ *chain = sl; -+ sl->next = cl; + continue; + } + @@ -6984,6 +6993,10 @@ new file mode 100644 + in->buf->pos += n; + offset += n; + limit -= n; ++ ++ if (size) { ++ *size += n; ++ } + } + + if (b->sync && p == b->last) { @@ -6992,19 +7005,11 @@ new file mode 100644 + } + + if (b->sync && p != b->pos) { -+ /* split hole at p - b->pos */ -+ -+ b->sync = 0; -+ -+ sl = ngx_quic_read_chain(c, &cl, p - b->pos); -+ if (sl == NGX_CHAIN_ERROR) { ++ if (ngx_quic_split_chain(c, cl, p - b->pos) != NGX_OK) { + return NGX_CHAIN_ERROR; + } + -+ cl->buf->sync = 1; -+ -+ *chain = sl; -+ sl->next = cl; ++ b->sync = 0; + } + } + @@ -7277,7 +7282,7 @@ new file mode 100644 +ngx_chain_t *ngx_quic_read_chain(ngx_connection_t *c, ngx_chain_t **chain, + off_t limit); +ngx_chain_t *ngx_quic_write_chain(ngx_connection_t *c, ngx_chain_t **chain, -+ ngx_chain_t *in, off_t limit, off_t offset); ++ ngx_chain_t *in, off_t limit, off_t offset, size_t *size); + +#if (NGX_DEBUG) +void ngx_quic_log_frame(ngx_log_t *log, ngx_quic_frame_t *f, ngx_uint_t tx); @@ -11311,7 +11316,7 @@ new file mode 100644 + + if (f->offset > ctx->crypto_received) { + if (ngx_quic_write_chain(c, &ctx->crypto, frame->data, f->length, -+ f->offset - ctx->crypto_received) ++ f->offset - ctx->crypto_received, NULL) + == NGX_CHAIN_ERROR) + { + return NGX_ERROR; @@ -11581,7 +11586,7 @@ diff --git a/src/event/quic/ngx_event_quic_streams.c b/src/event/quic/ngx_event_ new file mode 100644 --- /dev/null +++ b/src/event/quic/ngx_event_quic_streams.c -@@ -0,0 +1,1608 @@ +@@ -0,0 +1,1599 @@ + +/* + * Copyright (C) Nginx, Inc. @@ -12408,9 +12413,10 @@ new file mode 100644 +static ngx_chain_t * +ngx_quic_stream_send_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit) +{ -+ off_t n, flow; ++ off_t flow; ++ size_t n; + ngx_event_t *wev; -+ ngx_chain_t *out, *cl; ++ ngx_chain_t *out; + ngx_connection_t *pc; + ngx_quic_frame_t *frame; + ngx_quic_stream_t *qs; @@ -12435,17 +12441,7 @@ new file mode 100644 + limit = flow; + } + -+ n = 0; -+ -+ for (cl = in; cl; cl = cl->next) { -+ n += cl->buf->last - cl->buf->pos; -+ if (n >= limit) { -+ n = limit; -+ break; -+ } -+ } -+ -+ in = ngx_quic_write_chain(pc, &qs->out, in, limit, 0); ++ in = ngx_quic_write_chain(pc, &qs->out, in, limit, 0, &n); + if (in == NGX_CHAIN_ERROR) { + return NGX_CHAIN_ERROR; + } @@ -12481,7 +12477,7 @@ new file mode 100644 + } + + ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, -+ "quic send_chain sent:%O", n); ++ "quic send_chain sent:%uz", n); + + return in; +} @@ -12683,7 +12679,7 @@ new file mode 100644 + } + + if (ngx_quic_write_chain(c, &qs->in, frame->data, f->length, -+ f->offset - qs->recv_offset) ++ f->offset - qs->recv_offset, NULL) + == NGX_CHAIN_ERROR) + { + return NGX_ERROR;