}
*p = '\0';
- send_log(px, level, "%s", trash.str);
+ send_log(px, level, "%s\n", trash.str);
if (!(global.mode & MODE_QUIET) || (global.mode & (MODE_VERBOSE | MODE_STARTING))) {
get_localtime(date.tv_sec, &tm);
fprintf(stderr, "[%s] %03d/%02d%02d%02d (%d) : %s\n",
/* finished with error. */
case HLUA_E_ERRMSG:
- send_log(NULL, LOG_ERR, "Lua task: %s.", lua_tostring(hlua->T, -1));
+ send_log(NULL, LOG_ERR, "Lua task: %s.\n", lua_tostring(hlua->T, -1));
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Lua task: %s.\n", lua_tostring(hlua->T, -1));
hlua_ctx_destroy(hlua);
case HLUA_E_ERR:
default:
- send_log(NULL, LOG_ERR, "Lua task: unknown error.");
+ send_log(NULL, LOG_ERR, "Lua task: unknown error.\n");
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Lua task: unknown error.\n");
hlua_ctx_destroy(hlua);
* Lua initialization cause 5% performances loss.
*/
if (!stream->hlua.T && !hlua_ctx_init(&stream->hlua, stream->task)) {
- send_log(stream->be, LOG_ERR, "Lua converter '%s': can't initialize Lua context.", fcn->name);
+ send_log(stream->be, LOG_ERR, "Lua converter '%s': can't initialize Lua context.\n", fcn->name);
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Lua converter '%s': can't initialize Lua context.\n", fcn->name);
return 0;
if (!HLUA_IS_RUNNING(&stream->hlua)) {
/* Check stack available size. */
if (!lua_checkstack(stream->hlua.T, 1)) {
- send_log(stream->be, LOG_ERR, "Lua converter '%s': full stack.", fcn->name);
+ send_log(stream->be, LOG_ERR, "Lua converter '%s': full stack.\n", fcn->name);
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Lua converter '%s': full stack.\n", fcn->name);
return 0;
/* convert input sample and pust-it in the stack. */
if (!lua_checkstack(stream->hlua.T, 1)) {
- send_log(stream->be, LOG_ERR, "Lua converter '%s': full stack.", fcn->name);
+ send_log(stream->be, LOG_ERR, "Lua converter '%s': full stack.\n", fcn->name);
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Lua converter '%s': full stack.\n", fcn->name);
return 0;
if (arg_p) {
for (; arg_p->type != ARGT_STOP; arg_p++) {
if (!lua_checkstack(stream->hlua.T, 1)) {
- send_log(stream->be, LOG_ERR, "Lua converter '%s': full stack.", fcn->name);
+ send_log(stream->be, LOG_ERR, "Lua converter '%s': full stack.\n", fcn->name);
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Lua converter '%s': full stack.\n", fcn->name);
return 0;
/* yield. */
case HLUA_E_AGAIN:
- send_log(stream->be, LOG_ERR, "Lua converter '%s': cannot use yielded functions.", fcn->name);
+ send_log(stream->be, LOG_ERR, "Lua converter '%s': cannot use yielded functions.\n", fcn->name);
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Lua converter '%s': cannot use yielded functions.\n", fcn->name);
return 0;
/* finished with error. */
case HLUA_E_ERRMSG:
/* Display log. */
- send_log(stream->be, LOG_ERR, "Lua converter '%s': %s.", fcn->name, lua_tostring(stream->hlua.T, -1));
+ send_log(stream->be, LOG_ERR, "Lua converter '%s': %s.\n", fcn->name, lua_tostring(stream->hlua.T, -1));
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Lua converter '%s': %s.\n", fcn->name, lua_tostring(stream->hlua.T, -1));
lua_pop(stream->hlua.T, 1);
case HLUA_E_ERR:
/* Display log. */
- send_log(stream->be, LOG_ERR, "Lua converter '%s' returns an unknown error.", fcn->name);
+ send_log(stream->be, LOG_ERR, "Lua converter '%s' returns an unknown error.\n", fcn->name);
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Lua converter '%s' returns an unknown error.\n", fcn->name);
* Lua initialization cause 5% performances loss.
*/
if (!stream->hlua.T && !hlua_ctx_init(&stream->hlua, stream->task)) {
- send_log(stream->be, LOG_ERR, "Lua sample-fetch '%s': can't initialize Lua context.", fcn->name);
+ send_log(stream->be, LOG_ERR, "Lua sample-fetch '%s': can't initialize Lua context.\n", fcn->name);
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Lua sample-fetch '%s': can't initialize Lua context.\n", fcn->name);
return 0;
if (!HLUA_IS_RUNNING(&stream->hlua)) {
/* Check stack available size. */
if (!lua_checkstack(stream->hlua.T, 2)) {
- send_log(smp->px, LOG_ERR, "Lua sample-fetch '%s': full stack.", fcn->name);
+ send_log(smp->px, LOG_ERR, "Lua sample-fetch '%s': full stack.\n", fcn->name);
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Lua sample-fetch '%s': full stack.\n", fcn->name);
return 0;
/* push arguments in the stack. */
if (!hlua_txn_new(stream->hlua.T, stream, smp->px)) {
- send_log(smp->px, LOG_ERR, "Lua sample-fetch '%s': full stack.", fcn->name);
+ send_log(smp->px, LOG_ERR, "Lua sample-fetch '%s': full stack.\n", fcn->name);
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Lua sample-fetch '%s': full stack.\n", fcn->name);
return 0;
for (; arg_p && arg_p->type != ARGT_STOP; arg_p++) {
/* Check stack available size. */
if (!lua_checkstack(stream->hlua.T, 1)) {
- send_log(smp->px, LOG_ERR, "Lua sample-fetch '%s': full stack.", fcn->name);
+ send_log(smp->px, LOG_ERR, "Lua sample-fetch '%s': full stack.\n", fcn->name);
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Lua sample-fetch '%s': full stack.\n", fcn->name);
return 0;
}
if (!lua_checkstack(stream->hlua.T, 1)) {
- send_log(smp->px, LOG_ERR, "Lua sample-fetch '%s': full stack.", fcn->name);
+ send_log(smp->px, LOG_ERR, "Lua sample-fetch '%s': full stack.\n", fcn->name);
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Lua sample-fetch '%s': full stack.\n", fcn->name);
return 0;
/* yield. */
case HLUA_E_AGAIN:
- send_log(smp->px, LOG_ERR, "Lua sample-fetch '%s': cannot use yielded functions.", fcn->name);
+ send_log(smp->px, LOG_ERR, "Lua sample-fetch '%s': cannot use yielded functions.\n", fcn->name);
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Lua sample-fetch '%s': cannot use yielded functions.\n", fcn->name);
return 0;
/* finished with error. */
case HLUA_E_ERRMSG:
/* Display log. */
- send_log(smp->px, LOG_ERR, "Lua sample-fetch '%s': %s.", fcn->name, lua_tostring(stream->hlua.T, -1));
+ send_log(smp->px, LOG_ERR, "Lua sample-fetch '%s': %s.\n", fcn->name, lua_tostring(stream->hlua.T, -1));
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Lua sample-fetch '%s': %s.\n", fcn->name, lua_tostring(stream->hlua.T, -1));
lua_pop(stream->hlua.T, 1);
case HLUA_E_ERR:
/* Display log. */
- send_log(smp->px, LOG_ERR, "Lua sample-fetch '%s' returns an unknown error.", fcn->name);
+ send_log(smp->px, LOG_ERR, "Lua sample-fetch '%s' returns an unknown error.\n", fcn->name);
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Lua sample-fetch '%s': returns an unknown error.\n", fcn->name);
case ACT_F_HTTP_REQ: analyzer = AN_REQ_HTTP_PROCESS_FE; break;
case ACT_F_HTTP_RES: analyzer = AN_RES_HTTP_PROCESS_BE; break;
default:
- send_log(px, LOG_ERR, "Lua: internal error while execute action.");
+ send_log(px, LOG_ERR, "Lua: internal error while execute action.\n");
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Lua: internal error while execute action.\n");
return ACT_RET_CONT;
* Lua initialization cause 5% performances loss.
*/
if (!s->hlua.T && !hlua_ctx_init(&s->hlua, s->task)) {
- send_log(px, LOG_ERR, "Lua action '%s': can't initialize Lua context.",
+ send_log(px, LOG_ERR, "Lua action '%s': can't initialize Lua context.\n",
rule->arg.hlua_rule->fcn.name);
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Lua action '%s': can't initialize Lua context.\n",
if (!HLUA_IS_RUNNING(&s->hlua)) {
/* Check stack available size. */
if (!lua_checkstack(s->hlua.T, 1)) {
- send_log(px, LOG_ERR, "Lua function '%s': full stack.",
+ send_log(px, LOG_ERR, "Lua function '%s': full stack.\n",
rule->arg.hlua_rule->fcn.name);
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Lua function '%s': full stack.\n",
/* Create and and push object stream in the stack. */
if (!hlua_txn_new(s->hlua.T, s, px)) {
- send_log(px, LOG_ERR, "Lua function '%s': full stack.",
+ send_log(px, LOG_ERR, "Lua function '%s': full stack.\n",
rule->arg.hlua_rule->fcn.name);
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Lua function '%s': full stack.\n",
/* push keywords in the stack. */
for (arg = rule->arg.hlua_rule->args; arg && *arg; arg++) {
if (!lua_checkstack(s->hlua.T, 1)) {
- send_log(px, LOG_ERR, "Lua function '%s': full stack.",
+ send_log(px, LOG_ERR, "Lua function '%s': full stack.\n",
rule->arg.hlua_rule->fcn.name);
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Lua function '%s': full stack.\n",
/* finished with error. */
case HLUA_E_ERRMSG:
/* Display log. */
- send_log(px, LOG_ERR, "Lua function '%s': %s.",
+ send_log(px, LOG_ERR, "Lua function '%s': %s.\n",
rule->arg.hlua_rule->fcn.name, lua_tostring(s->hlua.T, -1));
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Lua function '%s': %s.\n",
case HLUA_E_ERR:
/* Display log. */
- send_log(px, LOG_ERR, "Lua function '%s' return an unknown error.",
+ send_log(px, LOG_ERR, "Lua function '%s' return an unknown error.\n",
rule->arg.hlua_rule->fcn.name);
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Lua function '%s' return an unknown error.\n",