From 11c72d478bf65aa186d2301ef63627372143f3b7 Mon Sep 17 00:00:00 2001 From: ng0 Date: Mon, 25 Feb 2019 11:22:36 +0000 Subject: curl->gnurl: rename new files in docs/libcurl/opts --- docs/libcurl/opts/CURLOPT_HTTP09_ALLOWED.3 | 58 --------------- docs/libcurl/opts/CURLOPT_TRAILERDATA.3 | 49 ------------- docs/libcurl/opts/CURLOPT_TRAILERFUNCTION.3 | 101 --------------------------- docs/libcurl/opts/GNURLOPT_HTTP09_ALLOWED.3 | 58 +++++++++++++++ docs/libcurl/opts/GNURLOPT_TRAILERDATA.3 | 49 +++++++++++++ docs/libcurl/opts/GNURLOPT_TRAILERFUNCTION.3 | 101 +++++++++++++++++++++++++++ 6 files changed, 208 insertions(+), 208 deletions(-) delete mode 100644 docs/libcurl/opts/CURLOPT_HTTP09_ALLOWED.3 delete mode 100644 docs/libcurl/opts/CURLOPT_TRAILERDATA.3 delete mode 100644 docs/libcurl/opts/CURLOPT_TRAILERFUNCTION.3 create mode 100644 docs/libcurl/opts/GNURLOPT_HTTP09_ALLOWED.3 create mode 100644 docs/libcurl/opts/GNURLOPT_TRAILERDATA.3 create mode 100644 docs/libcurl/opts/GNURLOPT_TRAILERFUNCTION.3 diff --git a/docs/libcurl/opts/CURLOPT_HTTP09_ALLOWED.3 b/docs/libcurl/opts/CURLOPT_HTTP09_ALLOWED.3 deleted file mode 100644 index 36f4f9a71..000000000 --- a/docs/libcurl/opts/CURLOPT_HTTP09_ALLOWED.3 +++ /dev/null @@ -1,58 +0,0 @@ -.\" ************************************************************************** -.\" * _ _ ____ _ -.\" * Project ___| | | | _ \| | -.\" * / __| | | | |_) | | -.\" * | (__| |_| | _ <| |___ -.\" * \___|\___/|_| \_\_____| -.\" * -.\" * Copyright (C) 1998 - 2018, Daniel Stenberg, , et al. -.\" * -.\" * This software is licensed as described in the file COPYING, which -.\" * you should have received as part of this distribution. The terms -.\" * are also available at https://curl.haxx.se/docs/copyright.html. -.\" * -.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell -.\" * copies of the Software, and permit persons to whom the Software is -.\" * furnished to do so, under the terms of the COPYING file. -.\" * -.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY -.\" * KIND, either express or implied. -.\" * -.\" ************************************************************************** -.\" -.TH CURLOPT_HTTP09_ALLOWED 3 "17 Dec 2018" "libcurl 7.64.0" "curl_easy_setopt options" -.SH NAME -CURLOPT_HTTP09 \- allow HTTP/0.9 response -.SH SYNOPSIS -#include - -CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTP09_ALLOWED, long allowed); -.SH DESCRIPTION -Pass the long argument \fIallowed\fP set to 1L to allow HTTP/0.9 responses. - -A HTTP/0.9 response is a server response entirely without headers and only a -body, while you can connect to lots of random TCP services and still get a -response that curl might consider to be HTTP/0.9. -.SH DEFAULT -curl allows HTTP/0.9 responses by default. - -A future curl version will require this option to be set to allow HTTP/0.9 -responses. -.SH PROTOCOLS -HTTP -.SH EXAMPLE -.nf -CURL *curl = curl_easy_init(); -if(curl) { - CURLcode ret; - curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); - curl_easy_setopt(curl, CURLOPT_HTTP09_ALLOWED, 1L); - ret = curl_easy_perform(curl); -} -.fi -.SH AVAILABILITY -Option added in 7.64.0, present along with HTTP. -.SH RETURN VALUE -Returns CURLE_OK if HTTP is supported, and CURLE_UNKNOWN_OPTION if not. -.SH "SEE ALSO" -.BR CURLOPT_SSLVERSION "(3), " CURLOPT_HTTP_VERSION "(3), " diff --git a/docs/libcurl/opts/CURLOPT_TRAILERDATA.3 b/docs/libcurl/opts/CURLOPT_TRAILERDATA.3 deleted file mode 100644 index 8162340d4..000000000 --- a/docs/libcurl/opts/CURLOPT_TRAILERDATA.3 +++ /dev/null @@ -1,49 +0,0 @@ -.\" ************************************************************************** -.\" * _ _ ____ _ -.\" * Project ___| | | | _ \| | -.\" * / __| | | | |_) | | -.\" * | (__| |_| | _ <| |___ -.\" * \___|\___/|_| \_\_____| -.\" * -.\" * Copyright (C) 1998 - 2018, Daniel Stenberg, , et al. -.\" * -.\" * This software is licensed as described in the file COPYING, which -.\" * you should have received as part of this distribution. The terms -.\" * are also available at https://curl.haxx.se/docs/copyright.html. -.\" * -.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell -.\" * copies of the Software, and permit persons to whom the Software is -.\" * furnished to do so, under the terms of the COPYING file. -.\" * -.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY -.\" * KIND, either express or implied. -.\" * -.\" ************************************************************************** -.\" -.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 - -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. */ - -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), " diff --git a/docs/libcurl/opts/CURLOPT_TRAILERFUNCTION.3 b/docs/libcurl/opts/CURLOPT_TRAILERFUNCTION.3 deleted file mode 100644 index 2aaffa28a..000000000 --- a/docs/libcurl/opts/CURLOPT_TRAILERFUNCTION.3 +++ /dev/null @@ -1,101 +0,0 @@ -.\" ************************************************************************** -.\" * _ _ ____ _ -.\" * Project ___| | | | _ \| | -.\" * / __| | | | |_) | | -.\" * | (__| |_| | _ <| |___ -.\" * \___|\___/|_| \_\_____| -.\" * -.\" * Copyright (C) 1998 - 2018, Daniel Stenberg, , et al. -.\" * -.\" * This software is licensed as described in the file COPYING, which -.\" * you should have received as part of this distribution. The terms -.\" * are also available at https://curl.haxx.se/docs/copyright.html. -.\" * -.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell -.\" * copies of the Software, and permit persons to whom the Software is -.\" * furnished to do so, under the terms of the COPYING file. -.\" * -.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY -.\" * KIND, either express or implied. -.\" * -.\" ************************************************************************** -.\" -.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 - -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. - -This callback function will be called once right before sending the final -CR LF in an HTTP chunked transfer to fill a list of trailing headers to be -sent before finishing the HTTP transfer. - -You can set the userdata argument with the CURLOPT_TRAILERDATA option. - -The trailing headers included in the linked list must not be CRLF-terminated, -because libcurl will add the appropriate line termination characters after -each header item. - -If you use curl_slist_append to add trailing headers to the curl_slist then -libcurl will duplicate the strings, and will free the curl_slist and the -duplicates once the trailers have been sent. - -If one of the trailing headers is not formatted correctly -(i.e. HeaderName: headerdata) it will be ignored and an info message -will be emitted. - -The return value can either be CURL_TRAILERFUNC_OK or CURL_TRAILERFUNC_ABORT -which would respectively instruct libcurl to either continue with sending the -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 - -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"); - 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 */ - curl_easy_setopt(curl, CURLOPT_PUT, 1L); - - /* Assuming we have a function that will return the data to be pushed - Let that function be read_cb */ - curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_cb); - - struct curl_slist *headers = NULL; - headers = curl_slist_append(headers, "Trailer: My-super-awsome-trailer"); - res = curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); - - /* Set the trailers filling callback */ - curl_easy_setopt(curl, CURLOPT_TRAILERFUNCTION, trailer_cb); - - /* Perform the request, res will get the return code */ - res = curl_easy_perform(curl); - - curl_easy_cleanup(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), " diff --git a/docs/libcurl/opts/GNURLOPT_HTTP09_ALLOWED.3 b/docs/libcurl/opts/GNURLOPT_HTTP09_ALLOWED.3 new file mode 100644 index 000000000..36f4f9a71 --- /dev/null +++ b/docs/libcurl/opts/GNURLOPT_HTTP09_ALLOWED.3 @@ -0,0 +1,58 @@ +.\" ************************************************************************** +.\" * _ _ ____ _ +.\" * Project ___| | | | _ \| | +.\" * / __| | | | |_) | | +.\" * | (__| |_| | _ <| |___ +.\" * \___|\___/|_| \_\_____| +.\" * +.\" * Copyright (C) 1998 - 2018, Daniel Stenberg, , et al. +.\" * +.\" * This software is licensed as described in the file COPYING, which +.\" * you should have received as part of this distribution. The terms +.\" * are also available at https://curl.haxx.se/docs/copyright.html. +.\" * +.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell +.\" * copies of the Software, and permit persons to whom the Software is +.\" * furnished to do so, under the terms of the COPYING file. +.\" * +.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +.\" * KIND, either express or implied. +.\" * +.\" ************************************************************************** +.\" +.TH CURLOPT_HTTP09_ALLOWED 3 "17 Dec 2018" "libcurl 7.64.0" "curl_easy_setopt options" +.SH NAME +CURLOPT_HTTP09 \- allow HTTP/0.9 response +.SH SYNOPSIS +#include + +CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTP09_ALLOWED, long allowed); +.SH DESCRIPTION +Pass the long argument \fIallowed\fP set to 1L to allow HTTP/0.9 responses. + +A HTTP/0.9 response is a server response entirely without headers and only a +body, while you can connect to lots of random TCP services and still get a +response that curl might consider to be HTTP/0.9. +.SH DEFAULT +curl allows HTTP/0.9 responses by default. + +A future curl version will require this option to be set to allow HTTP/0.9 +responses. +.SH PROTOCOLS +HTTP +.SH EXAMPLE +.nf +CURL *curl = curl_easy_init(); +if(curl) { + CURLcode ret; + curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); + curl_easy_setopt(curl, CURLOPT_HTTP09_ALLOWED, 1L); + ret = curl_easy_perform(curl); +} +.fi +.SH AVAILABILITY +Option added in 7.64.0, present along with HTTP. +.SH RETURN VALUE +Returns CURLE_OK if HTTP is supported, and CURLE_UNKNOWN_OPTION if not. +.SH "SEE ALSO" +.BR CURLOPT_SSLVERSION "(3), " CURLOPT_HTTP_VERSION "(3), " diff --git a/docs/libcurl/opts/GNURLOPT_TRAILERDATA.3 b/docs/libcurl/opts/GNURLOPT_TRAILERDATA.3 new file mode 100644 index 000000000..8162340d4 --- /dev/null +++ b/docs/libcurl/opts/GNURLOPT_TRAILERDATA.3 @@ -0,0 +1,49 @@ +.\" ************************************************************************** +.\" * _ _ ____ _ +.\" * Project ___| | | | _ \| | +.\" * / __| | | | |_) | | +.\" * | (__| |_| | _ <| |___ +.\" * \___|\___/|_| \_\_____| +.\" * +.\" * Copyright (C) 1998 - 2018, Daniel Stenberg, , et al. +.\" * +.\" * This software is licensed as described in the file COPYING, which +.\" * you should have received as part of this distribution. The terms +.\" * are also available at https://curl.haxx.se/docs/copyright.html. +.\" * +.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell +.\" * copies of the Software, and permit persons to whom the Software is +.\" * furnished to do so, under the terms of the COPYING file. +.\" * +.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +.\" * KIND, either express or implied. +.\" * +.\" ************************************************************************** +.\" +.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 + +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. */ + +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), " diff --git a/docs/libcurl/opts/GNURLOPT_TRAILERFUNCTION.3 b/docs/libcurl/opts/GNURLOPT_TRAILERFUNCTION.3 new file mode 100644 index 000000000..2aaffa28a --- /dev/null +++ b/docs/libcurl/opts/GNURLOPT_TRAILERFUNCTION.3 @@ -0,0 +1,101 @@ +.\" ************************************************************************** +.\" * _ _ ____ _ +.\" * Project ___| | | | _ \| | +.\" * / __| | | | |_) | | +.\" * | (__| |_| | _ <| |___ +.\" * \___|\___/|_| \_\_____| +.\" * +.\" * Copyright (C) 1998 - 2018, Daniel Stenberg, , et al. +.\" * +.\" * This software is licensed as described in the file COPYING, which +.\" * you should have received as part of this distribution. The terms +.\" * are also available at https://curl.haxx.se/docs/copyright.html. +.\" * +.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell +.\" * copies of the Software, and permit persons to whom the Software is +.\" * furnished to do so, under the terms of the COPYING file. +.\" * +.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +.\" * KIND, either express or implied. +.\" * +.\" ************************************************************************** +.\" +.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 + +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. + +This callback function will be called once right before sending the final +CR LF in an HTTP chunked transfer to fill a list of trailing headers to be +sent before finishing the HTTP transfer. + +You can set the userdata argument with the CURLOPT_TRAILERDATA option. + +The trailing headers included in the linked list must not be CRLF-terminated, +because libcurl will add the appropriate line termination characters after +each header item. + +If you use curl_slist_append to add trailing headers to the curl_slist then +libcurl will duplicate the strings, and will free the curl_slist and the +duplicates once the trailers have been sent. + +If one of the trailing headers is not formatted correctly +(i.e. HeaderName: headerdata) it will be ignored and an info message +will be emitted. + +The return value can either be CURL_TRAILERFUNC_OK or CURL_TRAILERFUNC_ABORT +which would respectively instruct libcurl to either continue with sending the +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 + +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"); + 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 */ + curl_easy_setopt(curl, CURLOPT_PUT, 1L); + + /* Assuming we have a function that will return the data to be pushed + Let that function be read_cb */ + curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_cb); + + struct curl_slist *headers = NULL; + headers = curl_slist_append(headers, "Trailer: My-super-awsome-trailer"); + res = curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); + + /* Set the trailers filling callback */ + curl_easy_setopt(curl, CURLOPT_TRAILERFUNCTION, trailer_cb); + + /* Perform the request, res will get the return code */ + res = curl_easy_perform(curl); + + curl_easy_cleanup(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), " -- cgit v1.2.3