Added ngtcp2 workaround.

This commit is contained in:
LoRd_MuldeR 2022-07-10 19:43:13 +02:00
parent 2aa3bedd5c
commit 8e324eb69e
2 changed files with 26 additions and 0 deletions

View File

@ -195,6 +195,7 @@ readonly TCP2_DIR="${BASE_DIR}/ngtcp2-${MY_CPU}"
rm -rf "${TCP2_DIR}" && mkdir "${TCP2_DIR}" rm -rf "${TCP2_DIR}" && mkdir "${TCP2_DIR}"
tar -xvf "${LIBS_DIR}/.pkg/ngtcp2.tar.gz" --strip-components=1 -C "${TCP2_DIR}" tar -xvf "${LIBS_DIR}/.pkg/ngtcp2.tar.gz" --strip-components=1 -C "${TCP2_DIR}"
pushd "${TCP2_DIR}" pushd "${TCP2_DIR}"
patch -p1 -b < "${BASE_DIR}/patch/ngtcp2_htons.diff"
CFLAGS="-march=${MY_MARCH} -mtune=${MY_MTUNE} -DNDEBUG -D_WIN32_WINNT=0x0501 -I${LIBS_DIR}/include" LDFLAGS="-L${LIBS_DIR}/lib" OPENSSL_CFLAGS="-I${LIBS_DIR}/include" OPENSSL_LIBS="-L${LIBS_DIR}/lib -lssl -lcrypto -lws2_32 -lz" ZLIB_CFLAGS="-I${LIBS_DIR}/include" ZLIB_LIBS="-L${LIBS_DIR}/lib -lz" ./configure --prefix="${LIBS_DIR}" --enable-lib-only --with-openssl --disable-shared CFLAGS="-march=${MY_MARCH} -mtune=${MY_MTUNE} -DNDEBUG -D_WIN32_WINNT=0x0501 -I${LIBS_DIR}/include" LDFLAGS="-L${LIBS_DIR}/lib" OPENSSL_CFLAGS="-I${LIBS_DIR}/include" OPENSSL_LIBS="-L${LIBS_DIR}/lib -lssl -lcrypto -lws2_32 -lz" ZLIB_CFLAGS="-I${LIBS_DIR}/include" ZLIB_LIBS="-L${LIBS_DIR}/lib -lz" ./configure --prefix="${LIBS_DIR}" --enable-lib-only --with-openssl --disable-shared
make && make install make && make install
popd popd

25
patch/ngtcp2_htons.diff Normal file
View File

@ -0,0 +1,25 @@
From 20995d0137b72fbbdb57f53bb8c272b2c5b61280 Mon Sep 17 00:00:00 2001
From: Dmitry Karpov <dkarpov@roku.com>
Date: Tue, 28 Jun 2022 18:02:36 -0700
Subject: [PATCH] Fixed error in ngtcp2_htons.
---
lib/ngtcp2_net.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/ngtcp2_net.h b/lib/ngtcp2_net.h
index f8d8e518..b1f28096 100644
--- a/lib/ngtcp2_net.h
+++ b/lib/ngtcp2_net.h
@@ -101,7 +101,7 @@ STIN uint32_t ngtcp2_htonl(uint32_t hostlong) {
STIN uint16_t ngtcp2_htons(uint16_t hostshort) {
uint16_t res;
unsigned char *p = (unsigned char *)&res;
- *p++ = (unsigned char)hostshort >> 8;
+ *p++ = (unsigned char)(hostshort >> 8);
*p = hostshort & 0xffu;
return res;
}
--
2.35.1.windows.2