MINOR: checks: fix recv polling after connect()
Commit a522f801 moved a call to __conn_data_want_recv() just after the
connect() call, which is not 100% correct. First, it does not take errors
into account, eventhough this is harmless. Second, this change will only
be taken into account after next call do conn_data_polling_update(), which
is not necessarily what is expected (eg: if an error is only reported on
the recv side).
So let's use conn_data_poll_recv() instead, which directly subscribes
the event to polling.
diff --git a/src/checks.c b/src/checks.c
index b4a937c..530ccd8 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -1323,7 +1323,6 @@
* connect() when a pure TCP check is used.
*/
ret = s->check.proto->connect(conn, (s->proxy->options2 & PR_O2_CHK_ANY) ? 1 : 2);
- __conn_data_want_recv(conn); /* prepare for reading a possible reply */
conn->flags |= CO_FL_WAKE_DATA;
if (s->check.send_proxy)
conn->flags |= CO_FL_LOCAL_SPROXY;
@@ -1340,6 +1339,7 @@
int t_con = tick_add(now_ms, s->proxy->timeout.connect);
t->expire = tick_first(t->expire, t_con);
}
+ conn_data_poll_recv(conn); /* prepare for reading a possible reply */
goto reschedule;
case SN_ERR_SRVTO: /* ETIMEDOUT */