mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:41:40 +03:00
lib: add void *ctx to reader/writer instances
- `struct Curl_cwriter` and `struct Curl_creader` now carry a `void *ctx` member that points to the instance as allocated. - using `r->ctx` and `w->ctx` as pointer to the instance specific struct that has been allocated Reported-by: Rudi Heitbaum Fixes #13035 Closes #13059
This commit is contained in:
parent
2ca530d2fa
commit
9978d40ddb
8 changed files with 68 additions and 50 deletions
|
|
@ -123,7 +123,7 @@ struct Curl_cwtype Curl_cwt_out = {
|
|||
static CURLcode cw_out_init(struct Curl_easy *data,
|
||||
struct Curl_cwriter *writer)
|
||||
{
|
||||
struct cw_out_ctx *ctx = (struct cw_out_ctx *)writer;
|
||||
struct cw_out_ctx *ctx = writer->ctx;
|
||||
(void)data;
|
||||
ctx->buf = NULL;
|
||||
return CURLE_OK;
|
||||
|
|
@ -151,7 +151,7 @@ static size_t cw_out_bufs_len(struct cw_out_ctx *ctx)
|
|||
|
||||
static void cw_out_close(struct Curl_easy *data, struct Curl_cwriter *writer)
|
||||
{
|
||||
struct cw_out_ctx *ctx = (struct cw_out_ctx *)writer;
|
||||
struct cw_out_ctx *ctx = writer->ctx;
|
||||
|
||||
(void)data;
|
||||
cw_out_bufs_free(ctx);
|
||||
|
|
@ -378,7 +378,7 @@ static CURLcode cw_out_write(struct Curl_easy *data,
|
|||
struct Curl_cwriter *writer, int type,
|
||||
const char *buf, size_t blen)
|
||||
{
|
||||
struct cw_out_ctx *ctx = (struct cw_out_ctx *)writer;
|
||||
struct cw_out_ctx *ctx = writer->ctx;
|
||||
CURLcode result;
|
||||
bool flush_all;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue