]> granicus.if.org Git - apache/commitdiff
util_filter: axe loglevel explicit checks already done by ap_log_cerror().
authorYann Ylavic <ylavic@apache.org>
Wed, 18 Jul 2018 22:43:45 +0000 (22:43 +0000)
committerYann Ylavic <ylavic@apache.org>
Wed, 18 Jul 2018 22:43:45 +0000 (22:43 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1836241 13f79535-47bb-0310-9956-ffa450edef68

server/util_filter.c

index 5d35c96b10133983bdada948a6b39849d4926aae..b1cfb0769ab3b3c0639a51de67070ec4d2af975c 100644 (file)
@@ -761,17 +761,13 @@ AP_DECLARE(int) ap_filter_prepare_brigade(ap_filter_t *f, apr_pool_t **p)
 }
 
 AP_DECLARE(apr_status_t) ap_filter_setaside_brigade(ap_filter_t *f,
-        apr_bucket_brigade *bb)
+                                                    apr_bucket_brigade *bb)
 {
-    int loglevel = ap_get_conn_module_loglevel(f->c, APLOG_MODULE_INDEX);
-
-    if (loglevel >= APLOG_TRACE6) {
-        ap_log_cerror(
-            APLOG_MARK, APLOG_TRACE6, 0, f->c,
-            "setaside %s brigade to %s brigade in '%s' output filter",
-            (APR_BRIGADE_EMPTY(bb) ? "empty" : "full"),
-            (!f->bb || APR_BRIGADE_EMPTY(f->bb) ? "empty" : "full"), f->frec->name);
-    }
+    ap_log_cerror(APLOG_MARK, APLOG_TRACE6, 0, f->c,
+                  "setaside %s brigade to %s brigade in '%s' output filter",
+                  APR_BRIGADE_EMPTY(bb) ? "empty" : "full",
+                  (!f->bb || APR_BRIGADE_EMPTY(f->bb)) ? "empty" : "full",
+                  f->frec->name);
 
     if (!APR_BRIGADE_EMPTY(bb)) {
         /*
@@ -820,17 +816,8 @@ AP_DECLARE(apr_status_t) ap_filter_reinstate_brigade(ap_filter_t *f,
     apr_bucket *bucket, *next;
     apr_size_t bytes_in_brigade, non_file_bytes_in_brigade;
     int eor_buckets_in_brigade, morphing_bucket_in_brigade;
-    int loglevel = ap_get_conn_module_loglevel(f->c, APLOG_MODULE_INDEX);
     core_server_config *conf;
  
-    if (loglevel >= APLOG_TRACE6) {
-        ap_log_cerror(
-            APLOG_MARK, APLOG_TRACE6, 0, f->c,
-            "reinstate %s brigade to %s brigade in '%s' output filter",
-            (!f->bb || APR_BRIGADE_EMPTY(f->bb) ? "empty" : "full"),
-            (APR_BRIGADE_EMPTY(bb) ? "empty" : "full"), f->frec->name);
-    }
-
     if (f->bb && !APR_BRIGADE_EMPTY(f->bb)) {
         APR_BRIGADE_PREPEND(bb, f->bb);
     }
@@ -841,6 +828,12 @@ AP_DECLARE(apr_status_t) ap_filter_reinstate_brigade(ap_filter_t *f,
  
     *flush_upto = NULL;
 
+    ap_log_cerror(APLOG_MARK, APLOG_TRACE6, 0, f->c,
+                  "reinstate %s brigade to %s brigade in '%s' output filter",
+                  (!f->bb || APR_BRIGADE_EMPTY(f->bb) ? "empty" : "full"),
+                  (APR_BRIGADE_EMPTY(bb) ? "empty" : "full"),
+                  f->frec->name);
+
     /*
      * Determine if and up to which bucket we need to do a blocking write:
      *
@@ -907,7 +900,7 @@ AP_DECLARE(apr_status_t) ap_filter_reinstate_brigade(ap_filter_t *f,
             || eor_buckets_in_brigade > conf->flush_max_pipelined) {
             /* this segment of the brigade MUST be sent before returning. */
 
-            if (loglevel >= APLOG_TRACE6) {
+            if (APLOGctrace6(f->c)) {
                 char *reason = APR_BUCKET_IS_FLUSH(bucket) ?
                                "FLUSH bucket" :
                                (non_file_bytes_in_brigade >= conf->flush_max_threshold) ?
@@ -939,14 +932,12 @@ AP_DECLARE(apr_status_t) ap_filter_reinstate_brigade(ap_filter_t *f,
         }
     }
 
-    if (loglevel >= APLOG_TRACE8) {
-        ap_log_cerror(APLOG_MARK, APLOG_TRACE8, 0, f->c,
-                      "brigade contains: bytes: %" APR_SIZE_T_FMT
-                      ", non-file bytes: %" APR_SIZE_T_FMT
-                      ", eor buckets: %d, morphing buckets: %d",
-                      bytes_in_brigade, non_file_bytes_in_brigade,
-                      eor_buckets_in_brigade, morphing_bucket_in_brigade);
-    }
+    ap_log_cerror(APLOG_MARK, APLOG_TRACE8, 0, f->c,
+                  "brigade contains: bytes: %" APR_SIZE_T_FMT
+                  ", non-file bytes: %" APR_SIZE_T_FMT
+                  ", eor buckets: %d, morphing buckets: %d",
+                  bytes_in_brigade, non_file_bytes_in_brigade,
+                  eor_buckets_in_brigade, morphing_bucket_in_brigade);
 
     return APR_SUCCESS;
 }