]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: mux-h2: Implement h2_attach().
authorOlivier Houchard <ohouchard@haproxy.com>
Tue, 27 Nov 2018 16:36:33 +0000 (17:36 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 2 Dec 2018 12:31:53 +0000 (13:31 +0100)
Implement h2_attach(), so that we can have multiple streams in one outgoin
h2 connection.

src/mux_h2.c

index 64dbc5adceadf25e044886cb250ba47ce5e9cdd7..b5bef03236cc179a2df7b5fbe286c7c773d65a3e 100644 (file)
@@ -2721,7 +2721,19 @@ static struct task *h2_timeout_task(struct task *t, void *context, unsigned shor
  */
 static struct conn_stream *h2_attach(struct connection *conn)
 {
-       return NULL;
+       struct conn_stream *cs;
+       struct h2s *h2s;
+       struct h2c *h2c = conn->mux_ctx;
+
+       cs = cs_new(conn);
+       if (!cs)
+               return NULL;
+       h2s = h2c_bck_stream_new(h2c, cs);
+       if (!h2s) {
+               cs_free(cs);
+               return NULL;
+       }
+       return cs;
 }
 
 /* Retrieves the first valid conn_stream from this connection, or returns NULL.