mirror of
https://github.com/oatpp/oatpp.git
synced 2025-03-31 18:30:22 +08:00
http::outgoing::Response: use putIfNotExists_LockFree instead of put_LockFree
This commit is contained in:
parent
92ebc8dd6b
commit
57e48ee51c
@ -238,18 +238,18 @@ oatpp::async::CoroutineStarter Response::sendAsync(const std::shared_ptr<Respons
|
||||
bodySize = m_this->m_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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user