Skip to content

Commit a387134

Browse files
committed
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
1 parent 7fdac73 commit a387134

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

extension/script/common/socket.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,13 @@ return function (param)
8585
elseif t.mode == "listen" then
8686
server = assert(net.listen(t.protocol, t.address, t.port))
8787
function server:on_accepted(new_s)
88-
return init_session(new_s)
88+
local ok = init_session(new_s)
89+
assert(ok)
90+
if writebuf ~= '' then
91+
new_s:write(writebuf)
92+
writebuf = ''
93+
end
94+
return ok
8995
end
9096
else
9197
return

0 commit comments

Comments
 (0)