diff --git a/tunnels/client/http2/http2_client.c b/tunnels/client/http2/http2_client.c index 0795dc05..ff27c0f2 100644 --- a/tunnels/client/http2/http2_client.c +++ b/tunnels/client/http2/http2_client.c @@ -303,7 +303,7 @@ static inline void upStream(tunnel_t *self, context_t *c) { http2_client_child_con_state_t *stream = CSTATE(c); http2_client_con_state_t *con = stream->parent->chains_state[self->chain_index]; - stream->io = c->src_io; + stream->io = c->src_io ? c->src_io : stream->io; if (!con->handshake_completed) { contextQueuePush(con->queue, c); @@ -378,7 +378,7 @@ static inline void downStream(tunnel_t *self, context_t *c) { http2_client_state_t *state = STATE(self); http2_client_con_state_t *con = CSTATE(c); - con->io = c->src_io; + con->io = c->src_io ? c->src_io : con->io; if (c->payload != NULL) { @@ -409,7 +409,6 @@ static inline void downStream(tunnel_t *self, context_t *c) con_dest->upStream(con_dest, con_fc); } - destroyContext(c); } else diff --git a/tunnels/server/http2/http2_server.c b/tunnels/server/http2/http2_server.c index 3b62720a..bc1ffd01 100644 --- a/tunnels/server/http2/http2_server.c +++ b/tunnels/server/http2/http2_server.c @@ -360,7 +360,7 @@ static inline void downStream(tunnel_t *self, context_t *c) { http2_server_child_con_state_t *stream = (http2_server_child_con_state_t *)CSTATE(c); http2_server_con_state_t *con = stream->parent->chains_state[self->chain_index]; - stream->io = c->src_io; + stream->io = c->src_io ? c->src_io : stream->io; if (c->payload != NULL) {