struct h1_tunnel_state *ts,
bool *done)
{
- char *buf = curlx_dyn_ptr(&ts->request_data);
+ uint8_t *buf = curlx_dyn_uptr(&ts->request_data);
size_t request_len = curlx_dyn_len(&ts->request_data);
size_t blen = request_len;
CURLcode result = CURLE_OK;
DEBUGASSERT(blen >= nwritten);
ts->nsent += nwritten;
- Curl_debug(data, CURLINFO_HEADER_OUT, buf, nwritten);
+ Curl_debug(data, CURLINFO_HEADER_OUT, (char *)buf, nwritten);
out:
if(result)
}
static CURLcode proxy_h2_nw_out_writer(void *writer_ctx,
- const unsigned char *buf, size_t buflen,
+ const uint8_t *buf, size_t buflen,
size_t *pnwritten)
{
struct Curl_cfilter *cf = writer_ctx;
if(cf) {
struct Curl_easy *data = CF_DATA_CURRENT(cf);
CURLcode result;
- result = Curl_conn_cf_send(cf->next, data, (const char *)buf, buflen,
+ result = Curl_conn_cf_send(cf->next, data, buf, buflen,
FALSE, pnwritten);
CURL_TRC_CF(data, cf, "[0] nw_out_writer(len=%zu) -> %d, %zu",
buflen, result, *pnwritten);
static CURLcode cf_h2_proxy_send(struct Curl_cfilter *cf,
struct Curl_easy *data,
- const void *buf, size_t len, bool eos,
+ const uint8_t *buf, size_t len, bool eos,
size_t *pnwritten)
{
struct cf_h2_proxy_ctx *ctx = cf->ctx;
if(len > 0) {
size_t nwritten;
result = Curl_conn_cf_send(cf->next, data,
- curlx_dyn_ptr(&ctx->data_out), len, FALSE,
+ curlx_dyn_uptr(&ctx->data_out), len, FALSE,
&nwritten);
if(result) {
if(result != CURLE_AGAIN)
#endif /* USE_WINSOCK */
static CURLcode cf_socket_send(struct Curl_cfilter *cf, struct Curl_easy *data,
- const void *buf, size_t len, bool eos,
+ const uint8_t *buf, size_t len, bool eos,
size_t *pnwritten)
{
struct cf_socket_ctx *ctx = cf->ctx;
}
CURLcode Curl_cf_def_send(struct Curl_cfilter *cf, struct Curl_easy *data,
- const void *buf, size_t len, bool eos,
+ const uint8_t *buf, size_t len, bool eos,
size_t *pnwritten)
{
if(cf->next)
}
static CURLcode cf_bufq_writer(void *writer_ctx,
- const unsigned char *buf, size_t buflen,
+ const uint8_t *buf, size_t buflen,
size_t *pnwritten)
{
struct cf_io_ctx *io = writer_ctx;
- return Curl_conn_cf_send(io->cf, io->data, (const char *)buf,
- buflen, FALSE, pnwritten);
+ return Curl_conn_cf_send(io->cf, io->data, buf, buflen, FALSE, pnwritten);
}
CURLcode Curl_cf_send_bufq(struct Curl_cfilter *cf,
}
CURLcode Curl_conn_cf_send(struct Curl_cfilter *cf, struct Curl_easy *data,
- const void *buf, size_t len, bool eos,
+ const uint8_t *buf, size_t len, bool eos,
size_t *pnwritten)
{
if(cf)
typedef CURLcode Curl_cft_send(struct Curl_cfilter *cf,
struct Curl_easy *data, /* transfer */
- const void *buf, /* data to write */
+ const uint8_t *buf, /* data to write */
size_t len, /* amount to write */
bool eos, /* last chunk */
size_t *pnwritten); /* how much sent */
bool Curl_cf_def_data_pending(struct Curl_cfilter *cf,
const struct Curl_easy *data);
CURLcode Curl_cf_def_send(struct Curl_cfilter *cf, struct Curl_easy *data,
- const void *buf, size_t len, bool eos,
+ const uint8_t *buf, size_t len, bool eos,
size_t *pnwritten);
CURLcode Curl_cf_def_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
char *buf, size_t len, size_t *pnread);
bool *done);
void Curl_conn_cf_close(struct Curl_cfilter *cf, struct Curl_easy *data);
CURLcode Curl_conn_cf_send(struct Curl_cfilter *cf, struct Curl_easy *data,
- const void *buf, size_t len, bool eos,
+ const uint8_t *buf, size_t len, bool eos,
size_t *pnwritten);
CURLcode Curl_conn_cf_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
char *buf, size_t len, size_t *pnread);
static CURLcode h2_submit(struct h2_stream_ctx **pstream,
struct Curl_cfilter *cf, struct Curl_easy *data,
- const void *buf, size_t len,
+ const uint8_t *buf, size_t len,
bool eos, size_t *pnwritten)
{
struct cf_h2_ctx *ctx = cf->ctx;
if(result)
goto out;
- result = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL,
+ result = Curl_h1_req_parse_read(&stream->h1, (const char *)buf, len, NULL,
!data->state.http_ignorecustom ?
data->set.str[STRING_CUSTOMREQUEST] : NULL,
0, &nwritten);
}
static CURLcode cf_h2_send(struct Curl_cfilter *cf, struct Curl_easy *data,
- const void *buf, size_t len, bool eos,
+ const uint8_t *buf, size_t len, bool eos,
size_t *pnwritten)
{
struct cf_h2_ctx *ctx = cf->ctx;
us_length = htons((unsigned short)gss_send_token.length);
memcpy(socksreq + 2, &us_length, sizeof(short));
- code = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 4,
+ code = Curl_conn_cf_send(cf->next, data, socksreq, 4,
FALSE, &nwritten);
if(code || (nwritten != 4)) {
failf(data, "Failed to send GSS-API authentication request.");
}
code = Curl_conn_cf_send(cf->next, data,
- (char *)gss_send_token.value,
+ gss_send_token.value,
gss_send_token.length, FALSE, &nwritten);
if(code || (gss_send_token.length != nwritten)) {
failf(data, "Failed to send GSS-API authentication token.");
memcpy(socksreq + 2, &us_length, sizeof(short));
}
- code = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 4, FALSE,
- &nwritten);
+ code = Curl_conn_cf_send(cf->next, data, socksreq, 4, FALSE, &nwritten);
if(code || (nwritten != 4)) {
failf(data, "Failed to send GSS-API encryption request.");
gss_release_buffer(&gss_status, &gss_w_token);
if(data->set.socks5_gssapi_nec) {
memcpy(socksreq, &gss_enc, 1);
- code = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 1, FALSE,
- &nwritten);
+ code = Curl_conn_cf_send(cf->next, data, socksreq, 1, FALSE, &nwritten);
if(code || (nwritten != 1)) {
failf(data, "Failed to send GSS-API encryption type.");
Curl_gss_delete_sec_context(&gss_status, &gss_context, NULL);
}
}
else {
- code = Curl_conn_cf_send(cf->next, data, (char *)gss_w_token.value,
+ code = Curl_conn_cf_send(cf->next, data, gss_w_token.value,
gss_w_token.length, FALSE, &nwritten);
if(code || (gss_w_token.length != nwritten)) {
failf(data, "Failed to send GSS-API encryption type.");
unsigned char socksreq[4]; /* room for GSS-API exchange header only */
const char *service = data->set.str[STRING_PROXY_SERVICE_NAME] ?
data->set.str[STRING_PROXY_SERVICE_NAME] : "rcmd";
- char *etbuf;
+ uint8_t *etbuf;
size_t etbuf_size;
/* GSS-API request looks like
us_length = htons((unsigned short)sspi_send_token.cbBuffer);
memcpy(socksreq + 2, &us_length, sizeof(short));
- code = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 4, FALSE,
- &written);
+ code = Curl_conn_cf_send(cf->next, data, socksreq, 4, FALSE, &written);
if(code || (written != 4)) {
failf(data, "Failed to send SSPI authentication request.");
result = CURLE_COULDNT_CONNECT;
}
code = Curl_conn_cf_send(cf->next, data,
- (char *)sspi_send_token.pvBuffer,
+ sspi_send_token.pvBuffer,
sspi_send_token.cbBuffer, FALSE, &written);
if(code || (sspi_send_token.cbBuffer != written)) {
failf(data, "Failed to send SSPI authentication token.");
memcpy(socksreq + 2, &us_length, sizeof(short));
}
- code = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 4, FALSE,
- &written);
+ code = Curl_conn_cf_send(cf->next, data, socksreq, 4, FALSE, &written);
if(code || (written != 4)) {
failf(data, "Failed to send SSPI encryption request.");
result = CURLE_COULDNT_CONNECT;
if(data->set.socks5_gssapi_nec) {
memcpy(socksreq, &gss_enc, 1);
- code = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 1, FALSE,
- &written);
+ code = Curl_conn_cf_send(cf->next, data, socksreq, 1, FALSE, &written);
if(code || (written != 1)) {
failf(data, "Failed to send SSPI encryption type.");
result = CURLE_COULDNT_CONNECT;
static CURLcode h3_stream_open(struct Curl_cfilter *cf,
struct Curl_easy *data,
- const void *buf, size_t len,
+ const uint8_t *buf, size_t len,
size_t *pnwritten)
{
struct cf_ngtcp2_ctx *ctx = cf->ctx;
goto out;
}
- result = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL,
+ result = Curl_h1_req_parse_read(&stream->h1, (const char *)buf, len, NULL,
!data->state.http_ignorecustom ?
data->set.str[STRING_CUSTOMREQUEST] : NULL,
0, pnwritten);
}
static CURLcode cf_ngtcp2_send(struct Curl_cfilter *cf, struct Curl_easy *data,
- const void *buf, size_t len, bool eos,
+ const uint8_t *buf, size_t len, bool eos,
size_t *pnwritten)
{
struct cf_ngtcp2_ctx *ctx = cf->ctx;
static CURLcode h3_stream_open(struct Curl_cfilter *cf,
struct Curl_easy *data,
- const void *buf, size_t len,
+ const uint8_t *buf, size_t len,
size_t *pnwritten)
{
struct cf_osslq_ctx *ctx = cf->ctx;
goto out;
}
- result = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL,
+ result = Curl_h1_req_parse_read(&stream->h1, (const char *)buf, len, NULL,
!data->state.http_ignorecustom ?
data->set.str[STRING_CUSTOMREQUEST] : NULL,
0, pnwritten);
}
static CURLcode cf_osslq_send(struct Curl_cfilter *cf, struct Curl_easy *data,
- const void *buf, size_t len, bool eos,
+ const uint8_t *buf, size_t len, bool eos,
size_t *pnwritten)
{
struct cf_osslq_ctx *ctx = cf->ctx;
static CURLcode cf_quiche_send_body(struct Curl_cfilter *cf,
struct Curl_easy *data,
struct h3_stream_ctx *stream,
- const void *buf, size_t len, bool eos,
+ const uint8_t *buf, size_t len, bool eos,
size_t *pnwritten)
{
struct cf_quiche_ctx *ctx = cf->ctx;
static CURLcode h3_open_stream(struct Curl_cfilter *cf,
struct Curl_easy *data,
- const char *buf, size_t blen, bool eos,
+ const uint8_t *buf, size_t blen, bool eos,
size_t *pnwritten)
{
struct cf_quiche_ctx *ctx = cf->ctx;
DEBUGASSERT(stream);
- result = Curl_h1_req_parse_read(&stream->h1, buf, blen, NULL,
+ result = Curl_h1_req_parse_read(&stream->h1, (const char *)buf, blen, NULL,
!data->state.http_ignorecustom ?
data->set.str[STRING_CUSTOMREQUEST] : NULL,
0, pnwritten);
}
static CURLcode cf_quiche_send(struct Curl_cfilter *cf, struct Curl_easy *data,
- const void *buf, size_t len, bool eos,
+ const uint8_t *buf, size_t len, bool eos,
size_t *pnwritten)
{
struct cf_quiche_ctx *ctx = cf->ctx;
if(!data)
return 0;
- result = Curl_conn_cf_send(cf->next, data, (const char *)buf, blen, FALSE,
- &nwritten);
+ result = Curl_conn_cf_send(cf->next, data, buf, blen, FALSE, &nwritten);
CURL_TRC_CF(data, cf, "mbedtls_bio_cf_out_write(len=%zu) -> %d, %zu",
blen, result, nwritten);
if(CURLE_AGAIN == result)
if(blen < 0)
return 0;
- result = Curl_conn_cf_send(cf->next, data, buf, (size_t)blen, FALSE,
+ result = Curl_conn_cf_send(cf->next, data,
+ (const uint8_t *)buf, (size_t)blen, FALSE,
&nwritten);
CURL_TRC_CF(data, cf, "ossl_bio_cf_out_write(len=%d) -> %d, %zu",
blen, result, nwritten);
size_t nwritten;
result = Curl_conn_cf_send(io_ctx->cf->next, io_ctx->data,
- (const char *)buf, len, FALSE, &nwritten);
+ buf, len, FALSE, &nwritten);
if(result) {
nwritten = 0;
if(CURLE_AGAIN == result)
/* send initial handshake data which is now stored in output buffer */
result = Curl_conn_cf_send(cf->next, data,
- outbuf.pvBuffer, outbuf.cbBuffer, FALSE,
+ (const uint8_t *)outbuf.pvBuffer,
+ outbuf.cbBuffer, FALSE,
&written);
Curl_pSecFn->FreeContextBuffer(outbuf.pvBuffer);
if(result || (outbuf.cbBuffer != written)) {
/* send handshake token to server */
result = Curl_conn_cf_send(cf->next, data,
- outbuf[i].pvBuffer, outbuf[i].cbBuffer,
+ (const uint8_t *)outbuf[i].pvBuffer,
+ outbuf[i].cbBuffer,
FALSE, &written);
if(result || (outbuf[i].cbBuffer != written)) {
failf(data, "schannel: failed to send next handshake data: "
/* socket is writable */
result = Curl_conn_cf_send(cf->next, data,
- ptr + *pnwritten, len - *pnwritten,
+ (const uint8_t *)ptr + *pnwritten,
+ len - *pnwritten,
FALSE, &this_write);
if(result == CURLE_AGAIN)
continue;
size_t written;
result = Curl_conn_cf_send(cf->next, data,
- outbuf.pvBuffer, outbuf.cbBuffer,
+ (const uint8_t *)outbuf.pvBuffer,
+ outbuf.cbBuffer,
FALSE, &written);
Curl_pSecFn->FreeContextBuffer(outbuf.pvBuffer);
if(!result) {
static CURLcode ssl_cf_send(struct Curl_cfilter *cf,
struct Curl_easy *data,
- const void *buf, size_t blen,
+ const uint8_t *buf, size_t blen,
bool eos, size_t *pnwritten)
{
struct ssl_connect_data *connssl = cf->ctx;
}
else {
*pnwritten = connssl->earlydata_skip;
- buf = ((const char *)buf) + connssl->earlydata_skip;
+ buf = buf + connssl->earlydata_skip;
blen -= connssl->earlydata_skip;
connssl->earlydata_skip = 0;
}
skiplen = (ssize_t)(blen - wssl->io_send_blocked_len);
blen = wssl->io_send_blocked_len;
}
- result = Curl_conn_cf_send(cf->next, data, buf, blen, FALSE, &nwritten);
+ result = Curl_conn_cf_send(cf->next, data,
+ (const uint8_t *)buf, blen, FALSE, &nwritten);
wssl->io_result = result;
CURL_TRC_CF(data, cf, "bio_write(len=%d) -> %d, %zu",
blen, result, nwritten);