diff --git a/plugins/psgi/psgi_plugin.c b/plugins/psgi/psgi_plugin.c index d0e6194a..cbb45db7 100644 --- a/plugins/psgi/psgi_plugin.c +++ b/plugins/psgi/psgi_plugin.c @@ -248,7 +248,6 @@ void uwsgi_perl_enable_threads() { int uwsgi_perl_request(struct wsgi_request *wsgi_req) { HV *env; - SV **item; AV *response; @@ -293,11 +292,11 @@ int uwsgi_perl_request(struct wsgi_request *wsgi_req) { for(i=0;ivar_cnt;i++) { if (wsgi_req->hvec[i+1].iov_len > 0) { - item = hv_store(env, wsgi_req->hvec[i].iov_base, wsgi_req->hvec[i].iov_len, - newSVpv(wsgi_req->hvec[i+1].iov_base, wsgi_req->hvec[i+1].iov_len), 0); + if (!hv_store(env, wsgi_req->hvec[i].iov_base, wsgi_req->hvec[i].iov_len, + newSVpv(wsgi_req->hvec[i+1].iov_base, wsgi_req->hvec[i+1].iov_len), 0)) goto clear; } else { - item = hv_store(env, wsgi_req->hvec[i].iov_base, wsgi_req->hvec[i].iov_len, newSVpv("", 0), 0); + if (!hv_store(env, wsgi_req->hvec[i].iov_base, wsgi_req->hvec[i].iov_len, newSVpv("", 0), 0)) goto clear; } //uwsgi_log("%.*s = %.*s\n", wsgi_req->hvec[i].iov_len, wsgi_req->hvec[i].iov_base, wsgi_req->hvec[i+1].iov_len, wsgi_req->hvec[i+1].iov_base); i++; @@ -305,7 +304,7 @@ int uwsgi_perl_request(struct wsgi_request *wsgi_req) { SV *us = newSVpv("http", 4); - item = hv_store(env, "psgi.url_scheme", 15, us, 0); + if (!hv_store(env, "psgi.url_scheme", 15, us, 0)) goto clear; SV* iohandle = newSVpv( "IO::Handle", 10 ); @@ -330,7 +329,7 @@ int uwsgi_perl_request(struct wsgi_request *wsgi_req) { SV *pi = SvREFCNT_inc(POPs); - item = hv_store(env, "psgi.input", 10, pi, 0); + if (!hv_store(env, "psgi.input", 10, pi, 0)) goto clear; PUSHMARK(SP); @@ -349,7 +348,7 @@ int uwsgi_perl_request(struct wsgi_request *wsgi_req) { SPAGAIN; SV *pe = SvREFCNT_inc(POPs); - item = hv_store(env, "psgi.errors", 11, pe, 0); + if (!hv_store(env, "psgi.errors", 11, pe, 0)) goto clear; PUSHMARK(SP); diff --git a/plugins/psgi/uwsgi_plmodule.c b/plugins/psgi/uwsgi_plmodule.c index 01aa881e..faf8733f 100644 --- a/plugins/psgi/uwsgi_plmodule.c +++ b/plugins/psgi/uwsgi_plmodule.c @@ -4,7 +4,8 @@ extern struct uwsgi_server uwsgi; XS(XS_reload) { dXSARGS; - items = 0; + + psgi_check_args(0); uwsgi_log("SENDING HUP TO %d\n", (int) uwsgi.workers[0].pid); if (kill(uwsgi.workers[0].pid, SIGHUP)) { diff --git a/plugins/python/uwsgi_pymodule.c b/plugins/python/uwsgi_pymodule.c index 7243ca79..c4c6927b 100644 --- a/plugins/python/uwsgi_pymodule.c +++ b/plugins/python/uwsgi_pymodule.c @@ -1660,8 +1660,6 @@ PyObject *py_uwsgi_async_send_message(PyObject * self, PyObject * args) { int modifier1 = 0; int modifier2 = 0; - ssize_t ret; - char *encoded; uint16_t esize = 0; @@ -1676,14 +1674,14 @@ PyObject *py_uwsgi_async_send_message(PyObject * self, PyObject * args) { if (PyDict_Check(pyobj)) { encoded = uwsgi_encode_pydict(pyobj, &esize); if (esize > 0) { - UWSGI_RELEASE_GIL ret = uwsgi_send_message(uwsgi_fd, (uint8_t) modifier1, (uint8_t) modifier2, encoded, esize, -1, 0, 0); + UWSGI_RELEASE_GIL uwsgi_send_message(uwsgi_fd, (uint8_t) modifier1, (uint8_t) modifier2, encoded, esize, -1, 0, 0); free(encoded); } } else if (PyString_Check(pyobj)) { encoded = PyString_AsString(pyobj); esize = PyString_Size(pyobj); - UWSGI_RELEASE_GIL ret = uwsgi_send_message(uwsgi_fd, (uint8_t) modifier1, (uint8_t) modifier2, encoded, esize, -1, 0, 0); + UWSGI_RELEASE_GIL uwsgi_send_message(uwsgi_fd, (uint8_t) modifier1, (uint8_t) modifier2, encoded, esize, -1, 0, 0); } else { marshalled = PyMarshal_WriteObjectToString(pyobj, 1); @@ -1694,7 +1692,7 @@ PyObject *py_uwsgi_async_send_message(PyObject * self, PyObject * args) { encoded = PyString_AsString(marshalled); esize = PyString_Size(marshalled); - UWSGI_RELEASE_GIL ret = uwsgi_send_message(uwsgi_fd, (uint8_t) modifier1, (uint8_t) modifier2, encoded, esize, -1, 0, 0); + UWSGI_RELEASE_GIL uwsgi_send_message(uwsgi_fd, (uint8_t) modifier1, (uint8_t) modifier2, encoded, esize, -1, 0, 0); } UWSGI_GET_GIL clear: @@ -1804,8 +1802,6 @@ PyObject *py_uwsgi_send_message(PyObject * self, PyObject * args) { int fd = -1; int cl = 0; - ssize_t ret; - int uwsgi_fd = -1; char *encoded; uint16_t esize = 0; @@ -1834,14 +1830,14 @@ PyObject *py_uwsgi_send_message(PyObject * self, PyObject * args) { if (PyDict_Check(pyobj)) { encoded = uwsgi_encode_pydict(pyobj, &esize); if (esize > 0) { - UWSGI_RELEASE_GIL ret = uwsgi_send_message(uwsgi_fd, (uint8_t) modifier1, (uint8_t) modifier2, encoded, esize, fd, cl, timeout); + UWSGI_RELEASE_GIL uwsgi_send_message(uwsgi_fd, (uint8_t) modifier1, (uint8_t) modifier2, encoded, esize, fd, cl, timeout); free(encoded); } } else if (PyString_Check(pyobj)) { encoded = PyString_AsString(pyobj); esize = PyString_Size(pyobj); - UWSGI_RELEASE_GIL ret = uwsgi_send_message(uwsgi_fd, (uint8_t) modifier1, (uint8_t) modifier2, encoded, esize, fd, cl, timeout); + UWSGI_RELEASE_GIL uwsgi_send_message(uwsgi_fd, (uint8_t) modifier1, (uint8_t) modifier2, encoded, esize, fd, cl, timeout); } else { marshalled = PyMarshal_WriteObjectToString(pyobj, 1); @@ -1852,7 +1848,7 @@ PyObject *py_uwsgi_send_message(PyObject * self, PyObject * args) { encoded = PyString_AsString(marshalled); esize = PyString_Size(marshalled); - UWSGI_RELEASE_GIL ret = uwsgi_send_message(uwsgi_fd, (uint8_t) modifier1, (uint8_t) modifier2, encoded, esize, fd, cl, timeout); + UWSGI_RELEASE_GIL uwsgi_send_message(uwsgi_fd, (uint8_t) modifier1, (uint8_t) modifier2, encoded, esize, fd, cl, timeout); } UWSGI_GET_GIL diff --git a/proto/http.c b/proto/http.c index 5d6cd339..39805266 100644 --- a/proto/http.c +++ b/proto/http.c @@ -219,7 +219,6 @@ int uwsgi_proto_http_parser(struct wsgi_request *wsgi_req) { ssize_t len; int j; char *ptr; - int ret; ssize_t remains; // make this buffer configurable char post_buf[8192]; @@ -280,7 +279,7 @@ int uwsgi_proto_http_parser(struct wsgi_request *wsgi_req) { else if (*ptr == '\n' && wsgi_req->proto_parser_status == 3) { ptr++; remains = len - (j + 1); - ret = http_parse(wsgi_req, ptr); + http_parse(wsgi_req, ptr); //is there a Content_Length ? if (wsgi_req->post_cl) { wsgi_req->async_post = tmpfile(); diff --git a/uwsgiconfig.py b/uwsgiconfig.py index c2613295..32d3f855 100644 --- a/uwsgiconfig.py +++ b/uwsgiconfig.py @@ -181,7 +181,7 @@ class uConf(object): self.cflags = self.cflags + [ '-Wextra', '-Wno-unused-parameter', '-Wno-missing-field-initializers' ] self.ldflags = os.environ.get("LDFLAGS", "").split() - self.libs = ['-lpthread', '-rdynamic'] + self.libs = ['-lpthread', '-lm', '-rdynamic'] if uwsgi_os == 'Linux': self.libs.append('-ldl')