You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
@@ -1135,6 +1142,24 @@ class winhttp_client : public _http_client_communicator
1135
1142
}
1136
1143
}
1137
1144
1145
+
// If the response body is compressed we will read the encoding header and create a decompressor object which will later decompress the body
1146
+
utility::string_t encoding;
1147
+
if (web::http::details::compression::stream_decompressor::is_supported() && response.headers().match(web::http::header_names::content_encoding, encoding))
1148
+
{
1149
+
auto alg = web::http::details::compression::stream_decompressor::to_compression_algorithm(encoding);
1150
+
1151
+
if (alg != web::http::details::compression::compression_algorithm::invalid)
// Decompression is too slow to reliably do on this callback. Therefore we need to store it now in order to decompress it at a later stage in the flow.
1194
+
// However, we want to eventually use the writebuf to store the decompressed body. Therefore we'll store the compressed body as an internal allocation in the request_context
@@ -1198,7 +1232,7 @@ class winhttp_client : public _http_client_communicator
1198
1232
case WINHTTP_CALLBACK_STATUS_READ_COMPLETE :
1199
1233
{
1200
1234
// Status information length contains the number of bytes read.
1201
-
constDWORD bytesRead = statusInfoLength;
1235
+
DWORD bytesRead = statusInfoLength;
1202
1236
1203
1237
// Report progress about downloaded bytes.
1204
1238
auto progress = p_request_context->m_request._get_impl()->_progress_handler();
@@ -1220,9 +1254,39 @@ class winhttp_client : public _http_client_communicator
1220
1254
break;
1221
1255
}
1222
1256
1257
+
auto writebuf = p_request_context->_get_writebuffer();
1258
+
1259
+
// If we have compressed data it is stored in the local allocation of the p_request_context. We will store the decompressed buffer in the external allocation of the p_request_context.
0 commit comments