From a73862b954209fd1adce0f07b8f80b8cf27f2486 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Thu, 9 Sep 2021 16:29:24 +0200 Subject: Added compile time logic to toggle http.sys / null http implementation on/off --- zenhttp/httpsys.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'zenhttp/httpsys.cpp') diff --git a/zenhttp/httpsys.cpp b/zenhttp/httpsys.cpp index da07a13dd..2041be5c3 100644 --- a/zenhttp/httpsys.cpp +++ b/zenhttp/httpsys.cpp @@ -5,11 +5,10 @@ #include #include -#include +#if ZEN_WITH_HTTPSYS -#if ZEN_PLATFORM_WINDOWS -# pragma comment(lib, "httpapi.lib") -#endif +#include +#pragma comment(lib, "httpapi.lib") std::wstring UTF8_to_wstring(const char* in) @@ -246,7 +245,6 @@ ReasonStringForHttpResultCode(int HttpCode) } } -#if ZEN_PLATFORM_WINDOWS class HttpSysServer; class HttpSysTransaction; class HttpMessageResponseRequest; @@ -848,22 +846,22 @@ HttpSysServerRequest::HttpSysServerRequest(HttpSysTransaction& Tx, HttpService& // we just have to live with it WideToUtf8({(char16_t*)HttpRequestPtr->CookedUrl.pAbsPath + PrefixLength, gsl::narrow(AbsPathLength - PrefixLength)}, - m_Uri); + m_UriUtf8); } else { - m_Uri.Reset(); + m_UriUtf8.Reset(); } if (auto QueryStringLength = HttpRequestPtr->CookedUrl.QueryStringLength) { --QueryStringLength; - WideToUtf8({(char16_t*)(HttpRequestPtr->CookedUrl.pQueryString) + 1, QueryStringLength / sizeof(char16_t)}, m_QueryString); + WideToUtf8({(char16_t*)(HttpRequestPtr->CookedUrl.pQueryString) + 1, QueryStringLength / sizeof(char16_t)}, m_QueryStringUtf8); } else { - m_QueryString.Reset(); + m_QueryStringUtf8.Reset(); } switch (HttpRequestPtr->Verb) @@ -1245,6 +1243,5 @@ HttpSysServer::RegisterService(HttpService& Service) RegisterService(Service.BaseUri(), Service); } -#endif // ZEN_PLATFORM_WINDOWS - } // namespace zen +#endif \ No newline at end of file -- cgit v1.2.3