diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 90ce7bdd..2914cbcb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,7 +109,7 @@ jobs: matrix: sys: - mingw64 - - clang64 + #- clang64 defaults: run: shell: msys2 {0} diff --git a/deps/quickjs/CMakeLists.txt b/deps/quickjs/CMakeLists.txt index 2681f70f..67e0b2a5 100644 --- a/deps/quickjs/CMakeLists.txt +++ b/deps/quickjs/CMakeLists.txt @@ -13,6 +13,8 @@ if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang") -funsigned-char) else() list(APPEND qjs_cflags + -Wno-sign-compare + -Wno-unused-parameter -Wno-array-bounds -Wno-unused-variable -Wno-unused-but-set-variable) diff --git a/src/curl-utils.c b/src/curl-utils.c index 11c5bd33..73790ee2 100644 --- a/src/curl-utils.c +++ b/src/curl-utils.c @@ -117,7 +117,6 @@ int tjs_curl_load_http(DynBuf *dbuf, const char *url) { } static void check_multi_info(TJSRuntime *qrt) { - char *done_url; CURLMsg *message; int pending; @@ -135,6 +134,12 @@ static void check_multi_info(TJSRuntime *qrt) { tjs_curl_private_t *curl_private = NULL; curl_easy_getinfo(easy_handle, CURLINFO_PRIVATE, &curl_private); CHECK_NOT_NULL(curl_private); + /** + * This is an ugly workaround. The WS code uses a _different_ private + * struct and we need to tell them apart. + */ + if (curl_private->magic != TJS__CURL_PRIVATE_MAGIC) + break; CHECK_NOT_NULL(curl_private->done_cb); curl_private->done_cb(message, curl_private->arg); diff --git a/src/curl-utils.h b/src/curl-utils.h index 1d31bcad..0cd265a1 100644 --- a/src/curl-utils.h +++ b/src/curl-utils.h @@ -27,9 +27,11 @@ #include +#define TJS__CURL_PRIVATE_MAGIC 0xde4dc0d3 typedef void (*tjs_curl_done_cb)(CURLMsg *message, void *arg); typedef struct { + uint32_t magic; void *arg; tjs_curl_done_cb done_cb; } tjs_curl_private_t; diff --git a/src/xhr.c b/src/xhr.c index d10a3234..014a3c1e 100644 --- a/src/xhr.c +++ b/src/xhr.c @@ -326,6 +326,7 @@ static JSValue tjs_xhr_constructor(JSContext *ctx, JSValueConst new_target, int x->events[i] = JS_UNDEFINED; } + x->curl_private.magic = TJS__CURL_PRIVATE_MAGIC; x->curl_private.arg = x; x->curl_private.done_cb = curlm__done_cb;