diff options
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; } |