]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: h1: In h1_init(), wake the tasklet instead of calling h1_recv().
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 4 Jan 2019 15:51:40 +0000 (16:51 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 4 Jan 2019 16:08:45 +0000 (17:08 +0100)
In h1_init(), instead of calling h1_recv() directly, just wake the tasklet,
so that the receive will be done later.
h1_init() might be called from connect_server(), which is itself called
indirectly from process_stream(), and if the receive fails, we may call
si_cs_process(), which may destroy the channel buffers while process_stream()
still expects them to exist.

This should be backported to 1.9.

src/mux_h1.c

index 4658e48a8bae60043a56ef6be6ef6476c344ab10..742572abe5a0472269d2a28cb3b5e3ac145023fa 100644 (file)
@@ -414,8 +414,7 @@ static int h1_init(struct connection *conn, struct proxy *proxy, struct session
                task_queue(t);
 
        /* Try to read, if nothing is available yet we'll just subscribe */
-       if (h1_recv(h1c))
-               h1_process(h1c);
+       tasklet_wakeup(h1c->wait_event.task);
 
        /* mux->wake will be called soon to complete the operation */
        return 0;