From 822b0b1cb3868fdfc2b7159cdbf11c3df776c9dd Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Sun, 12 Sep 2021 11:51:29 +0200 Subject: HttpResponse enum -> HttpResponseCode Also removed initial CbPackage API HttpServer changes as I have decided to take a different approach --- zenhttp/httpsys.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'zenhttp/httpsys.cpp') 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 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 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 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 BlobList) { - m_HttpResponseCode = ResponseCode; + m_ResponseCode = ResponseCode; const uint32_t ChunkCount = gsl::narrow(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 Blobs) +HttpSysServerRequest::WriteResponse(HttpResponseCode ResponseCode, HttpContentType ContentType, std::span 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) { -- cgit v1.2.3