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

This fixes #496 by handling EOF correctly#508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Changes fromall commits
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
Thisfixes#496 by handling EOF correctly
  • Loading branch information
@deanberris
deanberris committedMar 16, 2015
commitc82e8364f368cd1c4bd1553402128df17cccd9df
28 changes: 16 additions & 12 deletionsboost/network/protocol/http/client/connection/async_normal.hpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -94,11 +94,11 @@ struct http_async_connection
&command_streambuf));
this->method = method;
boost::uint16_t port_ = port(request);
resolve_(
resolver_, host(request), port_,
request_strand_.wrap(boost::bind(
&this_type::handle_resolved, this_type::shared_from_this(),string_type(host(request)), port_,
get_body, callback, generator, boost::arg<1>(), boost::arg<2>())));
resolve_(resolver_, host(request), port_,
request_strand_.wrap(boost::bind(
&this_type::handle_resolved, this_type::shared_from_this(),
string_type(host(request)), port_, get_body, callback,
generator, boost::arg<1>(), boost::arg<2>())));
if (timeout_ > 0) {
timer_.expires_from_now(boost::posix_time::seconds(timeout_));
timer_.async_wait(request_strand_.wrap(
Expand DownExpand Up@@ -140,11 +140,12 @@ struct http_async_connection
resolver_iterator iter = boost::begin(endpoint_range);
asio::ip::tcp::endpoint endpoint(iter->endpoint().address(), port);
delegate_->connect(
endpoint, host, request_strand_.wrap(boost::bind(
&this_type::handle_connected,
this_type::shared_from_this(), host, port, get_body, callback,
generator, std::make_pair(++iter, resolver_iterator()),
placeholders::error)));
endpoint, host,
request_strand_.wrap(boost::bind(
&this_type::handle_connected, this_type::shared_from_this(), host,
port, get_body, callback, generator,
std::make_pair(++iter, resolver_iterator()),
placeholders::error)));
} else {
set_errors(ec ? ec : boost::asio::error::host_not_found);
boost::iterator_range<const char*> range;
Expand DownExpand Up@@ -172,8 +173,7 @@ struct http_async_connection
resolver_iterator iter = boost::begin(endpoint_range);
asio::ip::tcp::endpoint endpoint(iter->endpoint().address(), port);
delegate_->connect(
endpoint,
host,
endpoint, host,
request_strand_.wrap(boost::bind(
&this_type::handle_connected, this_type::shared_from_this(),
host, port, get_body, callback, generator,
Expand DownExpand Up@@ -254,6 +254,7 @@ struct http_async_connection
size_t remainder;
switch (state) {
case version:
if (ec == boost::asio::error::eof) return;
parsed_ok = this->parse_version(
delegate_,
request_strand_.wrap(boost::bind(
Expand All@@ -263,6 +264,7 @@ struct http_async_connection
bytes_transferred);
if (!parsed_ok || indeterminate(parsed_ok)) return;
case status:
if (ec == boost::asio::error::eof) return;
parsed_ok = this->parse_status(
delegate_,
request_strand_.wrap(boost::bind(
Expand All@@ -272,6 +274,7 @@ struct http_async_connection
bytes_transferred);
if (!parsed_ok || indeterminate(parsed_ok)) return;
case status_message:
if (ec == boost::asio::error::eof) return;
parsed_ok = this->parse_status_message(
delegate_, request_strand_.wrap(boost::bind(
&this_type::handle_received_data,
Expand All@@ -281,6 +284,7 @@ struct http_async_connection
bytes_transferred);
if (!parsed_ok || indeterminate(parsed_ok)) return;
case headers:
if (ec == boost::asio::error::eof) return;
// In the following, remainder is the number of bytes that
// remain
// in the buffer. We need this in the body processing to make
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp