From: Willy Tarreau Date: Fri, 23 Nov 2012 15:32:33 +0000 (+0100) Subject: MINOR: checks: fix recv polling after connect() X-Git-Tag: v1.5-dev14~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db3b4a28913a26a0835c60b93ad49f0a6c714363;p=thirdparty%2Fhaproxy.git 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 b4a937ccbf..530ccd8bcf 100644 --- a/src/checks.c +++ b/src/checks.c @@ -1323,7 +1323,6 @@ static struct task *process_chk(struct task *t) * 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 @@ static struct task *process_chk(struct task *t) 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 */