From 570dcde6546e0dd9537c63c05e45bca8b92cebad Mon Sep 17 00:00:00 2001 From: "roberto@mercury" Date: Fri, 16 Mar 2012 06:52:48 +0100 Subject: [PATCH] report listen_queue_errors --- master_utils.c | 5 +++-- plugins/cheaper_backlog2/cheaper_backlog2.c | 2 +- plugins/python/uwsgi_pymodule.c | 2 +- uwsgi.c | 2 ++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/master_utils.c b/master_utils.c index c1eda885..1d670c91 100644 --- a/master_utils.c +++ b/master_utils.c @@ -178,7 +178,7 @@ int uwsgi_cheaper_algo_backlog(void) { int i; #ifdef __linux__ - int backlog = uwsgi.shared->ti.tcpi_unacked; + int backlog = uwsgi.shared->options[UWSGI_OPTION_BACKLOG_STATUS]; #else int backlog = 0; #endif @@ -671,7 +671,8 @@ void uwsgi_send_stats(int fd) { stats_send("{ \"version\": \"%s\",\n", UWSGI_VERSION); #ifdef __linux__ - stats_send_llu("\"listen_queue\": %llu,\n", uwsgi.shared->ti.tcpi_unacked); + stats_send_llu("\"listen_queue\": %llu,\n", (unsigned long long) uwsgi.shared->options[UWSGI_OPTION_BACKLOG_STATUS]); + stats_send_llu("\"listen_queue_errors\": %llu,\n", (unsigned long long) uwsgi.shared->options[UWSGI_OPTION_BACKLOG_ERRORS]); #endif stats_send_llu("\"load\": %llu,\n", uwsgi.shared->load); diff --git a/plugins/cheaper_backlog2/cheaper_backlog2.c b/plugins/cheaper_backlog2/cheaper_backlog2.c index 9fb42654..5cce8a08 100644 --- a/plugins/cheaper_backlog2/cheaper_backlog2.c +++ b/plugins/cheaper_backlog2/cheaper_backlog2.c @@ -17,7 +17,7 @@ int cheaper_backlog2_algo(void) { int i; #ifdef __linux__ - int backlog = uwsgi.shared->ti.tcpi_unacked; + int backlog = uwsgi.shared->options[UWSGI_OPTION_BACKLOG_STATUS]; #else int backlog = 0; #endif diff --git a/plugins/python/uwsgi_pymodule.c b/plugins/python/uwsgi_pymodule.c index cfb40fe4..84b55afd 100644 --- a/plugins/python/uwsgi_pymodule.c +++ b/plugins/python/uwsgi_pymodule.c @@ -171,7 +171,7 @@ char *uwsgi_encode_pydict(PyObject * pydict, uint16_t * size) { PyObject *py_uwsgi_listen_queue(PyObject * self, PyObject * args) { #ifdef __linux__ - return PyInt_FromLong(uwsgi.shared->ti.tcpi_unacked); + return PyInt_FromLong(uwsgi.shared->options[UWSGI_OPTION_BACKLOG_STATUS]); #else return NULL; #endif diff --git a/uwsgi.c b/uwsgi.c index 7354ac0b..cddff5c5 100644 --- a/uwsgi.c +++ b/uwsgi.c @@ -2220,10 +2220,12 @@ int uwsgi_start(void *v_argv) { if (!getsockname(0, gsa.sa, &socket_type_len)) { if (gsa.sa->sa_family == AF_UNIX) { uwsgi_sock = uwsgi_new_socket(usa.sa_un.sun_path); + uwsgi_sock->family = AF_UNIX; uwsgi_log("uwsgi socket %d inherited UNIX address %s fd 0\n", uwsgi_get_socket_num(uwsgi_sock), uwsgi_sock->name); } else { uwsgi_sock = uwsgi_new_socket(uwsgi_concat2("::","")); + uwsgi_sock->family = AF_INET; uwsgi_log("uwsgi socket %d inherited INET address %s fd 0\n", uwsgi_get_socket_num(uwsgi_sock), uwsgi_sock->name); } }