From aa19ccda1dc6f4be36d17a283f8b70d8e9cb752d Mon Sep 17 00:00:00 2001 From: Unbit Date: Mon, 8 Apr 2013 17:05:12 +0200 Subject: [PATCH] removed the probe subsystem --- core/lock.c | 3 - core/master.c | 16 ---- core/signal.c | 81 ----------------- plugins/probeconnect/connectprobe.c | 90 ------------------- plugins/probeconnect/uwsgiplugin.py | 7 -- plugins/probepg/pgprobe.c | 132 ---------------------------- plugins/probepg/uwsgiplugin.py | 9 -- plugins/python/uwsgi_pymodule.c | 21 ----- plugins/v8/v8_commonjs.cc | 123 ++++++++++++++++++++------ plugins/v8/v8_uwsgi.cc | 4 + uwsgi.h | 116 +++++++++--------------- 11 files changed, 140 insertions(+), 462 deletions(-) delete mode 100644 plugins/probeconnect/connectprobe.c delete mode 100644 plugins/probeconnect/uwsgiplugin.py delete mode 100644 plugins/probepg/pgprobe.c delete mode 100644 plugins/probepg/uwsgiplugin.py diff --git a/core/lock.c b/core/lock.c index 887c4374..ed6d11d5 100644 --- a/core/lock.c +++ b/core/lock.c @@ -679,9 +679,6 @@ ready: // timer table lock uwsgi.timer_table_lock = uwsgi_lock_init("timer"); - // probe table lock - uwsgi.probe_table_lock = uwsgi_lock_init("probe"); - // rb_timer table lock uwsgi.rb_timer_table_lock = uwsgi_lock_init("rbtimer"); diff --git a/core/master.c b/core/master.c index 97a1fd79..175e4056 100644 --- a/core/master.c +++ b/core/master.c @@ -638,22 +638,6 @@ int master_loop(char **argv, char **environ) { uwsgi_manage_command_cron(uwsgi_now()); } - - // check for probes - if (ushared->probes_cnt > 0) { - uwsgi_lock(uwsgi.probe_table_lock); - for (i = 0; i < ushared->probes_cnt; i++) { - if (interesting_fd == -1) { - // increment cycles - ushared->probes[i].cycles++; - } - if (ushared->probes[i].func(interesting_fd, &ushared->probes[i])) { - uwsgi_route_signal(ushared->probes[i].sig); - } - } - uwsgi_unlock(uwsgi.probe_table_lock); - } - // some event returned if (rlen > 0) { // if the following function returns -1, a new worker has just spawned diff --git a/core/signal.c b/core/signal.c index 09106fd0..ba497517 100644 --- a/core/signal.c +++ b/core/signal.c @@ -177,87 +177,6 @@ int uwsgi_add_file_monitor(uint8_t sig, char *filename) { } -struct uwsgi_probe *uwsgi_probe_register(struct uwsgi_probe **up, char *name, int (*func) (int, struct uwsgi_signal_probe *)) { - - struct uwsgi_probe *uwsgi_up = *up, *old_up; - - if (!uwsgi_up) { - *up = uwsgi_malloc(sizeof(struct uwsgi_probe)); - uwsgi_up = *up; - } - else { - while (uwsgi_up) { - old_up = uwsgi_up; - uwsgi_up = uwsgi_up->next; - } - - uwsgi_up = uwsgi_malloc(sizeof(struct uwsgi_probe)); - old_up->next = uwsgi_up; - } - - uwsgi_up->name = name; - uwsgi_up->func = func; - uwsgi_up->next = NULL; - - uwsgi_log("registered new probe \"%s\" at %p\n", name, uwsgi_up); - - return uwsgi_up; -} - - -int uwsgi_add_probe(uint8_t sig, char *kind, char *args, int timeout, int freq) { - - uwsgi_lock(uwsgi.probe_table_lock); - - if (ushared->probes_cnt < MAX_PROBES) { - - struct uwsgi_probe *up = uwsgi.probes; - while (up) { - if (!strcmp(up->name, kind)) { - break; - } - up = up->next; - } - - if (!up) { - uwsgi_log("unable to find probe \"%s\" !!!\n", kind); - uwsgi_unlock(uwsgi.probe_table_lock); - return -1; - } - - // fill the probe table - ushared->probes[ushared->probes_cnt].func = up->func; - strncpy(ushared->probes[ushared->probes_cnt].args, args, 1024 - 1); - ushared->probes[ushared->probes_cnt].registered = 0; - ushared->probes[ushared->probes_cnt].sig = sig; - ushared->probes[ushared->probes_cnt].fd = -1; - ushared->probes[ushared->probes_cnt].state = 0; - ushared->probes[ushared->probes_cnt].last_event = 0; - ushared->probes[ushared->probes_cnt].data = NULL; - ushared->probes[ushared->probes_cnt].cycles = 0; - ushared->probes[ushared->probes_cnt].bad = 0; - - if (!timeout) { - timeout = uwsgi.shared->options[UWSGI_OPTION_SOCKET_TIMEOUT]; - } - ushared->probes[ushared->probes_cnt].timeout = timeout; - if (!freq) { - freq = 1; - } - ushared->probes[ushared->probes_cnt].freq = freq; - ushared->probes_cnt++; - } - else { - uwsgi_log("you can register max %d probes !!!\n", MAX_PROBES); - uwsgi_unlock(uwsgi.probe_table_lock); - return -1; - } - - uwsgi_unlock(uwsgi.probe_table_lock); - - return 0; -} - int uwsgi_add_timer(uint8_t sig, int secs) { if (!uwsgi.master_process) return -1; diff --git a/plugins/probeconnect/connectprobe.c b/plugins/probeconnect/connectprobe.c deleted file mode 100644 index 251cbee3..00000000 --- a/plugins/probeconnect/connectprobe.c +++ /dev/null @@ -1,90 +0,0 @@ -#include "../../uwsgi.h" - -extern struct uwsgi_server uwsgi; - -int connect_prober_callback(int interesting_fd, struct uwsgi_signal_probe *up) { - - // is this a timeout event ? - if (interesting_fd == -1) { - // am i wating for something ? - if (up->fd != -1) { - if (up->cycles > (uint64_t) up->timeout) { - // reset the cycle - up->cycles = 0; - close(up->fd); - up->fd = -1; - // state = NOOP - up->state = 0; - // avoid duplicated events - if (!up->bad) { - up->bad = 1; - return 1; - } - } - } - // ok register a new event - else { - if ((up->cycles % up->freq) == 0) { - up->fd = uwsgi_connect(up->args, -1, 1); - if (up->fd != -1) { - // status = CONNECTING - up->state = 1; - event_queue_add_fd_write(uwsgi.master_queue, up->fd); - return 0; - } - // signal the bad event (if not already bad) - if (!up->bad) { - up->bad = 1; - return 1; - } - - } - } - } - else if (up->fd != -1) { - // is this event for me ? - if (interesting_fd == up->fd) { - // uselsess here (we have only one state), only to show a good practice - // check the state - if (up->state == 1) { - if (uwsgi_is_bad_connection(up->fd)) { - // signal the bad connection (if needed) - up->cycles = 0; - close(up->fd); - up->fd = -1; - // state = NOOP - up->state = 0; - if (!up->bad) { - up->bad = 1; - return 1; - } - return 0; - } - // this is a good connection - up->cycles = 0; - close(up->fd); - up->fd = -1; - // state = NOOP - up->state = 0; - if (up->bad) { - up->bad = 0; - return 1; - } - } - } - } - - // default action - return 0; -} - -int probeconnect_init() { - - uwsgi_probe_register(&uwsgi.probes, "connect", connect_prober_callback); - return 0; -} - -struct uwsgi_plugin probeconnect_plugin = { - - .init = probeconnect_init, -}; diff --git a/plugins/probeconnect/uwsgiplugin.py b/plugins/probeconnect/uwsgiplugin.py deleted file mode 100644 index d42968a0..00000000 --- a/plugins/probeconnect/uwsgiplugin.py +++ /dev/null @@ -1,7 +0,0 @@ - -NAME='probeconnect' -CFLAGS = [] -LDFLAGS = [] -LIBS = [] - -GCC_LIST = ['connectprobe'] diff --git a/plugins/probepg/pgprobe.c b/plugins/probepg/pgprobe.c deleted file mode 100644 index 2e3eb114..00000000 --- a/plugins/probepg/pgprobe.c +++ /dev/null @@ -1,132 +0,0 @@ -#include "../../uwsgi.h" -#include - -extern struct uwsgi_server uwsgi; -int pg_prober_callback(int, struct uwsgi_signal_probe *); -int probepg_init(void); - -int pg_prober_callback(int interesting_fd, struct uwsgi_signal_probe *up) { - - // is this a timeout event ? - if (interesting_fd == -1) { - // am i wating for something ? - if (up->fd != -1) { - if (up->cycles > (uint64_t) up->timeout) { - // reset the cycle - up->cycles = 0; - PQfinish((PGconn *) up->data); - up->fd = -1; - // state = NOOP - up->state = 0; - // avoid duplicated events - if (!up->bad) { - up->bad = 1; - return 1; - } - } - } - // ok register a new event - else { - if ((up->cycles % up->freq) == 0) { - up->last_event = event_queue_write(); - up->data = (void *) PQconnectStart(up->args); - if (up->data) { - // status = CONNECTING - up->state = PQstatus((PGconn *) up->data); - if (up->state == CONNECTION_BAD) - goto bad; - up->fd = PQsocket((PGconn *) up->data); - event_queue_add_fd_write(uwsgi.master_queue, up->fd); - return 0; - } - bad: - // signal the bad event (if not already bad) - if (!up->bad) { - up->bad = 1; - return 1; - } - - } - } - } - else if (up->fd != -1) { - // is this event for me ? - if (interesting_fd == up->fd) { - // check the state - up->state = PQstatus((PGconn *) up->data); - if (up->state == CONNECTION_BAD) { - // signal the bad connection (if needed) - up->cycles = 0; - PQfinish((PGconn *) up->data); - up->fd = -1; - up->state = 0; - if (!up->bad) { - up->bad = 1; - return 1; - } - return 0; - } - else if (up->state == CONNECTION_OK) { - up->cycles = 0; - PQfinish((PGconn *) up->data); - up->fd = -1; - // state = NOOP - up->state = 0; - if (up->bad) { - up->bad = 0; - return 1; - } - } - // still wait... - else { - PostgresPollingStatusType wait_type = PQconnectPoll((PGconn *) up->data); - // the connection is good - if (wait_type == PGRES_POLLING_ACTIVE || wait_type == PGRES_POLLING_FAILED || wait_type == PGRES_POLLING_OK) { - if (wait_type == PGRES_POLLING_ACTIVE) - wait_type = PQconnectPoll((PGconn *) up->data); - up->cycles = 0; - up->fd = -1; - // state = NOOP - up->state = 0; - PQfinish((PGconn *) up->data); - if (wait_type == PGRES_POLLING_FAILED) { - if (!up->bad) { - up->bad = 1; - return 1; - } - } - else { - if (up->bad) { - up->bad = 0; - return 1; - } - } - } - else if (wait_type == PGRES_POLLING_READING) { - event_queue_del_fd(uwsgi.master_queue, up->fd, up->last_event); - event_queue_add_fd_read(uwsgi.master_queue, up->fd); - up->last_event = event_queue_read(); - } - else if (wait_type == PGRES_POLLING_WRITING) { - event_queue_del_fd(uwsgi.master_queue, up->fd, up->last_event); - event_queue_add_fd_write(uwsgi.master_queue, up->fd); - up->last_event = event_queue_write(); - } - } - } - } - - // default action - return 0; -} - -int probepg_init() { - - uwsgi_probe_register(&uwsgi.probes, "pg", pg_prober_callback); - return 0; -} - -struct uwsgi_plugin probepg_plugin = { - - .init = probepg_init, -}; diff --git a/plugins/probepg/uwsgiplugin.py b/plugins/probepg/uwsgiplugin.py deleted file mode 100644 index e205001e..00000000 --- a/plugins/probepg/uwsgiplugin.py +++ /dev/null @@ -1,9 +0,0 @@ -import os - -NAME='probepg' -CFLAGS = os.popen('pg_config --cflags').read().rstrip().split() -CFLAGS.append('-I' + os.popen('pg_config --includedir').read().rstrip()) -LDFLAGS = os.popen('pg_config --ldflags').read().rstrip().split() -LIBS = ['-L' + os.popen('pg_config --libdir').read().rstrip(), '-lpq'] - -GCC_LIST = ['pgprobe'] diff --git a/plugins/python/uwsgi_pymodule.c b/plugins/python/uwsgi_pymodule.c index d1e61394..68a2d4fd 100644 --- a/plugins/python/uwsgi_pymodule.c +++ b/plugins/python/uwsgi_pymodule.c @@ -210,26 +210,6 @@ PyObject *py_uwsgi_add_cron(PyObject * self, PyObject * args) { } -PyObject *py_uwsgi_add_probe(PyObject * self, PyObject * args) { - - uint8_t uwsgi_signal; - int timeout = 0; - int freq = 0; - char *probe, *probe_args; - - if (!PyArg_ParseTuple(args, "Bss|ii:add_probe", &uwsgi_signal, &probe, &probe_args, &timeout, &freq)) { - return NULL; - } - - if (uwsgi_add_probe(uwsgi_signal, probe, probe_args, timeout, freq)) - return PyErr_Format(PyExc_ValueError, "unable to add probe"); - - Py_INCREF(Py_None); - return Py_None; -} - - - PyObject *py_uwsgi_add_timer(PyObject * self, PyObject * args) { uint8_t uwsgi_signal; @@ -2444,7 +2424,6 @@ static PyMethodDef uwsgi_advanced_methods[] = { {"signal_received", py_uwsgi_signal_received, METH_VARARGS, ""}, {"add_file_monitor", py_uwsgi_add_file_monitor, METH_VARARGS, ""}, {"add_timer", py_uwsgi_add_timer, METH_VARARGS, ""}, - {"add_probe", py_uwsgi_add_probe, METH_VARARGS, ""}, {"add_rb_timer", py_uwsgi_add_rb_timer, METH_VARARGS, ""}, {"add_cron", py_uwsgi_add_cron, METH_VARARGS, ""}, diff --git a/plugins/v8/v8_commonjs.cc b/plugins/v8/v8_commonjs.cc index aaa32335..a046c743 100644 --- a/plugins/v8/v8_commonjs.cc +++ b/plugins/v8/v8_commonjs.cc @@ -1,67 +1,119 @@ #include "v8_uwsgi.h" extern struct uwsgi_v8 uv8; +extern struct uwsgi_server uwsgi; -static v8::Handle uwsgi_v8_commonjs_require_do(char *filename) { +/* + + support .js + support .so files (TeaJS) + +*/ +static void uwsgi_v8_commonjs_require_do(char *filename, v8::Local exports, v8::Local module) { size_t len = 0; char *code = uwsgi_open_and_read(filename, &len, 1, NULL); - // we re-create every time an "exports" object to emulate a local object - v8::Local exports = v8::Object::New(); - v8::Context::GetCurrent()->Global()->Set(v8::String::New("exports"), exports); - // we do not use TryCatch as we directly use stderr and simply exit with error code 1 v8::Handle script = v8::Script::Compile( v8::String::New(code), v8::String::New(filename) ); free(code); if (script.IsEmpty()) { - exit(1); + return; } - - v8::Handle result = script->Run(); - if (result.IsEmpty()) { - return v8::Undefined(); - } - - return exports; + script->Run(); } +static void uwsgi_v8_commonjs_require_teajs_do(char *filename, v8::Local exports, v8::Local module) { + + void *handle = dlopen(filename, RTLD_LAZY); + if (!handle) { + uwsgi_log("error opening teajs module %s: %s\n", filename, dlerror()); + return; + } + typedef void (*init_t)(v8::Handle, v8::Handle, v8::Handle); + init_t func = (init_t) dlsym(handle, "init"); + if (!func) { + uwsgi_log("unable to find teajs module init function\n"); + return; + } + func(v8::Handle::Cast(v8::Context::GetCurrent()->Global()->Get(v8::String::New("require"))), exports, module); +} + + static v8::Handle uwsgi_v8_commonjs_require(const v8::Arguments& args) { if (args.Length() > 0) { v8::String::Utf8Value module_name(args[0]->ToString()); + char *id = (char *)"pippo"; + // we re-create every time an "exports" object to emulate a local object + v8::Local exports = v8::Object::New(); + v8::Context::GetCurrent()->Global()->Set(v8::String::New("exports"), exports); + v8::Local module = v8::Object::New(); + v8::Context::GetCurrent()->Global()->Set(v8::String::New("module"), module); + module->Set(v8::String::New("id"), v8::String::New(id)); // ok lets start searching the module if (uwsgi_is_file(*module_name)) { - return uwsgi_v8_commonjs_require_do(*module_name); + if (!uwsgi_endswith(*module_name, (char *)".js")) { + uwsgi_v8_commonjs_require_do(*module_name, exports, module); + return exports; + } + else if (!uwsgi_endswith(*module_name, (char *)".so")) { + uwsgi_v8_commonjs_require_teajs_do(*module_name, exports, module); + return exports; + } + return v8::Undefined(); } - // try appending .js extension - if (!uwsgi_endswith(*module_name, (char *)".js")) { - char *tmp_filename = uwsgi_concat2(*module_name, (char *)".js"); + // try appending .js/.so extension + if (!uwsgi_endswith(*module_name, (char *)".js") && !uwsgi_endswith(*module_name, (char *)".so")) { + char *tmp_filename = uwsgi_concat2(*module_name, (char *)".so"); + if (uwsgi_is_file(tmp_filename)) { + uwsgi_v8_commonjs_require_teajs_do(tmp_filename, exports, module); + free(tmp_filename); + return exports; + } + free(tmp_filename); + tmp_filename = uwsgi_concat2(*module_name, (char *)".js"); if (uwsgi_is_file(tmp_filename)) { - v8::Handle ret = uwsgi_v8_commonjs_require_do(tmp_filename); + uwsgi_v8_commonjs_require_do(tmp_filename, exports, module); free(tmp_filename); - return ret; + return exports; } free(tmp_filename); - } + } // let's start searching in the modules search path struct uwsgi_string_list *usl = uv8.module_paths; while(usl) { char *tmp_filename = uwsgi_concat3(usl->value, (char *)"/", *module_name); if (uwsgi_is_file(tmp_filename)) { - v8::Handle ret = uwsgi_v8_commonjs_require_do(tmp_filename); + if (!uwsgi_endswith(tmp_filename, (char *)".js")) { + uwsgi_v8_commonjs_require_do(tmp_filename, exports, module); + } + else if (!uwsgi_endswith(tmp_filename, (char *)".so")) { + uwsgi_v8_commonjs_require_teajs_do(tmp_filename, exports, module); + } + else { + free(tmp_filename); + return v8::Undefined(); + } free(tmp_filename); - return ret; + return exports; } free(tmp_filename); - if (!uwsgi_endswith(*module_name, (char *)".js")) { + if (!uwsgi_endswith(*module_name, (char *)".js") && !uwsgi_endswith(*module_name, (char *)".so")) { + tmp_filename = uwsgi_concat4(usl->value, (char *)"/", *module_name, (char *)".so"); + if (uwsgi_is_file(tmp_filename)) { + uwsgi_v8_commonjs_require_teajs_do(tmp_filename, exports, module); + free(tmp_filename); + return exports; + } tmp_filename = uwsgi_concat4(usl->value, (char *)"/", *module_name, (char *)".js"); if (uwsgi_is_file(tmp_filename)) { - v8::Handle ret = uwsgi_v8_commonjs_require_do(tmp_filename); + uwsgi_v8_commonjs_require_do(tmp_filename, exports, module); free(tmp_filename); - return ret; + return exports; } + free(tmp_filename); } free(tmp_filename); usl = usl->next; @@ -70,6 +122,23 @@ static v8::Handle uwsgi_v8_commonjs_require(const v8::Arguments& args return v8::Undefined(); } -void uwsgi_v8_add_commonjs(v8::Handle global) { - global->Set(v8::String::New("require"), v8::FunctionTemplate::New(uwsgi_v8_commonjs_require)); +void uwsgi_v8_fill_commonjs(v8::Persistent context) { + context->Enter(); + v8::Handle system = context->Global()->Get(v8::String::New("system"))->ToObject(); + v8::Handle args = v8::Array::New(); + int i; + for(i=0;iSet(v8::Integer::New(i), v8::String::New(uwsgi.argv[i])); + } + system->Set(v8::String::New("args"), args); + v8::Handle env = v8::Object::New(); + system->Set(v8::String::New("env"), env); +} + +void uwsgi_v8_add_commonjs(v8::Handle global) { + // the require function (Modules/1.1) + global->Set(v8::String::New("require"), v8::FunctionTemplate::New(uwsgi_v8_commonjs_require)); + // the system namespace (System/1.0) + v8::Handle system = v8::ObjectTemplate::New(); + global->Set(v8::String::New("system"), system); } diff --git a/plugins/v8/v8_uwsgi.cc b/plugins/v8/v8_uwsgi.cc index ddb0659d..37427b24 100644 --- a/plugins/v8/v8_uwsgi.cc +++ b/plugins/v8/v8_uwsgi.cc @@ -135,6 +135,7 @@ static v8::Handle uwsgi_v8_api_log(const v8::Arguments& args) { } void uwsgi_v8_add_commonjs(v8::Handle); +void uwsgi_v8_fill_commonjs(v8::Persistent); static v8::Persistent uwsgi_v8_new_isolate(int core_id) { // create a new isolate @@ -159,6 +160,9 @@ static v8::Persistent uwsgi_v8_new_isolate(int core_id) { // create a new context v8::Persistent context = v8::Context::New(NULL, global); + + uwsgi_v8_fill_commonjs(context); + return context; } diff --git a/uwsgi.h b/uwsgi.h index 06a247a7..b717a0a6 100644 --- a/uwsgi.h +++ b/uwsgi.h @@ -1444,33 +1444,6 @@ struct uwsgi_router { struct uwsgi_rb_timer *uwsgi_rb_timer; }; - struct uwsgi_signal_probe { - - int (*func) (int, struct uwsgi_signal_probe *); - char args[1024]; - - int fd; - int state; - int bad; - int last_event; - void *data; - uint64_t cycles; - - int timeout; - int freq; - - int registered; - uint8_t sig; - }; - - struct uwsgi_probe { - - char *name; - int (*func) (int, struct uwsgi_signal_probe *); - - struct uwsgi_probe *next; - }; - struct uwsgi_cheaper_algo { char *name; @@ -1830,8 +1803,6 @@ struct uwsgi_server { struct uwsgi_string_list *mime_file; - struct uwsgi_probe *probes; - struct uwsgi_string_list *exec_pre_jail; struct uwsgi_string_list *exec_post_jail; struct uwsgi_string_list *exec_in_jail; @@ -2246,7 +2217,6 @@ struct uwsgi_server { struct uwsgi_lock_item *signal_table_lock; struct uwsgi_lock_item *fmon_table_lock; struct uwsgi_lock_item *timer_table_lock; - struct uwsgi_lock_item *probe_table_lock; struct uwsgi_lock_item *rb_timer_table_lock; struct uwsgi_lock_item *cron_table_lock; struct uwsgi_lock_item *rpc_table_lock; @@ -2387,9 +2357,6 @@ struct uwsgi_signal_entry { struct uwsgi_fmon files_monitored[64]; int files_monitored_cnt; - struct uwsgi_signal_probe probes[MAX_PROBES]; - int probes_cnt; - struct uwsgi_timer timers[MAX_TIMERS]; int timers_cnt; @@ -3131,74 +3098,71 @@ void uwsgi_set_processname(char *); struct uwsgi_subscribe_slot *next; }; - void mule_send_msg(int, char *, size_t); +void mule_send_msg(int, char *, size_t); - uint32_t djb33x_hash(char *, uint64_t); - void create_signal_pipe(int *); - struct uwsgi_subscribe_slot *uwsgi_get_subscribe_slot(struct uwsgi_subscribe_slot **, char *, uint16_t); - struct uwsgi_subscribe_node *uwsgi_get_subscribe_node_by_name(struct uwsgi_subscribe_slot **, char *, uint16_t, char *, uint16_t); - struct uwsgi_subscribe_node *uwsgi_get_subscribe_node(struct uwsgi_subscribe_slot **, char *, uint16_t); - int uwsgi_remove_subscribe_node(struct uwsgi_subscribe_slot **, struct uwsgi_subscribe_node *); - struct uwsgi_subscribe_node *uwsgi_add_subscribe_node(struct uwsgi_subscribe_slot **, struct uwsgi_subscribe_req *); +uint32_t djb33x_hash(char *, uint64_t); +void create_signal_pipe(int *); +struct uwsgi_subscribe_slot *uwsgi_get_subscribe_slot(struct uwsgi_subscribe_slot **, char *, uint16_t); +struct uwsgi_subscribe_node *uwsgi_get_subscribe_node_by_name(struct uwsgi_subscribe_slot **, char *, uint16_t, char *, uint16_t); +struct uwsgi_subscribe_node *uwsgi_get_subscribe_node(struct uwsgi_subscribe_slot **, char *, uint16_t); +int uwsgi_remove_subscribe_node(struct uwsgi_subscribe_slot **, struct uwsgi_subscribe_node *); +struct uwsgi_subscribe_node *uwsgi_add_subscribe_node(struct uwsgi_subscribe_slot **, struct uwsgi_subscribe_req *); - ssize_t uwsgi_mule_get_msg(int, int, char *, size_t, int); +ssize_t uwsgi_mule_get_msg(int, int, char *, size_t, int); - int uwsgi_signal_wait(int); - struct uwsgi_app *uwsgi_add_app(int, uint8_t, char *, int, void *, void *); - int uwsgi_signal_send(int, uint8_t); - int uwsgi_remote_signal_send(char *, uint8_t); +int uwsgi_signal_wait(int); +struct uwsgi_app *uwsgi_add_app(int, uint8_t, char *, int, void *, void *); +int uwsgi_signal_send(int, uint8_t); +int uwsgi_remote_signal_send(char *, uint8_t); - void uwsgi_configure(); +void uwsgi_configure(); - int uwsgi_read_response(int, struct uwsgi_header *, int, char **); - char *uwsgi_simple_file_read(char *); +int uwsgi_read_response(int, struct uwsgi_header *, int, char **); +char *uwsgi_simple_file_read(char *); - void uwsgi_send_subscription(char *, char *, size_t, uint8_t, uint8_t, uint8_t, char *, char *); +void uwsgi_send_subscription(char *, char *, size_t, uint8_t, uint8_t, uint8_t, char *, char *); - void uwsgi_subscribe(char *, uint8_t); - void uwsgi_subscribe2(char *, uint8_t); +void uwsgi_subscribe(char *, uint8_t); +void uwsgi_subscribe2(char *, uint8_t); - struct uwsgi_probe *uwsgi_probe_register(struct uwsgi_probe **, char *, int (*)(int, struct uwsgi_signal_probe *)); - int uwsgi_add_probe(uint8_t sig, char *, char *, int, int); - - int uwsgi_is_bad_connection(int); - int uwsgi_long2str2n(unsigned long long, char *, int); +int uwsgi_is_bad_connection(int); +int uwsgi_long2str2n(unsigned long long, char *, int); #ifdef __linux__ - void uwsgi_build_unshare(char *); +void uwsgi_build_unshare(char *); #ifdef MADV_MERGEABLE - void uwsgi_linux_ksm_map(void); +void uwsgi_linux_ksm_map(void); #endif #endif #ifdef UWSGI_CAP - void uwsgi_build_cap(char *); +void uwsgi_build_cap(char *); #endif - void uwsgi_register_logger(char *, ssize_t(*func) (struct uwsgi_logger *, char *, size_t)); - void uwsgi_append_logger(struct uwsgi_logger *); - void uwsgi_append_req_logger(struct uwsgi_logger *); - struct uwsgi_logger *uwsgi_get_logger(char *); - struct uwsgi_logger *uwsgi_get_logger_from_id(char *); +void uwsgi_register_logger(char *, ssize_t(*func) (struct uwsgi_logger *, char *, size_t)); +void uwsgi_append_logger(struct uwsgi_logger *); +void uwsgi_append_req_logger(struct uwsgi_logger *); +struct uwsgi_logger *uwsgi_get_logger(char *); +struct uwsgi_logger *uwsgi_get_logger_from_id(char *); - char *uwsgi_getsockname(int); - char *uwsgi_get_var(struct wsgi_request *, char *, uint16_t, uint16_t *); +char *uwsgi_getsockname(int); +char *uwsgi_get_var(struct wsgi_request *, char *, uint16_t, uint16_t *); - struct uwsgi_gateway_socket *uwsgi_new_gateway_socket(char *, char *); - struct uwsgi_gateway_socket *uwsgi_new_gateway_socket_from_fd(int, char *); +struct uwsgi_gateway_socket *uwsgi_new_gateway_socket(char *, char *); +struct uwsgi_gateway_socket *uwsgi_new_gateway_socket_from_fd(int, char *); - void escape_shell_arg(char *, size_t, char *); +void escape_shell_arg(char *, size_t, char *); - void *uwsgi_malloc_shared(size_t); - void *uwsgi_calloc_shared(size_t); +void *uwsgi_malloc_shared(size_t); +void *uwsgi_calloc_shared(size_t); - struct uwsgi_spooler *uwsgi_new_spooler(char *); +struct uwsgi_spooler *uwsgi_new_spooler(char *); - struct uwsgi_spooler *uwsgi_get_spooler_by_name(char *); +struct uwsgi_spooler *uwsgi_get_spooler_by_name(char *); - int uwsgi_zerg_attach(char *); +int uwsgi_zerg_attach(char *); - int uwsgi_manage_opt(char *, char *); +int uwsgi_manage_opt(char *, char *); void uwsgi_opt_print(char *, char *, void *); void uwsgi_opt_true(char *, char *, void *);