[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 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);
[trafficserver] branch master updated: cppcheck: Changed from C casting to C++ casting
This is an automated email from the ASF dual-hosted git repository. bcall 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 0eb7810 cppcheck: Changed from C casting to C++ casting 0eb7810 is described below commit 0eb7810fba923cd66f837991eac9c8f2ef659b42 Author: Bryan Call AuthorDate: Tue Apr 23 13:42:07 2019 +0800 cppcheck: Changed from C casting to C++ casting --- iocore/net/SSLConfig.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iocore/net/SSLConfig.cc b/iocore/net/SSLConfig.cc index 491bd78..ca61712 100644 --- a/iocore/net/SSLConfig.cc +++ b/iocore/net/SSLConfig.cc @@ -475,7 +475,7 @@ SSLConfig::reconfigure() SSLConfigParams * SSLConfig::acquire() { - return ((SSLConfigParams *)configProcessor.get(configid)); + return static_cast(configProcessor.get(configid)); } void @@ -544,7 +544,7 @@ SSLCertificateConfig::reconfigure() SSLCertLookup * SSLCertificateConfig::acquire() { - return (SSLCertLookup *)configProcessor.get(configid); + return static_cast(configProcessor.get(configid)); } void
[trafficserver] branch master updated: Move the delete to please clang-analyzer
This is an automated email from the ASF dual-hosted git repository. bcall 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 83e5b28 Move the delete to please clang-analyzer 83e5b28 is described below commit 83e5b28cfb7612640f462543f47f7080d676da6e Author: Leif Hedstrom AuthorDate: Thu Apr 25 13:28:31 2019 +0800 Move the delete to please clang-analyzer --- proxy/PluginVC.cc | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/proxy/PluginVC.cc b/proxy/PluginVC.cc index 79abc43..569ea85 100644 --- a/proxy/PluginVC.cc +++ b/proxy/PluginVC.cc @@ -1283,7 +1283,7 @@ public: ~PVCTestDriver() override; void start_tests(RegressionTest *r_arg, int *pstatus_arg); - void run_next_test(); + bool run_next_test(); int main_handler(int event, void *data); private: @@ -1307,12 +1307,12 @@ PVCTestDriver::start_tests(RegressionTest *r_arg, int *pstatus_arg) r = r_arg; pstatus = pstatus_arg; - run_next_test(); - - SET_HANDLER(::main_handler); + if (run_next_test()) { +SET_HANDLER(::main_handler); + } } -void +bool PVCTestDriver::run_next_test() { unsigned a_index = i * 2; @@ -1326,7 +1326,7 @@ PVCTestDriver::run_next_test() *pstatus = REGRESSION_TEST_FAILED; } delete this; -return; +return false; } completions_received = 0; i++; @@ -1341,6 +1341,8 @@ PVCTestDriver::run_next_test() PluginVC *a_vc = core->connect(); a->init_test(NET_VC_TEST_ACTIVE, this, a_vc, r, _tests_def[a_index], "PluginVC", "pvc_test_detail"); + + return true; } int