Fix Bug: libcurl transport layer hangs on 304 response (#2558)

This commit is contained in:
JinmingHu 2021-07-07 02:28:32 +08:00 committed by GitHub
parent cc1a7d22ce
commit a8d7a48a07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -705,7 +705,8 @@ void CurlSession::ReadStatusLineAndHeadersFromRawResponse(
// For NoContent status code, also need to set contentLength to 0.
// https://github.com/Azure/azure-sdk-for-cpp/issues/406
if (this->m_request.GetMethod() == HttpMethod::Head
|| this->m_lastStatusCode == HttpStatusCode::NoContent)
|| this->m_lastStatusCode == HttpStatusCode::NoContent
|| this->m_lastStatusCode == HttpStatusCode::NotModified)
{
this->m_contentLength = 0;
this->m_bodyStartInBuffer = _detail::DefaultLibcurlReaderSize;