From bcda3001530b66664ec8bfa90892be951f3d99b8 Mon Sep 17 00:00:00 2001 From: ading2210 Date: Thu, 3 Oct 2024 06:21:44 -0400 Subject: [PATCH] remove wolfssl and nghttp2 entirely --- .gitignore | 3 ++- client/build.sh | 2 +- client/fragments/fix_socket_limit.js | 5 +++++ client/javascript/copyright.js | 2 -- client/libcurl/http.c | 2 +- client/libcurl/util.c | 4 ---- client/tools/all_deps.sh | 10 ---------- client/tools/curl.sh | 8 +++----- client/tools/nghttp2.sh | 24 ----------------------- client/tools/wolfssl.sh | 29 ---------------------------- 10 files changed, 12 insertions(+), 77 deletions(-) delete mode 100755 client/tools/nghttp2.sh delete mode 100755 client/tools/wolfssl.sh diff --git a/.gitignore b/.gitignore index c322792..e6662fd 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ /client/out /client/fragments/tmp /server/.venv -/server/websockify \ No newline at end of file + +node_modules \ No newline at end of file diff --git a/client/build.sh b/client/build.sh index 6e71214..21f61a1 100755 --- a/client/build.sh +++ b/client/build.sh @@ -27,7 +27,7 @@ EXPORTED_FUNCS="${EXPORTED_FUNCS:1}" #compile options RUNTIME_METHODS="addFunction,removeFunction,allocate,ALLOC_NORMAL" -COMPILER_OPTIONS="-o $MODULE_FILE -lcurl -lwolfssl -lcjson -lz -lbrotlidec -lbrotlicommon -lnghttp2 -I $INCLUDE_DIR -L $LIB_DIR" +COMPILER_OPTIONS="-o $MODULE_FILE -lcurl -lcjson -lz -lbrotlidec -lbrotlicommon -I $INCLUDE_DIR -L $LIB_DIR" EMSCRIPTEN_OPTIONS="-lwebsocket.js -sENVIRONMENT=worker,web -sASSERTIONS=1 -sLLD_REPORT_UNDEFINED -sALLOW_TABLE_GROWTH -sALLOW_MEMORY_GROWTH -sNO_EXIT_RUNTIME -sEXPORTED_FUNCTIONS=$EXPORTED_FUNCS -sEXPORTED_RUNTIME_METHODS=$RUNTIME_METHODS" #clean output dir diff --git a/client/fragments/fix_socket_limit.js b/client/fragments/fix_socket_limit.js index e3af9ae..85f576c 100644 --- a/client/fragments/fix_socket_limit.js +++ b/client/fragments/fix_socket_limit.js @@ -1,3 +1,8 @@ /* DELETE assert\(sock\.stream\.fd ?< ?64\); */ + + +/* DELETE +assert\(!exceptfds, ?['"]exceptfds not supported['"]\); +*/ diff --git a/client/javascript/copyright.js b/client/javascript/copyright.js index d51bd98..ecddacc 100644 --- a/client/javascript/copyright.js +++ b/client/javascript/copyright.js @@ -2,9 +2,7 @@ const copyright_notice = `libcurl.js is licensed under the GNU AGPL v3. You can Several C libraries are used, and their licenses are listed below: - libcurl: curl License (https://curl.se/docs/copyright.html) -- wolfssl: GNU GPL v2 (https://github.com/wolfSSL/wolfssl/blob/master/COPYING) - cjson: MIT License (https://github.com/DaveGamble/cJSON/blob/master/LICENSE) - zlib: zlib License (https://www.zlib.net/zlib_license.html) - brotli: MIT License (https://github.com/google/brotli/blob/master/LICENSE) -- nghttp2: MIT License (https://github.com/nghttp2/nghttp2/blob/master/COPYING) `; \ No newline at end of file diff --git a/client/libcurl/http.c b/client/libcurl/http.c index 4821a13..3396914 100644 --- a/client/libcurl/http.c +++ b/client/libcurl/http.c @@ -14,7 +14,7 @@ void http_set_options(CURL* http_handle, const char* json_params, const char* bo //some default options curl_easy_setopt(http_handle, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(http_handle, CURLOPT_ACCEPT_ENCODING, ""); - curl_easy_setopt(http_handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); + curl_easy_setopt(http_handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); //parse json options cJSON* request_json = cJSON_Parse(json_params); diff --git a/client/libcurl/util.c b/client/libcurl/util.c index 9687891..f949fec 100644 --- a/client/libcurl/util.c +++ b/client/libcurl/util.c @@ -21,14 +21,10 @@ char* get_version() { } cJSON* curl_version_item = cJSON_CreateString(version_info->version); - cJSON* ssl_version_item = cJSON_CreateString(version_info->ssl_version); cJSON* brotli_version_item = cJSON_CreateString(version_info->brotli_version); - cJSON* nghttp2_version_item = cJSON_CreateString(version_info->nghttp2_version); cJSON_AddItemToObject(version_json, "curl", curl_version_item); - cJSON_AddItemToObject(version_json, "ssl", ssl_version_item); cJSON_AddItemToObject(version_json, "brotli", brotli_version_item); - cJSON_AddItemToObject(version_json, "nghttp2", nghttp2_version_item); cJSON_AddItemToObject(version_json, "protocols", protocols_array); char* version_json_str = cJSON_Print(version_json); diff --git a/client/tools/all_deps.sh b/client/tools/all_deps.sh index 385ad70..bcd6119 100755 --- a/client/tools/all_deps.sh +++ b/client/tools/all_deps.sh @@ -5,16 +5,11 @@ set -e mkdir -p build -WOLFSSL_PREFIX=$(realpath build/wolfssl-wasm) CJSON_PREFIX=$(realpath build/cjson-wasm) CURL_PREFIX=$(realpath build/curl-wasm) ZLIB_PREFIX=$(realpath build/zlib-wasm) BROTLI_PREFIX=$(realpath build/brotli-wasm) -NGHTTP2_PREFIX=$(realpath build/nghttp2-wasm) -if [ ! -d $WOLFSSL_PREFIX ]; then - tools/wolfssl.sh -fi if [ ! -d $CJSON_PREFIX ]; then tools/cjson.sh fi @@ -24,15 +19,10 @@ fi if [ ! -d $BROTLI_PREFIX ]; then tools/brotli.sh fi -if [ ! -d $NGHTTP2_PREFIX ]; then - tools/nghttp2.sh -fi if [ ! -d $CURL_PREFIX ]; then tools/curl.sh fi -cp -r $WOLFSSL_PREFIX/* $CURL_PREFIX cp -r $CJSON_PREFIX/* $CURL_PREFIX cp -r $ZLIB_PREFIX/* $CURL_PREFIX cp -r $BROTLI_PREFIX/* $CURL_PREFIX -cp -r $NGHTTP2_PREFIX/* $CURL_PREFIX \ No newline at end of file diff --git a/client/tools/curl.sh b/client/tools/curl.sh index 4b9255a..47ee1fa 100755 --- a/client/tools/curl.sh +++ b/client/tools/curl.sh @@ -7,14 +7,12 @@ set -e CORE_COUNT=$(nproc --all) PREFIX=$(realpath build/curl-wasm) -WOLFSSL_PREFIX=$(realpath build/wolfssl-wasm) ZLIB_PREFIX=$(realpath build/zlib-wasm) BROTLI_PREFIX=$(realpath build/brotli-wasm) -NGHTTP2_PREFIX=$(realpath build/nghttp2-wasm) cd build rm -rf curl -git clone -b curl-8_9_1 --depth=1 https://github.com/curl/curl +git clone -b curl-8_10_1 --depth=1 https://github.com/curl/curl cd curl autoreconf -fi @@ -24,8 +22,8 @@ emconfigure ./configure --host i686-linux \ --enable-websockets --disable-ftp --disable-file --disable-gopher \ --disable-imap --disable-mqtt --disable-pop3 --disable-rtsp \ --disable-smb --disable-smtp --disable-telnet --disable-dict \ - --with-wolfssl=$WOLFSSL_PREFIX --with-zlib=$ZLIB_PREFIX \ - --with-brotli=$BROTLI_PREFIX --with-nghttp2=$NGHTTP2_PREFIX + --with-zlib=$ZLIB_PREFIX --with-brotli=$BROTLI_PREFIX \ + --without-ssl emmake make -j$CORE_COUNT CFLAGS="-Oz" LIBS="-lbrotlicommon" diff --git a/client/tools/nghttp2.sh b/client/tools/nghttp2.sh deleted file mode 100755 index 256efb8..0000000 --- a/client/tools/nghttp2.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -#compile nghttp2 for use with emscripten - -set -x -set -e - -CORE_COUNT=$(nproc --all) -PREFIX=$(realpath build/nghttp2-wasm) - -cd build -rm -rf nghttp2 -git clone -b v1.63.0 --depth=1 https://github.com/nghttp2/nghttp2 -cd nghttp2 - -rm -rf $PREFIX -mkdir -p $PREFIX - -autoreconf -fi -emconfigure ./configure --host i686-linux --enable-static --disable-shared --enable-lib-only --prefix=$PREFIX -emmake make -j$CORE_COUNT -make install - -cd ../../ \ No newline at end of file diff --git a/client/tools/wolfssl.sh b/client/tools/wolfssl.sh deleted file mode 100755 index 897da09..0000000 --- a/client/tools/wolfssl.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -#compile wolfssl for use with emscripten - -set -x -set -e - -CORE_COUNT=$(nproc --all) -PREFIX=$(realpath build/wolfssl-wasm) -rm -rf $PREFIX -mkdir -p $PREFIX - -cd build -rm -rf wolfssl -git clone -b v5.6.6-stable --depth=1 https://github.com/wolfSSL/wolfssl wolfssl -cd wolfssl - -autoreconf -fi -export CFLAGS="-Oz -DSP_WORD_SIZE=32 -DWOLFSSL_NO_ATOMICS -DWOLFSSL_TICKET_NONCE_MALLOC" -emconfigure ./configure --prefix=$PREFIX --enable-curl --enable-static --disable-shared --host=i686-linux --disable-examples --disable-asm --enable-sni --enable-alpn --enable-truncatedhmac --enable-oldtls --enable-tlsv12 --enable-all-crypto --disable-asyncthreads --disable-threadlocal --enable-tlsx -emmake make -j$CORE_COUNT -make install - -rm -rf $PREFIX/bin -rm -rf $PREFIX/share -rm -rf $PREFIX/lib/pkgconfig -rm -rf $PREFIX/lib/*.la - -cd ../../ \ No newline at end of file