Skip to content

Commit 67bc626

Browse files
committed
refactor core: use a single flag
commit_hash:c89606f4ad50263b23c84e07e4e672c28c9f6a25
1 parent 977cd9a commit 67bc626

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

core/src/server/net/connection.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,22 +139,18 @@ void Connection::ListenForRequests() noexcept {
139139
<< "Received " << pending_data_size_ << " byte(s) from " << Getpeername() << " on fd " << Fd();
140140
}
141141

142-
bool should_stop_accepting_requests = false;
143142
if (!request_parser.Parse({pending_data_.data(), pending_data_size_})) {
144143
LOG_DEBUG() << "Malformed request from " << Getpeername() << " on fd " << Fd();
145144

146145
// Stop accepting new requests, send previous answers.
147-
should_stop_accepting_requests = true;
146+
is_accepting_requests_ = false;
148147
}
149148
pending_data_size_ = 0;
150149

151150
for (auto&& request : pending_requests) {
152151
ProcessRequest(std::move(request));
153152
}
154153
pending_requests.resize(0);
155-
if (should_stop_accepting_requests) {
156-
is_accepting_requests_ = false;
157-
}
158154
}
159155

160156
LOG_TRACE() << "Gracefully stopping ListenForRequests()";

0 commit comments

Comments
 (0)