s_webHandlers[endpoint] = handler;
}
+void clearWebHandlers()
+{
+ s_webHandlers.clear();
+}
+
static void redirectToIndex(const YaHTTP::Request& req, YaHTTP::Response& resp)
{
const string charset = "; charset=utf-8";
}
#ifdef COVERAGE
+static void cleanupLuaObjects()
+{
+ /* when our coverage mode is enabled, we need to make
+ that the Lua objects destroyed before the Lua contexts. */
+ g_ruleactions.setState({});
+ g_respruleactions.setState({});
+ g_cachehitrespruleactions.setState({});
+ g_selfansweredrespruleactions.setState({});
+ g_dstates.setState({});
+ g_policy.setState(ServerPolicy());
+ clearWebHandlers();
+}
+
static void sighandler(int sig)
{
+ cleanupLuaObjects();
exit(EXIT_SUCCESS);
}
#endif
// No exception was thrown
infolog("Configuration '%s' OK!", g_cmdLine.config);
#ifdef COVERAGE
+ cleanupLuaObjects();
exit(EXIT_SUCCESS);
#else
_exit(EXIT_SUCCESS);
doConsole();
}
#ifdef COVERAGE
+ cleanupLuaObjects();
exit(EXIT_SUCCESS);
#else
_exit(EXIT_SUCCESS);