MAJOR: stream-int: stop using si->conn and use si->end instead

The connection will only remain there as a pre-allocated entity whose
goal is to be placed in ->end when establishing an outgoing connection.
All connection initialization can be made on this connection, but all
information retrieved should be applied to the end point only.

This change is huge because there were many users of si->conn. Now the
only users are those who initialize the new connection. The difficulty
appears in a few places such as backend.c, proto_http.c, peers.c where
si->conn is used to hold the connection's target address before assigning
the connection to the stream interface. This is why we have to keep
si->conn for now. A future improvement might consist in dynamically
allocating the connection when it is needed.
diff --git a/src/frontend.c b/src/frontend.c
index 1048052..8a01a4a 100644
--- a/src/frontend.c
+++ b/src/frontend.c
@@ -49,11 +49,13 @@
 /* Finish a session accept() for a proxy (TCP or HTTP). It returns a negative
  * value in case of a critical failure which must cause the listener to be
  * disabled, a positive value in case of success, or zero if it is a success
- * but the session must be closed ASAP (eg: monitoring).
+ * but the session must be closed ASAP (eg: monitoring). It only supports
+ * sessions with a connection in si[0].
  */
 int frontend_accept(struct session *s)
 {
-	int cfd = s->si[0].conn->t.sock.fd;
+	struct connection *conn = __objt_conn(s->si[0].end);
+	int cfd = conn->t.sock.fd;
 
 	tv_zero(&s->logs.tv_request);
 	s->logs.t_queue = -1;
@@ -140,16 +142,16 @@
 		else {
 			char pn[INET6_ADDRSTRLEN], sn[INET6_ADDRSTRLEN];
 
-			conn_get_from_addr(s->req->prod->conn);
-			conn_get_to_addr(s->req->prod->conn);
+			conn_get_from_addr(conn);
+			conn_get_to_addr(conn);
 
-			switch (addr_to_str(&s->req->prod->conn->addr.from, pn, sizeof(pn))) {
+			switch (addr_to_str(&conn->addr.from, pn, sizeof(pn))) {
 			case AF_INET:
 			case AF_INET6:
-				addr_to_str(&s->req->prod->conn->addr.to, sn, sizeof(sn));
+				addr_to_str(&conn->addr.to, sn, sizeof(sn));
 				send_log(s->fe, LOG_INFO, "Connect from %s:%d to %s:%d (%s/%s)\n",
-					 pn, get_host_port(&s->req->prod->conn->addr.from),
-					 sn, get_host_port(&s->req->prod->conn->addr.to),
+					 pn, get_host_port(&conn->addr.from),
+					 sn, get_host_port(&conn->addr.to),
 					 s->fe->id, (s->fe->mode == PR_MODE_HTTP) ? "HTTP" : "TCP");
 				break;
 			case AF_UNIX:
@@ -165,14 +167,14 @@
 	if (unlikely((global.mode & MODE_DEBUG) && (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE)))) {
 		char pn[INET6_ADDRSTRLEN];
 
-		conn_get_from_addr(s->req->prod->conn);
+		conn_get_from_addr(conn);
 
-		switch (addr_to_str(&s->req->prod->conn->addr.from, pn, sizeof(pn))) {
+		switch (addr_to_str(&conn->addr.from, pn, sizeof(pn))) {
 		case AF_INET:
 		case AF_INET6:
 			chunk_printf(&trash, "%08x:%s.accept(%04x)=%04x from [%s:%d]\n",
 			             s->uniq_id, s->fe->id, (unsigned short)s->listener->fd, (unsigned short)cfd,
-			             pn, get_host_port(&s->req->prod->conn->addr.from));
+			             pn, get_host_port(&conn->addr.from));
 			break;
 		case AF_UNIX:
 			/* UNIX socket, only the destination is known */