mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-24 20:21:49 +00:00
Fix mg.onerror returns non-zero to stop processing
This commit is contained in:
1 parent
ab960df8a9
commit
34df4ec1fd
1 file changed
+2
-2
+2
-2
@@ -3979,12 +3979,12 @@ static int lsp(struct mg_connection *conn, const char *path,
|
|||||||
if (p[j] == '\n') ++lualines;
|
if (p[j] == '\n') ++lualines;
|
||||||
if (p[j] == '?' && p[j + 1] == '>') {
|
if (p[j] == '?' && p[j + 1] == '>') {
|
||||||
mg_write(conn, p + pos, i - pos);
|
mg_write(conn, p + pos, i - pos);
|
||||||
// lua_settop(L, 0);
|
//lua_settop(L, 0);
|
||||||
lua_pushlightuserdata(L, conn);
|
lua_pushlightuserdata(L, conn);
|
||||||
lua_pushcclosure(L, lsp_mg_error, 1);
|
lua_pushcclosure(L, lsp_mg_error, 1);
|
||||||
snprintf (chunkname, sizeof(chunkname), "@%s+%i", path, lines);
|
snprintf (chunkname, sizeof(chunkname), "@%s+%i", path, lines);
|
||||||
if (luaL_loadbuffer(L, p + (i + 2), j - (i + 2), chunkname)) {
|
if (luaL_loadbuffer(L, p + (i + 2), j - (i + 2), chunkname)) {
|
||||||
lua_pcall(L, 1, 0, 0);
|
lua_pcall(L, 1, 1, 0);
|
||||||
result = lua_tointeger(L, -1);
|
result = lua_tointeger(L, -1);
|
||||||
if (result) return result;
|
if (result) return result;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in new issue
Block a user