* Returns CURLcode
*/
CURLcode Curl_add_buffer_send(Curl_send_buffer *in,
- struct connectdata *conn,
- long *bytes_written, /* add the number of sent bytes
- to this counter */
- size_t included_body_bytes, /* how much of the buffer
- contains body data */
- int socketindex)
+ struct connectdata *conn,
+
+ /* add the number of sent bytes to this
+ counter */
+ long *bytes_written,
+
+ /* how much of the buffer contains body data */
+ size_t included_body_bytes,
+ int socketindex)
{
ssize_t amount;
accordingly */
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((size_t)amount != size) {
if(CURLE_OK == result) {
/* Now send off the request */
result = Curl_add_buffer_send(req_buffer, conn,
- &data->info.request_size, 0, sockindex);
+ &data->info.request_size, 0, sockindex);
}
req_buffer = NULL;
if(result)
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_send(Curl_send_buffer *in,
- struct connectdata *conn,
- long *bytes_written,
- size_t included_body_bytes,
- int socketindex);
-
+ struct connectdata *conn,
+ long *bytes_written,
+ size_t included_body_bytes,
+ int socketindex);
CURLcode Curl_add_timecondition(struct SessionHandle *data,
Curl_send_buffer *buf);