Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/src/HttpResponseImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ void HttpResponseImpl::makeHeaderString(trantor::MsgBuffer &buffer)
{
// When the headers are created, it is time to set the transfer
// encoding to chunked if the contents size is not specified
if (!ifCloseConnection() &&
if (version_ != Version::kHttp10 &&
headers_.find("content-length") == headers_.end())
{
LOG_DEBUG << "send stream with transfer-encoding chunked";
Expand Down
8 changes: 4 additions & 4 deletions lib/src/HttpServer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -985,15 +985,15 @@ void HttpServer::sendResponse(const TcpConnectionPtr &conn,
auto &asyncStreamCallback = respImplPtr->asyncStreamCallback();
if (asyncStreamCallback)
{
if (!respImplPtr->ifCloseConnection())
if (respImplPtr->version() != Version::kHttp10)
{
asyncStreamCallback(
std::make_unique<ResponseStream>(conn->sendAsyncStream(
respImplPtr->asyncStreamKickoffDisabled())));
}
else
{
LOG_INFO << "Chunking Set CloseConnection !!!";
LOG_INFO << "Async stream not supported for HTTP/1.0";
}
}
auto &streamCallback = respImplPtr->streamCallback();
Expand Down Expand Up @@ -1069,15 +1069,15 @@ void HttpServer::sendResponses(
{
conn->send(buffer);
buffer.retrieveAll();
if (!respImplPtr->ifCloseConnection())
if (respImplPtr->version() != Version::kHttp10)
{
asyncStreamCallback(
std::make_unique<ResponseStream>(conn->sendAsyncStream(
respImplPtr->asyncStreamKickoffDisabled())));
}
else
{
LOG_INFO << "Chunking Set CloseConnection !!!";
LOG_INFO << "Async stream not supported for HTTP/1.0";
}
}
auto &streamCallback = respImplPtr->streamCallback();
Expand Down
Loading