Skip to content

Commit 53c23d2

Browse files
Reorder complete_headers call to avoid race condition
1 parent cf91c13 commit 53c23d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Release/src/http/client/http_client_asio.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,11 +1207,11 @@ class asio_context : public request_context, public std::enable_shared_from_this
12071207
m_response.headers().add(std::move(name), std::move(value));
12081208
}
12091209
}
1210-
complete_headers();
1211-
12121210
m_content_length = std::numeric_limits<size_t>::max(); // Without Content-Length header, size should be same as TCP stream - set it size_t max.
12131211
m_response.headers().match(header_names::content_length, m_content_length);
12141212

1213+
complete_headers();
1214+
12151215
// note: need to check for 'chunked' here as well, azure storage sends both
12161216
// transfer-encoding:chunked and content-length:0 (although HTTP says not to)
12171217
if (m_request.method() == U("HEAD") || (!needChunked && m_content_length == 0))

0 commit comments

Comments
 (0)