MEDIUM: connections: Get ride of the xprt_done callback.

The xprt_done_cb callback was used to defer some connection initialization
until we're connected and the handshake are done. As it mostly consists of
creating the mux, instead of using the callback, introduce a conn_create_mux()
function, that will just call conn_complete_session() for frontend, and
create the mux for backend.
In h2_wake(), make sure we call the wake method of the stream_interface,
as we no longer wakeup the stream task.
diff --git a/include/proto/connection.h b/include/proto/connection.h
index b0771cb..af0eaae 100644
--- a/include/proto/connection.h
+++ b/include/proto/connection.h
@@ -67,6 +67,9 @@
 int conn_send_socks4_proxy_request(struct connection *conn);
 int conn_recv_socks4_proxy_response(struct connection *conn);
 
+/* If we delayed the mux creation because we were waiting for the handshake, do it now */
+int conn_create_mux(struct connection *conn);
+
 __decl_hathreads(extern HA_SPINLOCK_T toremove_lock[MAX_THREADS]);
 
 /* returns true is the transport layer is ready */
@@ -398,7 +401,6 @@
 	conn->handle.fd = DEAD_FD_MAGIC;
 	conn->err_code = CO_ER_NONE;
 	conn->target = NULL;
-	conn->xprt_done_cb = NULL;
 	conn->destroy_cb = NULL;
 	conn->proxy_netns = NULL;
 	LIST_INIT(&conn->list);
@@ -417,18 +419,6 @@
 	conn->destroy_cb = cb;
 }
 
-/* registers <cb> as a callback to notify for transport's readiness or failure */
-static inline void conn_set_xprt_done_cb(struct connection *conn, int (*cb)(struct connection *))
-{
-	conn->xprt_done_cb = cb;
-}
-
-/* unregisters the callback to notify for transport's readiness or failure */
-static inline void conn_clear_xprt_done_cb(struct connection *conn)
-{
-	conn->xprt_done_cb = NULL;
-}
-
 /* Allocates a struct sockaddr from the pool if needed, assigns it to *sap and
  * returns it. If <sap> is NULL, the address is always allocated and returned.
  * if <sap> is non-null, an address will only be allocated if it points to a
diff --git a/include/proto/session.h b/include/proto/session.h
index a80f97d..3eaa357 100644
--- a/include/proto/session.h
+++ b/include/proto/session.h
@@ -40,6 +40,7 @@
 struct session *session_new(struct proxy *fe, struct listener *li, enum obj_type *origin);
 void session_free(struct session *sess);
 int session_accept_fd(struct listener *l, int cfd, struct sockaddr_storage *addr);
+int conn_complete_session(struct connection *conn);
 
 /* Remove the refcount from the session to the tracked counters, and clear the
  * pointer to ensure this is only performed once. The caller is responsible for
diff --git a/include/types/connection.h b/include/types/connection.h
index 4524c2e..9329654 100644
--- a/include/types/connection.h
+++ b/include/types/connection.h
@@ -437,10 +437,7 @@
  * socket, and can also be made to an internal applet. It can support
  * several transport schemes (raw, ssl, ...). It can support several
  * connection control schemes, generally a protocol for socket-oriented
- * connections, but other methods for applets. The xprt_done_cb() callback
- * is called once the transport layer initialization is done (success or
- * failure). It may return < 0 to report an error and require an abort of the
- * connection being instanciated. It must be removed once done.
+ * connections, but other methods for applets.
  */
 struct connection {
 	/* first cache line */
@@ -462,7 +459,6 @@
 	struct list session_list;     /* List of attached connections to a session */
 	union conn_handle handle;     /* connection handle at the socket layer */
 	const struct netns_entry *proxy_netns;
-	int (*xprt_done_cb)(struct connection *conn);  /* callback to notify of end of handshake */
 
 	/* third cache line and beyond */
 	void (*destroy_cb)(struct connection *conn);  /* callback to notify of imminent death of the connection */