Adding fix for uninitialized char *

This commit is contained in:
Ian Roddis
2022-02-24 10:46:52 -04:00
parent 4e5ca633d8
commit 93ab2f38c9

View File

@@ -8,34 +8,36 @@ using namespace std::chrono_literals;
static int http_trace(CURL *handle, curl_infotype type, char *data, size_t size,
void *userp)
{
const char *text;
const char *text = "";
(void)handle; /* prevent compiler warning */
(void)userp;
// from curl.h
switch (type) {
case CURLINFO_TEXT:
fprintf(stderr, "== Info: %s", data);
default: /* in case a new one is introduced to shock us */
return 0;
case CURLINFO_HEADER_OUT:
text = "=> Send header";
break;
case CURLINFO_DATA_OUT:
text = "=> Send data";
break;
case CURLINFO_SSL_DATA_OUT:
text = "=> Send SSL data";
text = "== Info";
break;
case CURLINFO_HEADER_IN:
text = "<= Recv header";
break;
case CURLINFO_HEADER_OUT:
text = "=> Send header";
break;
case CURLINFO_DATA_IN:
text = "<= Recv data";
break;
case CURLINFO_DATA_OUT:
text = "=> Send data";
break;
case CURLINFO_SSL_DATA_IN:
text = "<= Recv SSL data";
break;
case CURLINFO_SSL_DATA_OUT:
text = "=> Send SSL data";
break;
default: /* in case a new one is introduced to shock us */
text = "?? Unknown curl_infotype";
break;
}
std::cerr << "\n================== " << text