You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by rr...@apache.org on 2019/04/26 00:33:34 UTC

[trafficserver] branch master updated: cppcheck: fix comparison issues found in plugins

This is an automated email from the ASF dual-hosted git repository.

rrm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 19d1733  cppcheck:  fix comparison issues found in plugins
19d1733 is described below

commit 19d1733f555bc6cbf0d55e12dbf6eeb81fdd0519
Author: Randall Meyer <ra...@yahoo.com>
AuthorDate: Thu Apr 25 11:26:34 2019 +0800

    cppcheck:  fix comparison issues found in plugins
    
    (style) Condition 'TS_EVENT_VCONN_WRITE_COMPLETE' is always true
---
 plugins/experimental/acme/acme.c          | 2 +-
 plugins/healthchecks/healthchecks.c       | 2 +-
 plugins/stats_over_http/stats_over_http.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/plugins/experimental/acme/acme.c b/plugins/experimental/acme/acme.c
index 32c899d..65507d9 100644
--- a/plugins/experimental/acme/acme.c
+++ b/plugins/experimental/acme/acme.c
@@ -208,7 +208,7 @@ acme_process_write(TSCont contp, TSEvent event, AcmeState *my_state)
 
     TSVIONBytesSet(my_state->write_vio, my_state->output_bytes);
     TSVIOReenable(my_state->write_vio);
-  } else if (TS_EVENT_VCONN_WRITE_COMPLETE) {
+  } else if (event == TS_EVENT_VCONN_WRITE_COMPLETE) {
     cleanup(contp, my_state);
   } else if (event == TS_EVENT_ERROR) {
     TSError("[%s] acme_process_write: Received TS_EVENT_ERROR", PLUGIN_NAME);
diff --git a/plugins/healthchecks/healthchecks.c b/plugins/healthchecks/healthchecks.c
index c2fe095..3fe44b9 100644
--- a/plugins/healthchecks/healthchecks.c
+++ b/plugins/healthchecks/healthchecks.c
@@ -458,7 +458,7 @@ hc_process_write(TSCont contp, TSEvent event, HCState *my_state)
     }
     TSVIONBytesSet(my_state->write_vio, my_state->output_bytes);
     TSVIOReenable(my_state->write_vio);
-  } else if (TS_EVENT_VCONN_WRITE_COMPLETE) {
+  } else if (event == TS_EVENT_VCONN_WRITE_COMPLETE) {
     cleanup(contp, my_state);
   } else if (event == TS_EVENT_ERROR) {
     TSError("[healthchecks] hc_process_write: Received TS_EVENT_ERROR");
diff --git a/plugins/stats_over_http/stats_over_http.c b/plugins/stats_over_http/stats_over_http.c
index 919c394..3f44b68 100644
--- a/plugins/stats_over_http/stats_over_http.c
+++ b/plugins/stats_over_http/stats_over_http.c
@@ -205,7 +205,7 @@ stats_process_write(TSCont contp, TSEvent event, stats_state *my_state)
       TSVIONBytesSet(my_state->write_vio, my_state->output_bytes);
     }
     TSVIOReenable(my_state->write_vio);
-  } else if (TS_EVENT_VCONN_WRITE_COMPLETE) {
+  } else if (event == TS_EVENT_VCONN_WRITE_COMPLETE) {
     stats_cleanup(contp, my_state);
   } else if (event == TS_EVENT_ERROR) {
     TSError("[%s] stats_process_write: Received TS_EVENT_ERROR", PLUGIN_NAME);