Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit78afee4

Browse files
committed
Qualify stoi and only catch exceptions thrown by it.
1 parentd00836d commit78afee4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎include/network/protocol/http/client/connection/async_normal.ipp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,11 +439,11 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
439439
auto it = headers_.find("Content-Length");
440440
if (it != headers_.end()) {
441441
try {
442-
unsigned content_length =stoi(it->second);
442+
unsigned content_length =std::stoi(it->second);
443443
get_more = (end - begin) < content_length;
444-
NETWORK_MESSAGE("Content-Length:" << content_length
445-
<<", disconnect:" << !get_more);
446-
}catch(...) {
444+
NETWORK_MESSAGE("Content-Length:" << content_length);
445+
}catch(const std::invalid_argument&) {
446+
}catch(const std::out_of_range&) {
447447
}
448448
}
449449
// Here we don't have a body callback. Let's

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp