Skip to content

Commit 31be131

Browse files
Gancho Tenevgtenev
authored andcommitted
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.
1 parent 7bb88a1 commit 31be131

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

example/cache_scan/cache_scan.cc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,21 +281,25 @@ handle_io(TSCont contp, TSEvent event, void * /* edata ATS_UNUSED */)
281281
}
282282

283283
return 0;
284-
}
284+
} break;
285285
case TS_EVENT_VCONN_WRITE_READY: {
286286
TSDebug(PLUGIN_NAME, "ndone: %" PRId64 " total_bytes: % " PRId64, TSVIONDoneGet(cstate->write_vio), cstate->total_bytes);
287287
cstate->write_pending = false;
288288
// the cache scan handler should call vio reenable when there is
289289
// available data
290290
// TSVIOReenable(cstate->write_vio);
291291
return 0;
292-
}
293-
case TS_EVENT_VCONN_WRITE_COMPLETE:
292+
} break;
293+
case TS_EVENT_VCONN_WRITE_COMPLETE: {
294294
TSDebug(PLUGIN_NAME, "write complete");
295+
cstate->done = 1;
296+
cleanup(contp);
297+
} break;
295298
case TS_EVENT_VCONN_EOS:
296-
default:
299+
default: {
297300
cstate->done = 1;
298301
cleanup(contp);
302+
} break;
299303
}
300304

301305
return 0;

0 commit comments

Comments
 (0)