mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 22:56:12 -04:00
slight cleanup of Weave TryWriteControl()
PiperOrigin-RevId: 545755012
This commit is contained in:
committed by
Copybara-Service
parent
0b3e42a511
commit
04936e0aba
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user