diff options
| author | Stefan Boberg <[email protected]> | 2023-09-26 09:54:00 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2023-09-26 09:54:00 +0200 |
| commit | 6b23bf09acd11f50ec224297ee69bef15cad39ee (patch) | |
| tree | 8b2bcfe89eb5ffd71cae323dc62c4881024aa876 /src/zenhttp/httpsys.cpp | |
| parent | sort commands for cleaner merges (diff) | |
| parent | 0.2.24 (diff) | |
| download | zen-6b23bf09acd11f50ec224297ee69bef15cad39ee.tar.xz zen-6b23bf09acd11f50ec224297ee69bef15cad39ee.zip | |
Merge branch 'main' of https://github.com/EpicGames/zen
Diffstat (limited to 'src/zenhttp/httpsys.cpp')
| -rw-r--r-- | src/zenhttp/httpsys.cpp | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/zenhttp/httpsys.cpp b/src/zenhttp/httpsys.cpp index 3bcaa5861..f95a31914 100644 --- a/src/zenhttp/httpsys.cpp +++ b/src/zenhttp/httpsys.cpp @@ -877,8 +877,11 @@ HttpSysServer::InitializeServer(int BasePort) HTTP_BINDING_INFO HttpBindingInfo = {{0}, 0}; + WideStringBuilder<64> QueueName; + QueueName << "zenserver_" << EffectivePort; + Result = HttpCreateRequestQueue(HTTPAPI_VERSION_2, - /* Name */ nullptr, + /* Name */ QueueName.c_str(), /* SecurityAttributes */ nullptr, /* Flags */ 0, &m_RequestQueueHandle); @@ -902,6 +905,20 @@ HttpSysServer::InitializeServer(int BasePort) return EffectivePort; } + // Configure rejection method. Default is to drop the connection, it's better if we + // return an explicit error code when the queue cannot accept more requests + + { + HTTP_503_RESPONSE_VERBOSITY VerbosityInformation = Http503ResponseVerbosityLimited; + + Result = HttpSetRequestQueueProperty(m_RequestQueueHandle, + HttpServer503VerbosityProperty, + &VerbosityInformation, + sizeof VerbosityInformation, + 0, + 0); + } + // Create I/O completion port std::error_code ErrorCode; @@ -918,6 +935,21 @@ HttpSysServer::InitializeServer(int BasePort) ZEN_INFO("Started http.sys server at '{}'", WideToUtf8(m_BaseUris.front())); } + // This is not available in all Windows SDK versions so for now we can't use recently + // released functionality. We should investigate how to get more recent SDK releases + // into the build + +# if 0 + if (HttpIsFeatureSupported(/* HttpFeatureHttp3 */ (HTTP_FEATURE_ID) 4)) + { + ZEN_DEBUG("HTTP3 is available"); + } + else + { + ZEN_DEBUG("HTTP3 is NOT available"); + } +# endif + return EffectivePort; } |