Skip to content

Commit 47e7d5a

Browse files
committed
FIX | blocked connection
1 parent 97c18bf commit 47e7d5a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/worker/ManapiTcp.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,11 @@ void manapi::net::worker::TCP::close_connection(shared_conn conn, int flags) MAN
414414
manapi_log_trace(manapi::debug::LOG_TRACE_LOW, "TCP:closing the connection %p with CLOSE_CONN_FINISHED "
415415
"top->cur_send_size=%d top->send_size=%d", conn.get(), connection->top->cur_send_size, connection->top->send_size);
416416

417-
if (connection->top->cur_send_size != connection->top->send_size) {
417+
if (connection->top->cur_send_size) {
418+
this->flush_write_(conn, true);
419+
}
420+
421+
if (connection->top->send_size) {
418422
// wait
419423
return;
420424
}
@@ -439,12 +443,6 @@ void manapi::net::worker::TCP::close_connection(shared_conn conn, int flags) MAN
439443

440444
connection->flags |= CONN_CLOSED;
441445

442-
if (flags & CLOSE_CONN_SHUTDOWN && connection->top->send_size) {
443-
if (!this->flush_write_(conn, true)) {
444-
return;
445-
}
446-
}
447-
448446
if (conn->wrk.flags & WRK_INTERFACE_TCP_KEEP_ALIVE)
449447
conn->wrk.flags ^= WRK_INTERFACE_TCP_KEEP_ALIVE;
450448

0 commit comments

Comments
 (0)