mirror of
https://github.com/curl/curl.git
synced 2026-08-26 20:23:32 +03:00
Stefan Krause pointed out a compiler warning with a picky MSCV compiler when
passing a curl_off_t argument to the Curl_read_rewind() function which takes an size_t argument. Curl_read_rewind() also had debug code left in it and it was put in a different source file with no good reason when only used from one single spot.
This commit is contained in:
parent
eb29c5c285
commit
5fd096da8d
4 changed files with 38 additions and 22 deletions
18
lib/sendf.c
18
lib/sendf.c
|
|
@ -455,24 +455,6 @@ CURLcode Curl_client_write(struct connectdata *conn,
|
|||
|
||||
#define MIN(a,b) (a < b ? a : b)
|
||||
|
||||
void Curl_read_rewind(struct connectdata *conn,
|
||||
size_t extraBytesRead)
|
||||
{
|
||||
char buf[512 + 1];
|
||||
size_t bytesToShow;
|
||||
|
||||
conn->read_pos -= extraBytesRead;
|
||||
conn->bits.stream_was_rewound = TRUE;
|
||||
|
||||
bytesToShow = MIN(conn->buf_len - conn->read_pos, sizeof(buf)-1);
|
||||
memcpy(buf, conn->master_buffer + conn->read_pos, bytesToShow);
|
||||
buf[bytesToShow] = '\0';
|
||||
|
||||
DEBUGF(infof(conn->data,
|
||||
"Buffer after stream rewind (read_pos = %d): [%s]",
|
||||
conn->read_pos, buf));
|
||||
}
|
||||
|
||||
/*
|
||||
* Internal read-from-socket function. This is meant to deal with plain
|
||||
* sockets, SSL sockets and kerberos sockets.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue