httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@apache.org
Subject cvs commit: httpd-2.0/modules/ssl ssl_engine_kernel.c
Date Wed, 13 Mar 2002 06:12:25 GMT
dougm       02/03/12 22:12:25

  Modified:    modules/ssl ssl_engine_kernel.c
  Log:
  SSL_SESSION_id2sz() is somewhat expensive, make sure we only call it
  if SSLLogLevel >= info
  
  Revision  Changes    Path
  1.49      +24 -17    httpd-2.0/modules/ssl/ssl_engine_kernel.c
  
  Index: ssl_engine_kernel.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_kernel.c,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- ssl_engine_kernel.c	13 Mar 2002 05:30:43 -0000	1.48
  +++ ssl_engine_kernel.c	13 Mar 2002 06:12:24 -0000	1.49
  @@ -1605,12 +1605,14 @@
       /*
        * Log this cache operation
        */
  -    ssl_log(s, SSL_LOG_TRACE,
  -            "Inter-Process Session Cache: "
  -            "request=SET status=%s id=%s timeout=%ds (session caching)",
  -            (rc == TRUE ? "OK" : "BAD"),
  -            SSL_SESSION_id2sz(session_id, session_id_length),
  -            (timeout - time(NULL)));
  +    if (sc->nLogLevel >= SSL_LOG_TRACE) {
  +        ssl_log(s, SSL_LOG_TRACE,
  +                "Inter-Process Session Cache: "
  +                "request=SET status=%s id=%s timeout=%ds (session caching)",
  +                (rc == TRUE ? "OK" : "BAD"),
  +                SSL_SESSION_id2sz(session_id, session_id_length),
  +                (timeout - time(NULL)));
  +    }
   
       /*
        * return 0 which means to OpenSSL that the session is still
  @@ -1633,6 +1635,7 @@
       /* Get Apache context back through OpenSSL context */
       conn_rec *conn = (conn_rec *)SSL_get_app_data(ssl);
       server_rec *s  = conn->base_server;
  +    SSLSrvConfigRec *sc = mySrvConfig(s);
       SSL_SESSION *session;
   
       /*
  @@ -1643,16 +1646,15 @@
       /*
        * Log this cache operation
        */
  -    if (session) {
  -        ssl_log(s, SSL_LOG_TRACE, "Inter-Process Session Cache: "
  -                "request=GET status=FOUND id=%s (session reuse)",
  -                SSL_SESSION_id2sz(id, idlen));
  -    }
  -    else {
  +    if (sc->nLogLevel >= SSL_LOG_TRACE) {
  +        const char *status = session ? "FOUND" : "MISSED";
  +        const char *re     = session ? "reuse" : "renewal";
  +
           ssl_log(s, SSL_LOG_TRACE, "Inter-Process Session Cache: "
  -                "request=GET status=MISSED id=%s (session renewal)",
  -                SSL_SESSION_id2sz(id, idlen));
  +                "request=GET status=%s id=%s (session %s)",
  +                status, SSL_SESSION_id2sz(id, idlen), re);
       }
  +
       /*
        * Return NULL or the retrieved SSL_SESSION. But indicate (by
        * setting do_copy to 0) that the reference count on the
  @@ -1674,6 +1676,7 @@
                                          SSL_SESSION *session)
   {
       server_rec *s;
  +    SSLSrvConfigRec *sc;
       unsigned char *session_id;
       unsigned int session_id_length;
   
  @@ -1684,6 +1687,8 @@
           return; /* on server shutdown Apache is already gone */
       }
   
  +    sc = mySrvConfig(s);
  +
       /*
        * Remove the SSL_SESSION from the inter-process cache
        */
  @@ -1695,9 +1700,11 @@
       /*
        * Log this cache operation
        */
  -    ssl_log(s, SSL_LOG_TRACE, "Inter-Process Session Cache: "
  -            "request=REM status=OK id=%s (session dead)",
  -            SSL_SESSION_id2sz(session_id, session_id_length));
  +    if (sc->nLogLevel >= SSL_LOG_TRACE) {
  +        ssl_log(s, SSL_LOG_TRACE, "Inter-Process Session Cache: "
  +                "request=REM status=OK id=%s (session dead)",
  +                SSL_SESSION_id2sz(session_id, session_id_length));
  +    }
   
       return;
   }
  
  
  

Mime
View raw message