mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-08 06:31:58 +00:00
fixed a couple of leaks spotted by Riccardo and added uwsgi.listen_queue()
This commit is contained in:
@@ -156,6 +156,15 @@ 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);
|
||||
#else
|
||||
return NULL
|
||||
#endif
|
||||
}
|
||||
|
||||
PyObject *py_uwsgi_close(PyObject * self, PyObject * args) {
|
||||
|
||||
int fd;
|
||||
@@ -2122,9 +2131,10 @@ PyObject *py_uwsgi_parse_file(PyObject * self, PyObject * args) {
|
||||
|
||||
}
|
||||
|
||||
goto clear;
|
||||
goto clear2;
|
||||
|
||||
clear3:
|
||||
free(buffer);
|
||||
Py_DECREF(zero);
|
||||
clear2:
|
||||
close(fd);
|
||||
@@ -2307,6 +2317,8 @@ static PyMethodDef uwsgi_advanced_methods[] = {
|
||||
{"send", py_uwsgi_send, METH_VARARGS, ""},
|
||||
{"cl", py_uwsgi_cl, METH_VARARGS, ""},
|
||||
|
||||
{"listen_queue", py_uwsgi_listen_queue, METH_VARARGS, ""},
|
||||
|
||||
{"attach_daemon", py_uwsgi_attach_daemon, METH_VARARGS, ""},
|
||||
|
||||
{"register_signal", py_uwsgi_register_signal, METH_VARARGS, ""},
|
||||
|
||||
Reference in New Issue
Block a user