From 49d90162756282b17ec8552459d6ae3579afa00a Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Tue, 16 Jul 2013 13:56:00 +0100 Subject: [PATCH] For lua, let mg.read() read only if the data is there. --- mod_lua.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod_lua.c b/mod_lua.c index 48816a44..579f2bfa 100644 --- a/mod_lua.c +++ b/mod_lua.c @@ -208,7 +208,7 @@ static int lsp_read(lua_State *L) { char buf[1024]; int len = mg_read(conn, buf, sizeof(buf)); - if (!len) return 0; + if (len <= 0) return 0; lua_pushlstring(L, buf, len); return 1;