curl_trace(): eliminate switch fallthrough

Our trace handler is called by curl with a curl_infotype variable to interpret its data field. For most types we print the data and then break out of the switch. But for CURLINFO_TEXT, we print data and then fall through to the "default" case, which does the exact same thing (nothing!) that breaking out of the switch would. This is probably a leftover from an early iteration of the patch where the code after the switch _did_ do something interesting that was unique to the non-text case arms. But in its current form, this fallthrough is merely confusing (and causes gcc's -Wimplicit-fallthrough to complain). Let's make CURLINFO_TEXT like the other case arms, and push the default arm to the end where it's more obviously a catch-all. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Sep 21, 2017 at 02:23 UTC d0e9983980a25e0c398cc03342e5ad22ef85b8a8
1 file changed +4 -3
http.c
+4 -3
@@ -638,9 +638,7 @@ static int curl_trace(CURL *handle, curl_infotype type, char *data, size_t size,
638 switch (type) {
639 case CURLINFO_TEXT:
640 trace_printf_key(&trace_curl, "== Info: %s", data);
641 - default: /* we ignore unknown types by default */
642 - return 0;
643 -
641 + break;
642 case CURLINFO_HEADER_OUT:
643 text = "=> Send header";
644 curl_dump_header(text, (unsigned char *)data, size, DO_FILTER);
@@ -665,6 +663,9 @@ static int curl_trace(CURL *handle, curl_infotype type, char *data, size_t size,
663 text = "<= Recv SSL data";
664 curl_dump_data(text, (unsigned char *)data, size);
665 break;
666 +
667 + default: /* we ignore unknown types by default */
668 + return 0;
669 }
670 return 0;
671 }