Loading docs/libcurl/opts/CURLOPT_TRAILERDATA.3 +0 −8 Original line number Diff line number Diff line Loading @@ -21,24 +21,18 @@ .\" ************************************************************************** .\" .TH CURLOPT_TRAILERDATA 3 "14 Aug 2018" "libcurl 7.64.0" "curl_easy_setopt options" .SH NAME: CURLOPT_TRAILERDATA \- Custom pointer passed to the trailing headers callback .SH SYNOPSIS: #include <curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TRAILERDATA, void *userdata); .SH DESCRIPTION: Data pointer to be passed to the HTTP trailer callback function. .SH DEFAULT: NULL .SH PROTOCOLS: HTTP .SH EXAMPLE: .nf /* Assuming we have a CURL handle in the hndl variable. */ Loading @@ -46,12 +40,10 @@ HTTP struct MyData data; curl_easy_setopt(hndl, CURLOPT_TRAILERDATA, &data); .fi A more complete example can be found in examples/http_trailers.html .SH AVAILABILITY: This option was added in curl 7.64.0 and is present if HTTP support is enabled .SH "SEE ALSO" .BR CURLOPT_TRAILERFUNCTION "(3), " docs/libcurl/opts/CURLOPT_TRAILERFUNCTION.3 +19 −30 Original line number Diff line number Diff line Loading @@ -21,17 +21,14 @@ .\" ************************************************************************** .\" .TH CURLOPT_TRAILERFUNCTION 3 "14 Aug 2018" "libcurl 7.64.0" "curl_easy_setopt options" .SH NAME: CURLOPT_TRAILERFUNCTION \- Set callback for sending trailing headers .SH SYNOPSIS: #include <curl.h> int curl_trailer_callback(struct curl_slist ** list, void *userdata); CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TRAILERFUNCTION, curl_trailer_callback *func); .SH DESCRIPTION: Pass a pointer to a callback function. Loading Loading @@ -59,27 +56,22 @@ trailers or to abort the request. If you set this option to NULL, then the transfer proceeds as usual without any interruptions. .SH DEFAULT: NULL .SH PROTOCOLS: HTTP .SH EXAMPLE: #include <curl/curl.h> static int trailer_cb(struct curl_slist **tr, void *data) { /* libcurl will free the list */ *tr = curl_slist_append(*tr, "My-super-awesome-trailer: trailer-stuff"); (void)data; tr = curl_slist_append(*tr, "My-super-awesome-trailer: trailer-stuff"); return CURL_TRAILERFUNC_OK; } CURL *curl = curl_easy_init(); if(curl) { /* Set the URL of the request */ curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/"); /* Now set it as a put */ Loading @@ -94,7 +86,7 @@ if(curl) { res = curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); /* Set the trailers filling callback */ curl_easy_setopt(curl, CURLOPT_TRAILERFUNCTION, (curl_trailer_callback)trailer_cb); curl_easy_setopt(curl, CURLOPT_TRAILERFUNCTION, trailer_cb); /* Perform the request, res will get the return code */ res = curl_easy_perform(curl); Loading @@ -103,10 +95,7 @@ if(curl) { curl_slist_free_all(headers); } .SH AVAILABILITY: This option was added in curl 7.64.0 and is present if HTTP support is enabled .SH "SEE ALSO" .BR CURLOPT_TRAILERDATA "(3), " tests/libtest/lib1591.c +0 −1 Original line number Diff line number Diff line Loading @@ -103,4 +103,3 @@ test_cleanup: return (int)res; } Loading
docs/libcurl/opts/CURLOPT_TRAILERDATA.3 +0 −8 Original line number Diff line number Diff line Loading @@ -21,24 +21,18 @@ .\" ************************************************************************** .\" .TH CURLOPT_TRAILERDATA 3 "14 Aug 2018" "libcurl 7.64.0" "curl_easy_setopt options" .SH NAME: CURLOPT_TRAILERDATA \- Custom pointer passed to the trailing headers callback .SH SYNOPSIS: #include <curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TRAILERDATA, void *userdata); .SH DESCRIPTION: Data pointer to be passed to the HTTP trailer callback function. .SH DEFAULT: NULL .SH PROTOCOLS: HTTP .SH EXAMPLE: .nf /* Assuming we have a CURL handle in the hndl variable. */ Loading @@ -46,12 +40,10 @@ HTTP struct MyData data; curl_easy_setopt(hndl, CURLOPT_TRAILERDATA, &data); .fi A more complete example can be found in examples/http_trailers.html .SH AVAILABILITY: This option was added in curl 7.64.0 and is present if HTTP support is enabled .SH "SEE ALSO" .BR CURLOPT_TRAILERFUNCTION "(3), "
docs/libcurl/opts/CURLOPT_TRAILERFUNCTION.3 +19 −30 Original line number Diff line number Diff line Loading @@ -21,17 +21,14 @@ .\" ************************************************************************** .\" .TH CURLOPT_TRAILERFUNCTION 3 "14 Aug 2018" "libcurl 7.64.0" "curl_easy_setopt options" .SH NAME: CURLOPT_TRAILERFUNCTION \- Set callback for sending trailing headers .SH SYNOPSIS: #include <curl.h> int curl_trailer_callback(struct curl_slist ** list, void *userdata); CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TRAILERFUNCTION, curl_trailer_callback *func); .SH DESCRIPTION: Pass a pointer to a callback function. Loading Loading @@ -59,27 +56,22 @@ trailers or to abort the request. If you set this option to NULL, then the transfer proceeds as usual without any interruptions. .SH DEFAULT: NULL .SH PROTOCOLS: HTTP .SH EXAMPLE: #include <curl/curl.h> static int trailer_cb(struct curl_slist **tr, void *data) { /* libcurl will free the list */ *tr = curl_slist_append(*tr, "My-super-awesome-trailer: trailer-stuff"); (void)data; tr = curl_slist_append(*tr, "My-super-awesome-trailer: trailer-stuff"); return CURL_TRAILERFUNC_OK; } CURL *curl = curl_easy_init(); if(curl) { /* Set the URL of the request */ curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/"); /* Now set it as a put */ Loading @@ -94,7 +86,7 @@ if(curl) { res = curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); /* Set the trailers filling callback */ curl_easy_setopt(curl, CURLOPT_TRAILERFUNCTION, (curl_trailer_callback)trailer_cb); curl_easy_setopt(curl, CURLOPT_TRAILERFUNCTION, trailer_cb); /* Perform the request, res will get the return code */ res = curl_easy_perform(curl); Loading @@ -103,10 +95,7 @@ if(curl) { curl_slist_free_all(headers); } .SH AVAILABILITY: This option was added in curl 7.64.0 and is present if HTTP support is enabled .SH "SEE ALSO" .BR CURLOPT_TRAILERDATA "(3), "
tests/libtest/lib1591.c +0 −1 Original line number Diff line number Diff line Loading @@ -103,4 +103,3 @@ test_cleanup: return (int)res; }