luaa: send back but do not block (FS#338)
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
bda6282df7
commit
bc5569ab94
12
luaa.c
12
luaa.c
|
@ -907,8 +907,16 @@ luaA_cb(EV_P_ ev_io *w, int revents)
|
||||||
s = lua_tolstring(globalconf.L, -1, &len);
|
s = lua_tolstring(globalconf.L, -1, &len);
|
||||||
|
|
||||||
/* ignore ENOENT because the client may not read */
|
/* ignore ENOENT because the client may not read */
|
||||||
if (send(w->fd, s, len, 0) == -1 && errno != ENOENT)
|
if (send(w->fd, s, len, MSG_DONTWAIT) == -1)
|
||||||
warn("can't send back to client via domain socket: %s", strerror(errno));
|
switch(errno)
|
||||||
|
{
|
||||||
|
case ENOENT:
|
||||||
|
case EAGAIN:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
warn("can't send back to client via domain socket: %s", strerror(errno));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
lua_pop(globalconf.L, 1); /* pop the string */
|
lua_pop(globalconf.L, 1); /* pop the string */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue