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

This commit is contained in:
Sergey Lyubka 2013-07-16 13:56:00 +01:00
parent cdc7380d00
commit 49d9016275

View File

@ -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;