From ca3ceecbf396dea87229749b6b917fa3b4f8625e Mon Sep 17 00:00:00 2001 From: d33tah Date: Wed, 4 Sep 2013 15:40:51 +0000 Subject: [PATCH] Fix echo.lua bug related to how io.stdin:read(n) works. --- ncat/scripts/echo.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ncat/scripts/echo.lua b/ncat/scripts/echo.lua index 48b71749e..3bfea90d0 100644 --- a/ncat/scripts/echo.lua +++ b/ncat/scripts/echo.lua @@ -2,7 +2,9 @@ while true do - data = io.stdin:read(512) + --We're reading in 1-byte chunks because calls like io.stdin:read(512) would + --wait for full 512 bytes of data before continuing. + data = io.stdin:read(1) if data == nil then break