From 83b69d05a4043681ce0ee3a2dc6713f9af8e42a9 Mon Sep 17 00:00:00 2001 From: Radkesvat <134321679+radkesvat@users.noreply.github.com> Date: Mon, 1 Apr 2024 00:23:46 +0300 Subject: [PATCH] fixes --- tunnels/client/protobuf/protobuf_client.c | 2 +- tunnels/server/http2/http2_server.c | 5 +++++ tunnels/server/protobuf/protobuf_server.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tunnels/client/protobuf/protobuf_client.c b/tunnels/client/protobuf/protobuf_client.c index f7197861..7008044e 100644 --- a/tunnels/client/protobuf/protobuf_client.c +++ b/tunnels/client/protobuf/protobuf_client.c @@ -124,7 +124,7 @@ static inline void downStream(tunnel_t *self, context_t *c) shiftr(buf, bytes_passed); if (data_len > MAX_PACKET_SIZE) { - LOGE("ProtoBufServer: rejected, size too large"); + LOGE("ProtoBufServer: rejected, size too large %zu (%zu passed %d left)",data_len,bytes_passed,(int)(bufLen(buf))); DISCARD_CONTEXT(c); cleanup(cstate); CSTATE_MUT(c) = NULL; diff --git a/tunnels/server/http2/http2_server.c b/tunnels/server/http2/http2_server.c index f3964440..3b62720a 100644 --- a/tunnels/server/http2/http2_server.c +++ b/tunnels/server/http2/http2_server.c @@ -97,6 +97,11 @@ static int on_data_chunk_recv_callback(nghttp2_session *session, context_t *stream_data = newContext(stream->line); stream_data->payload = gdata_buf; stream_data->src_io = con->io; + if (!stream->first_sent) + { + stream->first_sent = true; + stream_data->first = true; + } stream->tunnel->upStream(stream->tunnel, stream_data); if (nghttp2_session_get_stream_user_data(session, stream_id)) diff --git a/tunnels/server/protobuf/protobuf_server.c b/tunnels/server/protobuf/protobuf_server.c index fed7139b..763fb2df 100644 --- a/tunnels/server/protobuf/protobuf_server.c +++ b/tunnels/server/protobuf/protobuf_server.c @@ -99,7 +99,7 @@ static inline void upStream(tunnel_t *self, context_t *c) shiftr(buf, bytes_passed); if (data_len > MAX_PACKET_SIZE) { - LOGE("ProtoBufServer: rejected, size too large"); + LOGE("ProtoBufServer: rejected, size too large %zu (%zu passed %d left)",data_len,bytes_passed,(int)(bufLen(buf))); DISCARD_CONTEXT(c); cleanup(cstate); CSTATE_MUT(c) = NULL;