mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
add_buffer_send: fix compiler warning
Win64's 32 bit long but 64 bit size_t caused a warning that we avoid with a typecast. A small whitespace indent fix was also applied. Reported by: Adam Light
This commit is contained in:
parent
7738b15977
commit
6d2ccfed48
22
lib/http.c
22
lib/http.c
@ -977,12 +977,15 @@ Curl_send_buffer *Curl_add_buffer_init(void)
|
|||||||
* Returns CURLcode
|
* Returns CURLcode
|
||||||
*/
|
*/
|
||||||
CURLcode Curl_add_buffer_send(Curl_send_buffer *in,
|
CURLcode Curl_add_buffer_send(Curl_send_buffer *in,
|
||||||
struct connectdata *conn,
|
struct connectdata *conn,
|
||||||
long *bytes_written, /* add the number of sent bytes
|
|
||||||
to this counter */
|
/* add the number of sent bytes to this
|
||||||
size_t included_body_bytes, /* how much of the buffer
|
counter */
|
||||||
contains body data */
|
long *bytes_written,
|
||||||
int socketindex)
|
|
||||||
|
/* how much of the buffer contains body data */
|
||||||
|
size_t included_body_bytes,
|
||||||
|
int socketindex)
|
||||||
|
|
||||||
{
|
{
|
||||||
ssize_t amount;
|
ssize_t amount;
|
||||||
@ -1069,7 +1072,10 @@ CURLcode Curl_add_buffer_send(Curl_send_buffer *in,
|
|||||||
accordingly */
|
accordingly */
|
||||||
http->writebytecount += bodylen;
|
http->writebytecount += bodylen;
|
||||||
|
|
||||||
*bytes_written += amount;
|
/* 'amount' can never be a very large value here so typecasting it so a
|
||||||
|
signed 31 bit value should not cause problems even if ssize_t is
|
||||||
|
64bit */
|
||||||
|
*bytes_written += (long)amount;
|
||||||
|
|
||||||
if(http) {
|
if(http) {
|
||||||
if((size_t)amount != size) {
|
if((size_t)amount != size) {
|
||||||
@ -1380,7 +1386,7 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
|
|||||||
if(CURLE_OK == result) {
|
if(CURLE_OK == result) {
|
||||||
/* Now send off the request */
|
/* Now send off the request */
|
||||||
result = Curl_add_buffer_send(req_buffer, conn,
|
result = Curl_add_buffer_send(req_buffer, conn,
|
||||||
&data->info.request_size, 0, sockindex);
|
&data->info.request_size, 0, sockindex);
|
||||||
}
|
}
|
||||||
req_buffer = NULL;
|
req_buffer = NULL;
|
||||||
if(result)
|
if(result)
|
||||||
|
@ -56,11 +56,10 @@ Curl_send_buffer *Curl_add_buffer_init(void);
|
|||||||
CURLcode Curl_add_bufferf(Curl_send_buffer *in, const char *fmt, ...);
|
CURLcode Curl_add_bufferf(Curl_send_buffer *in, const char *fmt, ...);
|
||||||
CURLcode Curl_add_buffer(Curl_send_buffer *in, const void *inptr, size_t size);
|
CURLcode Curl_add_buffer(Curl_send_buffer *in, const void *inptr, size_t size);
|
||||||
CURLcode Curl_add_buffer_send(Curl_send_buffer *in,
|
CURLcode Curl_add_buffer_send(Curl_send_buffer *in,
|
||||||
struct connectdata *conn,
|
struct connectdata *conn,
|
||||||
long *bytes_written,
|
long *bytes_written,
|
||||||
size_t included_body_bytes,
|
size_t included_body_bytes,
|
||||||
int socketindex);
|
int socketindex);
|
||||||
|
|
||||||
|
|
||||||
CURLcode Curl_add_timecondition(struct SessionHandle *data,
|
CURLcode Curl_add_timecondition(struct SessionHandle *data,
|
||||||
Curl_send_buffer *buf);
|
Curl_send_buffer *buf);
|
||||||
|
Loading…
Reference in New Issue
Block a user