MEDIUM: raw-sock: remove obsolete calls to fd_{cant,cond,done}_{send,recv}
Given that raw_sock's functions solely act on connections and that all its
callers properly use subscribe() when they want to receive/send more, there
is no more reason for calling fd_{cant,cond,done}_{send,recv} anymore as
this call is immediately overridden by the subscribe call. It's also worth
noting that the purpose of fd_cond_recv() whose purpose was to speculatively
enable reading in the FD cache if the FD was active but not yet polled was
made to save on expensive epoll_ctl() calls and was implicitly covered more
cleanly by recent commit 5d7dcc2a8e ("OPTIM: epoll: always poll for recv if
neither active nor ready").
No change on the number of calls to epoll_ctl() was noticed consecutive to
this change.
diff --git a/src/raw_sock.c b/src/raw_sock.c
index af9a911..338491c 100644
--- a/src/raw_sock.c
+++ b/src/raw_sock.c
@@ -118,8 +118,6 @@
conn->flags |= CO_FL_WAIT_ROOM;
break;
}
-
- fd_cant_recv(conn->handle.fd);
break;
}
else if (errno == ENOSYS || errno == EINVAL || errno == EBADF) {
@@ -148,7 +146,6 @@
* being asked to poll.
*/
conn->flags |= CO_FL_WAIT_ROOM;
- fd_done_recv(conn->handle.fd);
break;
}
} /* while */
@@ -199,7 +196,6 @@
if (ret <= 0) {
if (ret == 0 || errno == EAGAIN) {
- fd_cant_send(conn->handle.fd);
break;
}
else if (errno == EINTR)
@@ -215,7 +211,6 @@
}
if (unlikely(conn->flags & CO_FL_WAIT_L4_CONN) && done) {
conn->flags &= ~CO_FL_WAIT_L4_CONN;
- fd_cond_recv(conn->handle.fd);
}
return done;
@@ -293,7 +288,6 @@
if ((!fdtab[conn->handle.fd].linger_risk) ||
(cur_poller.flags & HAP_POLL_F_RDHUP)) {
- fd_done_recv(conn->handle.fd);
break;
}
}
@@ -303,7 +297,6 @@
goto read0;
}
else if (errno == EAGAIN || errno == ENOTCONN) {
- fd_cant_recv(conn->handle.fd);
break;
}
else if (errno != EINTR) {
@@ -393,7 +386,6 @@
}
else if (ret == 0 || errno == EAGAIN || errno == ENOTCONN || errno == EINPROGRESS) {
/* nothing written, we need to poll for write first */
- fd_cant_send(conn->handle.fd);
break;
}
else if (errno != EINTR) {
@@ -403,7 +395,6 @@
}
if (unlikely(conn->flags & CO_FL_WAIT_L4_CONN) && done) {
conn->flags &= ~CO_FL_WAIT_L4_CONN;
- fd_cond_recv(conn->handle.fd);
}
if (done > 0) {