mirror of
https://github.com/moparisthebest/curl
synced 2025-01-03 09:58:02 -05:00
Explicit typecast for Curl_debug() size argument
This commit is contained in:
parent
44ffe0dc79
commit
ec956b0334
12
lib/ftp.c
12
lib/ftp.c
@ -341,7 +341,7 @@ static CURLcode ftp_readresp(curl_socket_t sockfd,
|
|||||||
/* output debug output if that is requested */
|
/* output debug output if that is requested */
|
||||||
if(data->set.verbose)
|
if(data->set.verbose)
|
||||||
Curl_debug(data, CURLINFO_HEADER_IN,
|
Curl_debug(data, CURLINFO_HEADER_IN,
|
||||||
ftpc->linestart_resp, perline, conn);
|
ftpc->linestart_resp, (size_t)perline, conn);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We pass all response-lines to the callback function registered
|
* We pass all response-lines to the callback function registered
|
||||||
@ -573,7 +573,8 @@ CURLcode Curl_GetFTPResponse(ssize_t *nreadp, /* return number of bytes read */
|
|||||||
|
|
||||||
/* output debug output if that is requested */
|
/* output debug output if that is requested */
|
||||||
if(data->set.verbose)
|
if(data->set.verbose)
|
||||||
Curl_debug(data, CURLINFO_HEADER_IN, line_start, perline, conn);
|
Curl_debug(data, CURLINFO_HEADER_IN,
|
||||||
|
line_start, (size_t)perline, conn);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We pass all response-lines to the callback function registered
|
* We pass all response-lines to the callback function registered
|
||||||
@ -3432,8 +3433,8 @@ CURLcode Curl_nbftpsendf(struct connectdata *conn,
|
|||||||
return res;
|
return res;
|
||||||
|
|
||||||
if(conn->data->set.verbose)
|
if(conn->data->set.verbose)
|
||||||
Curl_debug(conn->data, CURLINFO_HEADER_OUT, sptr, bytes_written,
|
Curl_debug(conn->data, CURLINFO_HEADER_OUT,
|
||||||
conn);
|
sptr, (size_t)bytes_written, conn);
|
||||||
|
|
||||||
if(bytes_written != (ssize_t)write_len) {
|
if(bytes_written != (ssize_t)write_len) {
|
||||||
/* the whole chunk was not sent, store the rest of the data */
|
/* the whole chunk was not sent, store the rest of the data */
|
||||||
@ -3490,7 +3491,8 @@ CURLcode Curl_ftpsendf(struct connectdata *conn,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
if(conn->data->set.verbose)
|
if(conn->data->set.verbose)
|
||||||
Curl_debug(conn->data, CURLINFO_HEADER_OUT, sptr, bytes_written, conn);
|
Curl_debug(conn->data, CURLINFO_HEADER_OUT,
|
||||||
|
sptr, (size_t)bytes_written, conn);
|
||||||
|
|
||||||
if(bytes_written != (ssize_t)write_len) {
|
if(bytes_written != (ssize_t)write_len) {
|
||||||
write_len -= bytes_written;
|
write_len -= bytes_written;
|
||||||
|
@ -901,10 +901,11 @@ CURLcode add_buffer_send(send_buffer *in,
|
|||||||
if(conn->data->set.verbose) {
|
if(conn->data->set.verbose) {
|
||||||
/* this data _may_ contain binary stuff */
|
/* this data _may_ contain binary stuff */
|
||||||
Curl_debug(conn->data, CURLINFO_HEADER_OUT, ptr,
|
Curl_debug(conn->data, CURLINFO_HEADER_OUT, ptr,
|
||||||
amount-included_body_bytes, conn);
|
(size_t)(amount-included_body_bytes), conn);
|
||||||
if (included_body_bytes)
|
if (included_body_bytes)
|
||||||
Curl_debug(conn->data, CURLINFO_DATA_OUT,
|
Curl_debug(conn->data, CURLINFO_DATA_OUT,
|
||||||
ptr+amount-included_body_bytes, included_body_bytes, conn);
|
ptr+amount-included_body_bytes,
|
||||||
|
(size_t)included_body_bytes, conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
*bytes_written += amount;
|
*bytes_written += amount;
|
||||||
@ -1257,8 +1258,8 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
|
|||||||
|
|
||||||
/* output debug if that is requested */
|
/* output debug if that is requested */
|
||||||
if(data->set.verbose)
|
if(data->set.verbose)
|
||||||
Curl_debug(data, CURLINFO_HEADER_IN, line_start, perline,
|
Curl_debug(data, CURLINFO_HEADER_IN,
|
||||||
conn);
|
line_start, (size_t)perline, conn);
|
||||||
|
|
||||||
/* send the header to the callback */
|
/* send the header to the callback */
|
||||||
writetype = CLIENTWRITE_HEADER;
|
writetype = CLIENTWRITE_HEADER;
|
||||||
|
@ -228,11 +228,13 @@ void Curl_infof(struct SessionHandle *data, const char *fmt, ...)
|
|||||||
{
|
{
|
||||||
if(data && data->set.verbose) {
|
if(data && data->set.verbose) {
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
size_t len;
|
||||||
char print_buffer[1024 + 1];
|
char print_buffer[1024 + 1];
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
vsnprintf(print_buffer, 1024, fmt, ap);
|
vsnprintf(print_buffer, 1024, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
Curl_debug(data, CURLINFO_TEXT, print_buffer, strlen(print_buffer), NULL);
|
len = strlen(print_buffer);
|
||||||
|
Curl_debug(data, CURLINFO_TEXT, print_buffer, len, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -293,7 +295,7 @@ CURLcode Curl_sendf(curl_socket_t sockfd, struct connectdata *conn,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
if(data->set.verbose)
|
if(data->set.verbose)
|
||||||
Curl_debug(data, CURLINFO_DATA_OUT, sptr, bytes_written, conn);
|
Curl_debug(data, CURLINFO_DATA_OUT, sptr, (size_t)bytes_written, conn);
|
||||||
|
|
||||||
if((size_t)bytes_written != write_len) {
|
if((size_t)bytes_written != write_len) {
|
||||||
/* if not all was written at once, we must advance the pointer, decrease
|
/* if not all was written at once, we must advance the pointer, decrease
|
||||||
|
@ -1151,7 +1151,7 @@ static void ssl_tls_trace(int direction, int ssl_ver, int content_type,
|
|||||||
|
|
||||||
txt_len = snprintf(ssl_buf, sizeof(ssl_buf), "SSLv%c, %s%s (%d):\n",
|
txt_len = snprintf(ssl_buf, sizeof(ssl_buf), "SSLv%c, %s%s (%d):\n",
|
||||||
ver, tls_rt_name, msg_name, msg_type);
|
ver, tls_rt_name, msg_name, msg_type);
|
||||||
Curl_debug(data, CURLINFO_TEXT, ssl_buf, txt_len, NULL);
|
Curl_debug(data, CURLINFO_TEXT, ssl_buf, (size_t)txt_len, NULL);
|
||||||
|
|
||||||
Curl_debug(data, (direction == 1) ? CURLINFO_SSL_DATA_OUT :
|
Curl_debug(data, (direction == 1) ? CURLINFO_SSL_DATA_OUT :
|
||||||
CURLINFO_SSL_DATA_IN, (char *)buf, len, NULL);
|
CURLINFO_SSL_DATA_IN, (char *)buf, len, NULL);
|
||||||
|
@ -992,7 +992,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||||||
|
|
||||||
if(data->set.verbose)
|
if(data->set.verbose)
|
||||||
Curl_debug(data, CURLINFO_HEADER_IN,
|
Curl_debug(data, CURLINFO_HEADER_IN,
|
||||||
k->p, k->hbuflen, conn);
|
k->p, (size_t)k->hbuflen, conn);
|
||||||
|
|
||||||
result = Curl_client_write(conn, writetype, k->p, k->hbuflen);
|
result = Curl_client_write(conn, writetype, k->p, k->hbuflen);
|
||||||
if(result)
|
if(result)
|
||||||
@ -1089,12 +1089,14 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||||||
if(data->set.verbose) {
|
if(data->set.verbose) {
|
||||||
if(k->badheader) {
|
if(k->badheader) {
|
||||||
Curl_debug(data, CURLINFO_DATA_IN, data->state.headerbuff,
|
Curl_debug(data, CURLINFO_DATA_IN, data->state.headerbuff,
|
||||||
k->hbuflen, conn);
|
(size_t)k->hbuflen, conn);
|
||||||
if(k->badheader == HEADER_PARTHEADER)
|
if(k->badheader == HEADER_PARTHEADER)
|
||||||
Curl_debug(data, CURLINFO_DATA_IN, k->str, nread, conn);
|
Curl_debug(data, CURLINFO_DATA_IN,
|
||||||
|
k->str, (size_t)nread, conn);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Curl_debug(data, CURLINFO_DATA_IN, k->str, nread, conn);
|
Curl_debug(data, CURLINFO_DATA_IN,
|
||||||
|
k->str, (size_t)nread, conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CURL_DISABLE_HTTP
|
#ifndef CURL_DISABLE_HTTP
|
||||||
@ -1354,7 +1356,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||||||
if(data->set.verbose)
|
if(data->set.verbose)
|
||||||
/* show the data before we change the pointer upload_fromhere */
|
/* show the data before we change the pointer upload_fromhere */
|
||||||
Curl_debug(data, CURLINFO_DATA_OUT, data->reqdata.upload_fromhere,
|
Curl_debug(data, CURLINFO_DATA_OUT, data->reqdata.upload_fromhere,
|
||||||
bytes_written, conn);
|
(size_t)bytes_written, conn);
|
||||||
|
|
||||||
if(data->reqdata.upload_present != bytes_written) {
|
if(data->reqdata.upload_present != bytes_written) {
|
||||||
/* we only wrote a part of the buffer (if anything), deal with it! */
|
/* we only wrote a part of the buffer (if anything), deal with it! */
|
||||||
|
Loading…
Reference in New Issue
Block a user