This commit is contained in:
J. Nick Koston
2025-05-14 17:27:05 -05:00
parent e244b71802
commit e2453dd513
2 changed files with 2 additions and 1 deletions

View File

@@ -153,7 +153,7 @@ void APIConnection::loop() {
return;
}
if (this->helper_->can_write_without_blocking()) {
if (!this->deferred_message_queue_.empty() && this->helper_->can_write_without_blocking()) {
this->deferred_message_queue_.process_queue();
}

View File

@@ -53,6 +53,7 @@ class DeferredMessageQueue {
DeferredMessageQueue(APIConnection *api_connection) : api_connection_(api_connection) {}
void process_queue();
void defer(void *source, send_message_t send_message);
bool empty() const { return deferred_queue_.empty(); }
};
class APIConnection : public APIServerConnection {