MEDIUM: stream-interface: the polling flags must always be updated in chk_snd_conn
We used to only update the polling flags in data phase, but after that
we could update other flags. It does not seem possible to trigger a
bug here but it's not very safe either. Better always keep them up to
date.
diff --git a/src/stream_interface.c b/src/stream_interface.c
index abbbcb1..bb5b962 100644
--- a/src/stream_interface.c
+++ b/src/stream_interface.c
@@ -980,15 +980,13 @@
return;
}
- if (!(conn->flags & (CO_FL_HANDSHAKE|CO_FL_WAIT_L4_CONN|CO_FL_WAIT_L6_CONN))) {
- /* Before calling the data-level operations, we have to prepare
- * the polling flags to ensure we properly detect changes.
- */
- if (conn_ctrl_ready(conn))
- fd_want_send(conn->t.sock.fd);
-
- conn_refresh_polling_flags(conn);
+ /* Before calling the data-level operations, we have to prepare
+ * the polling flags to ensure we properly detect changes.
+ */
+ conn_refresh_polling_flags(conn);
+ __conn_data_want_send(conn);
+ if (!(conn->flags & (CO_FL_HANDSHAKE|CO_FL_WAIT_L4_CONN|CO_FL_WAIT_L6_CONN))) {
si_conn_send(conn);
if (conn_ctrl_ready(conn) && (conn->flags & CO_FL_ERROR)) {
/* Write error on the file descriptor */