Commit 49d90162 authored by Sergey Lyubka's avatar Sergey Lyubka

For lua, let mg.read() read only if the data is there.

parent cdc7380d
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment