MINOR: tcp_samples: Be able to call bc_src/bc_dst from the health-checks

The new L4 sample fetches used to get source and destination info of the
backend connection may now be called from an health-check.
diff --git a/src/tcp_sample.c b/src/tcp_sample.c
index 4fbd98c..8242fa4 100644
--- a/src/tcp_sample.c
+++ b/src/tcp_sample.c
@@ -47,8 +47,13 @@
 static int
 smp_fetch_src(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct connection *conn = (kw[0] != 'b') ? objt_conn(smp->sess->origin) :
-		smp->strm ? cs_conn(objt_cs(smp->strm->si[1].end)) : NULL;
+	struct connection *conn;
+
+	if (obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
+                conn = (kw[0] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
+        else
+                conn = (kw[0] != 'b') ? objt_conn(smp->sess->origin) :
+			smp->strm ? cs_conn(objt_cs(smp->strm->si[1].end)) : NULL;
 
 	if (!conn)
 		return 0;
@@ -79,8 +84,13 @@
 static int
 smp_fetch_sport(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct connection *conn = (kw[0] != 'b') ? objt_conn(smp->sess->origin) :
-		smp->strm ? cs_conn(objt_cs(smp->strm->si[1].end)) : NULL;
+	struct connection *conn;
+
+	if (obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
+                conn = (kw[0] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
+        else
+                conn = (kw[0] != 'b') ? objt_conn(smp->sess->origin) :
+			smp->strm ? cs_conn(objt_cs(smp->strm->si[1].end)) : NULL;
 
 	if (!conn)
 		return 0;
@@ -102,8 +112,13 @@
 static int
 smp_fetch_dst(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct connection *conn = (kw[0] != 'b') ? objt_conn(smp->sess->origin) :
-		smp->strm ? cs_conn(objt_cs(smp->strm->si[1].end)) : NULL;
+	struct connection *conn;
+
+	if (obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
+                conn = (kw[0] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
+        else
+                conn = (kw[0] != 'b') ? objt_conn(smp->sess->origin) :
+			smp->strm ? cs_conn(objt_cs(smp->strm->si[1].end)) : NULL;
 
 	if (!conn)
 		return 0;
@@ -174,8 +189,13 @@
 static int
 smp_fetch_dport(const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct connection *conn = (kw[0] != 'b') ? objt_conn(smp->sess->origin) :
-		smp->strm ? cs_conn(objt_cs(smp->strm->si[1].end)) : NULL;
+	struct connection *conn;
+
+	if (obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
+                conn = (kw[0] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
+        else
+                conn = (kw[0] != 'b') ? objt_conn(smp->sess->origin) :
+			smp->strm ? cs_conn(objt_cs(smp->strm->si[1].end)) : NULL;
 
 	if (!conn)
 		return 0;