All handlers in send queue is now called on error
This commit is contained in:
parent
ebe170b4b3
commit
0ae69bffb1
1 changed files with 10 additions and 4 deletions
|
|
@ -95,16 +95,22 @@ namespace SimpleWeb {
|
|||
auto lock = self->session->connection->handler_runner->continue_lock();
|
||||
if(!lock)
|
||||
return;
|
||||
auto it = self->send_queue.begin();
|
||||
if(it->second)
|
||||
it->second(ec);
|
||||
if(!ec) {
|
||||
auto it = self->send_queue.begin();
|
||||
if(it->second)
|
||||
it->second(ec);
|
||||
self->send_queue.erase(it);
|
||||
if(self->send_queue.size() > 0)
|
||||
self->send_from_queue();
|
||||
}
|
||||
else
|
||||
else {
|
||||
// All handlers in the queue is called with ec:
|
||||
for(auto &pair : self->send_queue) {
|
||||
if(pair.second)
|
||||
pair.second(ec);
|
||||
}
|
||||
self->send_queue.clear();
|
||||
}
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue