connection: give send methods/prototypes an uint8_t buffer

To conclude changing the send buffer type from `const void *` to `const
uint8_t *`, change the top level send function and its implementations.

Closes #19743
This commit is contained in:
Stefan Eissing 2025-11-28 10:44:05 +01:00 committed by Daniel Stenberg
parent 8c68887d2d
commit 3896152843
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
6 changed files with 11 additions and 10 deletions

View file

@ -242,7 +242,7 @@ CURLcode Curl_cf_recv(struct Curl_easy *data, int num, char *buf,
}
CURLcode Curl_cf_send(struct Curl_easy *data, int num,
const void *mem, size_t len, bool eos,
const uint8_t *mem, size_t len, bool eos,
size_t *pnwritten)
{
struct Curl_cfilter *cf;

View file

@ -508,7 +508,7 @@ CURLcode Curl_cf_recv(struct Curl_easy *data, int sockindex, char *buf,
* in `*pnwritten` or on error.
*/
CURLcode Curl_cf_send(struct Curl_easy *data, int sockindex,
const void *buf, size_t len, bool eos,
const uint8_t *buf, size_t len, bool eos,
size_t *pnwritten);
/**

View file

@ -352,7 +352,7 @@ static CURLcode rtmp_recv(struct Curl_easy *data, int sockindex, char *buf,
}
static CURLcode rtmp_send(struct Curl_easy *data, int sockindex,
const void *buf, size_t len, bool eos,
const uint8_t *buf, size_t len, bool eos,
size_t *pnwritten)
{
struct connectdata *conn = data->conn;

View file

@ -162,7 +162,7 @@ typedef unsigned int curl_prot_t;
/* On error return, the value of `pnwritten` has no meaning */
typedef CURLcode (Curl_send)(struct Curl_easy *data, /* transfer */
int sockindex, /* socketindex */
const void *buf, /* data to write */
const uint8_t *buf, /* data to write */
size_t len, /* amount to send */
bool eos, /* last chunk */
size_t *pnwritten); /* how much sent */

View file

@ -2887,7 +2887,7 @@ static CURLcode scp_done(struct Curl_easy *data, CURLcode status,
}
static CURLcode scp_send(struct Curl_easy *data, int sockindex,
const void *mem, size_t len, bool eos,
const uint8_t *mem, size_t len, bool eos,
size_t *pnwritten)
{
int rc;
@ -3048,7 +3048,7 @@ static CURLcode sftp_done(struct Curl_easy *data, CURLcode status,
/* return number of sent bytes */
static CURLcode sftp_send(struct Curl_easy *data, int sockindex,
const void *mem, size_t len, bool eos,
const uint8_t *mem, size_t len, bool eos,
size_t *pnwritten)
{
struct connectdata *conn = data->conn;

View file

@ -3715,7 +3715,7 @@ static CURLcode scp_done(struct Curl_easy *data, CURLcode status,
}
static CURLcode scp_send(struct Curl_easy *data, int sockindex,
const void *mem, size_t len, bool eos,
const uint8_t *mem, size_t len, bool eos,
size_t *pnwritten)
{
struct connectdata *conn = data->conn;
@ -3731,7 +3731,8 @@ static CURLcode scp_send(struct Curl_easy *data, int sockindex,
return CURLE_FAILED_INIT;
/* libssh2_channel_write() returns int! */
nwritten = (ssize_t) libssh2_channel_write(sshc->ssh_channel, mem, len);
nwritten = (ssize_t) libssh2_channel_write(sshc->ssh_channel,
(const char *)mem, len);
ssh_block2waitfor(data, sshc, (nwritten == LIBSSH2_ERROR_EAGAIN));
@ -3874,7 +3875,7 @@ static CURLcode sftp_done(struct Curl_easy *data, CURLcode status,
/* return number of sent bytes */
static CURLcode sftp_send(struct Curl_easy *data, int sockindex,
const void *mem, size_t len, bool eos,
const uint8_t *mem, size_t len, bool eos,
size_t *pnwritten)
{
struct connectdata *conn = data->conn;
@ -3888,7 +3889,7 @@ static CURLcode sftp_send(struct Curl_easy *data, int sockindex,
if(!sshc)
return CURLE_FAILED_INIT;
nwrite = libssh2_sftp_write(sshc->sftp_handle, mem, len);
nwrite = libssh2_sftp_write(sshc->sftp_handle, (const char *)mem, len);
ssh_block2waitfor(data, sshc, (nwrite == LIBSSH2_ERROR_EAGAIN));