chore: remove unused stdio.h include from main.c and fix typo in comment
This commit is contained in:
+4
-1
@@ -973,7 +973,6 @@ static void handle_forwarding(connection_t *conn) {
|
||||
if (bytes_read == 0) {
|
||||
log_debug("EOF on fd %d, performing half-close on pair fd %d", conn->fd, pair->fd);
|
||||
conn->half_closed = 1;
|
||||
connection_modify_epoll(conn->fd, buffer_available_read(&conn->write_buf) ? EPOLLOUT : 0);
|
||||
|
||||
if (pair->fd != -1 && !pair->write_shutdown) {
|
||||
if (shutdown(pair->fd, SHUT_WR) == -1 && errno != ENOTCONN) {
|
||||
@@ -984,6 +983,10 @@ static void handle_forwarding(connection_t *conn) {
|
||||
|
||||
if (pair->half_closed) {
|
||||
connection_close(conn->fd);
|
||||
} else if (buffer_available_read(&conn->write_buf) > 0) {
|
||||
connection_modify_epoll(conn->fd, EPOLLOUT);
|
||||
} else {
|
||||
connection_modify_epoll(conn->fd, EPOLLIN);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user