]> granicus.if.org Git - apache/commitdiff
Use new loglevel accessor macros to simplify code
authorStefan Fritsch <sf@apache.org>
Sun, 6 Jun 2010 17:01:29 +0000 (17:01 +0000)
committerStefan Fritsch <sf@apache.org>
Sun, 6 Jun 2010 17:01:29 +0000 (17:01 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951896 13f79535-47bb-0310-9956-ffa450edef68

modules/ssl/ssl_engine_io.c
modules/ssl/ssl_engine_kernel.c

index 8d281ee66cfbf3609e5c50cda8937fe49b99af92..b641f77beefc472f9694a842c48d88db4409a874 100644 (file)
@@ -1015,7 +1015,7 @@ static void ssl_filter_io_shutdown(ssl_filter_ctx_t *filter_ctx,
     SSL_smart_shutdown(ssl);
 
     /* and finally log the fact that we've closed the connection */
-    if (mySrvFromConn(c)->loglevel >= APLOG_INFO) {
+    if (APLOGcinfo(c)) {
         ap_log_cerror(APLOG_MARK, APLOG_INFO, 0, c,
                       "Connection closed to child %ld with %s shutdown "
                       "(server %s)",
@@ -1740,8 +1740,7 @@ void ssl_io_filter_init(conn_rec *c, request_rec *r, SSL *ssl)
     apr_pool_cleanup_register(c->pool, (void*)filter_ctx,
                               ssl_io_filter_cleanup, apr_pool_cleanup_null);
 
-    if ((s->loglevel >= APLOG_DEBUG)
-         && (sc->ssl_log_level >= SSL_LOG_IO)) {
+    if (APLOGcdebug(c) && (sc->ssl_log_level >= SSL_LOG_IO)) {
         BIO_set_callback(SSL_get_rbio(ssl), ssl_io_data_cb);
         BIO_set_callback_arg(SSL_get_rbio(ssl), (void *)ssl);
     }
index 9bd0373c9abeec7747055a2d3ee5fc00e456afe0..e0352ab2e5c871134d8e6e07dd31f16c6500440d 100644 (file)
@@ -231,8 +231,8 @@ int ssl_hook_ReadReq(request_rec *r)
     /*
      * Log information about incoming HTTPS requests
      */
-    if (r->server->loglevel >= APLOG_INFO && ap_is_initial_req(r)) {
-        ap_log_error(APLOG_MARK, APLOG_INFO, 0, r->server,
+    if (APLOGrinfo(r) && ap_is_initial_req(r)) {
+        ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r,
                      "%s HTTPS request received for child %ld (server %s)",
                      (r->connection->keepalives <= 0 ?
                      "Initial (No.1)" :
@@ -1541,7 +1541,7 @@ int ssl_callback_SSLVerify_CRL(int ok, X509_STORE_CTX *ctx, conn_rec *c)
          * Log information about CRL
          * (A little bit complicated because of ASN.1 and BIOs...)
          */
-        if (s->loglevel >= APLOG_DEBUG) {
+        if (APLOGdebug(s)) {
             char buff[512]; /* should be plenty */
             BIO *bio = BIO_new(BIO_s_mem());
 
@@ -1633,11 +1633,11 @@ int ssl_callback_SSLVerify_CRL(int ok, X509_STORE_CTX *ctx, conn_rec *c)
             ASN1_INTEGER *sn = X509_REVOKED_get_serialNumber(revoked);
 
             if (!ASN1_INTEGER_cmp(sn, X509_get_serialNumber(cert))) {
-                if (s->loglevel >= APLOG_DEBUG) {
+                if (APLOGdebug(s)) {
                     char *cp = X509_NAME_oneline(issuer, NULL, 0);
                     long serial = ASN1_INTEGER_get(sn);
 
-                    ap_log_error(APLOG_MARK, APLOG_INFO, 0, s,
+                    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
                                  "Certificate with serial %ld (0x%lX) "
                                  "revoked per CRL from issuer %s",
                                  serial, serial, cp);
@@ -1669,7 +1669,7 @@ static void modssl_proxy_info_log(server_rec *s,
     X509_NAME *name;
     char *dn;
 
-    if (s->loglevel < APLOG_DEBUG) {
+    if (!APLOGdebug(s)) {
         return;
     }
 
@@ -1766,7 +1766,7 @@ static void ssl_session_log(server_rec *s,
     char buf[SSL_SESSION_ID_STRING_LEN];
     char timeout_str[56] = {'\0'};
 
-    if (s->loglevel < APLOG_DEBUG) {
+    if (!APLOGdebug(s)) {
         return;
     }
 
@@ -2012,7 +2012,7 @@ void ssl_callback_Info(MODSSL_INFO_CB_ARG_TYPE ssl, int where, int rc)
     }
 
     s = mySrvFromConn(c);
-    if (s && s->loglevel >= APLOG_DEBUG) {
+    if (s && APLOGdebug(s)) {
         log_tracing_state(ssl, c, s, where, rc);
     }
 }
@@ -2141,7 +2141,7 @@ static int ssl_find_vhost(void *servername, conn_rec *c, server_rec *s)
          * (and the first vhost doesn't use APLOG_DEBUG), then
          * we need to set that callback here.
          */
-        if (s->loglevel >= APLOG_DEBUG) {
+        if (APLOGdebug(s)) {
             BIO_set_callback(SSL_get_rbio(ssl), ssl_io_data_cb);
             BIO_set_callback_arg(SSL_get_rbio(ssl), (void *)ssl);
         }