From 57e48ee51c8b4bbc70b0f0e57fcc88291dfda5dc Mon Sep 17 00:00:00 2001 From: Leonid Stryzhevskyi Date: Wed, 26 Feb 2025 01:57:46 +0200 Subject: [PATCH] http::outgoing::Response: use putIfNotExists_LockFree instead of put_LockFree --- src/oatpp/web/protocol/http/outgoing/Response.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/oatpp/web/protocol/http/outgoing/Response.cpp b/src/oatpp/web/protocol/http/outgoing/Response.cpp index e3ba6b79..133e227a 100644 --- a/src/oatpp/web/protocol/http/outgoing/Response.cpp +++ b/src/oatpp/web/protocol/http/outgoing/Response.cpp @@ -238,18 +238,18 @@ oatpp::async::CoroutineStarter Response::sendAsync(const std::shared_ptrm_body->getKnownSize(); if (bodySize >= 0) { - m_this->m_headers.put_LockFree(Header::CONTENT_LENGTH, utils::Conversion::int64ToStr(bodySize)); + m_this->m_headers.putIfNotExists_LockFree(Header::CONTENT_LENGTH, utils::Conversion::int64ToStr(bodySize)); } else { - m_this->m_headers.put_LockFree(Header::TRANSFER_ENCODING, Header::Value::TRANSFER_ENCODING_CHUNKED); + m_this->m_headers.putIfNotExists_LockFree(Header::TRANSFER_ENCODING, Header::Value::TRANSFER_ENCODING_CHUNKED); } } else { - m_this->m_headers.put_LockFree(Header::TRANSFER_ENCODING, Header::Value::TRANSFER_ENCODING_CHUNKED); - m_this->m_headers.put_LockFree(Header::CONTENT_ENCODING, m_contentEncoderProvider->getEncodingName()); + m_this->m_headers.putIfNotExists_LockFree(Header::TRANSFER_ENCODING, Header::Value::TRANSFER_ENCODING_CHUNKED); + m_this->m_headers.putIfNotExists_LockFree(Header::CONTENT_ENCODING, m_contentEncoderProvider->getEncodingName()); } } else { - m_this->m_headers.put_LockFree(Header::CONTENT_LENGTH, "0"); + m_this->m_headers.putIfNotExists_LockFree(Header::CONTENT_LENGTH, "0"); } m_headersWriteBuffer->setCurrentPosition(0);