.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ABSTRACT_UNIX_SOCKET, char *path);
.SH DESCRIPTION
-Enables the use of an abstract Unix domain socket instead of establishing a TCP
-connection to a host. The parameter should be a char * to a null-terminated string
-holding the path of the socket. The path will be set to \fIpath\fP prefixed by a
-NULL byte (this is the convention for abstract sockets, however it should be stressed
-that the path passed to this function should not contain a leading NULL).
+Enables the use of an abstract Unix domain socket instead of establishing a
+TCP connection to a host. The parameter should be a char * to a
+null-terminated string holding the path of the socket. The path will be set to
+\fIpath\fP prefixed by a NULL byte (this is the convention for abstract
+sockets, however it should be stressed that the path passed to this function
+should not contain a leading NULL).
-On non-supporting platforms, the abstract address will be interpreted as an empty
-string and fail gracefully, generating a run-time error.
-
-This option shares the same semantics as
-.BR CURLOPT_UNIX_SOCKET_PATH "(3)
-in which documentation more details can be found. Internally, these two options share
-the same storage and therefore only one of them can be set per handle.
+On non-supporting platforms, the abstract address will be interpreted as an
+empty string and fail gracefully, generating a run-time error.
+This option shares the same semantics as \fICURLOPT_UNIX_SOCKET_PATH(3)\fP in
+which documentation more details can be found. Internally, these two options
+share the same storage and therefore only one of them can be set per handle.
.SH DEFAULT
Default is NULL.
+.SH PROTOCOLS
+All
.SH EXAMPLE
.nf
- curl_easy_setopt(curl_handle, CURLOPT_ABSTRACT_UNIX_SOCKET, "/tmp/foo.sock");
- curl_easy_setopt(curl_handle, CURLOPT_URL, "http://localhost/");
+ curl_easy_setopt(curl_handle, CURLOPT_ABSTRACT_UNIX_SOCKET, "/tmp/foo.sock");
+ curl_easy_setopt(curl_handle, CURLOPT_URL, "http://localhost/");
.fi
.SH AVAILABILITY
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
currently defaults to 200 ms. Firefox and Chrome currently default to 300 ms.
.SH DEFAULT
CURL_HET_DEFAULT (currently defined as 200L)
+.SH PROTOCOLS
+All except FILE
.SH EXAMPLE
.nf
CURL *curl = curl_easy_init();
Added in 7.59.0
.SH RETURN VALUE
Returns CURLE_OK
+.SH SEE ALSO
+.BR CURLOPT_CONNECTTIMEOUT_MS "(3), "
+.BR CURLOPT_TIMEOUT "(3), " CURLOPT_LOW_SPEED_LIMIT "(3), "
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
Along with HTTP. Added in 7.60.0.
.SH RETURN VALUE
Returns CURLE_OK if HTTP is enabled, and CURLE_UNKNOWN_OPTION if not.
+.SH SEE ALSO
+.BR CURLOPT_PROXY "(3), "
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
curl_easy_perform(curl);
}
.fi
+.SH AVAILABILITY
+Provided in all libcurl versions.
.SH RETURN VALUE
Returns CURLE_OK.
.SH "SEE ALSO"
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
extending the deprecated \fICURLOPT_HTTPPOST(3)\fP option.
.SH PROTOCOLS
HTTP, SMTP, IMAP.
-.SH AVAILABILITY
-Since 7.56.0.
-.SH RETURN VALUE
-This will return CURLE_OK.
.SH EXAMPLE
Using this option implies the use of several mime structure building
functions: see https://curl.se/libcurl/c/smtp-mime.html for a complete
example.
+.SH AVAILABILITY
+Since 7.56.0.
+.SH RETURN VALUE
+This will return CURLE_OK.
.SH "SEE ALSO"
.BR curl_mime_init "(3)"
raised.
.SH DEFAULT
0
+.SH PROTOCOLS
+All
.SH EXAMPLE
.nf
CURL *curl = curl_easy_init();
Added in 7.10
.SH RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
+.SH SEE ALSO
+.BR CURLOPT_TIMEOUT "(3), "
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
0
.SH PROTOCOLS
All TLS-based protocols
-.SH AVAILABLE
-Added in 7.52.0
.SH EXAMPLE
.nf
CURL *curl = curl_easy_init();
curl_easy_cleanup(curl);
}
.fi
+.SH AVAILABILITY
+Added in 7.52.0
.SH RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
.SH "SEE ALSO"
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
.SH RETURN VALUE
Returns CURLE_OK if false start is supported by the SSL backend, otherwise
returns CURLE_NOT_BUILT_IN.
+.SH SEE ALSO
+.BR CURLOPT_TCP_FASTOPEN "(3), "
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
.SH RETURN VALUE
Returns CURLE_OK if fast open is supported by the operating system, otherwise
returns CURLE_NOT_BUILT_IN.
+.SH SEE ALSO
+.BR CURLOPT_SSL_FALSESTART "(3), "
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
Added in 7.48.0
.SH RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
+.SH SEE ALSO
+.BR CURLOPT_TFTP_BLKSIZE "(3), "
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
#include <curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TRAILERDATA, void *userdata);
-.SH DESCRIPTION:
+.SH DESCRIPTION
Data pointer to be passed to the HTTP trailer callback function.
.SH DEFAULT
NULL
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 RETURN VALUE
+Returns CURLE_OK.
.SH "SEE ALSO"
.BR CURLOPT_TRAILERFUNCTION "(3), "
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
}
.SH AVAILABILITY
This option was added in curl 7.64.0 and is present if HTTP support is enabled
+.SH RETURN VALUE
+Returns CURLE_OK.
.SH "SEE ALSO"
.BR CURLOPT_TRAILERDATA "(3), "
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
The maximum path length on Cygwin, Linux and Solaris is 107. On other platforms
it might be even less.
-Proxy and TCP options such as
-.BR CURLOPT_TCP_NODELAY "(3)
-are not supported. Proxy options such as
-.BR CURLOPT_PROXY "(3)
-have no effect either as these are TCP-oriented, and asking a proxy server to
-connect to a certain Unix domain socket is not possible.
+Proxy and TCP options such as \fICURLOPT_TCP_NODELAY(3)\fP are not
+supported. Proxy options such as \fICURLOPT_PROXY(3)\fP have no effect either
+as these are TCP-oriented, and asking a proxy server to connect to a certain
+Unix domain socket is not possible.
The application does not have to keep the string around after setting this
option.
can request an HTTP resource with:
.nf
- curl_easy_setopt(curl_handle, CURLOPT_UNIX_SOCKET_PATH, "/tmp/nginx.sock");
- curl_easy_setopt(curl_handle, CURLOPT_URL, "http://localhost/");
+ curl_easy_setopt(curl_handle, CURLOPT_UNIX_SOCKET_PATH, "/tmp/nginx.sock");
+ curl_easy_setopt(curl_handle, CURLOPT_URL, "http://localhost/");
.fi
-If you are on Linux and somehow have a need for paths larger than 107 bytes, you
-could use the proc filesystem to bypass the limitation:
+If you are on Linux and somehow have a need for paths larger than 107 bytes,
+you could use the proc filesystem to bypass the limitation:
.nf
- int dirfd = open(long_directory_path_to_socket, O_DIRECTORY | O_RDONLY);
- char path[108];
- snprintf(path, sizeof(path), "/proc/self/fd/%d/nginx.sock", dirfd);
- curl_easy_setopt(curl_handle, CURLOPT_UNIX_SOCKET_PATH, path);
- /* Be sure to keep dirfd valid until you discard the handle */
+ int dirfd = open(long_directory_path_to_socket, O_DIRECTORY | O_RDONLY);
+ char path[108];
+ snprintf(path, sizeof(path), "/proc/self/fd/%d/nginx.sock", dirfd);
+ curl_easy_setopt(curl_handle, CURLOPT_UNIX_SOCKET_PATH, path);
+ /* Be sure to keep dirfd valid until you discard the handle */
.fi
.SH AVAILABILITY
Since 7.40.0.
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
.SH DEFAULT
CURL_UPKEEP_INTERVAL_DEFAULT (currently defined as 60000L, which is 60 seconds)
+.SH PROTOCOLS
+All
.SH EXAMPLE
.nf
CURL *curl = curl_easy_init();
Added in 7.62.0
.SH RETURN VALUE
Returns CURLE_OK
+.SH SEE ALSO
+.BR CURLOPT_TCP_KEEPALIVE "(3), "
+
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
libcurl will use 'fwrite' as a callback by default.
.SH PROTOCOLS
For all protocols
-.SH AVAILABILITY
-Support for the CURL_WRITEFUNC_PAUSE return code was added in version 7.18.0.
-.SH RETURN VALUE
-This will return CURLE_OK.
.SH EXAMPLE
.nf
struct memory {
/* we pass our 'chunk' struct to the callback function */
curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&chunk);
.fi
+.SH AVAILABILITY
+Support for the CURL_WRITEFUNC_PAUSE return code was added in version 7.18.0.
+.SH RETURN VALUE
+This will return CURLE_OK.
.SH "SEE ALSO"
.BR CURLOPT_WRITEDATA "(3), " CURLOPT_READFUNCTION "(3), "
.BR CURLOPT_HEADERFUNCTION "(3), "
my @manpages=@ARGV;
my $errors = 0;
+my %blessed;
+my @order = (
+ 'NAME',
+ 'SYNOPSIS',
+ 'DESCRIPTION',
+ #'DEFAULT', # CURLINFO_ has no default
+ 'PROTOCOLS',
+ 'EXAMPLE',
+ 'AVAILABILITY',
+ 'RETURN VALUE',
+ 'SEE ALSO'
+ );
+my %shline; # section => line number
+
sub scanmanpage {
my ($file) = @_;
my $reqex = 0;
my $inex = 0;
my $exsize = 0;
+ my $shc = 0;
+ my @sh;
print "Check $file\n";
open(M, "<$file") || die "no such file: $file";
}
my $line = 1;
while(<M>) {
- if($_ =~ /^.SH EXAMPLE/) {
+ if($_ =~ /^.SH EXAMPLE/i) {
$inex = 1;
}
- elsif($_ =~ /^.SH/) {
+ elsif($_ =~ /^.SH/i) {
$inex = 0;
}
elsif($inex) {
$exsize++;
}
+ if($_ =~ /^.SH (.*)/i) {
+ my $n = $1;
+ # remove enclosing quotes
+ $n =~ s/\"(.*)\"\z/$1/;
+ push @sh, $n;
+ $shline{$n} = $line;
+ }
if($_ =~ /^\'/) {
print STDERR "$file:$line line starts with single quote!\n";
}
close(M);
- if($reqex && ($exsize < 2)) {
- print STDERR "$file:$line missing EXAMPLE section\n";
- $errors++;
+ if($reqex) {
+ # only for libcurl options man-pages
+
+ if($exsize < 2) {
+ print STDERR "$file:$line missing EXAMPLE section\n";
+ $errors++;
+ }
+
+ my $got;
+ my $i = 0;
+ my $shused = 1;
+ do {
+ $got = shift(@sh);
+ if($got) {
+ $i = $blessed{$got};
+ }
+ if($i && $got) {
+ # mandatory section
+
+ if($i != $shused) {
+ printf STDERR "$file:%u Got $got, when %s was expected\n",
+ $shline{$got},
+ $order[$shused-1];
+ $errors++;
+ return;
+ }
+ $shused++;
+ if($i == 9) {
+ # last mandatory one, exit
+ $got="";
+ }
+ }
+ } while($got);
+
+ if($i != 8) {
+ printf STDERR "$file:$line missing mandatory section: %s\n",
+ $order[$i];
+ $errors++;
+ }
}
}
+my $ind = 1;
+for my $s (@order) {
+ $blessed{$s} = $ind++
+}
for my $m (@manpages) {
scanmanpage($m);