summaryrefslogtreecommitdiff
path: root/src/event/ngx_event_openssl.c
diff options
context:
space:
mode:
authornginx <nginx@nginx.org>2014-02-11 13:41:55 +0000
committerJon Kolb <kolbyjack@gmail.com>2014-02-11 13:41:55 +0000
commita4c36cb226a1a4ecd396757ace8c73675e01f6f1 (patch)
treeb053e48f056a57f19159b6d31af933e59861638e /src/event/ngx_event_openssl.c
parent725c7e56ecdd6f7406fd220f5cdd7c9174b808e6 (diff)
downloadnginx-a4c36cb226a1a4ecd396757ace8c73675e01f6f1.tar.gz
Changes with nginx 1.4.5 11 Feb 2014v1.4.5
*) Bugfix: the $ssl_session_id variable contained full session serialized instead of just a session id. Thanks to Ivan Ristić. *) Bugfix: client connections might be immediately closed if deferred accept was used; the bug had appeared in 1.3.15. *) Bugfix: alerts "zero size buf in output" might appear in logs while proxying; the bug had appeared in 1.3.9. *) Bugfix: a segmentation fault might occur in a worker process if the ngx_http_spdy_module was used. *) Bugfix: proxied WebSocket connections might hang right after handshake if the select, poll, or /dev/poll methods were used. *) Bugfix: a timeout might occur while reading client request body in an SSL connection using chunked transfer encoding. *) Bugfix: memory leak in nginx/Windows.
Diffstat (limited to 'src/event/ngx_event_openssl.c')
-rw-r--r--src/event/ngx_event_openssl.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c
index 62ce12c14..915e604bb 100644
--- a/src/event/ngx_event_openssl.c
+++ b/src/event/ngx_event_openssl.c
@@ -965,6 +965,7 @@ ngx_ssl_recv(ngx_connection_t *c, u_char *buf, size_t size)
size -= n;
if (size == 0) {
+ c->read->ready = 1;
return bytes;
}
@@ -974,6 +975,10 @@ ngx_ssl_recv(ngx_connection_t *c, u_char *buf, size_t size)
}
if (bytes) {
+ if (c->ssl->last != NGX_AGAIN) {
+ c->read->ready = 1;
+ }
+
return bytes;
}
@@ -2224,32 +2229,26 @@ ngx_int_t
ngx_ssl_get_session_id(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
{
int len;
- u_char *p, *buf;
+ u_char *buf;
SSL_SESSION *sess;
sess = SSL_get0_session(c->ssl->connection);
-
- len = i2d_SSL_SESSION(sess, NULL);
-
- buf = ngx_alloc(len, c->log);
- if (buf == NULL) {
- return NGX_ERROR;
+ if (sess == NULL) {
+ s->len = 0;
+ return NGX_OK;
}
+ buf = sess->session_id;
+ len = sess->session_id_length;
+
s->len = 2 * len;
s->data = ngx_pnalloc(pool, 2 * len);
if (s->data == NULL) {
- ngx_free(buf);
return NGX_ERROR;
}
- p = buf;
- i2d_SSL_SESSION(sess, &p);
-
ngx_hex_dump(s->data, buf, len);
- ngx_free(buf);
-
return NGX_OK;
}