removed the probe subsystem

This commit is contained in:
Unbit
2013-04-08 17:05:12 +02:00
parent cd0129e780
commit aa19ccda1d
11 changed files with 140 additions and 462 deletions
-3
View File
@@ -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");
-16
View File
@@ -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
-81
View File
@@ -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;
-90
View File
@@ -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,
};
-7
View File
@@ -1,7 +0,0 @@
NAME='probeconnect'
CFLAGS = []
LDFLAGS = []
LIBS = []
GCC_LIST = ['connectprobe']
-132
View File
@@ -1,132 +0,0 @@
#include "../../uwsgi.h"
#include <libpq-fe.h>
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,
};
-9
View File
@@ -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']
-21
View File
@@ -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, ""},
+96 -27
View File
@@ -1,67 +1,119 @@
#include "v8_uwsgi.h"
extern struct uwsgi_v8 uv8;
extern struct uwsgi_server uwsgi;
static v8::Handle<v8::Value> uwsgi_v8_commonjs_require_do(char *filename) {
/*
support .js
support .so files (TeaJS)
*/
static void uwsgi_v8_commonjs_require_do(char *filename, v8::Local<v8::Object> exports, v8::Local<v8::Object> 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<v8::Object> 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<v8::Script> script = v8::Script::Compile( v8::String::New(code), v8::String::New(filename) );
free(code);
if (script.IsEmpty()) {
exit(1);
return;
}
v8::Handle<v8::Value> 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<v8::Object> exports, v8::Local<v8::Object> 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::Function>, v8::Handle<v8::Object>, v8::Handle<v8::Object>);
init_t func = (init_t) dlsym(handle, "init");
if (!func) {
uwsgi_log("unable to find teajs module init function\n");
return;
}
func(v8::Handle<v8::Function>::Cast(v8::Context::GetCurrent()->Global()->Get(v8::String::New("require"))), exports, module);
}
static v8::Handle<v8::Value> 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<v8::Object> exports = v8::Object::New();
v8::Context::GetCurrent()->Global()->Set(v8::String::New("exports"), exports);
v8::Local<v8::Object> 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<v8::Value> 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<v8::Value> 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<v8::Value> 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<v8::Value> uwsgi_v8_commonjs_require(const v8::Arguments& args
return v8::Undefined();
}
void uwsgi_v8_add_commonjs(v8::Handle<v8::ObjectTemplate> global) {
global->Set(v8::String::New("require"), v8::FunctionTemplate::New(uwsgi_v8_commonjs_require));
void uwsgi_v8_fill_commonjs(v8::Persistent<v8::Context> context) {
context->Enter();
v8::Handle<v8::Object> system = context->Global()->Get(v8::String::New("system"))->ToObject();
v8::Handle<v8::Array> args = v8::Array::New();
int i;
for(i=0;i<uwsgi.argc;i++) {
args->Set(v8::Integer::New(i), v8::String::New(uwsgi.argv[i]));
}
system->Set(v8::String::New("args"), args);
v8::Handle<v8::Object> env = v8::Object::New();
system->Set(v8::String::New("env"), env);
}
void uwsgi_v8_add_commonjs(v8::Handle<v8::ObjectTemplate> 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<v8::ObjectTemplate> system = v8::ObjectTemplate::New();
global->Set(v8::String::New("system"), system);
}
+4
View File
@@ -135,6 +135,7 @@ static v8::Handle<v8::Value> uwsgi_v8_api_log(const v8::Arguments& args) {
}
void uwsgi_v8_add_commonjs(v8::Handle<v8::ObjectTemplate>);
void uwsgi_v8_fill_commonjs(v8::Persistent<v8::Context>);
static v8::Persistent<v8::Context> uwsgi_v8_new_isolate(int core_id) {
// create a new isolate
@@ -159,6 +160,9 @@ static v8::Persistent<v8::Context> uwsgi_v8_new_isolate(int core_id) {
// create a new context
v8::Persistent<v8::Context> context = v8::Context::New(NULL, global);
uwsgi_v8_fill_commonjs(context);
return context;
}
+40 -76
View File
@@ -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 *);