You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ga...@apache.org on 2017/05/08 17:50:25 UTC

[trafficserver] branch master updated: coverity 1021925: Missing break in switch

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

gancho 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  31be131   coverity 1021925: Missing break in switch
31be131 is described below

commit 31be1319223d111e9a5509300b0d463e832f2567
Author: Gancho Tenev <ga...@apache.com>
AuthorDate: Mon May 8 10:33:33 2017 -0700

    coverity 1021925: Missing break in switch
    
    Problem:
      CID 1021925 (#1 of 1): Missing break in switch (MISSING_BREAK)
      unterminated_case: The case for value TS_EVENT_VCONN_WRITE_COMPLETE is not terminated by a 'break' statement.
    
    Solution:
      It was intended not to have a break (not a bug), so refactored the code to make coverity happy.
---
 example/cache_scan/cache_scan.cc | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/example/cache_scan/cache_scan.cc b/example/cache_scan/cache_scan.cc
index 9172aca..f14e96e 100644
--- a/example/cache_scan/cache_scan.cc
+++ b/example/cache_scan/cache_scan.cc
@@ -281,7 +281,7 @@ handle_io(TSCont contp, TSEvent event, void * /* edata ATS_UNUSED */)
     }
 
     return 0;
-  }
+  } break;
   case TS_EVENT_VCONN_WRITE_READY: {
     TSDebug(PLUGIN_NAME, "ndone: %" PRId64 " total_bytes: % " PRId64, TSVIONDoneGet(cstate->write_vio), cstate->total_bytes);
     cstate->write_pending = false;
@@ -289,13 +289,17 @@ handle_io(TSCont contp, TSEvent event, void * /* edata ATS_UNUSED */)
     // available data
     // TSVIOReenable(cstate->write_vio);
     return 0;
-  }
-  case TS_EVENT_VCONN_WRITE_COMPLETE:
+  } break;
+  case TS_EVENT_VCONN_WRITE_COMPLETE: {
     TSDebug(PLUGIN_NAME, "write complete");
+    cstate->done = 1;
+    cleanup(contp);
+  } break;
   case TS_EVENT_VCONN_EOS:
-  default:
+  default: {
     cstate->done = 1;
     cleanup(contp);
+  } break;
   }
 
   return 0;

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].