From 0f0c991891b6be076a9a367627201eceeb6d354e Mon Sep 17 00:00:00 2001 From: vnugent Date: Sun, 1 Oct 2023 00:02:48 -0400 Subject: patch websocket accept extension and cmake C standard --- lib/Net.Compression/vnlib_compress/CMakeLists.txt | 5 ++--- lib/Plugins.Essentials/src/Extensions/ConnectionInfoExtensions.cs | 2 +- .../src/Extensions/EssentialHttpEventExtensions.cs | 4 +--- lib/Utils.Memory/vnlib_rpmalloc/CMakeLists.txt | 5 ++--- lib/Utils/src/Async/AsyncAccessSerializer.cs | 2 +- lib/Utils/src/IO/VnMemoryStream.cs | 5 +++-- 6 files changed, 10 insertions(+), 13 deletions(-) diff --git a/lib/Net.Compression/vnlib_compress/CMakeLists.txt b/lib/Net.Compression/vnlib_compress/CMakeLists.txt index a7b6835..2e8f61b 100644 --- a/lib/Net.Compression/vnlib_compress/CMakeLists.txt +++ b/lib/Net.Compression/vnlib_compress/CMakeLists.txt @@ -37,9 +37,8 @@ endif() #Setup the compiler options -set(CMAKE_CXX_STANDARD 90) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(DEFAULT_BUILD_TYPE "Release") +set(CMAKE_C_STANDARD 90) +set(CMAKE_C_STANDARD_REQUIRED ON) #enable position independent code (for shared libraries with exports) set(CMAKE_POSITION_INDEPENDENT_CODE ON) diff --git a/lib/Plugins.Essentials/src/Extensions/ConnectionInfoExtensions.cs b/lib/Plugins.Essentials/src/Extensions/ConnectionInfoExtensions.cs index 8cabffd..f0cc46a 100644 --- a/lib/Plugins.Essentials/src/Extensions/ConnectionInfoExtensions.cs +++ b/lib/Plugins.Essentials/src/Extensions/ConnectionInfoExtensions.cs @@ -302,7 +302,7 @@ namespace VNLib.Plugins.Essentials.Extensions /// - /// Sets a cookie with an infinite (session life-span) + /// Sets the desired http cookie for the current connection /// /// /// The cookie to set for the server diff --git a/lib/Plugins.Essentials/src/Extensions/EssentialHttpEventExtensions.cs b/lib/Plugins.Essentials/src/Extensions/EssentialHttpEventExtensions.cs index 17af891..cb64cd1 100644 --- a/lib/Plugins.Essentials/src/Extensions/EssentialHttpEventExtensions.cs +++ b/lib/Plugins.Essentials/src/Extensions/EssentialHttpEventExtensions.cs @@ -835,9 +835,7 @@ namespace VNLib.Plugins.Essentials.Extensions //Setup a new websocket session with a new session id entity.DangerousChangeProtocol(ws); } - //Set the client up for a bad request response, nod a valid websocket request - entity.CloseResponse(HttpStatusCode.BadRequest); - return false; + return success; } /// diff --git a/lib/Utils.Memory/vnlib_rpmalloc/CMakeLists.txt b/lib/Utils.Memory/vnlib_rpmalloc/CMakeLists.txt index 84a0d16..b2cb287 100644 --- a/lib/Utils.Memory/vnlib_rpmalloc/CMakeLists.txt +++ b/lib/Utils.Memory/vnlib_rpmalloc/CMakeLists.txt @@ -29,9 +29,8 @@ if(UNIX) endif() #Setup the compiler options -set(CMAKE_CXX_STANDARD 90) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(DEFAULT_BUILD_TYPE "Release") +set(CMAKE_C_STANDARD 90) +set(CMAKE_C_STANDARD_REQUIRED ON) #enable position independent code (for shared libraries with exports) set(CMAKE_POSITION_INDEPENDENT_CODE ON) diff --git a/lib/Utils/src/Async/AsyncAccessSerializer.cs b/lib/Utils/src/Async/AsyncAccessSerializer.cs index fa164ac..83cc127 100644 --- a/lib/Utils/src/Async/AsyncAccessSerializer.cs +++ b/lib/Utils/src/Async/AsyncAccessSerializer.cs @@ -551,7 +551,7 @@ namespace VNLib.Utils.Async /// or yield (IE Return ) /// /// - public Task EnterWaitAsync() => _waiter ?? Task.CompletedTask; + public readonly Task EnterWaitAsync() => _waiter ?? Task.CompletedTask; } } } \ No newline at end of file diff --git a/lib/Utils/src/IO/VnMemoryStream.cs b/lib/Utils/src/IO/VnMemoryStream.cs index e984cc1..d97036d 100644 --- a/lib/Utils/src/IO/VnMemoryStream.cs +++ b/lib/Utils/src/IO/VnMemoryStream.cs @@ -1,5 +1,5 @@ /* -* Copyright (c) 2022 Vaughn Nugent +* Copyright (c) 2023 Vaughn Nugent * * Library: VNLib * Package: VNLib.Utils @@ -76,7 +76,8 @@ namespace VNLib.Utils.IO } /// - /// Creates a new memory stream + /// Creates a new memory stream using the + /// global heap instance. /// public VnMemoryStream() : this(MemoryUtil.Shared) { } -- cgit