Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Qualify stoi and only catch exceptions thrown by it.
  • Loading branch information
joelreymont committed Oct 31, 2012
commit 78afee4adb9f3f70372a3a118851485b582b3bc2
Original file line number Diff line number Diff line change
Expand Up @@ -439,11 +439,11 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
auto it = headers_.find("Content-Length");
if (it != headers_.end()) {
try {
unsigned content_length = stoi(it->second);
unsigned content_length = std::stoi(it->second);
get_more = (end - begin) < content_length;
NETWORK_MESSAGE("Content-Length: " << content_length
<< ", disconnect: " << !get_more);
} catch(...) {
NETWORK_MESSAGE("Content-Length: " << content_length);
} catch(const std::invalid_argument&) {
} catch(const std::out_of_range&) {
}
}
// Here we don't have a body callback. Let's
Expand Down