diff options
Diffstat (limited to 'zenhttp')
| -rw-r--r-- | zenhttp/httpasio.cpp | 13 | ||||
| -rw-r--r-- | zenhttp/httpserver.cpp | 9 | ||||
| -rw-r--r-- | zenhttp/httpsys.cpp | 4 |
3 files changed, 16 insertions, 10 deletions
diff --git a/zenhttp/httpasio.cpp b/zenhttp/httpasio.cpp index e1d417d06..7a6efd884 100644 --- a/zenhttp/httpasio.cpp +++ b/zenhttp/httpasio.cpp @@ -7,7 +7,7 @@ #include <deque> #include <memory> -#include <memory_resource> +#include <vector> ZEN_THIRD_PARTY_INCLUDES_START #if ZEN_PLATFORM_WINDOWS @@ -28,7 +28,6 @@ ZEN_THIRD_PARTY_INCLUDES_END namespace zen::asio_http { using namespace std::literals; -using namespace fmt::literals; struct HttpAcceptor; struct HttpRequest; @@ -154,6 +153,14 @@ struct HttpRequest private: struct HeaderEntry { + HeaderEntry() = default; + + HeaderEntry(std::string_view InName, std::string_view InValue) + : Name(InName) + , Value(InValue) + { + } + std::string_view Name; std::string_view Value; }; @@ -1127,7 +1134,7 @@ HttpAsioServerImpl::Start(uint16_t Port, int ThreadCount) for (int i = 0; i < ThreadCount; ++i) { m_ThreadPool.emplace_back([this, Index = i + 1] { - SetCurrentThreadName("asio worker {}"_format(Index)); + SetCurrentThreadName(fmt::format("asio worker {}", Index)); try { diff --git a/zenhttp/httpserver.cpp b/zenhttp/httpserver.cpp index 5712563c3..62b8d11a1 100644 --- a/zenhttp/httpserver.cpp +++ b/zenhttp/httpserver.cpp @@ -379,7 +379,7 @@ HttpServerRequest::WriteResponse(HttpResponseCode ResponseCode, HttpContentType Buffers.push_back(Segment.AsIoBuffer()); } - WriteResponse(ResponseCode, ContentType, Payload); + WriteResponse(ResponseCode, ContentType, Buffers); } HttpServerRequest::QueryParams @@ -400,7 +400,8 @@ HttpServerRequest::GetQueryParams() continue; } - const std::string_view Query{QueryIt, QueryEnd}; + size_t QueryLen = ptrdiff_t(QueryEnd - QueryIt); + const std::string_view Query{QueryIt, QueryLen}; size_t DelimIndex = Query.find('&', 0); @@ -415,10 +416,10 @@ HttpServerRequest::GetQueryParams() if (EqIndex != std::string_view::npos) { - std::string_view Parm{ThisQuery.data(), EqIndex}; + std::string_view Param{ThisQuery.data(), EqIndex}; ThisQuery.remove_prefix(EqIndex + 1); - Params.KvPairs.emplace_back(Parm, ThisQuery); + Params.KvPairs.emplace_back(Param, ThisQuery); } QueryIt += DelimIndex; diff --git a/zenhttp/httpsys.cpp b/zenhttp/httpsys.cpp index a17c2661c..67ff6b46b 100644 --- a/zenhttp/httpsys.cpp +++ b/zenhttp/httpsys.cpp @@ -674,8 +674,6 @@ HttpAsyncWorkRequest::HandleCompletion(ULONG IoResult, ULONG_PTR NumberOfBytesTr void HttpAsyncWorkRequest::AsyncWorkItem::Execute() { - using namespace fmt::literals; - try { HttpSysServerRequest& ThisRequest = Tx.ServerRequest(); @@ -705,7 +703,7 @@ HttpAsyncWorkRequest::AsyncWorkItem::Execute() } catch (std::exception& Ex) { - return (void)Tx.IssueNextRequest(new HttpMessageResponseRequest(Tx, 500, "Exception thrown in async work: '{}'"_format(Ex.what()))); + return (void)Tx.IssueNextRequest(new HttpMessageResponseRequest(Tx, 500, fmt::format("Exception thrown in async work: '{}'", Ex.what()))); } } |