diff options
| author | Stefan Boberg <[email protected]> | 2021-09-12 11:51:29 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-09-12 11:51:29 +0200 |
| commit | 822b0b1cb3868fdfc2b7159cdbf11c3df776c9dd (patch) | |
| tree | 7888b5017fdcd085103a60b14bff3efd5e7be7f3 /zenhttp/httpsys.cpp | |
| parent | Added gb benchmark tool for test script usage (diff) | |
| download | zen-822b0b1cb3868fdfc2b7159cdbf11c3df776c9dd.tar.xz zen-822b0b1cb3868fdfc2b7159cdbf11c3df776c9dd.zip | |
HttpResponse enum -> HttpResponseCode
Also removed initial CbPackage API HttpServer changes as I have decided to take a different approach
Diffstat (limited to 'zenhttp/httpsys.cpp')
| -rw-r--r-- | zenhttp/httpsys.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/zenhttp/httpsys.cpp b/zenhttp/httpsys.cpp index 1050bbbb7..7bb3bbc75 100644 --- a/zenhttp/httpsys.cpp +++ b/zenhttp/httpsys.cpp @@ -366,9 +366,9 @@ public: ~HttpSysServerRequest() = default; virtual IoBuffer ReadPayload() override; - virtual void WriteResponse(HttpResponse HttpResponseCode) override; - virtual void WriteResponse(HttpResponse HttpResponseCode, HttpContentType ContentType, std::span<IoBuffer> Blobs) override; - virtual void WriteResponse(HttpResponse HttpResponseCode, HttpContentType ContentType, std::u8string_view ResponseString) override; + virtual void WriteResponse(HttpResponseCode ResponseCode) override; + virtual void WriteResponse(HttpResponseCode ResponseCode, HttpContentType ContentType, std::span<IoBuffer> Blobs) override; + virtual void WriteResponse(HttpResponseCode ResponseCode, HttpContentType ContentType, std::u8string_view ResponseString) override; HttpSysTransaction& m_HttpTx; HttpMessageResponseRequest* m_Response = nullptr; // TODO: make this more general @@ -464,7 +464,7 @@ private: std::vector<HTTP_DATA_CHUNK> m_HttpDataChunks; uint64_t m_TotalDataSize = 0; // Sum of all chunk sizes - uint16_t m_HttpResponseCode = 0; + uint16_t m_ResponseCode = 0; uint32_t m_NextDataChunkOffset = 0; // This is used for responses where the number of chunks exceed the maximum number for one API call uint32_t m_RemainingChunkCount = 0; bool m_IsInitialResponse = true; @@ -525,7 +525,7 @@ HttpMessageResponseRequest::~HttpMessageResponseRequest() void HttpMessageResponseRequest::Initialize(uint16_t ResponseCode, std::span<IoBuffer> BlobList) { - m_HttpResponseCode = ResponseCode; + m_ResponseCode = ResponseCode; const uint32_t ChunkCount = gsl::narrow<uint32_t>(BlobList.size()); @@ -671,8 +671,8 @@ HttpMessageResponseRequest::IssueRequest() ContentTypeHeader->pRawValue = ContentTypeString.data(); ContentTypeHeader->RawValueLength = (USHORT)ContentTypeString.size(); - HttpResponse.StatusCode = m_HttpResponseCode; - HttpResponse.pReason = ReasonStringForHttpResultCode(m_HttpResponseCode); + HttpResponse.StatusCode = m_ResponseCode; + HttpResponse.pReason = ReasonStringForHttpResultCode(m_ResponseCode); HttpResponse.ReasonLength = (USHORT)strlen(HttpResponse.pReason); // Cache policy @@ -1143,11 +1143,11 @@ HttpSysServerRequest::ReadPayload() } void -HttpSysServerRequest::WriteResponse(HttpResponse HttpResponseCode) +HttpSysServerRequest::WriteResponse(HttpResponseCode ResponseCode) { ZEN_ASSERT(m_IsHandled == false); - m_Response = new HttpMessageResponseRequest(m_HttpTx, (uint16_t)HttpResponseCode); + m_Response = new HttpMessageResponseRequest(m_HttpTx, (uint16_t)ResponseCode); if (m_SuppressBody) { @@ -1158,11 +1158,11 @@ HttpSysServerRequest::WriteResponse(HttpResponse HttpResponseCode) } void -HttpSysServerRequest::WriteResponse(HttpResponse HttpResponseCode, HttpContentType ContentType, std::span<IoBuffer> Blobs) +HttpSysServerRequest::WriteResponse(HttpResponseCode ResponseCode, HttpContentType ContentType, std::span<IoBuffer> Blobs) { ZEN_ASSERT(m_IsHandled == false); - m_Response = new HttpMessageResponseRequest(m_HttpTx, (uint16_t)HttpResponseCode, ContentType, Blobs); + m_Response = new HttpMessageResponseRequest(m_HttpTx, (uint16_t)ResponseCode, ContentType, Blobs); if (m_SuppressBody) { @@ -1173,12 +1173,12 @@ HttpSysServerRequest::WriteResponse(HttpResponse HttpResponseCode, HttpContentTy } void -HttpSysServerRequest::WriteResponse(HttpResponse HttpResponseCode, HttpContentType ContentType, std::u8string_view ResponseString) +HttpSysServerRequest::WriteResponse(HttpResponseCode ResponseCode, HttpContentType ContentType, std::u8string_view ResponseString) { ZEN_ASSERT(m_IsHandled == false); m_Response = - new HttpMessageResponseRequest(m_HttpTx, (uint16_t)HttpResponseCode, ContentType, ResponseString.data(), ResponseString.size()); + new HttpMessageResponseRequest(m_HttpTx, (uint16_t)ResponseCode, ContentType, ResponseString.data(), ResponseString.size()); if (m_SuppressBody) { |