File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
src/aws-cpp-sdk-core/source/http Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -246,13 +246,19 @@ namespace Aws
246
246
}
247
247
248
248
// TODO: handle the read rate limiter here, once back pressure is setup.
249
+ assert (response);
249
250
for (const auto & hashIterator : request->GetResponseValidationHashes ())
250
251
{
252
+ std::stringstream headerStr;
253
+ headerStr<<" x-amz-checksum-" <<hashIterator.first ;
254
+ if (response->HasHeader (headerStr.str ().c_str ()))
255
+ {
251
256
hashIterator.second ->Update (reinterpret_cast <unsigned char *>(body.ptr ), body.len );
257
+ break ;
258
+ }
252
259
}
253
260
254
261
// When data is received from the content body of the incoming response, just copy it to the output stream.
255
- assert (response);
256
262
response->GetResponseBody ().write ((const char *)body.ptr , static_cast <long >(body.len ));
257
263
if (response->GetResponseBody ().fail ()) {
258
264
const auto & ref = response->GetResponseBody ();
Original file line number Diff line number Diff line change @@ -287,7 +287,13 @@ bool WinSyncHttpClient::BuildSuccessResponse(const std::shared_ptr<HttpRequest>&
287
287
{
288
288
for (const auto & hashIterator : request->GetResponseValidationHashes ())
289
289
{
290
+ std::stringstream headerStr;
291
+ headerStr<<" x-amz-checksum-" <<hashIterator.first ;
292
+ if (response->HasHeader (headerStr.str ().c_str ()))
293
+ {
290
294
hashIterator.second ->Update (reinterpret_cast <unsigned char *>(dst), static_cast <size_t >(read));
295
+ break ;
296
+ }
291
297
}
292
298
293
299
auto & headersHandler = request->GetHeadersReceivedEventHandler ();
You can’t perform that action at this time.
0 commit comments