Permalink
Browse files

Handle invalid fp->current in SSL hooks, just in case

  • Loading branch information...
1 parent f837eb2 commit 8d3be7ed17b46afb9372509d5926ac4358d51ae3 @gnosek committed Nov 19, 2007
Showing with 6 additions and 0 deletions.
  1. +6 −0 ngx_http_upstream_fair_module.c
@@ -846,6 +846,9 @@ ngx_http_upstream_fair_set_session(ngx_peer_connection_t *pc, void *data)
ngx_ssl_session_t *ssl_session;
ngx_http_upstream_rr_peer_t *peer;
+ if (fp->current == NGX_PEER_INVALID)
+ return NGX_OK;
+
peer = &fp->rrp->peer[fp->current];
/* TODO: threads only mutex */
@@ -872,6 +875,9 @@ ngx_http_upstream_fair_save_session(ngx_peer_connection_t *pc, void *data)
ngx_ssl_session_t *old_ssl_session, *ssl_session;
ngx_http_upstream_rr_peer_t *peer;
+ if (fp->current == NGX_PEER_INVALID)
+ return;
+
ssl_session = ngx_ssl_get_session(pc->connection);
if (ssl_session == NULL) {

0 comments on commit 8d3be7e

Please sign in to comment.