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/include | |
| 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/include')
| -rw-r--r-- | zenhttp/include/zenhttp/httpserver.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/zenhttp/include/zenhttp/httpserver.h b/zenhttp/include/zenhttp/httpserver.h index 95824b8f4..d9637dff5 100644 --- a/zenhttp/include/zenhttp/httpserver.h +++ b/zenhttp/include/zenhttp/httpserver.h @@ -175,8 +175,8 @@ public: // Synchronous operations - [[nodiscard]] inline std::string_view RelativeUri() const { return m_Uri; } // Returns URI without service prefix - [[nodiscard]] inline std::string_view QueryString() const { return m_QueryString; } + [[nodiscard]] inline std::string_view RelativeUri() const { return m_UriUtf8; } // Returns URI without service prefix + [[nodiscard]] inline std::string_view QueryString() const { return m_QueryStringUtf8; } inline bool IsHandled() const { return m_IsHandled; } struct QueryParams @@ -238,15 +238,14 @@ public: Note that this is destructive in the sense that the IoBuffer instances referred to by Blobs will be moved into our response handler array where they are kept alive, in order to reduce ref-counting storms */ - virtual void WriteResponse(HttpResponse HttpResponseCode, HttpContentType ContentType, std::span<IoBuffer> Blobs) = 0; - virtual void WriteResponse(HttpResponse HttpResponseCode, HttpContentType ContentType, IoBuffer Blob); - virtual void WriteResponse(HttpResponse HttpResponseCode) = 0; - + virtual void WriteResponse(HttpResponse HttpResponseCode, HttpContentType ContentType, std::span<IoBuffer> Blobs) = 0; + virtual void WriteResponse(HttpResponse HttpResponseCode) = 0; virtual void WriteResponse(HttpResponse HttpResponseCode, HttpContentType ContentType, std::u8string_view ResponseString) = 0; void WriteResponse(HttpResponse HttpResponseCode, CbObject Data); void WriteResponse(HttpResponse HttpResponseCode, CbPackage Package); void WriteResponse(HttpResponse HttpResponseCode, HttpContentType ContentType, std::string_view ResponseString); + void WriteResponse(HttpResponse HttpResponseCode, HttpContentType ContentType, IoBuffer Blob); protected: bool m_IsHandled = false; @@ -254,8 +253,8 @@ protected: HttpVerb m_Verb = HttpVerb::kGet; uint64_t m_ContentLength = ~0ull; HttpContentType m_ContentType = HttpContentType::kBinary; - ExtendableStringBuilder<256> m_Uri; - ExtendableStringBuilder<256> m_QueryString; + ExtendableStringBuilder<256> m_UriUtf8; + ExtendableStringBuilder<256> m_QueryStringUtf8; }; class HttpServerException : public std::exception |