Skip to content

Commit ed5ff7f

Browse files
committed
remove shutdown bool
1 parent 300acdc commit ed5ff7f

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

libs/server-sent-events/src/client.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ class FoxyClient : public Client,
9292
initial_reconnect_delay.value_or(kDefaultInitialReconnectDelay),
9393
kDefaultMaxBackoffDelay),
9494
backoff_timer_(session_.get_executor()),
95-
last_read_(std::nullopt),
96-
shutting_down_(false) {
95+
last_read_(std::nullopt) {
9796
create_parser();
9897
}
9998

@@ -160,7 +159,6 @@ class FoxyClient : public Client,
160159
logger_(msg.str());
161160

162161
create_parser();
163-
164162
backoff_timer_.expires_from_now(backoff_.delay());
165163
backoff_timer_.async_wait(beast::bind_front_handler(
166164
&FoxyClient::on_backoff, shared_from_this()));
@@ -293,8 +291,8 @@ class FoxyClient : public Client,
293291

294292
void on_read_body(boost::system::error_code ec, std::size_t amount) {
295293
boost::ignore_unused(amount);
296-
if (ec == boost::asio::error::operation_aborted && shutting_down_) {
297-
logger_("read HTTP response body aborted (shutting down)");
294+
if (ec == boost::asio::error::operation_aborted) {
295+
logger_("read HTTP response body aborted");
298296
return;
299297
}
300298
if (body_parser_->is_done()) {
@@ -321,7 +319,6 @@ class FoxyClient : public Client,
321319
}
322320

323321
void do_shutdown(std::function<void()> completion) {
324-
shutting_down_ = true;
325322
backoff_timer_.cancel();
326323
session_.async_shutdown(beast::bind_front_handler(
327324
&FoxyClient::on_shutdown, std::move(completion)));
@@ -398,8 +395,6 @@ class FoxyClient : public Client,
398395
boost::asio::steady_timer backoff_timer_;
399396

400397
std::optional<std::chrono::steady_clock::time_point> last_read_;
401-
402-
bool shutting_down_;
403398
};
404399

405400
Builder::Builder(net::any_io_executor ctx, std::string url)

0 commit comments

Comments
 (0)