From: Stefan Fritsch Date: Sun, 6 Jun 2010 17:01:29 +0000 (+0000) Subject: Use new loglevel accessor macros to simplify code X-Git-Tag: 2.3.6~44 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=af4c0f4923061dde7821b5230f3fd58cb61360b2;p=apache Use new loglevel accessor macros to simplify code git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951896 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/ssl/ssl_engine_io.c b/modules/ssl/ssl_engine_io.c index 8d281ee66c..b641f77bee 100644 --- a/modules/ssl/ssl_engine_io.c +++ b/modules/ssl/ssl_engine_io.c @@ -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); } diff --git a/modules/ssl/ssl_engine_kernel.c b/modules/ssl/ssl_engine_kernel.c index 9bd0373c9a..e0352ab2e5 100644 --- a/modules/ssl/ssl_engine_kernel.c +++ b/modules/ssl/ssl_engine_kernel.c @@ -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); }