diff options
| author | Stefan Boberg <[email protected]> | 2021-09-09 16:29:24 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-09-09 16:29:24 +0200 |
| commit | a73862b954209fd1adce0f07b8f80b8cf27f2486 (patch) | |
| tree | 07f2898998f884e871c47a2979dfb01434443584 /zenhttp/httpsys.cpp | |
| parent | Factored out http server related code into zenhttp module since it feels out ... (diff) | |
| download | zen-a73862b954209fd1adce0f07b8f80b8cf27f2486.tar.xz zen-a73862b954209fd1adce0f07b8f80b8cf27f2486.zip | |
Added compile time logic to toggle http.sys / null http implementation on/off
Diffstat (limited to 'zenhttp/httpsys.cpp')
| -rw-r--r-- | zenhttp/httpsys.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
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 <zencore/logging.h> #include <zencore/string.h> -#include <conio.h> +#if ZEN_WITH_HTTPSYS -#if ZEN_PLATFORM_WINDOWS -# pragma comment(lib, "httpapi.lib") -#endif +#include <conio.h> +#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<size_t>(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 |