From e0a4e3b839884311d9e403ccc72c03a6ec771536 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Tue, 24 Sep 2024 13:32:40 -0400 Subject: [PATCH] Upgrade uWebSockets to v20.67.0 (#181) See: https://github.com/uNetworking/uWebSockets/releases/tag/v20.67.0 Signed-off-by: Juan Cruz Viotti --- DEPENDENCIES | 2 +- vendor/uwebsockets/src/App.h | 16 ++++++++++++++-- vendor/uwebsockets/src/BloomFilter.h | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/DEPENDENCIES b/DEPENDENCIES index 7ea37940..550995c9 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -3,6 +3,6 @@ noa https://github.com/sourcemeta/noa 7e26abce7a4e31e86a16ef2851702a56773ca527 jsontoolkit https://github.com/sourcemeta/jsontoolkit a3765c8038ba4271e55318a677f6366bdaa7b805 bearssl https://www.bearssl.org/git/BearSSL 8ef7680081c61b486622f2d983c0d3d21e83caad zlib https://github.com/madler/zlib 51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf -uwebsockets https://github.com/uNetworking/uWebSockets v20.66.0 +uwebsockets https://github.com/uNetworking/uWebSockets v20.67.0 googletest https://github.com/google/googletest 987e225614755fec7253aa95bf959c09e0d380d7 curl https://github.com/curl/curl curl-8_10_1 diff --git a/vendor/uwebsockets/src/App.h b/vendor/uwebsockets/src/App.h index d0cac7f4..db916822 100644 --- a/vendor/uwebsockets/src/App.h +++ b/vendor/uwebsockets/src/App.h @@ -189,12 +189,12 @@ struct TemplatedApp { /* Delete TopicTree */ if (topicTree) { - delete topicTree; - /* And unregister loop callbacks */ /* We must unregister any loop post handler here */ Loop::get()->removePostHandler(topicTree); Loop::get()->removePreHandler(topicTree); + + delete topicTree; } } @@ -576,6 +576,18 @@ struct TemplatedApp { return std::move(static_cast(*this)); } + BuilderPatternReturnType &&removeChildApp(BuilderPatternReturnType *app) { + /* Remove this app from httpContextData list over child apps and reset round robin */ + auto &childApps = httpContext->getSocketContextData()->childApps; + childApps.erase( + std::remove(childApps.begin(), childApps.end(), (void *) app), + childApps.end() + ); + httpContext->getSocketContextData()->roundRobin = 0; + + return std::move(static_cast(*this)); + } + BuilderPatternReturnType &&addChildApp(BuilderPatternReturnType *app) { /* Add this app to httpContextData list over child apps and set onPreOpen */ httpContext->getSocketContextData()->childApps.push_back((void *) app); diff --git a/vendor/uwebsockets/src/BloomFilter.h b/vendor/uwebsockets/src/BloomFilter.h index 5d2398eb..a98cc395 100644 --- a/vendor/uwebsockets/src/BloomFilter.h +++ b/vendor/uwebsockets/src/BloomFilter.h @@ -30,7 +30,7 @@ struct BloomFilter { private: std::bitset<256> filter; static inline uint32_t perfectHash(uint32_t features) { - return features *= 1843993368; + return features * 1843993368; } union ScrambleArea {