diff options
author | Ayoub Boudhar <a.boudhar@outlook.com> | 2018-12-06 10:18:03 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-12-14 10:10:48 +0100 |
commit | f464535bfdd9a83140d8a13c3fe3d937239d1c2a (patch) | |
tree | da330b66fe21c30ef5821436fa53a56e5946b504 /lib/setopt.c | |
parent | 4531b299cc4771e6d2428fb22c1305f75db71666 (diff) |
http: Implement trailing headers for chunked transfers
This adds the CURLOPT_TRAILERDATA and CURLOPT_TRAILERFUNCTION
options that allow a callback based approach to sending trailing headers
with chunked transfers.
The test server (sws) was updated to take into account the detection of the
end of transfer in the case of trailing headers presence.
Test 1591 checks that trailing headers can be sent using libcurl.
Closes #3350
Diffstat (limited to 'lib/setopt.c')
-rw-r--r-- | lib/setopt.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/setopt.c b/lib/setopt.c index 01a890b39..27046768c 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -2636,6 +2636,16 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, return CURLE_BAD_FUNCTION_ARGUMENT; data->set.upkeep_interval_ms = arg; break; + case CURLOPT_TRAILERFUNCTION: +#ifndef CURL_DISABLE_HTTP + data->set.trailer_callback = va_arg(param, curl_trailer_callback); +#endif + break; + case CURLOPT_TRAILERDATA: +#ifndef CURL_DISABLE_HTTP + data->set.trailer_data = va_arg(param, void *); +#endif + break; default: /* unknown tag and its companion, just ignore: */ result = CURLE_UNKNOWN_OPTION; |