Skip to content

Commit f56d143

Browse files
committed
downloading timeout fix
1 parent 2f6d15e commit f56d143

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

boost/network/protocol/http/client/connection/async_normal.hpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,6 @@ namespace boost { namespace network { namespace http { namespace impl {
126126
timer_.cancel();
127127
}
128128

129-
void set_timer() {
130-
if (timeout_ > 0) {
131-
timer_.async_wait(request_strand_.wrap(
132-
boost::bind(&this_type::handle_timeout,
133-
this_type::shared_from_this(),
134-
_1)));
135-
}
136-
}
137-
138129
void handle_timeout(boost::system::error_code const &ec) {
139130
if (!ec)
140131
{
@@ -238,8 +229,6 @@ namespace boost { namespace network { namespace http { namespace impl {
238229
false
239230
#endif
240231
;
241-
timer_.cancel();
242-
243232
if (!ec || ec == boost::asio::error::eof || is_ssl_short_read_error) {
244233
logic::tribool parsed_ok;
245234
size_t remainder;
@@ -391,6 +380,7 @@ namespace boost { namespace network { namespace http { namespace impl {
391380
this->source_promise.set_value("");
392381
this->part.assign('\0');
393382
this->response_parser_.reset();
383+
this->timer_.cancel();
394384
} else {
395385
// This means the connection has not been closed yet and we want to get more
396386
// data.

0 commit comments

Comments
 (0)