mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-28 23:49:44 +08:00
For lua, let mg.read() read only if the data is there.
This commit is contained in:
parent
cdc7380d00
commit
49d9016275
@ -208,7 +208,7 @@ static int lsp_read(lua_State *L) {
|
|||||||
char buf[1024];
|
char buf[1024];
|
||||||
int len = mg_read(conn, buf, sizeof(buf));
|
int len = mg_read(conn, buf, sizeof(buf));
|
||||||
|
|
||||||
if (!len) return 0;
|
if (len <= 0) return 0;
|
||||||
lua_pushlstring(L, buf, len);
|
lua_pushlstring(L, buf, len);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user