diff options
author | Daniel Stenberg <daniel@haxx.se> | 2018-09-14 11:48:53 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-09-16 23:22:37 +0200 |
commit | 55dbcb061d6ee733a1ba12d8634c85691a3010e0 (patch) | |
tree | 3e46d55b591f5ea62bcb83bc032c79da78db0402 /lib/http.h | |
parent | 130c53b632ca63f48b01bc048eda20c7512efd5c (diff) | |
download | curl-55dbcb061d6ee733a1ba12d8634c85691a3010e0.tar.gz |
http: made Curl_add_buffer functions take a pointer-pointer
... so that they can clear the original pointer on failure, which makes
the error-paths and their cleanups easier.
Closes #2992
Diffstat (limited to 'lib/http.h')
-rw-r--r-- | lib/http.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/http.h b/lib/http.h index 1d373e8f4..c0dbc996f 100644 --- a/lib/http.h +++ b/lib/http.h @@ -58,10 +58,12 @@ struct Curl_send_buffer { typedef struct Curl_send_buffer Curl_send_buffer; Curl_send_buffer *Curl_add_buffer_init(void); -void Curl_add_buffer_free(Curl_send_buffer *buff); -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, +void Curl_add_buffer_free(Curl_send_buffer **inp); +CURLcode Curl_add_bufferf(Curl_send_buffer **inp, const char *fmt, ...) + WARN_UNUSED_RESULT; +CURLcode Curl_add_buffer(Curl_send_buffer **inp, const void *inptr, + size_t size) WARN_UNUSED_RESULT; +CURLcode Curl_add_buffer_send(Curl_send_buffer **inp, struct connectdata *conn, long *bytes_written, size_t included_body_bytes, @@ -154,9 +156,11 @@ struct HTTP { HTTPSEND_LAST /* never use this */ } sending; - void *send_buffer; /* used if the request couldn't be sent in one chunk, - points to an allocated send_buffer struct */ - +#ifndef CURL_DISABLE_HTTP + Curl_send_buffer *send_buffer; /* used if the request couldn't be sent in + one chunk, points to an allocated + send_buffer struct */ +#endif #ifdef USE_NGHTTP2 /*********** for HTTP/2 we store stream-local data here *************/ int32_t stream_id; /* stream we are interested in */ |