]> git.kaiwu.me - nginx.git/commitdiff
fix build by gcc46 with -Wunused-value option
authorIgor Sysoev <igor@sysoev.ru>
Fri, 22 Jul 2011 10:43:50 +0000 (10:43 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Fri, 22 Jul 2011 10:43:50 +0000 (10:43 +0000)
patch by Maxim Dounin

src/event/ngx_event_openssl.c

index a833640272552d2234be8bbe202cba296deab718..29718174299fcc961811e08d166e9fc13f4bae71 100644 (file)
@@ -1716,20 +1716,24 @@ ngx_ssl_get_cached_session(ngx_ssl_conn_t *ssl_conn, u_char *id, int len,
     ngx_int_t                 rc;
     ngx_shm_zone_t           *shm_zone;
     ngx_slab_pool_t          *shpool;
-    ngx_connection_t         *c;
     ngx_rbtree_node_t        *node, *sentinel;
     ngx_ssl_session_t        *sess;
     ngx_ssl_sess_id_t        *sess_id;
     ngx_ssl_session_cache_t  *cache;
     u_char                    buf[NGX_SSL_MAX_SESSION_SIZE];
-
-    c = ngx_ssl_get_connection(ssl_conn);
+#if (NGX_DEBUG)
+    ngx_connection_t         *c;
+#endif
 
     hash = ngx_crc32_short(id, (size_t) len);
     *copy = 0;
 
+#if (NGX_DEBUG)
+    c = ngx_ssl_get_connection(ssl_conn);
+
     ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
                    "ssl get session: %08XD:%d", hash, len);
+#endif
 
     shm_zone = SSL_CTX_get_ex_data(SSL_get_SSL_CTX(ssl_conn),
                                    ngx_ssl_session_cache_index);