Adding fix for uninitialized char *
This commit is contained in:
@@ -8,34 +8,36 @@ using namespace std::chrono_literals;
|
|||||||
static int http_trace(CURL *handle, curl_infotype type, char *data, size_t size,
|
static int http_trace(CURL *handle, curl_infotype type, char *data, size_t size,
|
||||||
void *userp)
|
void *userp)
|
||||||
{
|
{
|
||||||
const char *text;
|
const char *text = "";
|
||||||
(void)handle; /* prevent compiler warning */
|
(void)handle; /* prevent compiler warning */
|
||||||
(void)userp;
|
(void)userp;
|
||||||
|
|
||||||
|
// from curl.h
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case CURLINFO_TEXT:
|
case CURLINFO_TEXT:
|
||||||
fprintf(stderr, "== Info: %s", data);
|
text = "== Info";
|
||||||
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";
|
|
||||||
break;
|
break;
|
||||||
case CURLINFO_HEADER_IN:
|
case CURLINFO_HEADER_IN:
|
||||||
text = "<= Recv header";
|
text = "<= Recv header";
|
||||||
break;
|
break;
|
||||||
|
case CURLINFO_HEADER_OUT:
|
||||||
|
text = "=> Send header";
|
||||||
|
break;
|
||||||
case CURLINFO_DATA_IN:
|
case CURLINFO_DATA_IN:
|
||||||
text = "<= Recv data";
|
text = "<= Recv data";
|
||||||
break;
|
break;
|
||||||
|
case CURLINFO_DATA_OUT:
|
||||||
|
text = "=> Send data";
|
||||||
|
break;
|
||||||
case CURLINFO_SSL_DATA_IN:
|
case CURLINFO_SSL_DATA_IN:
|
||||||
text = "<= Recv SSL data";
|
text = "<= Recv SSL data";
|
||||||
break;
|
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
|
std::cerr << "\n================== " << text
|
||||||
|
|||||||
Reference in New Issue
Block a user