2
0
Fork 0

added 'blank' function to plugin_core

This commit is contained in:
Thomas Porzelt 2008-08-17 00:23:52 +02:00
parent 6804b1df00
commit ccaacfb285
2 changed files with 29 additions and 7 deletions

View File

@ -44,5 +44,9 @@ handler_t filter_chunked_encode(server *srv, connection *con, chunkqueue *out, c
}
handler_t filter_chunked_decode(server *srv, connection *con, chunkqueue *out, chunkqueue *in) {
UNUSED(srv);
UNUSED(con);
UNUSED(out);
UNUSED(in);
return HANDLER_ERROR;
}

View File

@ -250,13 +250,35 @@ static action* core_test(server *srv, plugin* p, option *opt) {
UNUSED(p);
if (opt) {
ERROR(srv, "%s", "static action doesn't have parameters");
ERROR(srv, "%s", "'static' action doesn't have parameters");
return NULL;
}
return action_new_function(core_handle_test, NULL, NULL);
}
static action_result core_handle_blank(server *srv, connection *con, gpointer param) {
UNUSED(param);
if (con->state != CON_STATE_HANDLE_REQUEST_HEADER) return ACTION_GO_ON;
con->response.http_status = 200;
connection_handle_direct(srv, con);
return ACTION_GO_ON;
}
static action* core_blank(server *srv, plugin* p, option *opt) {
UNUSED(p);
if (opt) {
ERROR(srv, "%s", "'empty' action doesn't have parameters");
return NULL;
}
return action_new_function(core_handle_blank, NULL, NULL);
}
static gboolean core_listen(server *srv, plugin* p, option *opt) {
guint32 ipv4;
guint8 ipv6[16];
@ -363,8 +385,7 @@ gboolean core_option_log_target_parse(server *srv, plugin *p, size_t ndx, option
log_t *log;
log_type_t log_type;
UNUSED(log);
UNUSED(log_type);
UNUSED(ndx);
UNUSED(p);
assert(opt->type == OPTION_STRING);
@ -374,8 +395,6 @@ gboolean core_option_log_target_parse(server *srv, plugin *p, size_t ndx, option
*value = (gpointer)log;
TRACE(srv, "log.target assignment; ndx: %zd, value: %s", ndx, opt->value.opt_string->str);
return TRUE;
}
@ -395,8 +414,6 @@ gboolean core_option_log_level_parse(server *srv, plugin *p, size_t ndx, option
*value = (gpointer)log_level_from_string(opt->value.opt_string);
TRACE(srv, "log.level assignment: %s", opt->value.opt_string->str);
return TRUE;
}
@ -427,6 +444,7 @@ static const plugin_action actions[] = {
{ "physical", core_physical },
{ "static", core_static },
{ "test", core_test },
{ "blank", core_blank },
{ NULL, NULL }
};