From d6da6848bebbd910f91adead9f1d0a968ddbf026 Mon Sep 17 00:00:00 2001 From: Unbit Date: Sat, 2 Mar 2013 09:54:10 +0100 Subject: [PATCH] manage https re-handshake and fix gevent timeout management --- plugins/gevent/gevent.c | 8 ++++---- plugins/http/http.c | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/plugins/gevent/gevent.c b/plugins/gevent/gevent.c index ed99a510..e451bae6 100644 --- a/plugins/gevent/gevent.c +++ b/plugins/gevent/gevent.c @@ -230,7 +230,7 @@ ssize_t uwsgi_gevent_hook_input_read(struct wsgi_request *wsgi_req, char *tmp_bu } Py_DECREF(ret); - ret = PyObject_CallMethod(timer, "start", "OO", current, timer); + ret = PyObject_CallMethod(timer, "again", "OO", current, timer); if (!ret) { stop_the_watchers_and_clear return -1; @@ -298,7 +298,7 @@ ssize_t uwsgi_gevent_hook_input_readline(struct wsgi_request *wsgi_req, char *re } Py_DECREF(ret); - ret = PyObject_CallMethod(timer, "start", "OO", current, timer); + ret = PyObject_CallMethod(timer, "again", "OO", current, timer); if (!ret) { stop_the_watchers_and_clear return -1; @@ -364,7 +364,7 @@ void uwsgi_gevent_nb_write(struct wsgi_request *wsgi_req, PyObject *str) { } Py_DECREF(ret); - ret = PyObject_CallMethod(timer, "start", "OO", current, timer); + ret = PyObject_CallMethod(timer, "again", "OO", current, timer); if (!ret) { stop_the_watchers_and_clear goto error; @@ -431,7 +431,7 @@ PyObject *uwsgi_gevent_wait(PyObject *watcher, PyObject *timer, PyObject *curren Py_DECREF(ret); // start the timeout handler - ret = PyObject_CallMethod(timer, "start", "OO", current, timer); + ret = PyObject_CallMethod(timer, "again", "OO", current, timer); if (!ret) return NULL; Py_DECREF(ret); diff --git a/plugins/http/http.c b/plugins/http/http.c index d70c5488..c7a8d980 100644 --- a/plugins/http/http.c +++ b/plugins/http/http.c @@ -551,8 +551,8 @@ ssize_t hr_read_ssl_body(struct corerouter_session * cs) { if (err == SSL_ERROR_WANT_READ) { if (cs->event_hook_write) { uwsgi_cr_hook_write(cs, NULL); - uwsgi_cr_hook_read(cs, hr_read_ssl_body); } + uwsgi_cr_hook_read(cs, hr_read_ssl_body); errno = EINPROGRESS; return -1; } @@ -560,8 +560,8 @@ ssize_t hr_read_ssl_body(struct corerouter_session * cs) { else if (err == SSL_ERROR_WANT_WRITE) { if (cs->event_hook_read) { uwsgi_cr_hook_read(cs, NULL); - uwsgi_cr_hook_write(cs, hr_read_ssl_body); } + uwsgi_cr_hook_write(cs, hr_read_ssl_body); errno = EINPROGRESS; return -1; } @@ -625,16 +625,16 @@ ssize_t hr_write_ssl_response(struct corerouter_session * cs) { if (err == SSL_ERROR_WANT_READ) { if (cs->event_hook_write) { uwsgi_cr_hook_write(cs, NULL); - uwsgi_cr_hook_read(cs, hr_write_ssl_response); } + uwsgi_cr_hook_read(cs, hr_write_ssl_response); errno = EINPROGRESS; return -1; } else if (err == SSL_ERROR_WANT_WRITE) { if (cs->event_hook_read) { uwsgi_cr_hook_read(cs, NULL); - uwsgi_cr_hook_write(cs, hr_write_ssl_response); } + uwsgi_cr_hook_write(cs, hr_write_ssl_response); errno = EINPROGRESS; return -1; } @@ -839,16 +839,16 @@ ssize_t hr_send_expect_continue(struct corerouter_session * cs) { if (err == SSL_ERROR_WANT_READ) { if (cs->event_hook_write) { uwsgi_cr_hook_write(cs, NULL); - uwsgi_cr_hook_read(cs, hr_write_ssl_response); } + uwsgi_cr_hook_read(cs, hr_write_ssl_response); errno = EINPROGRESS; return -1; } else if (err == SSL_ERROR_WANT_WRITE) { if (cs->event_hook_read) { uwsgi_cr_hook_read(cs, NULL); - uwsgi_cr_hook_write(cs, hr_write_ssl_response); } + uwsgi_cr_hook_write(cs, hr_write_ssl_response); errno = EINPROGRESS; return -1; } @@ -949,8 +949,8 @@ ssize_t hr_recv_http_ssl(struct corerouter_session * cs) { if (err == SSL_ERROR_WANT_READ) { if (cs->event_hook_write) { uwsgi_cr_hook_write(cs, NULL); - uwsgi_cr_hook_read(cs, hr_recv_http_ssl); } + uwsgi_cr_hook_read(cs, hr_recv_http_ssl); errno = EINPROGRESS; return -1; } @@ -958,8 +958,8 @@ ssize_t hr_recv_http_ssl(struct corerouter_session * cs) { else if (err == SSL_ERROR_WANT_WRITE) { if (cs->event_hook_read) { uwsgi_cr_hook_read(cs, NULL); - uwsgi_cr_hook_write(cs, hr_recv_http_ssl); } + uwsgi_cr_hook_write(cs, hr_recv_http_ssl); errno = EINPROGRESS; return -1; }