Add on_write_progress
This commit is contained in:
@@ -270,7 +270,7 @@ void Server::start_network_threads() {
|
||||
|
||||
// Call handler with unique_ptr - handler can take ownership if
|
||||
// needed
|
||||
handler_.process_data(data, conn);
|
||||
handler_.on_data_arrived(data, conn);
|
||||
|
||||
// If handler took ownership (conn is now null), don't continue
|
||||
// processing
|
||||
@@ -280,8 +280,22 @@ void Server::start_network_threads() {
|
||||
}
|
||||
|
||||
if (events[i].events & EPOLLOUT) {
|
||||
bool done = conn->writeBytes();
|
||||
if (done) {
|
||||
bool error = conn->writeBytes();
|
||||
if (error) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Call handler with unique_ptr - handler can take ownership if
|
||||
// needed
|
||||
handler_.on_write_progress(conn);
|
||||
// If handler took ownership (conn is now null), don't continue
|
||||
// processing
|
||||
if (!conn) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check if we should close the connection according to application
|
||||
if (!conn->hasMessages() && conn->closeConnection_) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user