diff --git a/www/varnish7/Makefile b/www/varnish7/Makefile index 8b934d86784e..97999e2ba500 100644 --- a/www/varnish7/Makefile +++ b/www/varnish7/Makefile @@ -1,54 +1,55 @@ PORTNAME= varnish DISTVERSION= 7.7.3 +PORTREVISION= 1 CATEGORIES= www MASTER_SITES= https://varnish-cache.org/downloads/ PKGNAMESUFFIX= 7 MAINTAINER= dbaio@FreeBSD.org COMMENT= High-performance HTTP accelerator WWW= https://varnish-cache.org/ LICENSE= BSD2CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE BUILD_DEPENDS= rst2man:textproc/py-docutils@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}sphinx>=0,1:textproc/py-sphinx@${PY_FLAVOR} LIB_DEPENDS= libpcre2-8.so:devel/pcre2 USES= cpe libedit libtool localbase ncurses pathfix \ pkgconfig python:build shebangfix tar:tgz CPE_VENDOR= varnish-cache CPE_PRODUCT= varnish_cache GNU_CONFIGURE= yes GNU_CONFIGURE_MANPREFIX= ${PREFIX}/share SHEBANG_FILES= lib/libvcc/*.py lib/libvsc/*.py USE_LDCONFIG= yes USE_RC_SUBR= varnishd varnishlog varnishncsa CONFLICTS= varnish4 varnish6 SUB_FILES= pkg-message USERS= varnish varnishlog GROUPS= varnish INSTALL_TARGET= install-strip TEST_TARGET= check TEST_ARGS= TESTS_PARALLELISM=1 CONFIGURE_ARGS= --localstatedir=${PREFIX} --without-dot # Needed for clang 15 (#268814) CONFIGURE_ENV+= ax_cv_check_cflags___Werror=no .if defined(NO_INET6) || defined(WITHOUT_INET6) BAD_TESTS= r00832 EXTRA_PATCHES= ${FILESDIR}/no-inet6.patch .endif OPTIONS_DEFINE= DOCS post-patch: .if defined(BAD_TESTS) ${RM} ${BAD_TESTS:C|.+|${WRKSRC}/bin/varnishtest/tests/\0.vtc|} .endif .include diff --git a/www/varnish7/files/patch-bin_varnishd_http2_cache__http2__hpack.c b/www/varnish7/files/patch-bin_varnishd_http2_cache__http2__hpack.c new file mode 100644 index 000000000000..cad7a205eb8e --- /dev/null +++ b/www/varnish7/files/patch-bin_varnishd_http2_cache__http2__hpack.c @@ -0,0 +1,45 @@ +--- bin/varnishd/http2/cache_http2_hpack.c.orig 2025-08-20 12:50:25 UTC ++++ bin/varnishd/http2/cache_http2_hpack.c +@@ -171,7 +171,7 @@ h2h_addhdr(struct http *hp, struct h2h_decode *d) + + /* Match H/2 pseudo headers */ + /* XXX: Should probably have some include tbl for pseudo-headers */ +- if (!Tstrcmp(nm, ":method")) { ++ if (Tstreq(nm, ":method")) { + hdr.b = val.b; + n = HTTP_HDR_METHOD; + disallow_empty = 1; +@@ -181,13 +181,13 @@ h2h_addhdr(struct http *hp, struct h2h_decode *d) + if (!vct_istchar(*p)) + return (H2SE_PROTOCOL_ERROR); + } +- } else if (!Tstrcmp(nm, ":path")) { ++ } else if (Tstreq(nm, ":path")) { + hdr.b = val.b; + n = HTTP_HDR_URL; + disallow_empty = 1; + + // rfc9113,l,2693,2705 +- if (Tlen(val) > 0 && val.b[0] != '/' && Tstrcmp(val, "*")) { ++ if (Tlen(val) > 0 && val.b[0] != '/' && !Tstreq(val, "*")) { + VSLb(hp->vsl, SLT_BogoHeader, + "Illegal :path pseudo-header %.*s", + (int)Tlen(val), val.b); +@@ -199,7 +199,7 @@ h2h_addhdr(struct http *hp, struct h2h_decode *d) + if (vct_islws(*p) || vct_isctl(*p)) + return (H2SE_PROTOCOL_ERROR); + } +- } else if (!Tstrcmp(nm, ":scheme")) { ++ } else if (Tstreq(nm, ":scheme")) { + /* XXX: What to do about this one? (typically + "http" or "https"). For now set it as a normal + header, stripping the first ':'. */ +@@ -213,7 +213,7 @@ h2h_addhdr(struct http *hp, struct h2h_decode *d) + if (!vct_istchar(*p)) + return (H2SE_PROTOCOL_ERROR); + } +- } else if (!Tstrcmp(nm, ":authority")) { ++ } else if (Tstreq(nm, ":authority")) { + /* NB: we inject "host" in place of "rity" for + * the ":authority" pseudo-header. + */ diff --git a/www/varnish7/files/patch-include_vdef.h b/www/varnish7/files/patch-include_vdef.h new file mode 100644 index 000000000000..13528fa2d8bb --- /dev/null +++ b/www/varnish7/files/patch-include_vdef.h @@ -0,0 +1,23 @@ +--- include/vdef.h.orig 2025-08-20 12:50:25 UTC ++++ include/vdef.h +@@ -255,6 +255,12 @@ int __llvm_gcov_flush(void); + # endif + #endif + ++#if __has_builtin(__builtin_memcmp) ++# define vmemcmp(s1, s2, n) __builtin_memcmp(s1, s2, n) ++#else ++# define vmemcmp(s1, s2, n) memcmp(s1, s2, n) ++#endif ++ + #ifndef v_counted_by_ + # define v_counted_by_(field) + #endif +@@ -277,6 +283,7 @@ typedef struct { + #define Tlen(t) (pdiff((t).b, (t).e)) + #define Tstr(s) (/*lint -e(446)*/ (txt){(s), (s) + strlen(s)}) + #define Tstrcmp(t, s) (strncmp((t).b, (s), Tlen(t))) ++#define Tstreq(t, s) (Tlen(t) == strlen(s) && !vmemcmp((t).b, (s), Tlen(t))) + #define Tforeach(c, t) for ((c) = (t).b; (c) < (t).e; (c)++) + + /* #3020 dummy definitions until PR is merged*/