File tree 1 file changed +10
-4
lines changed
boost/network/protocol/http/client/connection
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -270,9 +270,15 @@ struct http_async_protocol_handler {
270
270
}
271
271
trim (header_pair.second );
272
272
headers.insert (header_pair);
273
- if (boost::iequals (header_pair.first , " Content-Length" )) {
274
- is_content_length = true ;
275
- content_length = std::stoi (header_pair.second );
273
+ if (!is_content_length &&
274
+ boost::iequals (header_pair.first , " Content-Length" )) {
275
+ try {
276
+ content_length = std::stoll (header_pair.second );
277
+ is_content_length = true ;
278
+ }
279
+ catch (std::exception &) {
280
+ // is_content_length = false;
281
+ }
276
282
}
277
283
}
278
284
// determine if the body parser will need to handle chunked encoding
@@ -410,7 +416,7 @@ struct http_async_protocol_handler {
410
416
bool is_chunk_encoding;
411
417
bool is_chunk_end;
412
418
bool is_content_length;
413
- std:: size_t content_length;
419
+ long long content_length;
414
420
};
415
421
416
422
} // namespace impl
You can’t perform that action at this time.
0 commit comments