summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2015-04-18 10:15:29 +0300
committerDmitry Kozlov <xeb@mail.ru>2015-04-18 10:15:29 +0300
commit1c0a0c67d1b3331a638fd73317d7e1b8c4ab34bc (patch)
tree6d1121607bfbdcf40c0ef48ab6dc143afac94d50 /accel-pppd
parentfa28381c983d10edf938afad5e5e61331ed9f920 (diff)
downloadaccel-ppp-1c0a0c67d1b3331a638fd73317d7e1b8c4ab34bc.tar.gz
accel-ppp-1c0a0c67d1b3331a638fd73317d7e1b8c4ab34bc.zip
ipoe: don't block lua script if it raises error
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/ctrl/ipoe/lua.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/accel-pppd/ctrl/ipoe/lua.c b/accel-pppd/ctrl/ipoe/lua.c
index abc3d0dd..84da9d12 100644
--- a/accel-pppd/ctrl/ipoe/lua.c
+++ b/accel-pppd/ctrl/ipoe/lua.c
@@ -232,7 +232,7 @@ out_err:
char *ipoe_lua_get_username(struct ipoe_session *ses, const char *func)
{
- char *r;
+ char *r = NULL;
if (file_error && serial == __serial)
return NULL;
@@ -251,26 +251,21 @@ char *ipoe_lua_get_username(struct ipoe_session *ses, const char *func)
if (lua_pcall(L, 1, 1, 0)) {
log_ppp_error("ipoe: lua: %s\n", lua_tostring(L, -1));
- goto out_err;
+ lua_pop(L, 1);
+ goto out;
}
if (!lua_isstring(L, -1)) {
log_ppp_error("ipoe: lua: function '%s' must return a string\n", func);
- goto out_err;
+ goto out;
}
r = _strdup(lua_tostring(L, -1));
+out:
lua_settop(L, 0);
return r;
-
-out_err:
- file_error = 1;
- lua_close(L);
- L = NULL;
- pthread_setspecific(__key, L);
- return NULL;
}
static void load_config()