manage https re-handshake and fix gevent timeout management

This commit is contained in:
Unbit
2013-03-02 09:54:10 +01:00
parent b1caf56f49
commit d6da6848be
2 changed files with 12 additions and 12 deletions
+4 -4
View File
@@ -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);
+8 -8
View File
@@ -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;
}