Skip to content

Commit 937b304

Browse files
committed
remove shutdown bool
1 parent 300acdc commit 937b304

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class FoxyClient : public Client,
9393
kDefaultMaxBackoffDelay),
9494
backoff_timer_(session_.get_executor()),
9595
last_read_(std::nullopt),
96-
shutting_down_(false) {
96+
{
9797
create_parser();
9898
}
9999

@@ -160,7 +160,6 @@ class FoxyClient : public Client,
160160
logger_(msg.str());
161161

162162
create_parser();
163-
164163
backoff_timer_.expires_from_now(backoff_.delay());
165164
backoff_timer_.async_wait(beast::bind_front_handler(
166165
&FoxyClient::on_backoff, shared_from_this()));
@@ -293,8 +292,8 @@ class FoxyClient : public Client,
293292

294293
void on_read_body(boost::system::error_code ec, std::size_t amount) {
295294
boost::ignore_unused(amount);
296-
if (ec == boost::asio::error::operation_aborted && shutting_down_) {
297-
logger_("read HTTP response body aborted (shutting down)");
295+
if (ec == boost::asio::error::operation_aborted) {
296+
logger_("read HTTP response body aborted");
298297
return;
299298
}
300299
if (body_parser_->is_done()) {
@@ -321,7 +320,6 @@ class FoxyClient : public Client,
321320
}
322321

323322
void do_shutdown(std::function<void()> completion) {
324-
shutting_down_ = true;
325323
backoff_timer_.cancel();
326324
session_.async_shutdown(beast::bind_front_handler(
327325
&FoxyClient::on_shutdown, std::move(completion)));
@@ -398,8 +396,6 @@ class FoxyClient : public Client,
398396
boost::asio::steady_timer backoff_timer_;
399397

400398
std::optional<std::chrono::steady_clock::time_point> last_read_;
401-
402-
bool shutting_down_;
403399
};
404400

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

0 commit comments

Comments
 (0)