mirror of
https://github.com/curl/curl.git
synced 2025-01-18 14:04:30 +08:00
sendf: make Curl_debug a void function
As virtually no called checked the return code, and those that did wrongly treated it as a CURLcode. Detected by the icc compiler warning: enumerated type mixed with another type Closes #9179
This commit is contained in:
parent
f273b59144
commit
74d47e22aa
@ -1013,10 +1013,8 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done)
|
||||
/* For HTTP/2, we show the Host: header as if we sent it, to make it look
|
||||
like for HTTP/1 but it isn't actually sent since :authority is then
|
||||
used. */
|
||||
result = Curl_debug(data, CURLINFO_HEADER_OUT, data->state.aptr.host,
|
||||
strlen(data->state.aptr.host));
|
||||
if(result)
|
||||
goto error;
|
||||
Curl_debug(data, CURLINFO_HEADER_OUT, data->state.aptr.host,
|
||||
strlen(data->state.aptr.host));
|
||||
}
|
||||
|
||||
if(data->state.aptr.proxyuserpwd) {
|
||||
@ -1136,9 +1134,7 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done)
|
||||
if(result)
|
||||
goto error;
|
||||
|
||||
result = Curl_debug(data, CURLINFO_HEADER_OUT, (char *)"\r\n", 2);
|
||||
if(result)
|
||||
goto error;
|
||||
Curl_debug(data, CURLINFO_HEADER_OUT, (char *)"\r\n", 2);
|
||||
|
||||
data->req.upload_chunky = FALSE;
|
||||
sendtask = hyper_clientconn_send(client, req);
|
||||
|
@ -393,8 +393,8 @@ static CURLcode CONNECT(struct Curl_easy *data,
|
||||
|
||||
if(!result)
|
||||
/* send to debug callback! */
|
||||
result = Curl_debug(data, CURLINFO_HEADER_OUT,
|
||||
k->upload_fromhere, bytes_written);
|
||||
Curl_debug(data, CURLINFO_HEADER_OUT,
|
||||
k->upload_fromhere, bytes_written);
|
||||
|
||||
s->nsend -= bytes_written;
|
||||
k->upload_fromhere += bytes_written;
|
||||
|
@ -714,16 +714,15 @@ CURLcode Curl_read(struct Curl_easy *data, /* transfer */
|
||||
}
|
||||
|
||||
/* return 0 on success */
|
||||
int Curl_debug(struct Curl_easy *data, curl_infotype type,
|
||||
char *ptr, size_t size)
|
||||
void Curl_debug(struct Curl_easy *data, curl_infotype type,
|
||||
char *ptr, size_t size)
|
||||
{
|
||||
int rc = 0;
|
||||
if(data->set.verbose) {
|
||||
static const char s_infotype[CURLINFO_END][3] = {
|
||||
"* ", "< ", "> ", "{ ", "} ", "{ ", "} " };
|
||||
if(data->set.fdebug) {
|
||||
Curl_set_in_callback(data, true);
|
||||
rc = (*data->set.fdebug)(data, type, ptr, size, data->set.debugdata);
|
||||
(void)(*data->set.fdebug)(data, type, ptr, size, data->set.debugdata);
|
||||
Curl_set_in_callback(data, false);
|
||||
}
|
||||
else {
|
||||
@ -739,5 +738,4 @@ int Curl_debug(struct Curl_easy *data, curl_infotype type,
|
||||
}
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
@ -89,8 +89,8 @@ CURLcode Curl_write_plain(struct Curl_easy *data,
|
||||
ssize_t *written);
|
||||
|
||||
/* the function used to output verbose information */
|
||||
int Curl_debug(struct Curl_easy *data, curl_infotype type,
|
||||
char *ptr, size_t size);
|
||||
void Curl_debug(struct Curl_easy *data, curl_infotype type,
|
||||
char *ptr, size_t size);
|
||||
|
||||
|
||||
#endif /* HEADER_CURL_SENDF_H */
|
||||
|
Loading…
Reference in New Issue
Block a user