Latest update - 7320
This commit is contained in:
@@ -187,6 +187,7 @@ static void ngx_http_upstream_ssl_init_connection(ngx_http_request_t *,
|
||||
static void ngx_http_upstream_ssl_handshake_handler(ngx_connection_t *c);
|
||||
static void ngx_http_upstream_ssl_handshake(ngx_http_request_t *,
|
||||
ngx_http_upstream_t *u, ngx_connection_t *c);
|
||||
static void ngx_http_upstream_ssl_save_session(ngx_connection_t *c);
|
||||
static ngx_int_t ngx_http_upstream_ssl_name(ngx_http_request_t *r,
|
||||
ngx_http_upstream_t *u, ngx_connection_t *c);
|
||||
#endif
|
||||
@@ -1675,6 +1676,8 @@ ngx_http_upstream_ssl_init_connection(ngx_http_request_t *r,
|
||||
}
|
||||
|
||||
if (u->conf->ssl_session_reuse) {
|
||||
c->ssl->save_session = ngx_http_upstream_ssl_save_session;
|
||||
|
||||
if (u->peer.set_session(&u->peer, u->peer.data) != NGX_OK) {
|
||||
ngx_http_upstream_finalize_request(r, u,
|
||||
NGX_HTTP_INTERNAL_SERVER_ERROR);
|
||||
@@ -1759,10 +1762,6 @@ ngx_http_upstream_ssl_handshake(ngx_http_request_t *r, ngx_http_upstream_t *u,
|
||||
}
|
||||
}
|
||||
|
||||
if (u->conf->ssl_session_reuse) {
|
||||
u->peer.save_session(&u->peer, u->peer.data);
|
||||
}
|
||||
|
||||
c->write->handler = ngx_http_upstream_handler;
|
||||
c->read->handler = ngx_http_upstream_handler;
|
||||
|
||||
@@ -1782,6 +1781,27 @@ failed:
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ngx_http_upstream_ssl_save_session(ngx_connection_t *c)
|
||||
{
|
||||
ngx_http_request_t *r;
|
||||
ngx_http_upstream_t *u;
|
||||
|
||||
if (c->idle) {
|
||||
return;
|
||||
}
|
||||
|
||||
r = c->data;
|
||||
|
||||
u = r->upstream;
|
||||
c = r->connection;
|
||||
|
||||
ngx_http_set_log_request(c->log, r);
|
||||
|
||||
u->peer.save_session(&u->peer, u->peer.data);
|
||||
}
|
||||
|
||||
|
||||
static ngx_int_t
|
||||
ngx_http_upstream_ssl_name(ngx_http_request_t *r, ngx_http_upstream_t *u,
|
||||
ngx_connection_t *c)
|
||||
|
||||
Reference in New Issue
Block a user