From a38713466c8d9c6b9733517bbd7e20c826dbeb63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Haa=C3=9F?= Date: Thu, 19 Mar 2026 20:35:46 +0100 Subject: [PATCH] proxy forgets packages if debuggee connects this might fix #344 when lua-debug wait for a conencting debuggee, after the connection is accepted nothing happens. lua-debug should send queued packages in that case, as it does in the other case where lua-debug connects to the debuggee --- extension/script/common/socket.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/extension/script/common/socket.lua b/extension/script/common/socket.lua index 36deeaaf..76b66e5f 100644 --- a/extension/script/common/socket.lua +++ b/extension/script/common/socket.lua @@ -85,7 +85,13 @@ return function (param) elseif t.mode == "listen" then server = assert(net.listen(t.protocol, t.address, t.port)) function server:on_accepted(new_s) - return init_session(new_s) + local ok = init_session(new_s) + assert(ok) + if writebuf ~= '' then + new_s:write(writebuf) + writebuf = '' + end + return ok end else return