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
Print a debug message if content length conversion to size_t fails.
  • Loading branch information
joelreymont committed Oct 31, 2012
commit 4054936d0b0d8e9b775759e9bdd7f27cf1a47dde
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,11 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
content_length_ = std::stoul(it->second);
NETWORK_MESSAGE("Content-Length: " << *content_length_);
} catch(const std::invalid_argument&) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest a NETWORK_MESSAGE here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What line number is here exactly? There's a NETWORK_MESSAGE printing the content length, for example.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inside the catch, print out that you got an invalid content length value.

NETWORK_MESSAGE("invalid argument exception while interpreting "
<< it->second << " as content length");
} catch(const std::out_of_range&) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you are referring to a message on exception. Fair enough, will add.

NETWORK_MESSAGE("out of range exception while interpreting "
<< it->second << " as content length");
}
}
headers_promise.set_value(headers);
Expand Down