1.0.2+ wont build

Maxim Dounin mdounin at mdounin.ru
Thu Jun 30 16:08:14 MSD 2011


Hello!

On Thu, Jun 30, 2011 at 04:06:37PM +0400, Maxim Dounin wrote:

[...]

> Yes, thank you for report (though it's about gcc 4.6+, not about 
> nginx 1.0.2+).  Try the attached patch.

Oops, forgot to actually attach patch.  Let me try again.

Maxim Dounin
-------------- next part --------------
# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1309424678 -14400
# Node ID 60a67d95638f9187418a3a26c1fcb9f06be7a4fc
# Parent  1c167244d2fdb064c159012c50a7ae3fd1ed254a
Fix another gcc46 unused-but-set warning.

diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c
--- a/src/event/ngx_event_openssl.c
+++ b/src/event/ngx_event_openssl.c
@@ -1687,20 +1687,24 @@ ngx_ssl_get_cached_session(ngx_ssl_conn_
     ngx_int_t                 rc;
     ngx_shm_zone_t           *shm_zone;
     ngx_slab_pool_t          *shpool;
+#if (NGX_DEBUG)
     ngx_connection_t         *c;
+#endif
     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);
-
     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);


More information about the nginx mailing list