MEDIUM: connection: complete the polling cleanups
I/O handlers now all use __conn_{sock,data}_{stop,poll,want}_* instead
of returning dummy flags. The code has become slightly simpler because
some tricks such as the MIN_RET_FOR_READ_LOOP are not needed anymore,
and the data handlers which switch to a handshake handler do not need
to disable themselves anymore.
diff --git a/src/raw_sock.c b/src/raw_sock.c
index 80c8fb3..ea2fa66 100644
--- a/src/raw_sock.c
+++ b/src/raw_sock.c
@@ -118,7 +118,7 @@
* which will be able to deal with the situation.
*/
if (splice_detects_close)
- conn->flags |= CO_FL_WAIT_DATA; /* we know for sure that it's EAGAIN */
+ __conn_data_poll_recv(conn); /* we know for sure that it's EAGAIN */
break;
}
else if (errno == ENOSYS || errno == EINVAL) {
@@ -168,7 +168,7 @@
if (ret <= 0) {
if (ret == 0 || errno == EAGAIN) {
- conn->flags |= CO_FL_WAIT_ROOM;
+ __conn_data_poll_send(conn);
break;
}
else if (errno == EINTR)
@@ -245,7 +245,7 @@
goto read0;
}
else if (errno == EAGAIN) {
- conn->flags |= CO_FL_WAIT_DATA;
+ __conn_data_poll_recv(conn);
break;
}
else if (errno != EINTR) {
@@ -306,7 +306,7 @@
}
else if (ret == 0 || errno == EAGAIN) {
/* nothing written, we need to poll for write first */
- conn->flags |= CO_FL_WAIT_ROOM;
+ __conn_data_poll_send(conn);
break;
}
else if (errno != EINTR) {