slight cleanup of Weave TryWriteControl()

PiperOrigin-RevId: 545755012
This commit is contained in:
Anay Wadhera
2023-07-05 12:32:07 -07:00
committed by Copybara-Service
parent 0b3e42a511
commit 04936e0aba
+2 -2
View File
@@ -89,14 +89,14 @@ void BaseSocket::ShutDown() {
}
void BaseSocket::TryWriteNextControl() {
bool connected = IsConnected();
MutexLock lock(&mutex_);
if (current_control_ == nullptr) {
if (!control_request_queue_.empty()) {
current_control_ = &control_request_queue_.front();
}
}
if (current_control_ == nullptr && connected) {
// We should have a control packet to write at this point. If we don't, abort.
if (current_control_ == nullptr) {
return;
}
// We need to do this because if a control packet is being sent, it is