mirror of
https://github.com/curl/curl.git
synced 2026-08-25 06:33:32 +03:00
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
This commit is contained in:
parent
4531b299cc
commit
f464535bfd
17 changed files with 618 additions and 22 deletions
10
lib/setopt.c
10
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue