1-整理编译环境问题
This commit is contained in:
parent
e119abfd22
commit
06e1133421
195
3rdparty/curl/bin/curl-config
vendored
195
3rdparty/curl/bin/curl-config
vendored
@ -1,195 +0,0 @@
|
||||
#!/bin/sh
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 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
|
||||
# are also available at https://curl.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.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
# shellcheck disable=SC2006
|
||||
|
||||
prefix='F:/SourceCode/XSteam/3rdparty/curl'
|
||||
# Used in 'libdir'
|
||||
# shellcheck disable=SC2034
|
||||
exec_prefix="${prefix}"
|
||||
# shellcheck disable=SC2034
|
||||
includedir="${prefix}/include"
|
||||
cppflag_curl_staticlib=''
|
||||
|
||||
usage()
|
||||
{
|
||||
cat <<EOF
|
||||
Usage: curl-config [OPTION]
|
||||
|
||||
Available values for OPTION include:
|
||||
|
||||
--built-shared says 'yes' if libcurl was built shared
|
||||
--ca CA bundle install path
|
||||
--cc compiler
|
||||
--cflags preprocessor and compiler flags
|
||||
--checkfor [version] check for (lib)curl of the specified version
|
||||
--configure the arguments given to configure when building curl
|
||||
--features newline separated list of enabled features
|
||||
--help display this help and exit
|
||||
--libs library linking information
|
||||
--prefix curl install prefix
|
||||
--protocols newline separated list of enabled protocols
|
||||
--ssl-backends output the SSL backends libcurl was built to support
|
||||
--static-libs static libcurl library linking information
|
||||
--version output version information
|
||||
--vernum output version as a hexadecimal number
|
||||
EOF
|
||||
|
||||
exit "$1"
|
||||
}
|
||||
|
||||
if test "$#" -eq 0; then
|
||||
usage 1
|
||||
fi
|
||||
|
||||
while test "$#" -gt 0; do
|
||||
case "$1" in
|
||||
--built-shared)
|
||||
echo 'yes'
|
||||
;;
|
||||
|
||||
--ca)
|
||||
echo ''
|
||||
;;
|
||||
|
||||
--cc)
|
||||
echo 'D:/Dev/Qt/Tools/mingw1120_64/bin/gcc.exe'
|
||||
;;
|
||||
|
||||
--prefix)
|
||||
echo "$prefix"
|
||||
;;
|
||||
|
||||
--feature|--features)
|
||||
for feature in alt-svc AsynchDNS HTTP2 IDN IPv6 Largefile NTLM PSL threadsafe UnixSockets ''; do
|
||||
test -n "$feature" && echo "$feature"
|
||||
done
|
||||
;;
|
||||
|
||||
--protocols)
|
||||
# shellcheck disable=SC2043
|
||||
for protocol in DICT FILE FTP GOPHER HTTP IMAP IPFS IPNS LDAP LDAPS MQTT POP3 RTSP SCP SFTP SMB SMTP TELNET TFTP; do
|
||||
echo "$protocol"
|
||||
done
|
||||
;;
|
||||
|
||||
--version)
|
||||
echo 'libcurl 8.11.0-DEV'
|
||||
exit 0
|
||||
;;
|
||||
|
||||
--checkfor)
|
||||
checkfor="$2"
|
||||
cmajor=`echo "$checkfor" | cut -d. -f1`
|
||||
cminor=`echo "$checkfor" | cut -d. -f2`
|
||||
# when extracting the patch part we strip off everything after a
|
||||
# dash as that's used for things like version 1.2.3-pre1
|
||||
cpatch=`echo "$checkfor" | cut -d. -f3 | cut -d- -f1`
|
||||
|
||||
vmajor=`echo '8.11.0-DEV' | cut -d. -f1`
|
||||
vminor=`echo '8.11.0-DEV' | cut -d. -f2`
|
||||
# when extracting the patch part we strip off everything after a
|
||||
# dash as that's used for things like version 1.2.3-pre1
|
||||
vpatch=`echo '8.11.0-DEV' | cut -d. -f3 | cut -d- -f1`
|
||||
|
||||
if test "$vmajor" -gt "$cmajor"; then
|
||||
exit 0
|
||||
fi
|
||||
if test "$vmajor" -eq "$cmajor"; then
|
||||
if test "$vminor" -gt "$cminor"; then
|
||||
exit 0
|
||||
fi
|
||||
if test "$vminor" -eq "$cminor"; then
|
||||
if test "$cpatch" -le "$vpatch"; then
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "requested version $checkfor is newer than existing 8.11.0-DEV"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
--vernum)
|
||||
echo '080b00'
|
||||
exit 0
|
||||
;;
|
||||
|
||||
--help)
|
||||
usage 0
|
||||
;;
|
||||
|
||||
--cflags)
|
||||
if test "X$cppflag_curl_staticlib" = 'X-DCURL_STATICLIB'; then
|
||||
CPPFLAG_CURL_STATICLIB='-DCURL_STATICLIB '
|
||||
else
|
||||
CPPFLAG_CURL_STATICLIB=''
|
||||
fi
|
||||
if test "X${prefix}/include" = 'X/usr/include'; then
|
||||
echo "${CPPFLAG_CURL_STATICLIB}"
|
||||
else
|
||||
echo "${CPPFLAG_CURL_STATICLIB}-I${prefix}/include"
|
||||
fi
|
||||
;;
|
||||
|
||||
--libs)
|
||||
if test "X${exec_prefix}/lib" != 'X/usr/lib' -a "X${exec_prefix}/lib" != 'X/usr/lib64'; then
|
||||
CURLLIBDIR="-L${exec_prefix}/lib "
|
||||
else
|
||||
CURLLIBDIR=''
|
||||
fi
|
||||
if test 'Xyes' = 'Xno'; then
|
||||
echo "${CURLLIBDIR}-lcurl -lidn2 -lws2_32 -lbcrypt -lnghttp2 -lwldap32 -lpsl -lssh2 -ladvapi32 -lcrypt32"
|
||||
else
|
||||
echo "${CURLLIBDIR}-lcurl"
|
||||
fi
|
||||
;;
|
||||
|
||||
--ssl-backends)
|
||||
echo ''
|
||||
;;
|
||||
|
||||
--static-libs)
|
||||
if test 'Xyes' != 'Xno'; then
|
||||
echo "${exec_prefix}/lib/libcurl.a -LD:/Dev/msys64/mingw64/bin/../lib -LD:/Dev/msys64/mingw64/lib -lidn2 -lws2_32 -lbcrypt -lnghttp2 -lwldap32 -lpsl -lssh2 -ladvapi32 -lcrypt32"
|
||||
else
|
||||
echo 'curl was built with static libraries disabled' >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
--configure)
|
||||
echo
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "unknown option: $1"
|
||||
usage 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
exit 0
|
BIN
3rdparty/curl/bin/curl.exe
vendored
BIN
3rdparty/curl/bin/curl.exe
vendored
Binary file not shown.
BIN
3rdparty/curl/bin/libcurl.dll
vendored
BIN
3rdparty/curl/bin/libcurl.dll
vendored
Binary file not shown.
714
3rdparty/curl/bin/mk-ca-bundle.pl
vendored
714
3rdparty/curl/bin/mk-ca-bundle.pl
vendored
@ -1,714 +0,0 @@
|
||||
#!/usr/bin/env perl
|
||||
# ***************************************************************************
|
||||
# * _ _ ____ _
|
||||
# * Project ___| | | | _ \| |
|
||||
# * / __| | | | |_) | |
|
||||
# * | (__| |_| | _ <| |___
|
||||
# * \___|\___/|_| \_\_____|
|
||||
# *
|
||||
# * Copyright (C) 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
|
||||
# * are also available at https://curl.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.
|
||||
# *
|
||||
# * SPDX-License-Identifier: curl
|
||||
# *
|
||||
# ***************************************************************************
|
||||
# This Perl script creates a fresh ca-bundle.crt file for use with libcurl.
|
||||
# It downloads certdata.txt from Mozilla's source tree (see URL below),
|
||||
# then parses certdata.txt and extracts CA Root Certificates into PEM format.
|
||||
# These are then processed with the OpenSSL commandline tool to produce the
|
||||
# final ca-bundle.crt file.
|
||||
# The script is based on the parse-certs script written by Roland Krikava.
|
||||
# This Perl script works on almost any platform since its only external
|
||||
# dependency is the OpenSSL commandline tool for optional text listing.
|
||||
# Hacked by Guenter Knauf.
|
||||
#
|
||||
use Encode;
|
||||
use Getopt::Std;
|
||||
use MIME::Base64;
|
||||
use strict;
|
||||
use warnings;
|
||||
use vars qw($opt_b $opt_d $opt_f $opt_h $opt_i $opt_k $opt_l $opt_m $opt_n $opt_p $opt_q $opt_s $opt_t $opt_u $opt_v $opt_w);
|
||||
use List::Util;
|
||||
use Text::Wrap;
|
||||
use Time::Local;
|
||||
my $MOD_SHA = "Digest::SHA";
|
||||
eval "require $MOD_SHA";
|
||||
if ($@) {
|
||||
$MOD_SHA = "Digest::SHA::PurePerl";
|
||||
eval "require $MOD_SHA";
|
||||
}
|
||||
eval "require LWP::UserAgent";
|
||||
|
||||
my %urls = (
|
||||
'nss' =>
|
||||
'https://hg.mozilla.org/projects/nss/raw-file/default/lib/ckfw/builtins/certdata.txt',
|
||||
'central' =>
|
||||
'https://hg.mozilla.org/mozilla-central/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt',
|
||||
'beta' =>
|
||||
'https://hg.mozilla.org/releases/mozilla-beta/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt',
|
||||
'release' =>
|
||||
'https://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt',
|
||||
);
|
||||
|
||||
$opt_d = 'release';
|
||||
|
||||
# If the OpenSSL commandline is not in search path you can configure it here!
|
||||
my $openssl = 'openssl';
|
||||
|
||||
my $version = '1.29';
|
||||
|
||||
$opt_w = 76; # default base64 encoded lines length
|
||||
|
||||
# default cert types to include in the output (default is to include CAs which
|
||||
# may issue SSL server certs)
|
||||
my $default_mozilla_trust_purposes = "SERVER_AUTH";
|
||||
my $default_mozilla_trust_levels = "TRUSTED_DELEGATOR";
|
||||
$opt_p = $default_mozilla_trust_purposes . ":" . $default_mozilla_trust_levels;
|
||||
|
||||
my @valid_mozilla_trust_purposes = (
|
||||
"DIGITAL_SIGNATURE",
|
||||
"NON_REPUDIATION",
|
||||
"KEY_ENCIPHERMENT",
|
||||
"DATA_ENCIPHERMENT",
|
||||
"KEY_AGREEMENT",
|
||||
"KEY_CERT_SIGN",
|
||||
"CRL_SIGN",
|
||||
"SERVER_AUTH",
|
||||
"CLIENT_AUTH",
|
||||
"CODE_SIGNING",
|
||||
"EMAIL_PROTECTION",
|
||||
"IPSEC_END_SYSTEM",
|
||||
"IPSEC_TUNNEL",
|
||||
"IPSEC_USER",
|
||||
"TIME_STAMPING",
|
||||
"STEP_UP_APPROVED"
|
||||
);
|
||||
|
||||
my @valid_mozilla_trust_levels = (
|
||||
"TRUSTED_DELEGATOR", # CAs
|
||||
"NOT_TRUSTED", # Don't trust these certs.
|
||||
"MUST_VERIFY_TRUST", # This explicitly tells us that it ISN'T a CA but is
|
||||
# otherwise ok. In other words, this should tell the
|
||||
# app to ignore any other sources that claim this is
|
||||
# a CA.
|
||||
"TRUSTED" # This cert is trusted, but only for itself and not
|
||||
# for delegates (i.e. it is not a CA).
|
||||
);
|
||||
|
||||
my $default_signature_algorithms = $opt_s = "MD5";
|
||||
|
||||
my @valid_signature_algorithms = (
|
||||
"MD5",
|
||||
"SHA1",
|
||||
"SHA256",
|
||||
"SHA384",
|
||||
"SHA512"
|
||||
);
|
||||
|
||||
$0 =~ s@.*(/|\\)@@;
|
||||
$Getopt::Std::STANDARD_HELP_VERSION = 1;
|
||||
getopts('bd:fhiklmnp:qs:tuvw:');
|
||||
|
||||
if(!defined($opt_d)) {
|
||||
# to make plain "-d" use not cause warnings, and actually still work
|
||||
$opt_d = 'release';
|
||||
}
|
||||
|
||||
# Use predefined URL or else custom URL specified on command line.
|
||||
my $url;
|
||||
if(defined($urls{$opt_d})) {
|
||||
$url = $urls{$opt_d};
|
||||
if(!$opt_k && $url !~ /^https:\/\//i) {
|
||||
die "The URL for '$opt_d' is not HTTPS. Use -k to override (insecure).\n";
|
||||
}
|
||||
}
|
||||
else {
|
||||
$url = $opt_d;
|
||||
}
|
||||
|
||||
if ($opt_i) {
|
||||
print ("=" x 78 . "\n");
|
||||
print "Script Version : $version\n";
|
||||
print "Perl Version : $]\n";
|
||||
print "Operating System Name : $^O\n";
|
||||
print "Getopt::Std.pm Version : ${Getopt::Std::VERSION}\n";
|
||||
print "Encode::Encoding.pm Version : ${Encode::Encoding::VERSION}\n";
|
||||
print "MIME::Base64.pm Version : ${MIME::Base64::VERSION}\n";
|
||||
print "LWP::UserAgent.pm Version : ${LWP::UserAgent::VERSION}\n" if($LWP::UserAgent::VERSION);
|
||||
print "LWP.pm Version : ${LWP::VERSION}\n" if($LWP::VERSION);
|
||||
print "Digest::SHA.pm Version : ${Digest::SHA::VERSION}\n" if ($Digest::SHA::VERSION);
|
||||
print "Digest::SHA::PurePerl.pm Version : ${Digest::SHA::PurePerl::VERSION}\n" if ($Digest::SHA::PurePerl::VERSION);
|
||||
print ("=" x 78 . "\n");
|
||||
}
|
||||
|
||||
sub warning_message() {
|
||||
if ( $opt_d =~ m/^risk$/i ) { # Long Form Warning and Exit
|
||||
print "Warning: Use of this script may pose some risk:\n";
|
||||
print "\n";
|
||||
print " 1) If you use HTTP URLs they are subject to a man in the middle attack\n";
|
||||
print " 2) Default to 'release', but more recent updates may be found in other trees\n";
|
||||
print " 3) certdata.txt file format may change, lag time to update this script\n";
|
||||
print " 4) Generally unwise to blindly trust CAs without manual review & verification\n";
|
||||
print " 5) Mozilla apps use additional security checks aren't represented in certdata\n";
|
||||
print " 6) Use of this script will make a security engineer grind his teeth and\n";
|
||||
print " swear at you. ;)\n";
|
||||
exit;
|
||||
} else { # Short Form Warning
|
||||
print "Warning: Use of this script may pose some risk, -d risk for more details.\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub HELP_MESSAGE() {
|
||||
print "Usage:\t${0} [-b] [-d<certdata>] [-f] [-i] [-k] [-l] [-n] [-p<purposes:levels>] [-q] [-s<algorithms>] [-t] [-u] [-v] [-w<l>] [<outputfile>]\n";
|
||||
print "\t-b\tbackup an existing version of ca-bundle.crt\n";
|
||||
print "\t-d\tspecify Mozilla tree to pull certdata.txt or custom URL\n";
|
||||
print "\t\t Valid names are:\n";
|
||||
print "\t\t ", join( ", ", map { ( $_ =~ m/$opt_d/ ) ? "$_ (default)" : "$_" } sort keys %urls ), "\n";
|
||||
print "\t-f\tforce rebuild even if certdata.txt is current\n";
|
||||
print "\t-i\tprint version info about used modules\n";
|
||||
print "\t-k\tallow URLs other than HTTPS, enable HTTP fallback (insecure)\n";
|
||||
print "\t-l\tprint license info about certdata.txt\n";
|
||||
print "\t-m\tinclude meta data in output\n";
|
||||
print "\t-n\tno download of certdata.txt (to use existing)\n";
|
||||
print wrap("\t","\t\t", "-p\tlist of Mozilla trust purposes and levels for certificates to include in output. Takes the form of a comma separated list of purposes, a colon, and a comma separated list of levels. (default: $default_mozilla_trust_purposes:$default_mozilla_trust_levels)"), "\n";
|
||||
print "\t\t Valid purposes are:\n";
|
||||
print wrap("\t\t ","\t\t ", join( ", ", "ALL", @valid_mozilla_trust_purposes ) ), "\n";
|
||||
print "\t\t Valid levels are:\n";
|
||||
print wrap("\t\t ","\t\t ", join( ", ", "ALL", @valid_mozilla_trust_levels ) ), "\n";
|
||||
print "\t-q\tbe really quiet (no progress output at all)\n";
|
||||
print wrap("\t","\t\t", "-s\tcomma separated list of certificate signatures/hashes to output in plain text mode. (default: $default_signature_algorithms)\n");
|
||||
print "\t\t Valid signature algorithms are:\n";
|
||||
print wrap("\t\t ","\t\t ", join( ", ", "ALL", @valid_signature_algorithms ) ), "\n";
|
||||
print "\t-t\tinclude plain text listing of certificates\n";
|
||||
print "\t-u\tunlink (remove) certdata.txt after processing\n";
|
||||
print "\t-v\tbe verbose and print out processed CAs\n";
|
||||
print "\t-w <l>\twrap base64 output lines after <l> chars (default: ${opt_w})\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
sub VERSION_MESSAGE() {
|
||||
print "${0} version ${version} running Perl ${]} on ${^O}\n";
|
||||
}
|
||||
|
||||
warning_message() unless ($opt_q || $url =~ m/^(ht|f)tps:/i );
|
||||
HELP_MESSAGE() if ($opt_h);
|
||||
|
||||
sub report($@) {
|
||||
my $output = shift;
|
||||
|
||||
print STDERR $output . "\n" unless $opt_q;
|
||||
}
|
||||
|
||||
sub is_in_list($@) {
|
||||
my $target = shift;
|
||||
|
||||
return defined(List::Util::first { $target eq $_ } @_);
|
||||
}
|
||||
|
||||
# Parses $param_string as a case insensitive comma separated list with optional
|
||||
# whitespace validates that only allowed parameters are supplied
|
||||
sub parse_csv_param($$@) {
|
||||
my $description = shift;
|
||||
my $param_string = shift;
|
||||
my @valid_values = @_;
|
||||
|
||||
my @values = map {
|
||||
s/^\s+//; # strip leading spaces
|
||||
s/\s+$//; # strip trailing spaces
|
||||
uc $_ # return the modified string as upper case
|
||||
} split( ',', $param_string );
|
||||
|
||||
# Find all values which are not in the list of valid values or "ALL"
|
||||
my @invalid = grep { !is_in_list($_,"ALL",@valid_values) } @values;
|
||||
|
||||
if ( scalar(@invalid) > 0 ) {
|
||||
# Tell the user which parameters were invalid and print the standard help
|
||||
# message which will exit
|
||||
print "Error: Invalid ", $description, scalar(@invalid) == 1 ? ": " : "s: ", join( ", ", map { "\"$_\"" } @invalid ), "\n";
|
||||
HELP_MESSAGE();
|
||||
}
|
||||
|
||||
@values = @valid_values if ( is_in_list("ALL",@values) );
|
||||
|
||||
return @values;
|
||||
}
|
||||
|
||||
sub sha256 {
|
||||
my $result;
|
||||
if ($Digest::SHA::VERSION || $Digest::SHA::PurePerl::VERSION) {
|
||||
open(FILE, $_[0]) or die "Can't open '$_[0]': $!";
|
||||
binmode(FILE);
|
||||
$result = $MOD_SHA->new(256)->addfile(*FILE)->hexdigest;
|
||||
close(FILE);
|
||||
} else {
|
||||
# Use OpenSSL command if Perl Digest::SHA modules not available
|
||||
$result = `"$openssl" dgst -r -sha256 "$_[0]"`;
|
||||
$result =~ s/^([0-9a-f]{64}) .+/$1/is;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
sub oldhash {
|
||||
my $hash = "";
|
||||
open(C, "<$_[0]") || return 0;
|
||||
while(<C>) {
|
||||
chomp;
|
||||
if($_ =~ /^\#\# SHA256: (.*)/) {
|
||||
$hash = $1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
close(C);
|
||||
return $hash;
|
||||
}
|
||||
|
||||
if ( $opt_p !~ m/:/ ) {
|
||||
print "Error: Mozilla trust identifier list must include both purposes and levels\n";
|
||||
HELP_MESSAGE();
|
||||
}
|
||||
|
||||
(my $included_mozilla_trust_purposes_string, my $included_mozilla_trust_levels_string) = split( ':', $opt_p );
|
||||
my @included_mozilla_trust_purposes = parse_csv_param( "trust purpose", $included_mozilla_trust_purposes_string, @valid_mozilla_trust_purposes );
|
||||
my @included_mozilla_trust_levels = parse_csv_param( "trust level", $included_mozilla_trust_levels_string, @valid_mozilla_trust_levels );
|
||||
|
||||
my @included_signature_algorithms = parse_csv_param( "signature algorithm", $opt_s, @valid_signature_algorithms );
|
||||
|
||||
sub should_output_cert(%) {
|
||||
my %trust_purposes_by_level = @_;
|
||||
|
||||
foreach my $level (@included_mozilla_trust_levels) {
|
||||
# for each level we want to output, see if any of our desired purposes are
|
||||
# included
|
||||
return 1 if ( defined( List::Util::first { is_in_list( $_, @included_mozilla_trust_purposes ) } @{$trust_purposes_by_level{$level}} ) );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
my $crt = $ARGV[0] || 'ca-bundle.crt';
|
||||
(my $txt = $url) =~ s@(.*/|\?.*)@@g;
|
||||
|
||||
my $stdout = $crt eq '-';
|
||||
my $resp;
|
||||
my $fetched;
|
||||
|
||||
my $oldhash = oldhash($crt);
|
||||
|
||||
report "SHA256 of old file: $oldhash";
|
||||
|
||||
if(!$opt_n) {
|
||||
report "Downloading $txt ...";
|
||||
|
||||
# If we have an HTTPS URL then use curl
|
||||
if($url =~ /^https:\/\//i) {
|
||||
my $curl = `curl -V`;
|
||||
if($curl) {
|
||||
if($curl =~ /^Protocols:.* https( |$)/m) {
|
||||
report "Get certdata with curl!";
|
||||
my $proto = !$opt_k ? "--proto =https" : "";
|
||||
my $quiet = $opt_q ? "-s" : "";
|
||||
my @out = `curl -w %{response_code} $proto $quiet -o "$txt" "$url"`;
|
||||
if(!$? && @out && $out[0] == 200) {
|
||||
$fetched = 1;
|
||||
report "Downloaded $txt";
|
||||
}
|
||||
else {
|
||||
report "Failed downloading via HTTPS with curl";
|
||||
if(-e $txt && !unlink($txt)) {
|
||||
report "Failed to remove '$txt': $!";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
report "curl lacks https support";
|
||||
}
|
||||
}
|
||||
else {
|
||||
report "curl not found";
|
||||
}
|
||||
}
|
||||
|
||||
# If nothing was fetched then use LWP
|
||||
if(!$fetched) {
|
||||
if($url =~ /^https:\/\//i) {
|
||||
report "Falling back to HTTP";
|
||||
$url =~ s/^https:\/\//http:\/\//i;
|
||||
}
|
||||
if(!$opt_k) {
|
||||
report "URLs other than HTTPS are disabled by default, to enable use -k";
|
||||
exit 1;
|
||||
}
|
||||
report "Get certdata with LWP!";
|
||||
if(!defined(${LWP::UserAgent::VERSION})) {
|
||||
report "LWP is not available (LWP::UserAgent not found)";
|
||||
exit 1;
|
||||
}
|
||||
my $ua = new LWP::UserAgent(agent => "$0/$version");
|
||||
$ua->env_proxy();
|
||||
$resp = $ua->mirror($url, $txt);
|
||||
if($resp && $resp->code eq '304') {
|
||||
report "Not modified";
|
||||
exit 0 if -e $crt && !$opt_f;
|
||||
}
|
||||
else {
|
||||
$fetched = 1;
|
||||
report "Downloaded $txt";
|
||||
}
|
||||
if(!$resp || $resp->code !~ /^(?:200|304)$/) {
|
||||
report "Unable to download latest data: "
|
||||
. ($resp? $resp->code . ' - ' . $resp->message : "LWP failed");
|
||||
exit 1 if -e $crt || ! -r $txt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
my $filedate = $resp ? $resp->last_modified : (stat($txt))[9];
|
||||
my $datesrc = "as of";
|
||||
if(!$filedate) {
|
||||
# mxr.mozilla.org gave us a time, hg.mozilla.org does not!
|
||||
$filedate = time();
|
||||
$datesrc="downloaded on";
|
||||
}
|
||||
|
||||
# get the hash from the download file
|
||||
my $newhash= sha256($txt);
|
||||
|
||||
if(!$opt_f && $oldhash eq $newhash) {
|
||||
report "Downloaded file identical to previous run\'s source file. Exiting";
|
||||
if($opt_u && -e $txt && !unlink($txt)) {
|
||||
report "Failed to remove $txt: $!\n";
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
report "SHA256 of new file: $newhash";
|
||||
|
||||
my $currentdate = scalar gmtime($filedate);
|
||||
|
||||
my $format = $opt_t ? "plain text and " : "";
|
||||
if( $stdout ) {
|
||||
open(CRT, '> -') or die "Couldn't open STDOUT: $!\n";
|
||||
} else {
|
||||
open(CRT,">$crt.~") or die "Couldn't open $crt.~: $!\n";
|
||||
}
|
||||
print CRT <<EOT;
|
||||
##
|
||||
## Bundle of CA Root Certificates
|
||||
##
|
||||
## Certificate data from Mozilla ${datesrc}: ${currentdate} GMT
|
||||
##
|
||||
## Find updated versions here: https://curl.se/docs/caextract.html
|
||||
##
|
||||
## This is a bundle of X.509 certificates of public Certificate Authorities
|
||||
## (CA). These were automatically extracted from Mozilla's root certificates
|
||||
## file (certdata.txt). This file can be found in the mozilla source tree:
|
||||
## ${url}
|
||||
##
|
||||
## It contains the certificates in ${format}PEM format and therefore
|
||||
## can be directly used with curl / libcurl / php_curl, or with
|
||||
## an Apache+mod_ssl webserver for SSL client authentication.
|
||||
## Just configure this file as the SSLCACertificateFile.
|
||||
##
|
||||
## Conversion done with mk-ca-bundle.pl version $version.
|
||||
## SHA256: $newhash
|
||||
##
|
||||
|
||||
EOT
|
||||
|
||||
report "Processing '$txt' ...";
|
||||
my $caname;
|
||||
my $certnum = 0;
|
||||
my $skipnum = 0;
|
||||
my $start_of_cert = 0;
|
||||
my $main_block = 0;
|
||||
my $main_block_name;
|
||||
my $trust_block = 0;
|
||||
my $trust_block_name;
|
||||
my @precert;
|
||||
my $cka_value;
|
||||
my $valid = 0;
|
||||
|
||||
open(TXT,"$txt") or die "Couldn't open $txt: $!\n";
|
||||
while (<TXT>) {
|
||||
if (/\*\*\*\*\* BEGIN LICENSE BLOCK \*\*\*\*\*/) {
|
||||
print CRT;
|
||||
print if ($opt_l);
|
||||
while (<TXT>) {
|
||||
print CRT;
|
||||
print if ($opt_l);
|
||||
last if (/\*\*\*\*\* END LICENSE BLOCK \*\*\*\*\*/);
|
||||
}
|
||||
next;
|
||||
}
|
||||
# The input file format consists of blocks of Mozilla objects.
|
||||
# The blocks are separated by blank lines but may be related.
|
||||
elsif(/^\s*$/) {
|
||||
$main_block = 0;
|
||||
$trust_block = 0;
|
||||
next;
|
||||
}
|
||||
# Each certificate has a main block.
|
||||
elsif(/^# Certificate "(.*)"/) {
|
||||
(!$main_block && !$trust_block) or die "Unexpected certificate block";
|
||||
$main_block = 1;
|
||||
$main_block_name = $1;
|
||||
# Reset all other certificate variables.
|
||||
$trust_block = 0;
|
||||
$trust_block_name = "";
|
||||
$valid = 0;
|
||||
$start_of_cert = 0;
|
||||
$caname = "";
|
||||
$cka_value = "";
|
||||
undef @precert;
|
||||
next;
|
||||
}
|
||||
# Each certificate's main block is followed by a trust block.
|
||||
elsif(/^# Trust for (?:Certificate )?"(.*)"/) {
|
||||
(!$main_block && !$trust_block) or die "Unexpected trust block";
|
||||
$trust_block = 1;
|
||||
$trust_block_name = $1;
|
||||
if($main_block_name ne $trust_block_name) {
|
||||
die "cert name \"$main_block_name\" != trust name \"$trust_block_name\"";
|
||||
}
|
||||
next;
|
||||
}
|
||||
# Ignore other blocks.
|
||||
#
|
||||
# There is a documentation comment block, a BEGINDATA block, and a bunch of
|
||||
# blocks starting with "# Explicitly Distrust <certname>".
|
||||
#
|
||||
# The latter is for certificates that have already been removed and are not
|
||||
# included. Not all explicitly distrusted certificates are ignored at this
|
||||
# point, just those without an actual certificate.
|
||||
elsif(!$main_block && !$trust_block) {
|
||||
next;
|
||||
}
|
||||
elsif(/^#/) {
|
||||
# The commented lines in a main block are plaintext metadata that describes
|
||||
# the certificate. Issuer, Subject, Fingerprint, etc.
|
||||
if($main_block) {
|
||||
push @precert, $_ if not /^#$/;
|
||||
if(/^# Not Valid After : (.*)/) {
|
||||
my $stamp = $1;
|
||||
use Time::Piece;
|
||||
# Not Valid After : Thu Sep 30 14:01:15 2021
|
||||
my $t = Time::Piece->strptime($stamp, "%a %b %d %H:%M:%S %Y");
|
||||
my $delta = ($t->epoch - time()); # negative means no longer valid
|
||||
if($delta < 0) {
|
||||
$skipnum++;
|
||||
report "Skipping: $main_block_name is not valid anymore" if ($opt_v);
|
||||
$valid = 0;
|
||||
}
|
||||
else {
|
||||
$valid = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
next;
|
||||
}
|
||||
elsif(!$valid) {
|
||||
next;
|
||||
}
|
||||
|
||||
chomp;
|
||||
|
||||
if($main_block) {
|
||||
if(/^CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE/) {
|
||||
!$start_of_cert or die "Duplicate CKO_CERTIFICATE object";
|
||||
$start_of_cert = 1;
|
||||
next;
|
||||
}
|
||||
elsif(!$start_of_cert) {
|
||||
next;
|
||||
}
|
||||
elsif(/^CKA_LABEL UTF8 \"(.*)\"/) {
|
||||
($caname eq "") or die "Duplicate CKA_LABEL attribute";
|
||||
$caname = $1;
|
||||
if($caname ne $main_block_name) {
|
||||
die "caname \"$caname\" != cert name \"$main_block_name\"";
|
||||
}
|
||||
next;
|
||||
}
|
||||
elsif(/^CKA_VALUE MULTILINE_OCTAL/) {
|
||||
($cka_value eq "") or die "Duplicate CKA_VALUE attribute";
|
||||
while (<TXT>) {
|
||||
last if (/^END/);
|
||||
chomp;
|
||||
my @octets = split(/\\/);
|
||||
shift @octets;
|
||||
for (@octets) {
|
||||
$cka_value .= chr(oct);
|
||||
}
|
||||
}
|
||||
next;
|
||||
}
|
||||
elsif (/^CKA_NSS_SERVER_DISTRUST_AFTER (CK_BBOOL CK_FALSE|MULTILINE_OCTAL)/) {
|
||||
# Example:
|
||||
# CKA_NSS_SERVER_DISTRUST_AFTER MULTILINE_OCTAL
|
||||
# \062\060\060\066\061\067\060\060\060\060\060\060\132
|
||||
# END
|
||||
if($1 eq "MULTILINE_OCTAL") {
|
||||
my @timestamp;
|
||||
while (<TXT>) {
|
||||
last if (/^END/);
|
||||
chomp;
|
||||
my @octets = split(/\\/);
|
||||
shift @octets;
|
||||
for (@octets) {
|
||||
push @timestamp, chr(oct);
|
||||
}
|
||||
}
|
||||
scalar(@timestamp) == 13 or die "Failed parsing timestamp";
|
||||
# A trailing Z in the timestamp signifies UTC
|
||||
if($timestamp[12] ne "Z") {
|
||||
report "distrust date stamp is not using UTC";
|
||||
}
|
||||
# Example date: 200617000000Z
|
||||
# Means 2020-06-17 00:00:00 UTC
|
||||
my $distrustat =
|
||||
timegm($timestamp[10] . $timestamp[11], # second
|
||||
$timestamp[8] . $timestamp[9], # minute
|
||||
$timestamp[6] . $timestamp[7], # hour
|
||||
$timestamp[4] . $timestamp[5], # day
|
||||
($timestamp[2] . $timestamp[3]) - 1, # month
|
||||
"20" . $timestamp[0] . $timestamp[1]); # year
|
||||
if(time >= $distrustat) {
|
||||
# not trusted anymore
|
||||
$skipnum++;
|
||||
report "Skipping: $main_block_name is not trusted anymore" if ($opt_v);
|
||||
$valid = 0;
|
||||
}
|
||||
else {
|
||||
# still trusted
|
||||
}
|
||||
}
|
||||
next;
|
||||
}
|
||||
else {
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
if(!$trust_block || !$start_of_cert || $caname eq "" || $cka_value eq "") {
|
||||
die "Certificate extraction failed";
|
||||
}
|
||||
|
||||
my %trust_purposes_by_level;
|
||||
|
||||
if(/^CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST/) {
|
||||
# now scan the trust part to determine how we should trust this cert
|
||||
while (<TXT>) {
|
||||
if(/^\s*$/) {
|
||||
$trust_block = 0;
|
||||
last;
|
||||
}
|
||||
if (/^CKA_TRUST_([A-Z_]+)\s+CK_TRUST\s+CKT_NSS_([A-Z_]+)\s*$/) {
|
||||
if ( !is_in_list($1,@valid_mozilla_trust_purposes) ) {
|
||||
report "Warning: Unrecognized trust purpose for cert: $caname. Trust purpose: $1. Trust Level: $2";
|
||||
} elsif ( !is_in_list($2,@valid_mozilla_trust_levels) ) {
|
||||
report "Warning: Unrecognized trust level for cert: $caname. Trust purpose: $1. Trust Level: $2";
|
||||
} else {
|
||||
push @{$trust_purposes_by_level{$2}}, $1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Sanity check that an explicitly distrusted certificate only has trust
|
||||
# purposes with a trust level of NOT_TRUSTED.
|
||||
#
|
||||
# Certificate objects that are explicitly distrusted are in a certificate
|
||||
# block that starts # Certificate "Explicitly Distrust(ed) <certname>",
|
||||
# where "Explicitly Distrust(ed) " was prepended to the original cert name.
|
||||
if($caname =~ /distrust/i ||
|
||||
$main_block_name =~ /distrust/i ||
|
||||
$trust_block_name =~ /distrust/i) {
|
||||
my @levels = keys %trust_purposes_by_level;
|
||||
if(scalar(@levels) != 1 || $levels[0] ne "NOT_TRUSTED") {
|
||||
die "\"$caname\" must have all trust purposes at level NOT_TRUSTED.";
|
||||
}
|
||||
}
|
||||
|
||||
if ( !should_output_cert(%trust_purposes_by_level) ) {
|
||||
$skipnum ++;
|
||||
report "Skipping: $caname lacks acceptable trust level" if ($opt_v);
|
||||
} else {
|
||||
my $encoded = MIME::Base64::encode_base64($cka_value, '');
|
||||
$encoded =~ s/(.{1,${opt_w}})/$1\n/g;
|
||||
my $pem = "-----BEGIN CERTIFICATE-----\n"
|
||||
. $encoded
|
||||
. "-----END CERTIFICATE-----\n";
|
||||
print CRT "\n$caname\n";
|
||||
my $maxStringLength = length(decode('UTF-8', $caname, Encode::FB_CROAK | Encode::LEAVE_SRC));
|
||||
print CRT ("=" x $maxStringLength . "\n");
|
||||
if ($opt_t) {
|
||||
foreach my $key (sort keys %trust_purposes_by_level) {
|
||||
my $string = $key . ": " . join(", ", @{$trust_purposes_by_level{$key}});
|
||||
print CRT $string . "\n";
|
||||
}
|
||||
}
|
||||
if($opt_m) {
|
||||
print CRT for @precert;
|
||||
}
|
||||
if (!$opt_t) {
|
||||
print CRT $pem;
|
||||
} else {
|
||||
my $pipe = "";
|
||||
foreach my $hash (@included_signature_algorithms) {
|
||||
$pipe = "|$openssl x509 -" . $hash . " -fingerprint -noout -inform PEM";
|
||||
if (!$stdout) {
|
||||
$pipe .= " >> $crt.~";
|
||||
close(CRT) or die "Couldn't close $crt.~: $!";
|
||||
}
|
||||
open(TMP, $pipe) or die "Couldn't open openssl pipe: $!";
|
||||
print TMP $pem;
|
||||
close(TMP) or die "Couldn't close openssl pipe: $!";
|
||||
if (!$stdout) {
|
||||
open(CRT, ">>$crt.~") or die "Couldn't open $crt.~: $!";
|
||||
}
|
||||
}
|
||||
$pipe = "|$openssl x509 -text -inform PEM";
|
||||
if (!$stdout) {
|
||||
$pipe .= " >> $crt.~";
|
||||
close(CRT) or die "Couldn't close $crt.~: $!";
|
||||
}
|
||||
open(TMP, $pipe) or die "Couldn't open openssl pipe: $!";
|
||||
print TMP $pem;
|
||||
close(TMP) or die "Couldn't close openssl pipe: $!";
|
||||
if (!$stdout) {
|
||||
open(CRT, ">>$crt.~") or die "Couldn't open $crt.~: $!";
|
||||
}
|
||||
}
|
||||
report "Processed: $caname" if ($opt_v);
|
||||
$certnum ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
close(TXT) or die "Couldn't close $txt: $!\n";
|
||||
close(CRT) or die "Couldn't close $crt.~: $!\n";
|
||||
unless( $stdout ) {
|
||||
if ($opt_b && -e $crt) {
|
||||
my $bk = 1;
|
||||
while (-e "$crt.~${bk}~") {
|
||||
$bk++;
|
||||
}
|
||||
rename $crt, "$crt.~${bk}~" or die "Failed to create backup $crt.~$bk}~: $!\n";
|
||||
} elsif( -e $crt ) {
|
||||
unlink( $crt ) or die "Failed to remove $crt: $!\n";
|
||||
}
|
||||
rename "$crt.~", $crt or die "Failed to rename $crt.~ to $crt: $!\n";
|
||||
}
|
||||
if($opt_u && -e $txt && !unlink($txt)) {
|
||||
report "Failed to remove $txt: $!\n";
|
||||
}
|
||||
report "Done ($certnum CA certs processed, $skipnum skipped).";
|
3261
3rdparty/curl/include/curl/curl.h
vendored
3261
3rdparty/curl/include/curl/curl.h
vendored
File diff suppressed because it is too large
Load Diff
79
3rdparty/curl/include/curl/curlver.h
vendored
79
3rdparty/curl/include/curl/curlver.h
vendored
@ -1,79 +0,0 @@
|
||||
#ifndef CURLINC_CURLVER_H
|
||||
#define CURLINC_CURLVER_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 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
|
||||
* are also available at https://curl.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.
|
||||
*
|
||||
* SPDX-License-Identifier: curl
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* This header file contains nothing but libcurl version info, generated by
|
||||
a script at release-time. This was made its own header file in 7.11.2 */
|
||||
|
||||
/* This is the global package copyright */
|
||||
#define LIBCURL_COPYRIGHT "Daniel Stenberg, <daniel@haxx.se>."
|
||||
|
||||
/* This is the version number of the libcurl package from which this header
|
||||
file origins: */
|
||||
#define LIBCURL_VERSION "8.11.0-DEV"
|
||||
|
||||
/* The numeric version number is also available "in parts" by using these
|
||||
defines: */
|
||||
#define LIBCURL_VERSION_MAJOR 8
|
||||
#define LIBCURL_VERSION_MINOR 11
|
||||
#define LIBCURL_VERSION_PATCH 0
|
||||
|
||||
/* This is the numeric version of the libcurl version number, meant for easier
|
||||
parsing and comparisons by programs. The LIBCURL_VERSION_NUM define will
|
||||
always follow this syntax:
|
||||
|
||||
0xXXYYZZ
|
||||
|
||||
Where XX, YY and ZZ are the main version, release and patch numbers in
|
||||
hexadecimal (using 8 bits each). All three numbers are always represented
|
||||
using two digits. 1.2 would appear as "0x010200" while version 9.11.7
|
||||
appears as "0x090b07".
|
||||
|
||||
This 6-digit (24 bits) hexadecimal number does not show pre-release number,
|
||||
and it is always a greater number in a more recent release. It makes
|
||||
comparisons with greater than and less than work.
|
||||
|
||||
Note: This define is the full hex number and _does not_ use the
|
||||
CURL_VERSION_BITS() macro since curl's own configure script greps for it
|
||||
and needs it to contain the full number.
|
||||
*/
|
||||
#define LIBCURL_VERSION_NUM 0x080b00
|
||||
|
||||
/*
|
||||
* This is the date and time when the full source package was created. The
|
||||
* timestamp is not stored in git, as the timestamp is properly set in the
|
||||
* tarballs by the maketgz script.
|
||||
*
|
||||
* The format of the date follows this template:
|
||||
*
|
||||
* "2007-11-23"
|
||||
*/
|
||||
#define LIBCURL_TIMESTAMP "[unreleased]"
|
||||
|
||||
#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z))
|
||||
#define CURL_AT_LEAST_VERSION(x,y,z) \
|
||||
(LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
|
||||
|
||||
#endif /* CURLINC_CURLVER_H */
|
125
3rdparty/curl/include/curl/easy.h
vendored
125
3rdparty/curl/include/curl/easy.h
vendored
@ -1,125 +0,0 @@
|
||||
#ifndef CURLINC_EASY_H
|
||||
#define CURLINC_EASY_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 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
|
||||
* are also available at https://curl.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.
|
||||
*
|
||||
* SPDX-License-Identifier: curl
|
||||
*
|
||||
***************************************************************************/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Flag bits in the curl_blob struct: */
|
||||
#define CURL_BLOB_COPY 1 /* tell libcurl to copy the data */
|
||||
#define CURL_BLOB_NOCOPY 0 /* tell libcurl to NOT copy the data */
|
||||
|
||||
struct curl_blob {
|
||||
void *data;
|
||||
size_t len;
|
||||
unsigned int flags; /* bit 0 is defined, the rest are reserved and should be
|
||||
left zeroes */
|
||||
};
|
||||
|
||||
CURL_EXTERN CURL *curl_easy_init(void);
|
||||
CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
|
||||
CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);
|
||||
CURL_EXTERN void curl_easy_cleanup(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_getinfo()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Request internal information from the curl session with this function.
|
||||
* The third argument MUST be pointing to the specific type of the used option
|
||||
* which is documented in each manpage of the option. The data pointed to
|
||||
* will be filled in accordingly and can be relied upon only if the function
|
||||
* returns CURLE_OK. This function is intended to get used *AFTER* a performed
|
||||
* transfer, all results from this function are undefined until the transfer
|
||||
* is completed.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
|
||||
|
||||
|
||||
/*
|
||||
* NAME curl_easy_duphandle()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Creates a new curl session handle with the same options set for the handle
|
||||
* passed in. Duplicating a handle could only be a matter of cloning data and
|
||||
* options, internal state info and things like persistent connections cannot
|
||||
* be transferred. It is useful in multithreaded applications when you can run
|
||||
* curl_easy_duphandle() for each new thread to avoid a series of identical
|
||||
* curl_easy_setopt() invokes in every thread.
|
||||
*/
|
||||
CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_reset()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Re-initializes a CURL handle to the default values. This puts back the
|
||||
* handle to the same state as it was in when it was just created.
|
||||
*
|
||||
* It does keep: live connections, the Session ID cache, the DNS cache and the
|
||||
* cookies.
|
||||
*/
|
||||
CURL_EXTERN void curl_easy_reset(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_recv()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Receives data from the connected socket. Use after successful
|
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,
|
||||
size_t *n);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_send()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Sends data over the connected socket. Use after successful
|
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,
|
||||
size_t buflen, size_t *n);
|
||||
|
||||
|
||||
/*
|
||||
* NAME curl_easy_upkeep()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Performs connection upkeep for the given session handle.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_upkeep(CURL *curl);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end of extern "C" */
|
||||
#endif
|
||||
|
||||
#endif
|
74
3rdparty/curl/include/curl/header.h
vendored
74
3rdparty/curl/include/curl/header.h
vendored
@ -1,74 +0,0 @@
|
||||
#ifndef CURLINC_HEADER_H
|
||||
#define CURLINC_HEADER_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 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
|
||||
* are also available at https://curl.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.
|
||||
*
|
||||
* SPDX-License-Identifier: curl
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct curl_header {
|
||||
char *name; /* this might not use the same case */
|
||||
char *value;
|
||||
size_t amount; /* number of headers using this name */
|
||||
size_t index; /* ... of this instance, 0 or higher */
|
||||
unsigned int origin; /* see bits below */
|
||||
void *anchor; /* handle privately used by libcurl */
|
||||
};
|
||||
|
||||
/* 'origin' bits */
|
||||
#define CURLH_HEADER (1<<0) /* plain server header */
|
||||
#define CURLH_TRAILER (1<<1) /* trailers */
|
||||
#define CURLH_CONNECT (1<<2) /* CONNECT headers */
|
||||
#define CURLH_1XX (1<<3) /* 1xx headers */
|
||||
#define CURLH_PSEUDO (1<<4) /* pseudo headers */
|
||||
|
||||
typedef enum {
|
||||
CURLHE_OK,
|
||||
CURLHE_BADINDEX, /* header exists but not with this index */
|
||||
CURLHE_MISSING, /* no such header exists */
|
||||
CURLHE_NOHEADERS, /* no headers at all exist (yet) */
|
||||
CURLHE_NOREQUEST, /* no request with this number was used */
|
||||
CURLHE_OUT_OF_MEMORY, /* out of memory while processing */
|
||||
CURLHE_BAD_ARGUMENT, /* a function argument was not okay */
|
||||
CURLHE_NOT_BUILT_IN /* if API was disabled in the build */
|
||||
} CURLHcode;
|
||||
|
||||
CURL_EXTERN CURLHcode curl_easy_header(CURL *easy,
|
||||
const char *name,
|
||||
size_t index,
|
||||
unsigned int origin,
|
||||
int request,
|
||||
struct curl_header **hout);
|
||||
|
||||
CURL_EXTERN struct curl_header *curl_easy_nextheader(CURL *easy,
|
||||
unsigned int origin,
|
||||
int request,
|
||||
struct curl_header *prev);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end of extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CURLINC_HEADER_H */
|
85
3rdparty/curl/include/curl/mprintf.h
vendored
85
3rdparty/curl/include/curl/mprintf.h
vendored
@ -1,85 +0,0 @@
|
||||
#ifndef CURLINC_MPRINTF_H
|
||||
#define CURLINC_MPRINTF_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 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
|
||||
* are also available at https://curl.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.
|
||||
*
|
||||
* SPDX-License-Identifier: curl
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h> /* needed for FILE */
|
||||
#include "curl.h" /* for CURL_EXTERN */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef CURL_TEMP_PRINTF
|
||||
#if (defined(__GNUC__) || defined(__clang__) || \
|
||||
defined(__IAR_SYSTEMS_ICC__)) && \
|
||||
defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
|
||||
!defined(CURL_NO_FMT_CHECKS)
|
||||
#if defined(__MINGW32__) && !defined(__clang__)
|
||||
#if defined(__MINGW_PRINTF_FORMAT) /* mingw-w64 3.0.0+. Needs stdio.h. */
|
||||
#define CURL_TEMP_PRINTF(fmt, arg) \
|
||||
__attribute__((format(__MINGW_PRINTF_FORMAT, fmt, arg)))
|
||||
#else
|
||||
#define CURL_TEMP_PRINTF(fmt, arg)
|
||||
#endif
|
||||
#else
|
||||
#define CURL_TEMP_PRINTF(fmt, arg) \
|
||||
__attribute__((format(printf, fmt, arg)))
|
||||
#endif
|
||||
#else
|
||||
#define CURL_TEMP_PRINTF(fmt, arg)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
CURL_EXTERN int curl_mprintf(const char *format, ...)
|
||||
CURL_TEMP_PRINTF(1, 2);
|
||||
CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...)
|
||||
CURL_TEMP_PRINTF(2, 3);
|
||||
CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...)
|
||||
CURL_TEMP_PRINTF(2, 3);
|
||||
CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,
|
||||
const char *format, ...)
|
||||
CURL_TEMP_PRINTF(3, 4);
|
||||
CURL_EXTERN int curl_mvprintf(const char *format, va_list args)
|
||||
CURL_TEMP_PRINTF(1, 0);
|
||||
CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args)
|
||||
CURL_TEMP_PRINTF(2, 0);
|
||||
CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args)
|
||||
CURL_TEMP_PRINTF(2, 0);
|
||||
CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,
|
||||
const char *format, va_list args)
|
||||
CURL_TEMP_PRINTF(3, 0);
|
||||
CURL_EXTERN char *curl_maprintf(const char *format, ...)
|
||||
CURL_TEMP_PRINTF(1, 2);
|
||||
CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args)
|
||||
CURL_TEMP_PRINTF(1, 0);
|
||||
|
||||
#undef CURL_TEMP_PRINTF
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end of extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CURLINC_MPRINTF_H */
|
485
3rdparty/curl/include/curl/multi.h
vendored
485
3rdparty/curl/include/curl/multi.h
vendored
@ -1,485 +0,0 @@
|
||||
#ifndef CURLINC_MULTI_H
|
||||
#define CURLINC_MULTI_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 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
|
||||
* are also available at https://curl.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.
|
||||
*
|
||||
* SPDX-License-Identifier: curl
|
||||
*
|
||||
***************************************************************************/
|
||||
/*
|
||||
This is an "external" header file. Do not give away any internals here!
|
||||
|
||||
GOALS
|
||||
|
||||
o Enable a "pull" interface. The application that uses libcurl decides where
|
||||
and when to ask libcurl to get/send data.
|
||||
|
||||
o Enable multiple simultaneous transfers in the same thread without making it
|
||||
complicated for the application.
|
||||
|
||||
o Enable the application to select() on its own file descriptors and curl's
|
||||
file descriptors simultaneous easily.
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
* This header file should not really need to include "curl.h" since curl.h
|
||||
* itself includes this file and we expect user applications to do #include
|
||||
* <curl/curl.h> without the need for especially including multi.h.
|
||||
*
|
||||
* For some reason we added this include here at one point, and rather than to
|
||||
* break existing (wrongly written) libcurl applications, we leave it as-is
|
||||
* but with this warning attached.
|
||||
*/
|
||||
#include "curl.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(BUILDING_LIBCURL) || defined(CURL_STRICTER)
|
||||
typedef struct Curl_multi CURLM;
|
||||
#else
|
||||
typedef void CURLM;
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or
|
||||
curl_multi_socket*() soon */
|
||||
CURLM_OK,
|
||||
CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */
|
||||
CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */
|
||||
CURLM_OUT_OF_MEMORY, /* if you ever get this, you are in deep sh*t */
|
||||
CURLM_INTERNAL_ERROR, /* this is a libcurl bug */
|
||||
CURLM_BAD_SOCKET, /* the passed in socket argument did not match */
|
||||
CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */
|
||||
CURLM_ADDED_ALREADY, /* an easy handle already added to a multi handle was
|
||||
attempted to get added - again */
|
||||
CURLM_RECURSIVE_API_CALL, /* an api function was called from inside a
|
||||
callback */
|
||||
CURLM_WAKEUP_FAILURE, /* wakeup is unavailable or failed */
|
||||
CURLM_BAD_FUNCTION_ARGUMENT, /* function called with a bad parameter */
|
||||
CURLM_ABORTED_BY_CALLBACK,
|
||||
CURLM_UNRECOVERABLE_POLL,
|
||||
CURLM_LAST
|
||||
} CURLMcode;
|
||||
|
||||
/* just to make code nicer when using curl_multi_socket() you can now check
|
||||
for CURLM_CALL_MULTI_SOCKET too in the same style it works for
|
||||
curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */
|
||||
#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM
|
||||
|
||||
/* bitmask bits for CURLMOPT_PIPELINING */
|
||||
#define CURLPIPE_NOTHING 0L
|
||||
#define CURLPIPE_HTTP1 1L
|
||||
#define CURLPIPE_MULTIPLEX 2L
|
||||
|
||||
typedef enum {
|
||||
CURLMSG_NONE, /* first, not used */
|
||||
CURLMSG_DONE, /* This easy handle has completed. 'result' contains
|
||||
the CURLcode of the transfer */
|
||||
CURLMSG_LAST /* last, not used */
|
||||
} CURLMSG;
|
||||
|
||||
struct CURLMsg {
|
||||
CURLMSG msg; /* what this message means */
|
||||
CURL *easy_handle; /* the handle it concerns */
|
||||
union {
|
||||
void *whatever; /* message-specific data */
|
||||
CURLcode result; /* return code for transfer */
|
||||
} data;
|
||||
};
|
||||
typedef struct CURLMsg CURLMsg;
|
||||
|
||||
/* Based on poll(2) structure and values.
|
||||
* We do not use pollfd and POLL* constants explicitly
|
||||
* to cover platforms without poll(). */
|
||||
#define CURL_WAIT_POLLIN 0x0001
|
||||
#define CURL_WAIT_POLLPRI 0x0002
|
||||
#define CURL_WAIT_POLLOUT 0x0004
|
||||
|
||||
struct curl_waitfd {
|
||||
curl_socket_t fd;
|
||||
short events;
|
||||
short revents;
|
||||
};
|
||||
|
||||
/*
|
||||
* Name: curl_multi_init()
|
||||
*
|
||||
* Desc: initialize multi-style curl usage
|
||||
*
|
||||
* Returns: a new CURLM handle to use in all 'curl_multi' functions.
|
||||
*/
|
||||
CURL_EXTERN CURLM *curl_multi_init(void);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_add_handle()
|
||||
*
|
||||
* Desc: add a standard curl handle to the multi stack
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle,
|
||||
CURL *curl_handle);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_remove_handle()
|
||||
*
|
||||
* Desc: removes a curl handle from the multi stack again
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
|
||||
CURL *curl_handle);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_fdset()
|
||||
*
|
||||
* Desc: Ask curl for its fd_set sets. The app can use these to select() or
|
||||
* poll() on. We want curl_multi_perform() called as soon as one of
|
||||
* them are ready.
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
|
||||
fd_set *read_fd_set,
|
||||
fd_set *write_fd_set,
|
||||
fd_set *exc_fd_set,
|
||||
int *max_fd);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_wait()
|
||||
*
|
||||
* Desc: Poll on all fds within a CURLM set as well as any
|
||||
* additional fds passed to the function.
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle,
|
||||
struct curl_waitfd extra_fds[],
|
||||
unsigned int extra_nfds,
|
||||
int timeout_ms,
|
||||
int *ret);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_poll()
|
||||
*
|
||||
* Desc: Poll on all fds within a CURLM set as well as any
|
||||
* additional fds passed to the function.
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_poll(CURLM *multi_handle,
|
||||
struct curl_waitfd extra_fds[],
|
||||
unsigned int extra_nfds,
|
||||
int timeout_ms,
|
||||
int *ret);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_wakeup()
|
||||
*
|
||||
* Desc: wakes up a sleeping curl_multi_poll call.
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_wakeup(CURLM *multi_handle);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_perform()
|
||||
*
|
||||
* Desc: When the app thinks there is data available for curl it calls this
|
||||
* function to read/write whatever there is right now. This returns
|
||||
* as soon as the reads and writes are done. This function does not
|
||||
* require that there actually is data available for reading or that
|
||||
* data can be written, it can be called just in case. It returns
|
||||
* the number of handles that still transfer data in the second
|
||||
* argument's integer-pointer.
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code. *NOTE* that this only
|
||||
* returns errors etc regarding the whole multi stack. There might
|
||||
* still have occurred problems on individual transfers even when
|
||||
* this returns OK.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,
|
||||
int *running_handles);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_cleanup()
|
||||
*
|
||||
* Desc: Cleans up and removes a whole multi stack. It does not free or
|
||||
* touch any individual easy handles in any way. We need to define
|
||||
* in what state those handles will be if this function is called
|
||||
* in the middle of a transfer.
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_info_read()
|
||||
*
|
||||
* Desc: Ask the multi handle if there is any messages/informationals from
|
||||
* the individual transfers. Messages include informationals such as
|
||||
* error code from the transfer or just the fact that a transfer is
|
||||
* completed. More details on these should be written down as well.
|
||||
*
|
||||
* Repeated calls to this function will return a new struct each
|
||||
* time, until a special "end of msgs" struct is returned as a signal
|
||||
* that there is no more to get at this point.
|
||||
*
|
||||
* The data the returned pointer points to will not survive calling
|
||||
* curl_multi_cleanup().
|
||||
*
|
||||
* The 'CURLMsg' struct is meant to be very simple and only contain
|
||||
* very basic information. If more involved information is wanted,
|
||||
* we will provide the particular "transfer handle" in that struct
|
||||
* and that should/could/would be used in subsequent
|
||||
* curl_easy_getinfo() calls (or similar). The point being that we
|
||||
* must never expose complex structs to applications, as then we will
|
||||
* undoubtably get backwards compatibility problems in the future.
|
||||
*
|
||||
* Returns: A pointer to a filled-in struct, or NULL if it failed or ran out
|
||||
* of structs. It also writes the number of messages left in the
|
||||
* queue (after this read) in the integer the second argument points
|
||||
* to.
|
||||
*/
|
||||
CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,
|
||||
int *msgs_in_queue);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_strerror()
|
||||
*
|
||||
* Desc: The curl_multi_strerror function may be used to turn a CURLMcode
|
||||
* value into the equivalent human readable error string. This is
|
||||
* useful for printing meaningful error messages.
|
||||
*
|
||||
* Returns: A pointer to a null-terminated error message.
|
||||
*/
|
||||
CURL_EXTERN const char *curl_multi_strerror(CURLMcode);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_socket() and
|
||||
* curl_multi_socket_all()
|
||||
*
|
||||
* Desc: An alternative version of curl_multi_perform() that allows the
|
||||
* application to pass in one of the file descriptors that have been
|
||||
* detected to have "action" on them and let libcurl perform.
|
||||
* See manpage for details.
|
||||
*/
|
||||
#define CURL_POLL_NONE 0
|
||||
#define CURL_POLL_IN 1
|
||||
#define CURL_POLL_OUT 2
|
||||
#define CURL_POLL_INOUT 3
|
||||
#define CURL_POLL_REMOVE 4
|
||||
|
||||
#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD
|
||||
|
||||
#define CURL_CSELECT_IN 0x01
|
||||
#define CURL_CSELECT_OUT 0x02
|
||||
#define CURL_CSELECT_ERR 0x04
|
||||
|
||||
typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */
|
||||
curl_socket_t s, /* socket */
|
||||
int what, /* see above */
|
||||
void *userp, /* private callback
|
||||
pointer */
|
||||
void *socketp); /* private socket
|
||||
pointer */
|
||||
/*
|
||||
* Name: curl_multi_timer_callback
|
||||
*
|
||||
* Desc: Called by libcurl whenever the library detects a change in the
|
||||
* maximum number of milliseconds the app is allowed to wait before
|
||||
* curl_multi_socket() or curl_multi_perform() must be called
|
||||
* (to allow libcurl's timed events to take place).
|
||||
*
|
||||
* Returns: The callback should return zero.
|
||||
*/
|
||||
typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */
|
||||
long timeout_ms, /* see above */
|
||||
void *userp); /* private callback
|
||||
pointer */
|
||||
|
||||
CURL_EXTERN CURLMcode CURL_DEPRECATED(7.19.5, "Use curl_multi_socket_action()")
|
||||
curl_multi_socket(CURLM *multi_handle, curl_socket_t s, int *running_handles);
|
||||
|
||||
CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle,
|
||||
curl_socket_t s,
|
||||
int ev_bitmask,
|
||||
int *running_handles);
|
||||
|
||||
CURL_EXTERN CURLMcode CURL_DEPRECATED(7.19.5, "Use curl_multi_socket_action()")
|
||||
curl_multi_socket_all(CURLM *multi_handle, int *running_handles);
|
||||
|
||||
#ifndef CURL_ALLOW_OLD_MULTI_SOCKET
|
||||
/* This macro below was added in 7.16.3 to push users who recompile to use
|
||||
the new curl_multi_socket_action() instead of the old curl_multi_socket()
|
||||
*/
|
||||
#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Name: curl_multi_timeout()
|
||||
*
|
||||
* Desc: Returns the maximum number of milliseconds the app is allowed to
|
||||
* wait before curl_multi_socket() or curl_multi_perform() must be
|
||||
* called (to allow libcurl's timed events to take place).
|
||||
*
|
||||
* Returns: CURLM error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,
|
||||
long *milliseconds);
|
||||
|
||||
typedef enum {
|
||||
/* This is the socket callback function pointer */
|
||||
CURLOPT(CURLMOPT_SOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 1),
|
||||
|
||||
/* This is the argument passed to the socket callback */
|
||||
CURLOPT(CURLMOPT_SOCKETDATA, CURLOPTTYPE_OBJECTPOINT, 2),
|
||||
|
||||
/* set to 1 to enable pipelining for this multi handle */
|
||||
CURLOPT(CURLMOPT_PIPELINING, CURLOPTTYPE_LONG, 3),
|
||||
|
||||
/* This is the timer callback function pointer */
|
||||
CURLOPT(CURLMOPT_TIMERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 4),
|
||||
|
||||
/* This is the argument passed to the timer callback */
|
||||
CURLOPT(CURLMOPT_TIMERDATA, CURLOPTTYPE_OBJECTPOINT, 5),
|
||||
|
||||
/* maximum number of entries in the connection cache */
|
||||
CURLOPT(CURLMOPT_MAXCONNECTS, CURLOPTTYPE_LONG, 6),
|
||||
|
||||
/* maximum number of (pipelining) connections to one host */
|
||||
CURLOPT(CURLMOPT_MAX_HOST_CONNECTIONS, CURLOPTTYPE_LONG, 7),
|
||||
|
||||
/* maximum number of requests in a pipeline */
|
||||
CURLOPT(CURLMOPT_MAX_PIPELINE_LENGTH, CURLOPTTYPE_LONG, 8),
|
||||
|
||||
/* a connection with a content-length longer than this
|
||||
will not be considered for pipelining */
|
||||
CURLOPT(CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE, CURLOPTTYPE_OFF_T, 9),
|
||||
|
||||
/* a connection with a chunk length longer than this
|
||||
will not be considered for pipelining */
|
||||
CURLOPT(CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE, CURLOPTTYPE_OFF_T, 10),
|
||||
|
||||
/* a list of site names(+port) that are blocked from pipelining */
|
||||
CURLOPT(CURLMOPT_PIPELINING_SITE_BL, CURLOPTTYPE_OBJECTPOINT, 11),
|
||||
|
||||
/* a list of server types that are blocked from pipelining */
|
||||
CURLOPT(CURLMOPT_PIPELINING_SERVER_BL, CURLOPTTYPE_OBJECTPOINT, 12),
|
||||
|
||||
/* maximum number of open connections in total */
|
||||
CURLOPT(CURLMOPT_MAX_TOTAL_CONNECTIONS, CURLOPTTYPE_LONG, 13),
|
||||
|
||||
/* This is the server push callback function pointer */
|
||||
CURLOPT(CURLMOPT_PUSHFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 14),
|
||||
|
||||
/* This is the argument passed to the server push callback */
|
||||
CURLOPT(CURLMOPT_PUSHDATA, CURLOPTTYPE_OBJECTPOINT, 15),
|
||||
|
||||
/* maximum number of concurrent streams to support on a connection */
|
||||
CURLOPT(CURLMOPT_MAX_CONCURRENT_STREAMS, CURLOPTTYPE_LONG, 16),
|
||||
|
||||
CURLMOPT_LASTENTRY /* the last unused */
|
||||
} CURLMoption;
|
||||
|
||||
|
||||
/*
|
||||
* Name: curl_multi_setopt()
|
||||
*
|
||||
* Desc: Sets options for the multi handle.
|
||||
*
|
||||
* Returns: CURLM error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,
|
||||
CURLMoption option, ...);
|
||||
|
||||
|
||||
/*
|
||||
* Name: curl_multi_assign()
|
||||
*
|
||||
* Desc: This function sets an association in the multi handle between the
|
||||
* given socket and a private pointer of the application. This is
|
||||
* (only) useful for curl_multi_socket uses.
|
||||
*
|
||||
* Returns: CURLM error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,
|
||||
curl_socket_t sockfd, void *sockp);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_get_handles()
|
||||
*
|
||||
* Desc: Returns an allocated array holding all handles currently added to
|
||||
* the multi handle. Marks the final entry with a NULL pointer. If
|
||||
* there is no easy handle added to the multi handle, this function
|
||||
* returns an array with the first entry as a NULL pointer.
|
||||
*
|
||||
* Returns: NULL on failure, otherwise a CURL **array pointer
|
||||
*/
|
||||
CURL_EXTERN CURL **curl_multi_get_handles(CURLM *multi_handle);
|
||||
|
||||
/*
|
||||
* Name: curl_push_callback
|
||||
*
|
||||
* Desc: This callback gets called when a new stream is being pushed by the
|
||||
* server. It approves or denies the new stream. It can also decide
|
||||
* to completely fail the connection.
|
||||
*
|
||||
* Returns: CURL_PUSH_OK, CURL_PUSH_DENY or CURL_PUSH_ERROROUT
|
||||
*/
|
||||
#define CURL_PUSH_OK 0
|
||||
#define CURL_PUSH_DENY 1
|
||||
#define CURL_PUSH_ERROROUT 2 /* added in 7.72.0 */
|
||||
|
||||
struct curl_pushheaders; /* forward declaration only */
|
||||
|
||||
CURL_EXTERN char *curl_pushheader_bynum(struct curl_pushheaders *h,
|
||||
size_t num);
|
||||
CURL_EXTERN char *curl_pushheader_byname(struct curl_pushheaders *h,
|
||||
const char *name);
|
||||
|
||||
typedef int (*curl_push_callback)(CURL *parent,
|
||||
CURL *easy,
|
||||
size_t num_headers,
|
||||
struct curl_pushheaders *headers,
|
||||
void *userp);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_waitfds()
|
||||
*
|
||||
* Desc: Ask curl for fds for polling. The app can use these to poll on.
|
||||
* We want curl_multi_perform() called as soon as one of them are
|
||||
* ready. Passing zero size allows to get just a number of fds.
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_waitfds(CURLM *multi,
|
||||
struct curl_waitfd *ufds,
|
||||
unsigned int size,
|
||||
unsigned int *fd_count);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end of extern "C" */
|
||||
#endif
|
||||
|
||||
#endif
|
70
3rdparty/curl/include/curl/options.h
vendored
70
3rdparty/curl/include/curl/options.h
vendored
@ -1,70 +0,0 @@
|
||||
#ifndef CURLINC_OPTIONS_H
|
||||
#define CURLINC_OPTIONS_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 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
|
||||
* are also available at https://curl.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.
|
||||
*
|
||||
* SPDX-License-Identifier: curl
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
CURLOT_LONG, /* long (a range of values) */
|
||||
CURLOT_VALUES, /* (a defined set or bitmask) */
|
||||
CURLOT_OFF_T, /* curl_off_t (a range of values) */
|
||||
CURLOT_OBJECT, /* pointer (void *) */
|
||||
CURLOT_STRING, /* (char * to null-terminated buffer) */
|
||||
CURLOT_SLIST, /* (struct curl_slist *) */
|
||||
CURLOT_CBPTR, /* (void * passed as-is to a callback) */
|
||||
CURLOT_BLOB, /* blob (struct curl_blob *) */
|
||||
CURLOT_FUNCTION /* function pointer */
|
||||
} curl_easytype;
|
||||
|
||||
/* Flag bits */
|
||||
|
||||
/* "alias" means it is provided for old programs to remain functional,
|
||||
we prefer another name */
|
||||
#define CURLOT_FLAG_ALIAS (1<<0)
|
||||
|
||||
/* The CURLOPTTYPE_* id ranges can still be used to figure out what type/size
|
||||
to use for curl_easy_setopt() for the given id */
|
||||
struct curl_easyoption {
|
||||
const char *name;
|
||||
CURLoption id;
|
||||
curl_easytype type;
|
||||
unsigned int flags;
|
||||
};
|
||||
|
||||
CURL_EXTERN const struct curl_easyoption *
|
||||
curl_easy_option_by_name(const char *name);
|
||||
|
||||
CURL_EXTERN const struct curl_easyoption *
|
||||
curl_easy_option_by_id(CURLoption id);
|
||||
|
||||
CURL_EXTERN const struct curl_easyoption *
|
||||
curl_easy_option_next(const struct curl_easyoption *prev);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end of extern "C" */
|
||||
#endif
|
||||
#endif /* CURLINC_OPTIONS_H */
|
35
3rdparty/curl/include/curl/stdcheaders.h
vendored
35
3rdparty/curl/include/curl/stdcheaders.h
vendored
@ -1,35 +0,0 @@
|
||||
#ifndef CURLINC_STDCHEADERS_H
|
||||
#define CURLINC_STDCHEADERS_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 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
|
||||
* are also available at https://curl.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.
|
||||
*
|
||||
* SPDX-License-Identifier: curl
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
size_t fread(void *, size_t, size_t, FILE *);
|
||||
size_t fwrite(const void *, size_t, size_t, FILE *);
|
||||
|
||||
int strcasecmp(const char *, const char *);
|
||||
int strncasecmp(const char *, const char *, size_t);
|
||||
|
||||
#endif /* CURLINC_STDCHEADERS_H */
|
496
3rdparty/curl/include/curl/system.h
vendored
496
3rdparty/curl/include/curl/system.h
vendored
@ -1,496 +0,0 @@
|
||||
#ifndef CURLINC_SYSTEM_H
|
||||
#define CURLINC_SYSTEM_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 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
|
||||
* are also available at https://curl.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.
|
||||
*
|
||||
* SPDX-License-Identifier: curl
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/*
|
||||
* Try to keep one section per platform, compiler and architecture, otherwise,
|
||||
* if an existing section is reused for a different one and later on the
|
||||
* original is adjusted, probably the piggybacking one can be adversely
|
||||
* changed.
|
||||
*
|
||||
* In order to differentiate between platforms/compilers/architectures use
|
||||
* only compiler built-in predefined preprocessor symbols.
|
||||
*
|
||||
* curl_off_t
|
||||
* ----------
|
||||
*
|
||||
* For any given platform/compiler curl_off_t must be typedef'ed to a 64-bit
|
||||
* wide signed integral data type. The width of this data type must remain
|
||||
* constant and independent of any possible large file support settings.
|
||||
*
|
||||
* As an exception to the above, curl_off_t shall be typedef'ed to a 32-bit
|
||||
* wide signed integral data type if there is no 64-bit type.
|
||||
*
|
||||
* As a general rule, curl_off_t shall not be mapped to off_t. This rule shall
|
||||
* only be violated if off_t is the only 64-bit data type available and the
|
||||
* size of off_t is independent of large file support settings. Keep your
|
||||
* build on the safe side avoiding an off_t gating. If you have a 64-bit
|
||||
* off_t then take for sure that another 64-bit data type exists, dig deeper
|
||||
* and you will find it.
|
||||
*
|
||||
*/
|
||||
|
||||
#if defined(__DJGPP__) || defined(__GO32__)
|
||||
# if defined(__DJGPP__) && (__DJGPP__ > 1)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# else
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
|
||||
#elif defined(__SALFORDC__)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
|
||||
#elif defined(__BORLANDC__)
|
||||
# if (__BORLANDC__ < 0x520)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# else
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
|
||||
#elif defined(__TURBOC__)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
|
||||
#elif defined(__POCC__)
|
||||
# if (__POCC__ < 280)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# elif defined(_MSC_VER)
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# else
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
|
||||
#elif defined(__LCC__)
|
||||
# if defined(__MCST__) /* MCST eLbrus Compiler Collection */
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
# else /* Local (or Little) C Compiler */
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# endif
|
||||
|
||||
#elif defined(macintosh)
|
||||
# include <ConditionalMacros.h>
|
||||
# if TYPE_LONGLONG
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# else
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
|
||||
|
||||
#elif defined(__TANDEM)
|
||||
# if ! defined(__LP64)
|
||||
/* Required for 32-bit NonStop builds only. */
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# endif
|
||||
|
||||
#elif defined(_WIN32_WCE)
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
|
||||
#elif defined(__MINGW32__)
|
||||
# include <inttypes.h>
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T PRId64
|
||||
# define CURL_FORMAT_CURL_OFF_TU PRIu64
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
|
||||
#elif defined(__VMS)
|
||||
# if defined(__VAX)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# else
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
|
||||
|
||||
#elif defined(__OS400__)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
|
||||
#elif defined(__MVS__)
|
||||
# if defined(_LONG_LONG)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(_LP64)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# else
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
|
||||
#elif defined(__370__)
|
||||
# if defined(__IBMC__) || defined(__IBMCPP__)
|
||||
# if defined(_ILP32)
|
||||
# elif defined(_LP64)
|
||||
# endif
|
||||
# if defined(_LONG_LONG)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(_LP64)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# else
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
# endif
|
||||
|
||||
#elif defined(TPF)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
|
||||
#elif defined(__TINYC__) /* also known as tcc */
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
|
||||
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* Oracle Solaris Studio */
|
||||
# if !defined(__LP64) && (defined(__ILP32) || \
|
||||
defined(__i386) || \
|
||||
defined(__sparcv8) || \
|
||||
defined(__sparcv8plus))
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(__LP64) || \
|
||||
defined(__amd64) || defined(__sparcv9)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
|
||||
#elif defined(__xlc__) /* IBM xlc compiler */
|
||||
# if !defined(_LP64)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# else
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
|
||||
#elif defined(__hpux) /* HP aCC compiler */
|
||||
# if !defined(_LP64)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# else
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
|
||||
/* ===================================== */
|
||||
/* KEEP MSVC THE PENULTIMATE ENTRY */
|
||||
/* ===================================== */
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
# if (_MSC_VER >= 1800)
|
||||
# include <inttypes.h>
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T PRId64
|
||||
# define CURL_FORMAT_CURL_OFF_TU PRIu64
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# elif (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# else
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
|
||||
/* ===================================== */
|
||||
/* KEEP GENERIC GCC THE LAST ENTRY */
|
||||
/* ===================================== */
|
||||
|
||||
#elif defined(__GNUC__) && !defined(_SCO_DS)
|
||||
# if !defined(__LP64__) && \
|
||||
(defined(__ILP32__) || defined(__i386__) || defined(__hppa__) || \
|
||||
defined(__ppc__) || defined(__powerpc__) || defined(__arm__) || \
|
||||
defined(__sparc__) || defined(__mips__) || defined(__sh__) || \
|
||||
defined(__XTENSA__) || \
|
||||
(defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 4) || \
|
||||
(defined(__LONG_MAX__) && __LONG_MAX__ == 2147483647L))
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(__LP64__) || \
|
||||
defined(__x86_64__) || defined(__ppc64__) || defined(__sparc64__) || \
|
||||
defined(__e2k__) || \
|
||||
(defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 8) || \
|
||||
(defined(__LONG_MAX__) && __LONG_MAX__ == 9223372036854775807L)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
|
||||
#else
|
||||
/* generic "safe guess" on old 32-bit style */
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
#endif
|
||||
|
||||
#ifdef _AIX
|
||||
/* AIX needs <sys/poll.h> */
|
||||
#define CURL_PULL_SYS_POLL_H
|
||||
#endif
|
||||
|
||||
/* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file */
|
||||
/* sys/types.h is required here to properly make type definitions below. */
|
||||
#ifdef CURL_PULL_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
/* CURL_PULL_SYS_SOCKET_H is defined above when inclusion of header file */
|
||||
/* sys/socket.h is required here to properly make type definitions below. */
|
||||
#ifdef CURL_PULL_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
/* CURL_PULL_SYS_POLL_H is defined above when inclusion of header file */
|
||||
/* sys/poll.h is required here to properly make type definitions below. */
|
||||
#ifdef CURL_PULL_SYS_POLL_H
|
||||
# include <sys/poll.h>
|
||||
#endif
|
||||
|
||||
/* Data type definition of curl_socklen_t. */
|
||||
#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
|
||||
typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
|
||||
#endif
|
||||
|
||||
/* Data type definition of curl_off_t. */
|
||||
|
||||
#ifdef CURL_TYPEOF_CURL_OFF_T
|
||||
typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow
|
||||
* these to be visible and exported by the external libcurl interface API,
|
||||
* while also making them visible to the library internals, simply including
|
||||
* curl_setup.h, without actually needing to include curl.h internally.
|
||||
* If some day this section would grow big enough, all this should be moved
|
||||
* to its own header file.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Figure out if we can use the ## preprocessor operator, which is supported
|
||||
* by ISO/ANSI C and C++. Some compilers support it without setting __STDC__
|
||||
* or __cplusplus so we need to carefully check for them too.
|
||||
*/
|
||||
|
||||
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \
|
||||
defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \
|
||||
defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \
|
||||
defined(__ILEC400__)
|
||||
/* This compiler is believed to have an ISO compatible preprocessor */
|
||||
#define CURL_ISOCPP
|
||||
#else
|
||||
/* This compiler is believed NOT to have an ISO compatible preprocessor */
|
||||
#undef CURL_ISOCPP
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Macros for minimum-width signed and unsigned curl_off_t integer constants.
|
||||
*/
|
||||
|
||||
#if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551)
|
||||
# define CURLINC_OFF_T_C_HLPR2(x) x
|
||||
# define CURLINC_OFF_T_C_HLPR1(x) CURLINC_OFF_T_C_HLPR2(x)
|
||||
# define CURL_OFF_T_C(Val) CURLINC_OFF_T_C_HLPR1(Val) ## \
|
||||
CURLINC_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T)
|
||||
# define CURL_OFF_TU_C(Val) CURLINC_OFF_T_C_HLPR1(Val) ## \
|
||||
CURLINC_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU)
|
||||
#else
|
||||
# ifdef CURL_ISOCPP
|
||||
# define CURLINC_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix
|
||||
# else
|
||||
# define CURLINC_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix
|
||||
# endif
|
||||
# define CURLINC_OFF_T_C_HLPR1(Val,Suffix) CURLINC_OFF_T_C_HLPR2(Val,Suffix)
|
||||
# define CURL_OFF_T_C(Val) CURLINC_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T)
|
||||
# define CURL_OFF_TU_C(Val) CURLINC_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU)
|
||||
#endif
|
||||
|
||||
#endif /* CURLINC_SYSTEM_H */
|
718
3rdparty/curl/include/curl/typecheck-gcc.h
vendored
718
3rdparty/curl/include/curl/typecheck-gcc.h
vendored
@ -1,718 +0,0 @@
|
||||
#ifndef CURLINC_TYPECHECK_GCC_H
|
||||
#define CURLINC_TYPECHECK_GCC_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 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
|
||||
* are also available at https://curl.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.
|
||||
*
|
||||
* SPDX-License-Identifier: curl
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* wraps curl_easy_setopt() with typechecking */
|
||||
|
||||
/* To add a new kind of warning, add an
|
||||
* if(curlcheck_sometype_option(_curl_opt))
|
||||
* if(!curlcheck_sometype(value))
|
||||
* _curl_easy_setopt_err_sometype();
|
||||
* block and define curlcheck_sometype_option, curlcheck_sometype and
|
||||
* _curl_easy_setopt_err_sometype below
|
||||
*
|
||||
* NOTE: We use two nested 'if' statements here instead of the && operator, in
|
||||
* order to work around gcc bug #32061. It affects only gcc 4.3.x/4.4.x
|
||||
* when compiling with -Wlogical-op.
|
||||
*
|
||||
* To add an option that uses the same type as an existing option, you will
|
||||
* just need to extend the appropriate _curl_*_option macro
|
||||
*/
|
||||
#define curl_easy_setopt(handle, option, value) \
|
||||
__extension__({ \
|
||||
CURLoption _curl_opt = (option); \
|
||||
if(__builtin_constant_p(_curl_opt)) { \
|
||||
CURL_IGNORE_DEPRECATION( \
|
||||
if(curlcheck_long_option(_curl_opt)) \
|
||||
if(!curlcheck_long(value)) \
|
||||
_curl_easy_setopt_err_long(); \
|
||||
if(curlcheck_off_t_option(_curl_opt)) \
|
||||
if(!curlcheck_off_t(value)) \
|
||||
_curl_easy_setopt_err_curl_off_t(); \
|
||||
if(curlcheck_string_option(_curl_opt)) \
|
||||
if(!curlcheck_string(value)) \
|
||||
_curl_easy_setopt_err_string(); \
|
||||
if(curlcheck_write_cb_option(_curl_opt)) \
|
||||
if(!curlcheck_write_cb(value)) \
|
||||
_curl_easy_setopt_err_write_callback(); \
|
||||
if((_curl_opt) == CURLOPT_RESOLVER_START_FUNCTION) \
|
||||
if(!curlcheck_resolver_start_callback(value)) \
|
||||
_curl_easy_setopt_err_resolver_start_callback(); \
|
||||
if((_curl_opt) == CURLOPT_READFUNCTION) \
|
||||
if(!curlcheck_read_cb(value)) \
|
||||
_curl_easy_setopt_err_read_cb(); \
|
||||
if((_curl_opt) == CURLOPT_IOCTLFUNCTION) \
|
||||
if(!curlcheck_ioctl_cb(value)) \
|
||||
_curl_easy_setopt_err_ioctl_cb(); \
|
||||
if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \
|
||||
if(!curlcheck_sockopt_cb(value)) \
|
||||
_curl_easy_setopt_err_sockopt_cb(); \
|
||||
if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \
|
||||
if(!curlcheck_opensocket_cb(value)) \
|
||||
_curl_easy_setopt_err_opensocket_cb(); \
|
||||
if((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \
|
||||
if(!curlcheck_progress_cb(value)) \
|
||||
_curl_easy_setopt_err_progress_cb(); \
|
||||
if((_curl_opt) == CURLOPT_DEBUGFUNCTION) \
|
||||
if(!curlcheck_debug_cb(value)) \
|
||||
_curl_easy_setopt_err_debug_cb(); \
|
||||
if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \
|
||||
if(!curlcheck_ssl_ctx_cb(value)) \
|
||||
_curl_easy_setopt_err_ssl_ctx_cb(); \
|
||||
if(curlcheck_conv_cb_option(_curl_opt)) \
|
||||
if(!curlcheck_conv_cb(value)) \
|
||||
_curl_easy_setopt_err_conv_cb(); \
|
||||
if((_curl_opt) == CURLOPT_SEEKFUNCTION) \
|
||||
if(!curlcheck_seek_cb(value)) \
|
||||
_curl_easy_setopt_err_seek_cb(); \
|
||||
if(curlcheck_cb_data_option(_curl_opt)) \
|
||||
if(!curlcheck_cb_data(value)) \
|
||||
_curl_easy_setopt_err_cb_data(); \
|
||||
if((_curl_opt) == CURLOPT_ERRORBUFFER) \
|
||||
if(!curlcheck_error_buffer(value)) \
|
||||
_curl_easy_setopt_err_error_buffer(); \
|
||||
if((_curl_opt) == CURLOPT_STDERR) \
|
||||
if(!curlcheck_FILE(value)) \
|
||||
_curl_easy_setopt_err_FILE(); \
|
||||
if(curlcheck_postfields_option(_curl_opt)) \
|
||||
if(!curlcheck_postfields(value)) \
|
||||
_curl_easy_setopt_err_postfields(); \
|
||||
if((_curl_opt) == CURLOPT_HTTPPOST) \
|
||||
if(!curlcheck_arr((value), struct curl_httppost)) \
|
||||
_curl_easy_setopt_err_curl_httpost(); \
|
||||
if((_curl_opt) == CURLOPT_MIMEPOST) \
|
||||
if(!curlcheck_ptr((value), curl_mime)) \
|
||||
_curl_easy_setopt_err_curl_mimepost(); \
|
||||
if(curlcheck_slist_option(_curl_opt)) \
|
||||
if(!curlcheck_arr((value), struct curl_slist)) \
|
||||
_curl_easy_setopt_err_curl_slist(); \
|
||||
if((_curl_opt) == CURLOPT_SHARE) \
|
||||
if(!curlcheck_ptr((value), CURLSH)) \
|
||||
_curl_easy_setopt_err_CURLSH(); \
|
||||
) \
|
||||
} \
|
||||
curl_easy_setopt(handle, _curl_opt, value); \
|
||||
})
|
||||
|
||||
/* wraps curl_easy_getinfo() with typechecking */
|
||||
#define curl_easy_getinfo(handle, info, arg) \
|
||||
__extension__({ \
|
||||
CURLINFO _curl_info = (info); \
|
||||
if(__builtin_constant_p(_curl_info)) { \
|
||||
CURL_IGNORE_DEPRECATION( \
|
||||
if(curlcheck_string_info(_curl_info)) \
|
||||
if(!curlcheck_arr((arg), char *)) \
|
||||
_curl_easy_getinfo_err_string(); \
|
||||
if(curlcheck_long_info(_curl_info)) \
|
||||
if(!curlcheck_arr((arg), long)) \
|
||||
_curl_easy_getinfo_err_long(); \
|
||||
if(curlcheck_double_info(_curl_info)) \
|
||||
if(!curlcheck_arr((arg), double)) \
|
||||
_curl_easy_getinfo_err_double(); \
|
||||
if(curlcheck_slist_info(_curl_info)) \
|
||||
if(!curlcheck_arr((arg), struct curl_slist *)) \
|
||||
_curl_easy_getinfo_err_curl_slist(); \
|
||||
if(curlcheck_tlssessioninfo_info(_curl_info)) \
|
||||
if(!curlcheck_arr((arg), struct curl_tlssessioninfo *)) \
|
||||
_curl_easy_getinfo_err_curl_tlssesssioninfo(); \
|
||||
if(curlcheck_certinfo_info(_curl_info)) \
|
||||
if(!curlcheck_arr((arg), struct curl_certinfo *)) \
|
||||
_curl_easy_getinfo_err_curl_certinfo(); \
|
||||
if(curlcheck_socket_info(_curl_info)) \
|
||||
if(!curlcheck_arr((arg), curl_socket_t)) \
|
||||
_curl_easy_getinfo_err_curl_socket(); \
|
||||
if(curlcheck_off_t_info(_curl_info)) \
|
||||
if(!curlcheck_arr((arg), curl_off_t)) \
|
||||
_curl_easy_getinfo_err_curl_off_t(); \
|
||||
) \
|
||||
} \
|
||||
curl_easy_getinfo(handle, _curl_info, arg); \
|
||||
})
|
||||
|
||||
/*
|
||||
* For now, just make sure that the functions are called with three arguments
|
||||
*/
|
||||
#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)
|
||||
#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)
|
||||
|
||||
|
||||
/* the actual warnings, triggered by calling the _curl_easy_setopt_err*
|
||||
* functions */
|
||||
|
||||
/* To define a new warning, use _CURL_WARNING(identifier, "message") */
|
||||
#define CURLWARNING(id, message) \
|
||||
static void __attribute__((__warning__(message))) \
|
||||
__attribute__((__unused__)) __attribute__((__noinline__)) \
|
||||
id(void) { __asm__(""); }
|
||||
|
||||
CURLWARNING(_curl_easy_setopt_err_long,
|
||||
"curl_easy_setopt expects a long argument for this option")
|
||||
CURLWARNING(_curl_easy_setopt_err_curl_off_t,
|
||||
"curl_easy_setopt expects a curl_off_t argument for this option")
|
||||
CURLWARNING(_curl_easy_setopt_err_string,
|
||||
"curl_easy_setopt expects a "
|
||||
"string ('char *' or char[]) argument for this option"
|
||||
)
|
||||
CURLWARNING(_curl_easy_setopt_err_write_callback,
|
||||
"curl_easy_setopt expects a curl_write_callback argument for this option")
|
||||
CURLWARNING(_curl_easy_setopt_err_resolver_start_callback,
|
||||
"curl_easy_setopt expects a "
|
||||
"curl_resolver_start_callback argument for this option"
|
||||
)
|
||||
CURLWARNING(_curl_easy_setopt_err_read_cb,
|
||||
"curl_easy_setopt expects a curl_read_callback argument for this option")
|
||||
CURLWARNING(_curl_easy_setopt_err_ioctl_cb,
|
||||
"curl_easy_setopt expects a curl_ioctl_callback argument for this option")
|
||||
CURLWARNING(_curl_easy_setopt_err_sockopt_cb,
|
||||
"curl_easy_setopt expects a curl_sockopt_callback argument for this option")
|
||||
CURLWARNING(_curl_easy_setopt_err_opensocket_cb,
|
||||
"curl_easy_setopt expects a "
|
||||
"curl_opensocket_callback argument for this option"
|
||||
)
|
||||
CURLWARNING(_curl_easy_setopt_err_progress_cb,
|
||||
"curl_easy_setopt expects a curl_progress_callback argument for this option")
|
||||
CURLWARNING(_curl_easy_setopt_err_debug_cb,
|
||||
"curl_easy_setopt expects a curl_debug_callback argument for this option")
|
||||
CURLWARNING(_curl_easy_setopt_err_ssl_ctx_cb,
|
||||
"curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option")
|
||||
CURLWARNING(_curl_easy_setopt_err_conv_cb,
|
||||
"curl_easy_setopt expects a curl_conv_callback argument for this option")
|
||||
CURLWARNING(_curl_easy_setopt_err_seek_cb,
|
||||
"curl_easy_setopt expects a curl_seek_callback argument for this option")
|
||||
CURLWARNING(_curl_easy_setopt_err_cb_data,
|
||||
"curl_easy_setopt expects a "
|
||||
"private data pointer as argument for this option")
|
||||
CURLWARNING(_curl_easy_setopt_err_error_buffer,
|
||||
"curl_easy_setopt expects a "
|
||||
"char buffer of CURL_ERROR_SIZE as argument for this option")
|
||||
CURLWARNING(_curl_easy_setopt_err_FILE,
|
||||
"curl_easy_setopt expects a 'FILE *' argument for this option")
|
||||
CURLWARNING(_curl_easy_setopt_err_postfields,
|
||||
"curl_easy_setopt expects a 'void *' or 'char *' argument for this option")
|
||||
CURLWARNING(_curl_easy_setopt_err_curl_httpost,
|
||||
"curl_easy_setopt expects a 'struct curl_httppost *' "
|
||||
"argument for this option")
|
||||
CURLWARNING(_curl_easy_setopt_err_curl_mimepost,
|
||||
"curl_easy_setopt expects a 'curl_mime *' "
|
||||
"argument for this option")
|
||||
CURLWARNING(_curl_easy_setopt_err_curl_slist,
|
||||
"curl_easy_setopt expects a 'struct curl_slist *' argument for this option")
|
||||
CURLWARNING(_curl_easy_setopt_err_CURLSH,
|
||||
"curl_easy_setopt expects a CURLSH* argument for this option")
|
||||
|
||||
CURLWARNING(_curl_easy_getinfo_err_string,
|
||||
"curl_easy_getinfo expects a pointer to 'char *' for this info")
|
||||
CURLWARNING(_curl_easy_getinfo_err_long,
|
||||
"curl_easy_getinfo expects a pointer to long for this info")
|
||||
CURLWARNING(_curl_easy_getinfo_err_double,
|
||||
"curl_easy_getinfo expects a pointer to double for this info")
|
||||
CURLWARNING(_curl_easy_getinfo_err_curl_slist,
|
||||
"curl_easy_getinfo expects a pointer to 'struct curl_slist *' for this info")
|
||||
CURLWARNING(_curl_easy_getinfo_err_curl_tlssesssioninfo,
|
||||
"curl_easy_getinfo expects a pointer to "
|
||||
"'struct curl_tlssessioninfo *' for this info")
|
||||
CURLWARNING(_curl_easy_getinfo_err_curl_certinfo,
|
||||
"curl_easy_getinfo expects a pointer to "
|
||||
"'struct curl_certinfo *' for this info")
|
||||
CURLWARNING(_curl_easy_getinfo_err_curl_socket,
|
||||
"curl_easy_getinfo expects a pointer to curl_socket_t for this info")
|
||||
CURLWARNING(_curl_easy_getinfo_err_curl_off_t,
|
||||
"curl_easy_getinfo expects a pointer to curl_off_t for this info")
|
||||
|
||||
/* groups of curl_easy_setops options that take the same type of argument */
|
||||
|
||||
/* To add a new option to one of the groups, just add
|
||||
* (option) == CURLOPT_SOMETHING
|
||||
* to the or-expression. If the option takes a long or curl_off_t, you do not
|
||||
* have to do anything
|
||||
*/
|
||||
|
||||
/* evaluates to true if option takes a long argument */
|
||||
#define curlcheck_long_option(option) \
|
||||
(0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT)
|
||||
|
||||
#define curlcheck_off_t_option(option) \
|
||||
(((option) > CURLOPTTYPE_OFF_T) && ((option) < CURLOPTTYPE_BLOB))
|
||||
|
||||
/* evaluates to true if option takes a char* argument */
|
||||
#define curlcheck_string_option(option) \
|
||||
((option) == CURLOPT_ABSTRACT_UNIX_SOCKET || \
|
||||
(option) == CURLOPT_ACCEPT_ENCODING || \
|
||||
(option) == CURLOPT_ALTSVC || \
|
||||
(option) == CURLOPT_CAINFO || \
|
||||
(option) == CURLOPT_CAPATH || \
|
||||
(option) == CURLOPT_COOKIE || \
|
||||
(option) == CURLOPT_COOKIEFILE || \
|
||||
(option) == CURLOPT_COOKIEJAR || \
|
||||
(option) == CURLOPT_COOKIELIST || \
|
||||
(option) == CURLOPT_CRLFILE || \
|
||||
(option) == CURLOPT_CUSTOMREQUEST || \
|
||||
(option) == CURLOPT_DEFAULT_PROTOCOL || \
|
||||
(option) == CURLOPT_DNS_INTERFACE || \
|
||||
(option) == CURLOPT_DNS_LOCAL_IP4 || \
|
||||
(option) == CURLOPT_DNS_LOCAL_IP6 || \
|
||||
(option) == CURLOPT_DNS_SERVERS || \
|
||||
(option) == CURLOPT_DOH_URL || \
|
||||
(option) == CURLOPT_ECH || \
|
||||
(option) == CURLOPT_EGDSOCKET || \
|
||||
(option) == CURLOPT_FTP_ACCOUNT || \
|
||||
(option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \
|
||||
(option) == CURLOPT_FTPPORT || \
|
||||
(option) == CURLOPT_HSTS || \
|
||||
(option) == CURLOPT_HAPROXY_CLIENT_IP || \
|
||||
(option) == CURLOPT_INTERFACE || \
|
||||
(option) == CURLOPT_ISSUERCERT || \
|
||||
(option) == CURLOPT_KEYPASSWD || \
|
||||
(option) == CURLOPT_KRBLEVEL || \
|
||||
(option) == CURLOPT_LOGIN_OPTIONS || \
|
||||
(option) == CURLOPT_MAIL_AUTH || \
|
||||
(option) == CURLOPT_MAIL_FROM || \
|
||||
(option) == CURLOPT_NETRC_FILE || \
|
||||
(option) == CURLOPT_NOPROXY || \
|
||||
(option) == CURLOPT_PASSWORD || \
|
||||
(option) == CURLOPT_PINNEDPUBLICKEY || \
|
||||
(option) == CURLOPT_PRE_PROXY || \
|
||||
(option) == CURLOPT_PROTOCOLS_STR || \
|
||||
(option) == CURLOPT_PROXY || \
|
||||
(option) == CURLOPT_PROXY_CAINFO || \
|
||||
(option) == CURLOPT_PROXY_CAPATH || \
|
||||
(option) == CURLOPT_PROXY_CRLFILE || \
|
||||
(option) == CURLOPT_PROXY_ISSUERCERT || \
|
||||
(option) == CURLOPT_PROXY_KEYPASSWD || \
|
||||
(option) == CURLOPT_PROXY_PINNEDPUBLICKEY || \
|
||||
(option) == CURLOPT_PROXY_SERVICE_NAME || \
|
||||
(option) == CURLOPT_PROXY_SSL_CIPHER_LIST || \
|
||||
(option) == CURLOPT_PROXY_SSLCERT || \
|
||||
(option) == CURLOPT_PROXY_SSLCERTTYPE || \
|
||||
(option) == CURLOPT_PROXY_SSLKEY || \
|
||||
(option) == CURLOPT_PROXY_SSLKEYTYPE || \
|
||||
(option) == CURLOPT_PROXY_TLS13_CIPHERS || \
|
||||
(option) == CURLOPT_PROXY_TLSAUTH_PASSWORD || \
|
||||
(option) == CURLOPT_PROXY_TLSAUTH_TYPE || \
|
||||
(option) == CURLOPT_PROXY_TLSAUTH_USERNAME || \
|
||||
(option) == CURLOPT_PROXYPASSWORD || \
|
||||
(option) == CURLOPT_PROXYUSERNAME || \
|
||||
(option) == CURLOPT_PROXYUSERPWD || \
|
||||
(option) == CURLOPT_RANDOM_FILE || \
|
||||
(option) == CURLOPT_RANGE || \
|
||||
(option) == CURLOPT_REDIR_PROTOCOLS_STR || \
|
||||
(option) == CURLOPT_REFERER || \
|
||||
(option) == CURLOPT_REQUEST_TARGET || \
|
||||
(option) == CURLOPT_RTSP_SESSION_ID || \
|
||||
(option) == CURLOPT_RTSP_STREAM_URI || \
|
||||
(option) == CURLOPT_RTSP_TRANSPORT || \
|
||||
(option) == CURLOPT_SASL_AUTHZID || \
|
||||
(option) == CURLOPT_SERVICE_NAME || \
|
||||
(option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \
|
||||
(option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \
|
||||
(option) == CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256 || \
|
||||
(option) == CURLOPT_SSH_KNOWNHOSTS || \
|
||||
(option) == CURLOPT_SSH_PRIVATE_KEYFILE || \
|
||||
(option) == CURLOPT_SSH_PUBLIC_KEYFILE || \
|
||||
(option) == CURLOPT_SSLCERT || \
|
||||
(option) == CURLOPT_SSLCERTTYPE || \
|
||||
(option) == CURLOPT_SSLENGINE || \
|
||||
(option) == CURLOPT_SSLKEY || \
|
||||
(option) == CURLOPT_SSLKEYTYPE || \
|
||||
(option) == CURLOPT_SSL_CIPHER_LIST || \
|
||||
(option) == CURLOPT_TLS13_CIPHERS || \
|
||||
(option) == CURLOPT_TLSAUTH_PASSWORD || \
|
||||
(option) == CURLOPT_TLSAUTH_TYPE || \
|
||||
(option) == CURLOPT_TLSAUTH_USERNAME || \
|
||||
(option) == CURLOPT_UNIX_SOCKET_PATH || \
|
||||
(option) == CURLOPT_URL || \
|
||||
(option) == CURLOPT_USERAGENT || \
|
||||
(option) == CURLOPT_USERNAME || \
|
||||
(option) == CURLOPT_AWS_SIGV4 || \
|
||||
(option) == CURLOPT_USERPWD || \
|
||||
(option) == CURLOPT_XOAUTH2_BEARER || \
|
||||
(option) == CURLOPT_SSL_EC_CURVES || \
|
||||
0)
|
||||
|
||||
/* evaluates to true if option takes a curl_write_callback argument */
|
||||
#define curlcheck_write_cb_option(option) \
|
||||
((option) == CURLOPT_HEADERFUNCTION || \
|
||||
(option) == CURLOPT_WRITEFUNCTION)
|
||||
|
||||
/* evaluates to true if option takes a curl_conv_callback argument */
|
||||
#define curlcheck_conv_cb_option(option) \
|
||||
((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION || \
|
||||
(option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION || \
|
||||
(option) == CURLOPT_CONV_FROM_UTF8_FUNCTION)
|
||||
|
||||
/* evaluates to true if option takes a data argument to pass to a callback */
|
||||
#define curlcheck_cb_data_option(option) \
|
||||
((option) == CURLOPT_CHUNK_DATA || \
|
||||
(option) == CURLOPT_CLOSESOCKETDATA || \
|
||||
(option) == CURLOPT_DEBUGDATA || \
|
||||
(option) == CURLOPT_FNMATCH_DATA || \
|
||||
(option) == CURLOPT_HEADERDATA || \
|
||||
(option) == CURLOPT_HSTSREADDATA || \
|
||||
(option) == CURLOPT_HSTSWRITEDATA || \
|
||||
(option) == CURLOPT_INTERLEAVEDATA || \
|
||||
(option) == CURLOPT_IOCTLDATA || \
|
||||
(option) == CURLOPT_OPENSOCKETDATA || \
|
||||
(option) == CURLOPT_PREREQDATA || \
|
||||
(option) == CURLOPT_PROGRESSDATA || \
|
||||
(option) == CURLOPT_READDATA || \
|
||||
(option) == CURLOPT_SEEKDATA || \
|
||||
(option) == CURLOPT_SOCKOPTDATA || \
|
||||
(option) == CURLOPT_SSH_KEYDATA || \
|
||||
(option) == CURLOPT_SSL_CTX_DATA || \
|
||||
(option) == CURLOPT_WRITEDATA || \
|
||||
(option) == CURLOPT_RESOLVER_START_DATA || \
|
||||
(option) == CURLOPT_TRAILERDATA || \
|
||||
(option) == CURLOPT_SSH_HOSTKEYDATA || \
|
||||
0)
|
||||
|
||||
/* evaluates to true if option takes a POST data argument (void* or char*) */
|
||||
#define curlcheck_postfields_option(option) \
|
||||
((option) == CURLOPT_POSTFIELDS || \
|
||||
(option) == CURLOPT_COPYPOSTFIELDS || \
|
||||
0)
|
||||
|
||||
/* evaluates to true if option takes a struct curl_slist * argument */
|
||||
#define curlcheck_slist_option(option) \
|
||||
((option) == CURLOPT_HTTP200ALIASES || \
|
||||
(option) == CURLOPT_HTTPHEADER || \
|
||||
(option) == CURLOPT_MAIL_RCPT || \
|
||||
(option) == CURLOPT_POSTQUOTE || \
|
||||
(option) == CURLOPT_PREQUOTE || \
|
||||
(option) == CURLOPT_PROXYHEADER || \
|
||||
(option) == CURLOPT_QUOTE || \
|
||||
(option) == CURLOPT_RESOLVE || \
|
||||
(option) == CURLOPT_TELNETOPTIONS || \
|
||||
(option) == CURLOPT_CONNECT_TO || \
|
||||
0)
|
||||
|
||||
/* groups of curl_easy_getinfo infos that take the same type of argument */
|
||||
|
||||
/* evaluates to true if info expects a pointer to char * argument */
|
||||
#define curlcheck_string_info(info) \
|
||||
(CURLINFO_STRING < (info) && (info) < CURLINFO_LONG && \
|
||||
(info) != CURLINFO_PRIVATE)
|
||||
|
||||
/* evaluates to true if info expects a pointer to long argument */
|
||||
#define curlcheck_long_info(info) \
|
||||
(CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE)
|
||||
|
||||
/* evaluates to true if info expects a pointer to double argument */
|
||||
#define curlcheck_double_info(info) \
|
||||
(CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST)
|
||||
|
||||
/* true if info expects a pointer to struct curl_slist * argument */
|
||||
#define curlcheck_slist_info(info) \
|
||||
(((info) == CURLINFO_SSL_ENGINES) || ((info) == CURLINFO_COOKIELIST))
|
||||
|
||||
/* true if info expects a pointer to struct curl_tlssessioninfo * argument */
|
||||
#define curlcheck_tlssessioninfo_info(info) \
|
||||
(((info) == CURLINFO_TLS_SSL_PTR) || ((info) == CURLINFO_TLS_SESSION))
|
||||
|
||||
/* true if info expects a pointer to struct curl_certinfo * argument */
|
||||
#define curlcheck_certinfo_info(info) ((info) == CURLINFO_CERTINFO)
|
||||
|
||||
/* true if info expects a pointer to struct curl_socket_t argument */
|
||||
#define curlcheck_socket_info(info) \
|
||||
(CURLINFO_SOCKET < (info) && (info) < CURLINFO_OFF_T)
|
||||
|
||||
/* true if info expects a pointer to curl_off_t argument */
|
||||
#define curlcheck_off_t_info(info) \
|
||||
(CURLINFO_OFF_T < (info))
|
||||
|
||||
|
||||
/* typecheck helpers -- check whether given expression has requested type */
|
||||
|
||||
/* For pointers, you can use the curlcheck_ptr/curlcheck_arr macros,
|
||||
* otherwise define a new macro. Search for __builtin_types_compatible_p
|
||||
* in the GCC manual.
|
||||
* NOTE: these macros MUST NOT EVALUATE their arguments! The argument is
|
||||
* the actual expression passed to the curl_easy_setopt macro. This
|
||||
* means that you can only apply the sizeof and __typeof__ operators, no
|
||||
* == or whatsoever.
|
||||
*/
|
||||
|
||||
/* XXX: should evaluate to true if expr is a pointer */
|
||||
#define curlcheck_any_ptr(expr) \
|
||||
(sizeof(expr) == sizeof(void *))
|
||||
|
||||
/* evaluates to true if expr is NULL */
|
||||
/* XXX: must not evaluate expr, so this check is not accurate */
|
||||
#define curlcheck_NULL(expr) \
|
||||
(__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL)))
|
||||
|
||||
/* evaluates to true if expr is type*, const type* or NULL */
|
||||
#define curlcheck_ptr(expr, type) \
|
||||
(curlcheck_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), type *) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), const type *))
|
||||
|
||||
/* evaluates to true if expr is one of type[], type*, NULL or const type* */
|
||||
#define curlcheck_arr(expr, type) \
|
||||
(curlcheck_ptr((expr), type) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), type []))
|
||||
|
||||
/* evaluates to true if expr is a string */
|
||||
#define curlcheck_string(expr) \
|
||||
(curlcheck_arr((expr), char) || \
|
||||
curlcheck_arr((expr), signed char) || \
|
||||
curlcheck_arr((expr), unsigned char))
|
||||
|
||||
/* evaluates to true if expr is a long (no matter the signedness)
|
||||
* XXX: for now, int is also accepted (and therefore short and char, which
|
||||
* are promoted to int when passed to a variadic function) */
|
||||
#define curlcheck_long(expr) \
|
||||
(__builtin_types_compatible_p(__typeof__(expr), long) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), signed long) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), unsigned long) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), int) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), signed int) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), unsigned int) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), short) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), signed short) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), unsigned short) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), char) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), signed char) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), unsigned char))
|
||||
|
||||
/* evaluates to true if expr is of type curl_off_t */
|
||||
#define curlcheck_off_t(expr) \
|
||||
(__builtin_types_compatible_p(__typeof__(expr), curl_off_t))
|
||||
|
||||
/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */
|
||||
/* XXX: also check size of an char[] array? */
|
||||
#define curlcheck_error_buffer(expr) \
|
||||
(curlcheck_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), char *) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), char[]))
|
||||
|
||||
/* evaluates to true if expr is of type (const) void* or (const) FILE* */
|
||||
#if 0
|
||||
#define curlcheck_cb_data(expr) \
|
||||
(curlcheck_ptr((expr), void) || \
|
||||
curlcheck_ptr((expr), FILE))
|
||||
#else /* be less strict */
|
||||
#define curlcheck_cb_data(expr) \
|
||||
curlcheck_any_ptr(expr)
|
||||
#endif
|
||||
|
||||
/* evaluates to true if expr is of type FILE* */
|
||||
#define curlcheck_FILE(expr) \
|
||||
(curlcheck_NULL(expr) || \
|
||||
(__builtin_types_compatible_p(__typeof__(expr), FILE *)))
|
||||
|
||||
/* evaluates to true if expr can be passed as POST data (void* or char*) */
|
||||
#define curlcheck_postfields(expr) \
|
||||
(curlcheck_ptr((expr), void) || \
|
||||
curlcheck_arr((expr), char) || \
|
||||
curlcheck_arr((expr), unsigned char))
|
||||
|
||||
/* helper: __builtin_types_compatible_p distinguishes between functions and
|
||||
* function pointers, hide it */
|
||||
#define curlcheck_cb_compatible(func, type) \
|
||||
(__builtin_types_compatible_p(__typeof__(func), type) || \
|
||||
__builtin_types_compatible_p(__typeof__(func) *, type))
|
||||
|
||||
/* evaluates to true if expr is of type curl_resolver_start_callback */
|
||||
#define curlcheck_resolver_start_callback(expr) \
|
||||
(curlcheck_NULL(expr) || \
|
||||
curlcheck_cb_compatible((expr), curl_resolver_start_callback))
|
||||
|
||||
/* evaluates to true if expr is of type curl_read_callback or "similar" */
|
||||
#define curlcheck_read_cb(expr) \
|
||||
(curlcheck_NULL(expr) || \
|
||||
curlcheck_cb_compatible((expr), __typeof__(fread) *) || \
|
||||
curlcheck_cb_compatible((expr), curl_read_callback) || \
|
||||
curlcheck_cb_compatible((expr), _curl_read_callback1) || \
|
||||
curlcheck_cb_compatible((expr), _curl_read_callback2) || \
|
||||
curlcheck_cb_compatible((expr), _curl_read_callback3) || \
|
||||
curlcheck_cb_compatible((expr), _curl_read_callback4) || \
|
||||
curlcheck_cb_compatible((expr), _curl_read_callback5) || \
|
||||
curlcheck_cb_compatible((expr), _curl_read_callback6))
|
||||
typedef size_t (*_curl_read_callback1)(char *, size_t, size_t, void *);
|
||||
typedef size_t (*_curl_read_callback2)(char *, size_t, size_t, const void *);
|
||||
typedef size_t (*_curl_read_callback3)(char *, size_t, size_t, FILE *);
|
||||
typedef size_t (*_curl_read_callback4)(void *, size_t, size_t, void *);
|
||||
typedef size_t (*_curl_read_callback5)(void *, size_t, size_t, const void *);
|
||||
typedef size_t (*_curl_read_callback6)(void *, size_t, size_t, FILE *);
|
||||
|
||||
/* evaluates to true if expr is of type curl_write_callback or "similar" */
|
||||
#define curlcheck_write_cb(expr) \
|
||||
(curlcheck_read_cb(expr) || \
|
||||
curlcheck_cb_compatible((expr), __typeof__(fwrite) *) || \
|
||||
curlcheck_cb_compatible((expr), curl_write_callback) || \
|
||||
curlcheck_cb_compatible((expr), _curl_write_callback1) || \
|
||||
curlcheck_cb_compatible((expr), _curl_write_callback2) || \
|
||||
curlcheck_cb_compatible((expr), _curl_write_callback3) || \
|
||||
curlcheck_cb_compatible((expr), _curl_write_callback4) || \
|
||||
curlcheck_cb_compatible((expr), _curl_write_callback5) || \
|
||||
curlcheck_cb_compatible((expr), _curl_write_callback6))
|
||||
typedef size_t (*_curl_write_callback1)(const char *, size_t, size_t, void *);
|
||||
typedef size_t (*_curl_write_callback2)(const char *, size_t, size_t,
|
||||
const void *);
|
||||
typedef size_t (*_curl_write_callback3)(const char *, size_t, size_t, FILE *);
|
||||
typedef size_t (*_curl_write_callback4)(const void *, size_t, size_t, void *);
|
||||
typedef size_t (*_curl_write_callback5)(const void *, size_t, size_t,
|
||||
const void *);
|
||||
typedef size_t (*_curl_write_callback6)(const void *, size_t, size_t, FILE *);
|
||||
|
||||
/* evaluates to true if expr is of type curl_ioctl_callback or "similar" */
|
||||
#define curlcheck_ioctl_cb(expr) \
|
||||
(curlcheck_NULL(expr) || \
|
||||
curlcheck_cb_compatible((expr), curl_ioctl_callback) || \
|
||||
curlcheck_cb_compatible((expr), _curl_ioctl_callback1) || \
|
||||
curlcheck_cb_compatible((expr), _curl_ioctl_callback2) || \
|
||||
curlcheck_cb_compatible((expr), _curl_ioctl_callback3) || \
|
||||
curlcheck_cb_compatible((expr), _curl_ioctl_callback4))
|
||||
typedef curlioerr (*_curl_ioctl_callback1)(CURL *, int, void *);
|
||||
typedef curlioerr (*_curl_ioctl_callback2)(CURL *, int, const void *);
|
||||
typedef curlioerr (*_curl_ioctl_callback3)(CURL *, curliocmd, void *);
|
||||
typedef curlioerr (*_curl_ioctl_callback4)(CURL *, curliocmd, const void *);
|
||||
|
||||
/* evaluates to true if expr is of type curl_sockopt_callback or "similar" */
|
||||
#define curlcheck_sockopt_cb(expr) \
|
||||
(curlcheck_NULL(expr) || \
|
||||
curlcheck_cb_compatible((expr), curl_sockopt_callback) || \
|
||||
curlcheck_cb_compatible((expr), _curl_sockopt_callback1) || \
|
||||
curlcheck_cb_compatible((expr), _curl_sockopt_callback2))
|
||||
typedef int (*_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);
|
||||
typedef int (*_curl_sockopt_callback2)(const void *, curl_socket_t,
|
||||
curlsocktype);
|
||||
|
||||
/* evaluates to true if expr is of type curl_opensocket_callback or
|
||||
"similar" */
|
||||
#define curlcheck_opensocket_cb(expr) \
|
||||
(curlcheck_NULL(expr) || \
|
||||
curlcheck_cb_compatible((expr), curl_opensocket_callback) || \
|
||||
curlcheck_cb_compatible((expr), _curl_opensocket_callback1) || \
|
||||
curlcheck_cb_compatible((expr), _curl_opensocket_callback2) || \
|
||||
curlcheck_cb_compatible((expr), _curl_opensocket_callback3) || \
|
||||
curlcheck_cb_compatible((expr), _curl_opensocket_callback4))
|
||||
typedef curl_socket_t (*_curl_opensocket_callback1)
|
||||
(void *, curlsocktype, struct curl_sockaddr *);
|
||||
typedef curl_socket_t (*_curl_opensocket_callback2)
|
||||
(void *, curlsocktype, const struct curl_sockaddr *);
|
||||
typedef curl_socket_t (*_curl_opensocket_callback3)
|
||||
(const void *, curlsocktype, struct curl_sockaddr *);
|
||||
typedef curl_socket_t (*_curl_opensocket_callback4)
|
||||
(const void *, curlsocktype, const struct curl_sockaddr *);
|
||||
|
||||
/* evaluates to true if expr is of type curl_progress_callback or "similar" */
|
||||
#define curlcheck_progress_cb(expr) \
|
||||
(curlcheck_NULL(expr) || \
|
||||
curlcheck_cb_compatible((expr), curl_progress_callback) || \
|
||||
curlcheck_cb_compatible((expr), _curl_progress_callback1) || \
|
||||
curlcheck_cb_compatible((expr), _curl_progress_callback2))
|
||||
typedef int (*_curl_progress_callback1)(void *,
|
||||
double, double, double, double);
|
||||
typedef int (*_curl_progress_callback2)(const void *,
|
||||
double, double, double, double);
|
||||
|
||||
/* evaluates to true if expr is of type curl_debug_callback or "similar" */
|
||||
#define curlcheck_debug_cb(expr) \
|
||||
(curlcheck_NULL(expr) || \
|
||||
curlcheck_cb_compatible((expr), curl_debug_callback) || \
|
||||
curlcheck_cb_compatible((expr), _curl_debug_callback1) || \
|
||||
curlcheck_cb_compatible((expr), _curl_debug_callback2) || \
|
||||
curlcheck_cb_compatible((expr), _curl_debug_callback3) || \
|
||||
curlcheck_cb_compatible((expr), _curl_debug_callback4) || \
|
||||
curlcheck_cb_compatible((expr), _curl_debug_callback5) || \
|
||||
curlcheck_cb_compatible((expr), _curl_debug_callback6) || \
|
||||
curlcheck_cb_compatible((expr), _curl_debug_callback7) || \
|
||||
curlcheck_cb_compatible((expr), _curl_debug_callback8))
|
||||
typedef int (*_curl_debug_callback1) (CURL *,
|
||||
curl_infotype, char *, size_t, void *);
|
||||
typedef int (*_curl_debug_callback2) (CURL *,
|
||||
curl_infotype, char *, size_t, const void *);
|
||||
typedef int (*_curl_debug_callback3) (CURL *,
|
||||
curl_infotype, const char *, size_t, void *);
|
||||
typedef int (*_curl_debug_callback4) (CURL *,
|
||||
curl_infotype, const char *, size_t, const void *);
|
||||
typedef int (*_curl_debug_callback5) (CURL *,
|
||||
curl_infotype, unsigned char *, size_t, void *);
|
||||
typedef int (*_curl_debug_callback6) (CURL *,
|
||||
curl_infotype, unsigned char *, size_t, const void *);
|
||||
typedef int (*_curl_debug_callback7) (CURL *,
|
||||
curl_infotype, const unsigned char *, size_t, void *);
|
||||
typedef int (*_curl_debug_callback8) (CURL *,
|
||||
curl_infotype, const unsigned char *, size_t, const void *);
|
||||
|
||||
/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */
|
||||
/* this is getting even messier... */
|
||||
#define curlcheck_ssl_ctx_cb(expr) \
|
||||
(curlcheck_NULL(expr) || \
|
||||
curlcheck_cb_compatible((expr), curl_ssl_ctx_callback) || \
|
||||
curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback1) || \
|
||||
curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback2) || \
|
||||
curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback3) || \
|
||||
curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback4) || \
|
||||
curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback5) || \
|
||||
curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback6) || \
|
||||
curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback7) || \
|
||||
curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback8))
|
||||
typedef CURLcode (*_curl_ssl_ctx_callback1)(CURL *, void *, void *);
|
||||
typedef CURLcode (*_curl_ssl_ctx_callback2)(CURL *, void *, const void *);
|
||||
typedef CURLcode (*_curl_ssl_ctx_callback3)(CURL *, const void *, void *);
|
||||
typedef CURLcode (*_curl_ssl_ctx_callback4)(CURL *, const void *,
|
||||
const void *);
|
||||
#ifdef HEADER_SSL_H
|
||||
/* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX
|
||||
* this will of course break if we are included before OpenSSL headers...
|
||||
*/
|
||||
typedef CURLcode (*_curl_ssl_ctx_callback5)(CURL *, SSL_CTX *, void *);
|
||||
typedef CURLcode (*_curl_ssl_ctx_callback6)(CURL *, SSL_CTX *, const void *);
|
||||
typedef CURLcode (*_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX *, void *);
|
||||
typedef CURLcode (*_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX *,
|
||||
const void *);
|
||||
#else
|
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5;
|
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6;
|
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback7;
|
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8;
|
||||
#endif
|
||||
|
||||
/* evaluates to true if expr is of type curl_conv_callback or "similar" */
|
||||
#define curlcheck_conv_cb(expr) \
|
||||
(curlcheck_NULL(expr) || \
|
||||
curlcheck_cb_compatible((expr), curl_conv_callback) || \
|
||||
curlcheck_cb_compatible((expr), _curl_conv_callback1) || \
|
||||
curlcheck_cb_compatible((expr), _curl_conv_callback2) || \
|
||||
curlcheck_cb_compatible((expr), _curl_conv_callback3) || \
|
||||
curlcheck_cb_compatible((expr), _curl_conv_callback4))
|
||||
typedef CURLcode (*_curl_conv_callback1)(char *, size_t length);
|
||||
typedef CURLcode (*_curl_conv_callback2)(const char *, size_t length);
|
||||
typedef CURLcode (*_curl_conv_callback3)(void *, size_t length);
|
||||
typedef CURLcode (*_curl_conv_callback4)(const void *, size_t length);
|
||||
|
||||
/* evaluates to true if expr is of type curl_seek_callback or "similar" */
|
||||
#define curlcheck_seek_cb(expr) \
|
||||
(curlcheck_NULL(expr) || \
|
||||
curlcheck_cb_compatible((expr), curl_seek_callback) || \
|
||||
curlcheck_cb_compatible((expr), _curl_seek_callback1) || \
|
||||
curlcheck_cb_compatible((expr), _curl_seek_callback2))
|
||||
typedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int);
|
||||
typedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int);
|
||||
|
||||
|
||||
#endif /* CURLINC_TYPECHECK_GCC_H */
|
155
3rdparty/curl/include/curl/urlapi.h
vendored
155
3rdparty/curl/include/curl/urlapi.h
vendored
@ -1,155 +0,0 @@
|
||||
#ifndef CURLINC_URLAPI_H
|
||||
#define CURLINC_URLAPI_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 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
|
||||
* are also available at https://curl.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.
|
||||
*
|
||||
* SPDX-License-Identifier: curl
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* the error codes for the URL API */
|
||||
typedef enum {
|
||||
CURLUE_OK,
|
||||
CURLUE_BAD_HANDLE, /* 1 */
|
||||
CURLUE_BAD_PARTPOINTER, /* 2 */
|
||||
CURLUE_MALFORMED_INPUT, /* 3 */
|
||||
CURLUE_BAD_PORT_NUMBER, /* 4 */
|
||||
CURLUE_UNSUPPORTED_SCHEME, /* 5 */
|
||||
CURLUE_URLDECODE, /* 6 */
|
||||
CURLUE_OUT_OF_MEMORY, /* 7 */
|
||||
CURLUE_USER_NOT_ALLOWED, /* 8 */
|
||||
CURLUE_UNKNOWN_PART, /* 9 */
|
||||
CURLUE_NO_SCHEME, /* 10 */
|
||||
CURLUE_NO_USER, /* 11 */
|
||||
CURLUE_NO_PASSWORD, /* 12 */
|
||||
CURLUE_NO_OPTIONS, /* 13 */
|
||||
CURLUE_NO_HOST, /* 14 */
|
||||
CURLUE_NO_PORT, /* 15 */
|
||||
CURLUE_NO_QUERY, /* 16 */
|
||||
CURLUE_NO_FRAGMENT, /* 17 */
|
||||
CURLUE_NO_ZONEID, /* 18 */
|
||||
CURLUE_BAD_FILE_URL, /* 19 */
|
||||
CURLUE_BAD_FRAGMENT, /* 20 */
|
||||
CURLUE_BAD_HOSTNAME, /* 21 */
|
||||
CURLUE_BAD_IPV6, /* 22 */
|
||||
CURLUE_BAD_LOGIN, /* 23 */
|
||||
CURLUE_BAD_PASSWORD, /* 24 */
|
||||
CURLUE_BAD_PATH, /* 25 */
|
||||
CURLUE_BAD_QUERY, /* 26 */
|
||||
CURLUE_BAD_SCHEME, /* 27 */
|
||||
CURLUE_BAD_SLASHES, /* 28 */
|
||||
CURLUE_BAD_USER, /* 29 */
|
||||
CURLUE_LACKS_IDN, /* 30 */
|
||||
CURLUE_TOO_LARGE, /* 31 */
|
||||
CURLUE_LAST
|
||||
} CURLUcode;
|
||||
|
||||
typedef enum {
|
||||
CURLUPART_URL,
|
||||
CURLUPART_SCHEME,
|
||||
CURLUPART_USER,
|
||||
CURLUPART_PASSWORD,
|
||||
CURLUPART_OPTIONS,
|
||||
CURLUPART_HOST,
|
||||
CURLUPART_PORT,
|
||||
CURLUPART_PATH,
|
||||
CURLUPART_QUERY,
|
||||
CURLUPART_FRAGMENT,
|
||||
CURLUPART_ZONEID /* added in 7.65.0 */
|
||||
} CURLUPart;
|
||||
|
||||
#define CURLU_DEFAULT_PORT (1<<0) /* return default port number */
|
||||
#define CURLU_NO_DEFAULT_PORT (1<<1) /* act as if no port number was set,
|
||||
if the port number matches the
|
||||
default for the scheme */
|
||||
#define CURLU_DEFAULT_SCHEME (1<<2) /* return default scheme if
|
||||
missing */
|
||||
#define CURLU_NON_SUPPORT_SCHEME (1<<3) /* allow non-supported scheme */
|
||||
#define CURLU_PATH_AS_IS (1<<4) /* leave dot sequences */
|
||||
#define CURLU_DISALLOW_USER (1<<5) /* no user+password allowed */
|
||||
#define CURLU_URLDECODE (1<<6) /* URL decode on get */
|
||||
#define CURLU_URLENCODE (1<<7) /* URL encode on set */
|
||||
#define CURLU_APPENDQUERY (1<<8) /* append a form style part */
|
||||
#define CURLU_GUESS_SCHEME (1<<9) /* legacy curl-style guessing */
|
||||
#define CURLU_NO_AUTHORITY (1<<10) /* Allow empty authority when the
|
||||
scheme is unknown. */
|
||||
#define CURLU_ALLOW_SPACE (1<<11) /* Allow spaces in the URL */
|
||||
#define CURLU_PUNYCODE (1<<12) /* get the hostname in punycode */
|
||||
#define CURLU_PUNY2IDN (1<<13) /* punycode => IDN conversion */
|
||||
#define CURLU_GET_EMPTY (1<<14) /* allow empty queries and fragments
|
||||
when extracting the URL or the
|
||||
components */
|
||||
#define CURLU_NO_GUESS_SCHEME (1<<15) /* for get, do not accept a guess */
|
||||
|
||||
typedef struct Curl_URL CURLU;
|
||||
|
||||
/*
|
||||
* curl_url() creates a new CURLU handle and returns a pointer to it.
|
||||
* Must be freed with curl_url_cleanup().
|
||||
*/
|
||||
CURL_EXTERN CURLU *curl_url(void);
|
||||
|
||||
/*
|
||||
* curl_url_cleanup() frees the CURLU handle and related resources used for
|
||||
* the URL parsing. It will not free strings previously returned with the URL
|
||||
* API.
|
||||
*/
|
||||
CURL_EXTERN void curl_url_cleanup(CURLU *handle);
|
||||
|
||||
/*
|
||||
* curl_url_dup() duplicates a CURLU handle and returns a new copy. The new
|
||||
* handle must also be freed with curl_url_cleanup().
|
||||
*/
|
||||
CURL_EXTERN CURLU *curl_url_dup(const CURLU *in);
|
||||
|
||||
/*
|
||||
* curl_url_get() extracts a specific part of the URL from a CURLU
|
||||
* handle. Returns error code. The returned pointer MUST be freed with
|
||||
* curl_free() afterwards.
|
||||
*/
|
||||
CURL_EXTERN CURLUcode curl_url_get(const CURLU *handle, CURLUPart what,
|
||||
char **part, unsigned int flags);
|
||||
|
||||
/*
|
||||
* curl_url_set() sets a specific part of the URL in a CURLU handle. Returns
|
||||
* error code. The passed in string will be copied. Passing a NULL instead of
|
||||
* a part string, clears that part.
|
||||
*/
|
||||
CURL_EXTERN CURLUcode curl_url_set(CURLU *handle, CURLUPart what,
|
||||
const char *part, unsigned int flags);
|
||||
|
||||
/*
|
||||
* curl_url_strerror() turns a CURLUcode value into the equivalent human
|
||||
* readable error string. This is useful for printing meaningful error
|
||||
* messages.
|
||||
*/
|
||||
CURL_EXTERN const char *curl_url_strerror(CURLUcode);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end of extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CURLINC_URLAPI_H */
|
84
3rdparty/curl/include/curl/websockets.h
vendored
84
3rdparty/curl/include/curl/websockets.h
vendored
@ -1,84 +0,0 @@
|
||||
#ifndef CURLINC_WEBSOCKETS_H
|
||||
#define CURLINC_WEBSOCKETS_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 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
|
||||
* are also available at https://curl.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.
|
||||
*
|
||||
* SPDX-License-Identifier: curl
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct curl_ws_frame {
|
||||
int age; /* zero */
|
||||
int flags; /* See the CURLWS_* defines */
|
||||
curl_off_t offset; /* the offset of this data into the frame */
|
||||
curl_off_t bytesleft; /* number of pending bytes left of the payload */
|
||||
size_t len; /* size of the current data chunk */
|
||||
};
|
||||
|
||||
/* flag bits */
|
||||
#define CURLWS_TEXT (1<<0)
|
||||
#define CURLWS_BINARY (1<<1)
|
||||
#define CURLWS_CONT (1<<2)
|
||||
#define CURLWS_CLOSE (1<<3)
|
||||
#define CURLWS_PING (1<<4)
|
||||
#define CURLWS_OFFSET (1<<5)
|
||||
|
||||
/*
|
||||
* NAME curl_ws_recv()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Receives data from the websocket connection. Use after successful
|
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_ws_recv(CURL *curl, void *buffer, size_t buflen,
|
||||
size_t *recv,
|
||||
const struct curl_ws_frame **metap);
|
||||
|
||||
/* flags for curl_ws_send() */
|
||||
#define CURLWS_PONG (1<<6)
|
||||
|
||||
/*
|
||||
* NAME curl_ws_send()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Sends data over the websocket connection. Use after successful
|
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_ws_send(CURL *curl, const void *buffer,
|
||||
size_t buflen, size_t *sent,
|
||||
curl_off_t fragsize,
|
||||
unsigned int flags);
|
||||
|
||||
/* bits for the CURLOPT_WS_OPTIONS bitmask: */
|
||||
#define CURLWS_RAW_MODE (1<<0)
|
||||
|
||||
CURL_EXTERN const struct curl_ws_frame *curl_ws_meta(CURL *curl);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CURLINC_WEBSOCKETS_H */
|
75
3rdparty/curl/lib/cmake/CURL/CURLConfig.cmake
vendored
75
3rdparty/curl/lib/cmake/CURL/CURLConfig.cmake
vendored
@ -1,75 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 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
|
||||
# are also available at https://curl.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.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
|
||||
####### Any changes to this file will be overwritten by the next CMake run ####
|
||||
####### The input file was curl-config.cmake.in ########
|
||||
|
||||
get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
|
||||
|
||||
macro(set_and_check _var _file)
|
||||
set(${_var} "${_file}")
|
||||
if(NOT EXISTS "${_file}")
|
||||
message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(check_required_components _NAME)
|
||||
foreach(comp ${${_NAME}_FIND_COMPONENTS})
|
||||
if(NOT ${_NAME}_${comp}_FOUND)
|
||||
if(${_NAME}_FIND_REQUIRED_${comp})
|
||||
set(${_NAME}_FOUND FALSE)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
####################################################################################
|
||||
|
||||
if(UNIX OR VCPKG_TOOLCHAIN OR (MINGW AND NOT CMAKE_CROSSCOMPILING)) # Keep in sync with root CMakeLists.txt
|
||||
set(_curl_use_pkgconfig_default ON)
|
||||
else()
|
||||
set(_curl_use_pkgconfig_default OFF)
|
||||
endif()
|
||||
option(CURL_USE_PKGCONFIG "Enable pkg-config to detect CURL dependencies" ${_curl_use_pkgconfig_default})
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
if("")
|
||||
find_dependency(OpenSSL "")
|
||||
endif()
|
||||
if("OFF")
|
||||
find_dependency(ZLIB "")
|
||||
endif()
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/CURLTargets.cmake")
|
||||
check_required_components("CURL")
|
||||
|
||||
# Alias for either shared or static library
|
||||
if(NOT TARGET CURL::libcurl)
|
||||
add_library(CURL::libcurl ALIAS CURL::libcurl_shared)
|
||||
endif()
|
||||
|
||||
# For compatibility with CMake's FindCURL.cmake
|
||||
set(CURL_LIBRARIES CURL::libcurl)
|
||||
set_and_check(CURL_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/include")
|
@ -1,71 +0,0 @@
|
||||
|
||||
if(NOT PACKAGE_FIND_VERSION_RANGE AND PACKAGE_FIND_VERSION_MAJOR STREQUAL "7")
|
||||
# Version 8 satisfies version 7... requirements
|
||||
set(PACKAGE_FIND_VERSION_MAJOR 8)
|
||||
set(PACKAGE_FIND_VERSION_COUNT 1)
|
||||
endif()
|
||||
# This is a basic version file for the Config-mode of find_package().
|
||||
# It is used by write_basic_package_version_file() as input file for configure_file()
|
||||
# to create a version-file which can be installed along a config.cmake file.
|
||||
#
|
||||
# The created file sets PACKAGE_VERSION_EXACT if the current version string and
|
||||
# the requested version string are exactly the same and it sets
|
||||
# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version,
|
||||
# but only if the requested major version is the same as the current one.
|
||||
# The variable CVF_VERSION must be set before calling configure_file().
|
||||
|
||||
|
||||
set(PACKAGE_VERSION "8.11.0-DEV")
|
||||
|
||||
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
else()
|
||||
|
||||
if("8.11.0-DEV" MATCHES "^([0-9]+)\\.")
|
||||
set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
||||
if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
|
||||
string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
|
||||
endif()
|
||||
else()
|
||||
set(CVF_VERSION_MAJOR "8.11.0-DEV")
|
||||
endif()
|
||||
|
||||
if(PACKAGE_FIND_VERSION_RANGE)
|
||||
# both endpoints of the range must have the expected major version
|
||||
math (EXPR CVF_VERSION_MAJOR_NEXT "${CVF_VERSION_MAJOR} + 1")
|
||||
if (NOT PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
|
||||
OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX_MAJOR STREQUAL CVF_VERSION_MAJOR)
|
||||
OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX VERSION_LESS_EQUAL CVF_VERSION_MAJOR_NEXT)))
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
elseif(PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
|
||||
AND ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS_EQUAL PACKAGE_FIND_VERSION_MAX)
|
||||
OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MAX)))
|
||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
else()
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
endif()
|
||||
else()
|
||||
if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR)
|
||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
else()
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
endif()
|
||||
|
||||
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
|
||||
set(PACKAGE_VERSION_EXACT TRUE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
|
||||
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
|
||||
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8")
|
||||
math(EXPR installedBits "8 * 8")
|
||||
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
|
||||
set(PACKAGE_VERSION_UNSUITABLE TRUE)
|
||||
endif()
|
@ -1,38 +0,0 @@
|
||||
#----------------------------------------------------------------
|
||||
# Generated CMake target import file for configuration "Release".
|
||||
#----------------------------------------------------------------
|
||||
|
||||
# Commands may need to know the format version.
|
||||
set(CMAKE_IMPORT_FILE_VERSION 1)
|
||||
|
||||
# Import target "CURL::libcurl_static" for configuration "Release"
|
||||
set_property(TARGET CURL::libcurl_static APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(CURL::libcurl_static PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
|
||||
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libcurl.a"
|
||||
)
|
||||
|
||||
list(APPEND _cmake_import_check_targets CURL::libcurl_static )
|
||||
list(APPEND _cmake_import_check_files_for_CURL::libcurl_static "${_IMPORT_PREFIX}/lib/libcurl.a" )
|
||||
|
||||
# Import target "CURL::libcurl_shared" for configuration "Release"
|
||||
set_property(TARGET CURL::libcurl_shared APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(CURL::libcurl_shared PROPERTIES
|
||||
IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/libcurl.dll.a"
|
||||
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/libcurl.dll"
|
||||
)
|
||||
|
||||
list(APPEND _cmake_import_check_targets CURL::libcurl_shared )
|
||||
list(APPEND _cmake_import_check_files_for_CURL::libcurl_shared "${_IMPORT_PREFIX}/lib/libcurl.dll.a" "${_IMPORT_PREFIX}/bin/libcurl.dll" )
|
||||
|
||||
# Import target "CURL::curl" for configuration "Release"
|
||||
set_property(TARGET CURL::curl APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(CURL::curl PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/curl.exe"
|
||||
)
|
||||
|
||||
list(APPEND _cmake_import_check_targets CURL::curl )
|
||||
list(APPEND _cmake_import_check_files_for_CURL::curl "${_IMPORT_PREFIX}/bin/curl.exe" )
|
||||
|
||||
# Commands beyond this point should not need to know the version.
|
||||
set(CMAKE_IMPORT_FILE_VERSION)
|
118
3rdparty/curl/lib/cmake/CURL/CURLTargets.cmake
vendored
118
3rdparty/curl/lib/cmake/CURL/CURLTargets.cmake
vendored
@ -1,118 +0,0 @@
|
||||
# Generated by CMake
|
||||
|
||||
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
|
||||
message(FATAL_ERROR "CMake >= 2.8.0 required")
|
||||
endif()
|
||||
if(CMAKE_VERSION VERSION_LESS "2.8.12")
|
||||
message(FATAL_ERROR "CMake >= 2.8.12 required")
|
||||
endif()
|
||||
cmake_policy(PUSH)
|
||||
cmake_policy(VERSION 2.8.12...3.28)
|
||||
#----------------------------------------------------------------
|
||||
# Generated CMake target import file.
|
||||
#----------------------------------------------------------------
|
||||
|
||||
# Commands may need to know the format version.
|
||||
set(CMAKE_IMPORT_FILE_VERSION 1)
|
||||
|
||||
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
|
||||
set(_cmake_targets_defined "")
|
||||
set(_cmake_targets_not_defined "")
|
||||
set(_cmake_expected_targets "")
|
||||
foreach(_cmake_expected_target IN ITEMS CURL::libcurl_static CURL::libcurl_shared CURL::curl)
|
||||
list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
|
||||
if(TARGET "${_cmake_expected_target}")
|
||||
list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
|
||||
else()
|
||||
list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
|
||||
endif()
|
||||
endforeach()
|
||||
unset(_cmake_expected_target)
|
||||
if(_cmake_targets_defined STREQUAL _cmake_expected_targets)
|
||||
unset(_cmake_targets_defined)
|
||||
unset(_cmake_targets_not_defined)
|
||||
unset(_cmake_expected_targets)
|
||||
unset(CMAKE_IMPORT_FILE_VERSION)
|
||||
cmake_policy(POP)
|
||||
return()
|
||||
endif()
|
||||
if(NOT _cmake_targets_defined STREQUAL "")
|
||||
string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}")
|
||||
string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}")
|
||||
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n")
|
||||
endif()
|
||||
unset(_cmake_targets_defined)
|
||||
unset(_cmake_targets_not_defined)
|
||||
unset(_cmake_expected_targets)
|
||||
|
||||
|
||||
# Compute the installation prefix relative to this file.
|
||||
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
||||
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
||||
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
||||
if(_IMPORT_PREFIX STREQUAL "/")
|
||||
set(_IMPORT_PREFIX "")
|
||||
endif()
|
||||
|
||||
# Create imported target CURL::libcurl_static
|
||||
add_library(CURL::libcurl_static STATIC IMPORTED)
|
||||
|
||||
set_target_properties(CURL::libcurl_static PROPERTIES
|
||||
INTERFACE_COMPILE_DEFINITIONS "CURL_STATICLIB"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
|
||||
INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:idn2>;\$<LINK_ONLY:ws2_32>;\$<LINK_ONLY:bcrypt>;D:/Dev/msys64/mingw64/lib/libnghttp2.dll.a;\$<LINK_ONLY:wldap32>;D:/Dev/msys64/mingw64/lib/libpsl.dll.a;D:/Dev/msys64/mingw64/lib/libssh2.dll.a;\$<LINK_ONLY:advapi32>;\$<LINK_ONLY:crypt32>"
|
||||
)
|
||||
|
||||
# Create imported target CURL::libcurl_shared
|
||||
add_library(CURL::libcurl_shared SHARED IMPORTED)
|
||||
|
||||
set_target_properties(CURL::libcurl_shared PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
|
||||
)
|
||||
|
||||
# Create imported target CURL::curl
|
||||
add_executable(CURL::curl IMPORTED)
|
||||
|
||||
# Load information for each installed configuration.
|
||||
file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/CURLTargets-*.cmake")
|
||||
foreach(_cmake_config_file IN LISTS _cmake_config_files)
|
||||
include("${_cmake_config_file}")
|
||||
endforeach()
|
||||
unset(_cmake_config_file)
|
||||
unset(_cmake_config_files)
|
||||
|
||||
# Cleanup temporary variables.
|
||||
set(_IMPORT_PREFIX)
|
||||
|
||||
# Loop over all imported files and verify that they actually exist
|
||||
foreach(_cmake_target IN LISTS _cmake_import_check_targets)
|
||||
if(CMAKE_VERSION VERSION_LESS "3.28"
|
||||
OR NOT DEFINED _cmake_import_check_xcframework_for_${_cmake_target}
|
||||
OR NOT IS_DIRECTORY "${_cmake_import_check_xcframework_for_${_cmake_target}}")
|
||||
foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}")
|
||||
if(NOT EXISTS "${_cmake_file}")
|
||||
message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file
|
||||
\"${_cmake_file}\"
|
||||
but this file does not exist. Possible reasons include:
|
||||
* The file was deleted, renamed, or moved to another location.
|
||||
* An install or uninstall procedure did not complete successfully.
|
||||
* The installation package was faulty and contained
|
||||
\"${CMAKE_CURRENT_LIST_FILE}\"
|
||||
but not all the files it references.
|
||||
")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
unset(_cmake_file)
|
||||
unset("_cmake_import_check_files_for_${_cmake_target}")
|
||||
endforeach()
|
||||
unset(_cmake_target)
|
||||
unset(_cmake_import_check_targets)
|
||||
|
||||
# This file does not depend on other imported targets which have
|
||||
# been exported from the same project but in a separate export set.
|
||||
|
||||
# Commands beyond this point should not need to know the version.
|
||||
set(CMAKE_IMPORT_FILE_VERSION)
|
||||
cmake_policy(POP)
|
BIN
3rdparty/curl/lib/libcurl.a
vendored
BIN
3rdparty/curl/lib/libcurl.a
vendored
Binary file not shown.
BIN
3rdparty/curl/lib/libcurl.dll.a
vendored
BIN
3rdparty/curl/lib/libcurl.dll.a
vendored
Binary file not shown.
41
3rdparty/curl/lib/pkgconfig/libcurl.pc
vendored
41
3rdparty/curl/lib/pkgconfig/libcurl.pc
vendored
@ -1,41 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 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
|
||||
# are also available at https://curl.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.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
prefix=F:/SourceCode/XSteam/3rdparty/curl
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/lib
|
||||
includedir=${prefix}/include
|
||||
supported_protocols="DICT FILE FTP GOPHER HTTP IMAP IPFS IPNS LDAP LDAPS MQTT POP3 RTSP SCP SFTP SMB SMTP TELNET TFTP"
|
||||
supported_features="alt-svc AsynchDNS HTTP2 IDN IPv6 Largefile NTLM PSL threadsafe UnixSockets"
|
||||
|
||||
Name: libcurl
|
||||
URL: https://curl.se/
|
||||
Description: Library to transfer files with HTTP, FTP, etc.
|
||||
Version: 8.11.0-DEV
|
||||
Requires:
|
||||
Requires.private: libidn2,libnghttp2,libpsl,libssh2
|
||||
Libs: -L${libdir} -lcurl
|
||||
Libs.private: -LD:/Dev/msys64/mingw64/bin/../lib -LD:/Dev/msys64/mingw64/lib -lidn2 -lws2_32 -lbcrypt -lnghttp2 -lwldap32 -lpsl -lssh2 -ladvapi32 -lcrypt32
|
||||
Cflags: -I${includedir}
|
||||
Cflags.private: -DCURL_STATICLIB
|
82
3rdparty/curl/share/man/man1/curl-config.1
vendored
82
3rdparty/curl/share/man/man1/curl-config.1
vendored
@ -1,82 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from curl-config.md
|
||||
.TH curl-config 1 "2024-10-11" curl-config
|
||||
.SH NAME
|
||||
curl\-config \- Get information about a libcurl installation
|
||||
.SH SYNOPSIS
|
||||
\fBcurl\-config [options]\fP
|
||||
.SH DESCRIPTION
|
||||
\fBcurl\-config\fP
|
||||
displays information about the curl and libcurl installation.
|
||||
.SH OPTIONS
|
||||
.IP --ca
|
||||
Displays the built\-in path to the CA cert bundle this libcurl uses.
|
||||
.IP --cc
|
||||
Displays the compiler used to build libcurl.
|
||||
.IP --cflags
|
||||
Set of compiler options (CFLAGS) to use when compiling files that use
|
||||
libcurl. Currently that is only the include path to the curl include files.
|
||||
.IP "--checkfor [version]"
|
||||
Specify the oldest possible libcurl version string you want, and this script
|
||||
returns 0 if the current installation is new enough or it returns 1 and
|
||||
outputs a text saying that the current version is not new enough. (Added in
|
||||
7.15.4)
|
||||
.IP --configure
|
||||
Displays the arguments given to configure when building curl.
|
||||
.IP --feature
|
||||
Lists what particular main features the installed libcurl was built with. At
|
||||
the time of writing, this list may include SSL, KRB4 or IPv6. Do not assume
|
||||
any particular order. The keywords are separated by newlines. There may be
|
||||
none, one, or several keywords in the list.
|
||||
.IP --help
|
||||
Displays the available options.
|
||||
.IP --libs
|
||||
Shows the complete set of libs and other linker options you need in order to
|
||||
link your application with libcurl.
|
||||
.IP --prefix
|
||||
This is the prefix used when libcurl was installed. Libcurl is then installed
|
||||
in $prefix/lib and its header files are installed in $prefix/include and so
|
||||
on. The prefix is set with "configure \--prefix".
|
||||
.IP --protocols
|
||||
Lists what particular protocols the installed libcurl was built to support. At
|
||||
the time of writing, this list may include HTTP, HTTPS, FTP, FTPS, FILE,
|
||||
TELNET, LDAP, DICT and many more. Do not assume any particular order. The
|
||||
protocols are listed using uppercase and are separated by newlines. There may
|
||||
be none, one, or several protocols in the list. (Added in 7.13.0)
|
||||
.IP --ssl-backends
|
||||
Lists the SSL backends that were enabled when libcurl was built. It might be
|
||||
no, one or several names. If more than one name, they appear comma\-separated.
|
||||
(Added in 7.58.0)
|
||||
.IP --static-libs
|
||||
Shows the complete set of libs and other linker options you need in order to
|
||||
link your application with libcurl statically. (Added in 7.17.1)
|
||||
.IP --version
|
||||
Outputs version information about the installed libcurl.
|
||||
.IP --vernum
|
||||
Outputs version information about the installed libcurl, in numerical mode.
|
||||
This shows the version number, in hexadecimal, using 8 bits for each part:
|
||||
major, minor, and patch numbers. This makes libcurl 7.7.4 appear as 070704 and
|
||||
libcurl 12.13.14 appear as 0c0d0e... Note that the initial zero might be
|
||||
omitted. (This option was broken in the 7.15.0 release.)
|
||||
.SH EXAMPLES
|
||||
What linker options do I need when I link with libcurl?
|
||||
.nf
|
||||
$ curl-config --libs
|
||||
.fi
|
||||
What compiler options do I need when I compile using libcurl functions?
|
||||
.nf
|
||||
$ curl-config --cflags
|
||||
.fi
|
||||
How do I know if libcurl was built with SSL support?
|
||||
.nf
|
||||
$ curl-config --feature | grep SSL
|
||||
.fi
|
||||
What\(aqs the installed libcurl version?
|
||||
.nf
|
||||
$ curl-config --version
|
||||
.fi
|
||||
How do I build a single file with a one\-line command?
|
||||
.nf
|
||||
$ `curl-config --cc --cflags` -o example source.c `curl-config --libs`
|
||||
.fi
|
||||
.SH SEE ALSO
|
||||
.BR curl (1)
|
6523
3rdparty/curl/share/man/man1/curl.1
vendored
6523
3rdparty/curl/share/man/man1/curl.1
vendored
File diff suppressed because it is too large
Load Diff
81
3rdparty/curl/share/man/man1/mk-ca-bundle.1
vendored
81
3rdparty/curl/share/man/man1/mk-ca-bundle.1
vendored
@ -1,81 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from mk-ca-bundle.md
|
||||
.TH mk-ca-bundle 1 "2024-10-11" mk-ca-bundle
|
||||
.SH NAME
|
||||
mk\-ca\-bundle \- convert Mozilla\(aqs certificate bundle to PEM format
|
||||
.SH SYNOPSIS
|
||||
mk\-ca\-bundle [options] [output]
|
||||
.SH DESCRIPTION
|
||||
This tool downloads the \fIcertdata.txt\fP file from Mozilla\(aqs source tree over
|
||||
HTTPS, then parses it and extracts the included certificates into PEM format.
|
||||
By default, only CA root certificates trusted to issue SSL server
|
||||
authentication certificates are extracted. These are then processed with the
|
||||
OpenSSL command line tool to produce the final ca\-bundle output file.
|
||||
|
||||
The default \fIoutput\fP name is \fBca\-bundle.crt\fP. By setting it to \(aq\-\(aq (a single
|
||||
dash) you get the output sent to STDOUT instead of a file.
|
||||
|
||||
The PEM format this scripts uses for output makes the result readily available
|
||||
for use by just about all OpenSSL or GnuTLS powered applications, such as curl
|
||||
and others.
|
||||
.SH OPTIONS
|
||||
The following options are supported:
|
||||
.IP -b
|
||||
backup an existing version of \fIoutput\fP
|
||||
.IP "-d [name]"
|
||||
specify which Mozilla tree to pull \fIcertdata.txt\fP from (or a custom URL).
|
||||
Valid names are: \fBaurora\fP, \fBbeta\fP, \fBcentral\fP, \fBMozilla\fP, \fBnss\fP,
|
||||
\fBrelease\fP (default). They are shortcuts for which source tree to get the
|
||||
certificate data from.
|
||||
.IP -f
|
||||
force rebuild even if \fIcertdata.txt\fP is current (Added in version 1.17)
|
||||
.IP -i
|
||||
print version info about used modules
|
||||
.IP -k
|
||||
Allow insecure data transfer. By default (since 1.27) this command fails if
|
||||
the HTTPS transfer fails. This overrides that decision (and opens for
|
||||
man\-in\-the\-middle attacks).
|
||||
.IP -l
|
||||
print license info about \fIcertdata.txt\fP
|
||||
.IP -m
|
||||
(Added in 1.26) Include meta data comments in the output. The meta data is
|
||||
specific information about each certificate that is stored in the original
|
||||
file as comments and using this option makes those comments get passed on to
|
||||
the output file. The meta data is not parsed in any way by mk\-ca\-bundle.
|
||||
.IP -n
|
||||
Do not download \fIcertdata.txt\fP \- use the existing.
|
||||
.IP "-p [purposes]:[levels]"
|
||||
list of Mozilla trust purposes and levels for certificates to include in
|
||||
output. Takes the form of a comma separated list of purposes, a colon, and a
|
||||
comma separated list of levels. The default is to include all certificates
|
||||
trusted to issue SSL Server certificates (\fISERVER_AUTH:TRUSTED_DELEGATOR\fP).
|
||||
|
||||
Valid purposes are: \fBALL\fP, \fBDIGITAL_SIGNATURE\fP, \fBNON_REPUDIATION\fP,
|
||||
\fBKEY_ENCIPHERMENT\fP, \fBDATA_ENCIPHERMENT\fP, \fBKEY_AGREEMENT\fP,
|
||||
\fBKEY_CERT_SIGN\fP, \fBCRL_SIGN\fP, \fBSERVER_AUTH\fP (default), \fBCLIENT_AUTH\fP,
|
||||
\fBCODE_SIGNING\fP, \fBEMAIL_PROTECTION\fP, \fBIPSEC_END_SYSTEM\fP,
|
||||
\fBIPSEC_TUNNEL\fP, \fBIPSEC_USER\fP, \fBTIME_STAMPING\fP, \fBSTEP_UP_APPROVED\fP
|
||||
|
||||
Valid trust levels are: \fBALL\fP, \fBTRUSTED_DELEGATOR\fP (default), \fBNOT_TRUSTED\fP,
|
||||
\fBMUST_VERIFY_TRUST\fP, \fBTRUSTED\fP
|
||||
.IP -q
|
||||
be really quiet (no progress output at all)
|
||||
.IP -t
|
||||
include plain text listing of certificates
|
||||
.IP "-s [algorithms]"
|
||||
A comma separated list of signature algorithms with which to hash/fingerprint
|
||||
each certificate and output when run in plain text mode.
|
||||
|
||||
Valid algorithms are:
|
||||
ALL, NONE, MD5 (default), SHA1, SHA256, SHA384, SHA512
|
||||
.IP -u
|
||||
unlink (remove) \fIcertdata.txt\fP after processing
|
||||
.IP -v
|
||||
be verbose and print out processed certificate authorities
|
||||
.SH EXIT STATUS
|
||||
Returns 0 on success. Returns 1 if it fails to download data.
|
||||
.SH FILE FORMAT
|
||||
The file format used by Mozilla for this trust information is documented here:
|
||||
|
||||
https://p11\-glue.freedesktop.org/doc/storing\-trust\-policy/storing\-trust\-existing.html
|
||||
.SH SEE ALSO
|
||||
.BR curl (1)
|
@ -1,63 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_ACTIVESOCKET.md
|
||||
.TH CURLINFO_ACTIVESOCKET 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_ACTIVESOCKET \- get the active socket
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_ACTIVESOCKET,
|
||||
curl_socket_t *socket);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a curl_socket_t to receive the most recently active socket
|
||||
used for the transfer connection by this curl session. If the socket is no
|
||||
longer valid, \fICURL_SOCKET_BAD\fP is returned. When you are finished working
|
||||
with the socket, you must call \fIcurl_easy_cleanup(3)\fP as usual on the easy
|
||||
handle and let libcurl close the socket and cleanup other resources associated
|
||||
with the handle. This option returns the active socket only after the transfer
|
||||
is complete, and is typically used in combination with
|
||||
\fICURLOPT_CONNECT_ONLY(3)\fP, which skips the transfer phase.
|
||||
|
||||
\fICURLINFO_ACTIVESOCKET(3)\fP was added as a replacement for
|
||||
\fICURLINFO_LASTSOCKET(3)\fP since that one is not working on all platforms.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_socket_t sockfd;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Do not do the transfer - only connect to host */
|
||||
curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1L);
|
||||
res = curl_easy_perform(curl);
|
||||
if(res != CURLE_OK) {
|
||||
printf("Error: %s\\n", curl_easy_strerror(res));
|
||||
curl_easy_cleanup(curl);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Extract the socket from the curl handle */
|
||||
res = curl_easy_getinfo(curl, CURLINFO_ACTIVESOCKET, &sockfd);
|
||||
if(!res && sockfd != CURL_SOCKET_BAD) {
|
||||
/* operate on sockfd */
|
||||
}
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.45.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_LASTSOCKET (3),
|
||||
.BR CURLOPT_CONNECT_ONLY (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,52 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_APPCONNECT_TIME.md
|
||||
.TH CURLINFO_APPCONNECT_TIME 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_APPCONNECT_TIME \- get the time until the SSL/SSH handshake is completed
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_APPCONNECT_TIME,
|
||||
double *timep);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a double to receive the time, in seconds, it took from the
|
||||
start until the SSL/SSH connect/handshake to the remote host was completed.
|
||||
This time is most often close to the \fICURLINFO_PRETRANSFER_TIME(3)\fP time, except
|
||||
for cases such as HTTP multiplexing where the pretransfer time can be delayed
|
||||
due to waits in line for the stream and more.
|
||||
|
||||
When a redirect is followed, the time from each request is added together.
|
||||
|
||||
See also the TIMES overview in the \fIcurl_easy_getinfo(3)\fP man page.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
double connect;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
|
||||
res = curl_easy_perform(curl);
|
||||
if(CURLE_OK == res) {
|
||||
res = curl_easy_getinfo(curl, CURLINFO_APPCONNECT_TIME, &connect);
|
||||
if(CURLE_OK == res) {
|
||||
printf("Time: %.1f", connect);
|
||||
}
|
||||
}
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.19.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_APPCONNECT_TIME_T (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,53 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_APPCONNECT_TIME_T.md
|
||||
.TH CURLINFO_APPCONNECT_TIME_T 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_APPCONNECT_TIME_T \- time until the SSL/SSH handshake completed
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_APPCONNECT_TIME_T,
|
||||
curl_off_t *timep);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a curl_off_t to receive the time, in microseconds, it took
|
||||
from the start until the SSL/SSH connect/handshake to the remote host was
|
||||
completed. This time is most often close to the \fICURLINFO_PRETRANSFER_TIME_T(3)\fP
|
||||
time, except for cases such as HTTP multiplexing where the pretransfer time
|
||||
can be delayed due to waits in line for the stream and more.
|
||||
|
||||
When a redirect is followed, the time from each request is added together.
|
||||
|
||||
See also the TIMES overview in the \fIcurl_easy_getinfo(3)\fP man page.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_off_t connect;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
|
||||
res = curl_easy_perform(curl);
|
||||
if(CURLE_OK == res) {
|
||||
res = curl_easy_getinfo(curl, CURLINFO_APPCONNECT_TIME_T, &connect);
|
||||
if(CURLE_OK == res) {
|
||||
printf("Time: %" CURL_FORMAT_CURL_OFF_T ".%06ld", connect / 1000000,
|
||||
(long)(connect % 1000000));
|
||||
}
|
||||
}
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.61.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_APPCONNECT_TIME (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
49
3rdparty/curl/share/man/man3/CURLINFO_CAINFO.3
vendored
49
3rdparty/curl/share/man/man3/CURLINFO_CAINFO.3
vendored
@ -1,49 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_CAINFO.md
|
||||
.TH CURLINFO_CAINFO 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_CAINFO \- get the default built\-in CA certificate path
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CAINFO, char **path);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a char pointer to receive the pointer to a null\-terminated
|
||||
string holding the default built\-in path used for the \fICURLOPT_CAINFO(3)\fP
|
||||
option unless set by the user.
|
||||
|
||||
Note that in a situation where libcurl has been built to support multiple TLS
|
||||
libraries, this option might return a string even if the specific TLS library
|
||||
currently set to be used does not support \fICURLOPT_CAINFO(3)\fP.
|
||||
|
||||
This is a path identifying a single file containing CA certificates.
|
||||
|
||||
The \fBpath\fP pointer is set to NULL if there is no default path.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
|
||||
|
||||
All TLS backends support this option.
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
char *cainfo = NULL;
|
||||
curl_easy_getinfo(curl, CURLINFO_CAINFO, &cainfo);
|
||||
if(cainfo) {
|
||||
printf("default ca info path: %s\\n", cainfo);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.84.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_CAPATH (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
50
3rdparty/curl/share/man/man3/CURLINFO_CAPATH.3
vendored
50
3rdparty/curl/share/man/man3/CURLINFO_CAPATH.3
vendored
@ -1,50 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_CAPATH.md
|
||||
.TH CURLINFO_CAPATH 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_CAPATH \- get the default built\-in CA path string
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CAPATH, char **path);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a char pointer to receive the pointer to a null\-terminated
|
||||
string holding the default built\-in path used for the \fICURLOPT_CAPATH(3)\fP
|
||||
option unless set by the user.
|
||||
|
||||
Note that in a situation where libcurl has been built to support multiple TLS
|
||||
libraries, this option might return a string even if the specific TLS library
|
||||
currently set to be used does not support \fICURLOPT_CAPATH(3)\fP.
|
||||
|
||||
This is a path identifying a directory.
|
||||
|
||||
The \fBpath\fP pointer is set to NULL if there is no default path.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
|
||||
|
||||
This option works only with the following TLS backends:
|
||||
GnuTLS, OpenSSL, mbedTLS and wolfSSL
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
char *capath = NULL;
|
||||
curl_easy_getinfo(curl, CURLINFO_CAPATH, &capath);
|
||||
if(capath) {
|
||||
printf("default ca path: %s\\n", capath);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.84.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_CAINFO (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
84
3rdparty/curl/share/man/man3/CURLINFO_CERTINFO.3
vendored
84
3rdparty/curl/share/man/man3/CURLINFO_CERTINFO.3
vendored
@ -1,84 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_CERTINFO.md
|
||||
.TH CURLINFO_CERTINFO 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_CERTINFO \- get the TLS certificate chain
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CERTINFO,
|
||||
struct curl_certinfo **chainp);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a \fIstruct curl_certinfo \fP* and it is set to point to a
|
||||
struct that holds info about the server\(aqs certificate chain, assuming you had
|
||||
\fICURLOPT_CERTINFO(3)\fP enabled when the request was made.
|
||||
|
||||
.nf
|
||||
struct curl_certinfo {
|
||||
int num_of_certs;
|
||||
struct curl_slist **certinfo;
|
||||
};
|
||||
.fi
|
||||
|
||||
The \fIcertinfo\fP struct member is an array of linked lists of certificate
|
||||
information. The \fInum_of_certs\fP struct member is the number of certificates
|
||||
which is the number of elements in the array. Each certificate\(aqs list has
|
||||
items with textual information in the format "name:content" such as
|
||||
\&"Subject:Foo", "Issuer:Bar", etc. The items in each list varies depending on
|
||||
the SSL backend and the certificate.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
|
||||
|
||||
This option works only with the following TLS backends:
|
||||
GnuTLS, OpenSSL, Schannel and Secure Transport
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/");
|
||||
|
||||
/* connect to any HTTPS site, trusted or not */
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_CERTINFO, 1L);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
int i;
|
||||
struct curl_certinfo *ci;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CERTINFO, &ci);
|
||||
|
||||
if(!res) {
|
||||
printf("%d certs!\\n", ci->num_of_certs);
|
||||
|
||||
for(i = 0; i < ci->num_of_certs; i++) {
|
||||
struct curl_slist *slist;
|
||||
|
||||
for(slist = ci->certinfo[i]; slist; slist = slist->next)
|
||||
printf("%s\\n", slist->data);
|
||||
}
|
||||
}
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
|
||||
See also the \fIcertinfo.c\fP example.
|
||||
.SH HISTORY
|
||||
GnuTLS support added in 7.42.0. Schannel support added in 7.50.0. Secure
|
||||
Transport support added in 7.79.0. mbedTLS support added in 8.9.0.
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.19.1
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_CAPATH (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,61 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_CONDITION_UNMET.md
|
||||
.TH CURLINFO_CONDITION_UNMET 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_CONDITION_UNMET \- get info on unmet time conditional or 304 HTTP response.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CONDITION_UNMET,
|
||||
long *unmet);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a long to receive the number 1 if the condition provided in
|
||||
the previous request did not match (see \fICURLOPT_TIMECONDITION(3)\fP). Alas,
|
||||
if this returns a 1 you know that the reason you did not get data in return is
|
||||
because it did not fulfill the condition. The long this argument points to
|
||||
gets a zero stored if the condition instead was met. This can also return 1 if
|
||||
the server responded with a 304 HTTP status code, for example after sending a
|
||||
custom "If\-Match\-*" header.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects http only
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* January 1, 2020 is 1577833200 */
|
||||
curl_easy_setopt(curl, CURLOPT_TIMEVALUE, 1577833200L);
|
||||
|
||||
/* If-Modified-Since the above time stamp */
|
||||
curl_easy_setopt(curl, CURLOPT_TIMECONDITION,
|
||||
(long)CURL_TIMECOND_IFMODSINCE);
|
||||
|
||||
/* Perform the request */
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
/* check the time condition */
|
||||
long unmet;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &unmet);
|
||||
if(!res) {
|
||||
printf("The time condition was %sfulfilled\\n", unmet?"NOT":"");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.19.4
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLOPT_TIMECONDITION (3),
|
||||
.BR CURLOPT_TIMEVALUE (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,48 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_CONNECT_TIME.md
|
||||
.TH CURLINFO_CONNECT_TIME 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_CONNECT_TIME \- get the time until connect
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CONNECT_TIME, double *timep);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a double to receive the total time in seconds from the start
|
||||
until the connection to the remote host (or proxy) was completed.
|
||||
|
||||
When a redirect is followed, the time from each request is added together.
|
||||
|
||||
See also the TIMES overview in the \fIcurl_easy_getinfo(3)\fP man page.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
double connect;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(CURLE_OK == res) {
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CONNECT_TIME, &connect);
|
||||
if(CURLE_OK == res) {
|
||||
printf("Time: %.1f", connect);
|
||||
}
|
||||
}
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.4.1
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_CONNECT_TIME_T (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,51 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_CONNECT_TIME_T.md
|
||||
.TH CURLINFO_CONNECT_TIME_T 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_CONNECT_TIME_T \- get the time until connect
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CONNECT_TIME_T,
|
||||
curl_off_t *timep);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a curl_off_t to receive the total time in microseconds from
|
||||
the start until the connection to the remote host (or proxy) was completed.
|
||||
|
||||
When a redirect is followed, the time from each request is added together.
|
||||
|
||||
See also the TIMES overview in the \fIcurl_easy_getinfo(3)\fP man page.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_off_t connect;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(CURLE_OK == res) {
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CONNECT_TIME_T, &connect);
|
||||
if(CURLE_OK == res) {
|
||||
printf("Time: %" CURL_FORMAT_CURL_OFF_T ".%06ld", connect / 1000000,
|
||||
(long)(connect % 1000000));
|
||||
}
|
||||
}
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.61.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_CONNECT_TIME (3),
|
||||
.BR CURLOPT_CONNECTTIMEOUT (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
51
3rdparty/curl/share/man/man3/CURLINFO_CONN_ID.3
vendored
51
3rdparty/curl/share/man/man3/CURLINFO_CONN_ID.3
vendored
@ -1,51 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_CONN_ID.md
|
||||
.TH CURLINFO_CONN_ID 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_CONN_ID \- get the ID of the last connection used by the handle
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CONN_ID,
|
||||
curl_off_t *conn_id);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a \fIcurl_off_t\fP to receive the connection identifier last
|
||||
used by the handle. Stores \-1 if there was no connection used.
|
||||
|
||||
The connection id is unique among all connections using the same
|
||||
connection cache. This is implicitly the case for all connections in the
|
||||
same multi handle.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the request */
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
curl_off_t conn_id;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CONN_ID, &conn_id);
|
||||
if(!res) {
|
||||
printf("Connection used: %" CURL_FORMAT_CURL_OFF_T "\\n", conn_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 8.2.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_XFER_ID (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,53 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_CONTENT_LENGTH_DOWNLOAD.md
|
||||
.TH CURLINFO_CONTENT_LENGTH_DOWNLOAD 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_CONTENT_LENGTH_DOWNLOAD \- get content\-length of download
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CONTENT_LENGTH_DOWNLOAD,
|
||||
double *content_length);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a double to receive the content\-length of the download. This
|
||||
is the value read from the Content\-Length: field. Since 7.19.4, this returns
|
||||
-1 if the size is not known.
|
||||
|
||||
\fICURLINFO_CONTENT_LENGTH_DOWNLOAD_T(3)\fP is a newer replacement that returns a more
|
||||
sensible variable type.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the request */
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
/* check the size */
|
||||
double cl;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &cl);
|
||||
if(!res) {
|
||||
printf("Size: %.0f\\n", cl);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH DEPRECATED
|
||||
Deprecated since 7.55.0.
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.6.1
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_CONTENT_LENGTH_UPLOAD (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,48 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_CONTENT_LENGTH_DOWNLOAD_T.md
|
||||
.TH CURLINFO_CONTENT_LENGTH_DOWNLOAD_T 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_CONTENT_LENGTH_DOWNLOAD_T \- get content\-length of download
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T,
|
||||
curl_off_t *content_length);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a \fIcurl_off_t\fP to receive the content\-length of the
|
||||
download. This is the value read from the Content\-Length: field. Stores \-1 if
|
||||
the size is not known.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects http only
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the request */
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
/* check the size */
|
||||
curl_off_t cl;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &cl);
|
||||
if(!res) {
|
||||
printf("Download size: %" CURL_FORMAT_CURL_OFF_T "\\n", cl);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.55.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_CONTENT_LENGTH_UPLOAD_T (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,52 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_CONTENT_LENGTH_UPLOAD.md
|
||||
.TH CURLINFO_CONTENT_LENGTH_UPLOAD 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_CONTENT_LENGTH_UPLOAD \- get the specified size of the upload
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CONTENT_LENGTH_UPLOAD,
|
||||
double *content_length);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a double to receive the specified size of the upload. Since
|
||||
7.19.4, this returns \-1 if the size is not known.
|
||||
|
||||
\fICURLINFO_CONTENT_LENGTH_UPLOAD_T(3)\fP is a newer replacement that returns a
|
||||
more sensible variable type.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the upload */
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
/* check the size */
|
||||
double cl;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_UPLOAD, &cl);
|
||||
if(!res) {
|
||||
printf("Size: %.0f\\n", cl);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH DEPRECATED
|
||||
Deprecated since 7.55.0.
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.6.1
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_CONTENT_LENGTH_DOWNLOAD_T (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,47 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_CONTENT_LENGTH_UPLOAD_T.md
|
||||
.TH CURLINFO_CONTENT_LENGTH_UPLOAD_T 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_CONTENT_LENGTH_UPLOAD_T \- get the specified size of the upload
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CONTENT_LENGTH_UPLOAD_T,
|
||||
curl_off_t *content_length);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a \fIcurl_off_t\fP to receive the specified size of the
|
||||
upload. Stores \-1 if the size is not known.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the upload */
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
/* check the size */
|
||||
curl_off_t cl;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_UPLOAD_T, &cl);
|
||||
if(!res) {
|
||||
printf("Upload size: %" CURL_FORMAT_CURL_OFF_T "\\n", cl);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.55.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_CONTENT_LENGTH_DOWNLOAD_T (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,56 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_CONTENT_TYPE.md
|
||||
.TH CURLINFO_CONTENT_TYPE 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_CONTENT_TYPE \- get Content\-Type
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CONTENT_TYPE, char **ct);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a char pointer to receive the content\-type of the downloaded
|
||||
object. This is the value read from the Content\-Type: field. If you get NULL,
|
||||
it means that the server did not send a valid Content\-Type header or that the
|
||||
protocol used does not support this.
|
||||
|
||||
The \fBct\fP pointer is set to NULL or pointing to private memory. You MUST
|
||||
NOT free it \- it gets freed when you call \fIcurl_easy_cleanup(3)\fP on the
|
||||
corresponding CURL handle.
|
||||
|
||||
The modern way to get this header from a response is to instead use the
|
||||
\fIcurl_easy_header(3)\fP function.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects http only
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
/* extract the content-type */
|
||||
char *ct = NULL;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &ct);
|
||||
if(!res && ct) {
|
||||
printf("Content-Type: %s\\n", ct);
|
||||
}
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.9.4
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLOPT_HEADERFUNCTION (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_header (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,63 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_COOKIELIST.md
|
||||
.TH CURLINFO_COOKIELIST 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_COOKIELIST \- get all known cookies
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_COOKIELIST,
|
||||
struct curl_slist **cookies);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a \(aqstruct curl_slist *\(aq to receive a linked\-list of all
|
||||
cookies curl knows (expired ones, too). Do not forget to call
|
||||
\fIcurl_slist_free_all(3)\fP on the list after it has been used. If there are no
|
||||
cookies (cookies for the handle have not been enabled or simply none have been
|
||||
received) the \(aqstruct curl_slist *\(aq is made a NULL pointer.
|
||||
|
||||
Since 7.43.0 cookies that were imported in the Set\-Cookie format without a
|
||||
domain name are not exported by this option.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects http only
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* enable the cookie engine */
|
||||
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "");
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
/* extract all known cookies */
|
||||
struct curl_slist *cookies = NULL;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_COOKIELIST, &cookies);
|
||||
if(!res && cookies) {
|
||||
/* a linked list of cookies in cookie file format */
|
||||
struct curl_slist *each = cookies;
|
||||
while(each) {
|
||||
printf("%s\\n", each->data);
|
||||
each = each->next;
|
||||
}
|
||||
/* we must free these cookies when we are done */
|
||||
curl_slist_free_all(cookies);
|
||||
}
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.14.1
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLOPT_COOKIELIST (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,53 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_EFFECTIVE_METHOD.md
|
||||
.TH CURLINFO_EFFECTIVE_METHOD 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_EFFECTIVE_METHOD \- get the last used HTTP method
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_EFFECTIVE_METHOD,
|
||||
char **methodp);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass in a pointer to a char pointer and get the last used effective HTTP
|
||||
method.
|
||||
|
||||
In cases when you have asked libcurl to follow redirects, the method may not be
|
||||
the same method the first request would use.
|
||||
|
||||
The \fBmethodp\fP pointer is NULL or points to private memory. You MUST NOT
|
||||
free \- it gets freed when you call \fIcurl_easy_cleanup(3)\fP on the
|
||||
corresponding CURL handle.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects http only
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "data");
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
char *method = NULL;
|
||||
curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_METHOD, &method);
|
||||
if(method)
|
||||
printf("Redirected to method: %s\\n", method);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.72.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLOPT_CUSTOMREQUEST (3),
|
||||
.BR CURLOPT_FOLLOWLOCATION (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,49 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_EFFECTIVE_URL.md
|
||||
.TH CURLINFO_EFFECTIVE_URL 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_EFFECTIVE_URL \- get the last used URL
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_EFFECTIVE_URL, char **urlp);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass in a pointer to a char pointer and get the last used effective URL.
|
||||
|
||||
In cases when you have asked libcurl to follow redirects, it may not be the same
|
||||
value you set with \fICURLOPT_URL(3)\fP.
|
||||
|
||||
The \fBurlp\fP pointer is NULL or points to private memory. You MUST NOT free
|
||||
- it gets freed when you call \fIcurl_easy_cleanup(3)\fP on the corresponding
|
||||
CURL handle.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects http only
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
char *url = NULL;
|
||||
curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &url);
|
||||
if(url)
|
||||
printf("Redirect to: %s\\n", url);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.4
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLOPT_FOLLOWLOCATION (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
56
3rdparty/curl/share/man/man3/CURLINFO_FILETIME.3
vendored
56
3rdparty/curl/share/man/man3/CURLINFO_FILETIME.3
vendored
@ -1,56 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_FILETIME.md
|
||||
.TH CURLINFO_FILETIME 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_FILETIME \- get the remote time of the retrieved document
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_FILETIME, long *timep);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a long to receive the remote time of the retrieved document
|
||||
in number of seconds since January 1 1970 in the GMT/UTC time zone. If you get
|
||||
-1, it can be because of many reasons (it might be unknown, the server might
|
||||
hide it or the server does not support the command that tells document time
|
||||
etc) and the time of the document is unknown.
|
||||
|
||||
You must ask libcurl to collect this information before the transfer is made,
|
||||
by using the \fICURLOPT_FILETIME(3)\fP option or you unconditionally get a \-1 back.
|
||||
|
||||
Consider \fICURLINFO_FILETIME_T(3)\fP instead to be able to extract dates beyond the
|
||||
year 2038 on systems using 32\-bit longs (Windows).
|
||||
.SH PROTOCOLS
|
||||
This functionality affects ftp, http and sftp
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
/* Ask for filetime */
|
||||
curl_easy_setopt(curl, CURLOPT_FILETIME, 1L);
|
||||
res = curl_easy_perform(curl);
|
||||
if(CURLE_OK == res) {
|
||||
long filetime = 0;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_FILETIME, &filetime);
|
||||
if((CURLE_OK == res) && (filetime >= 0)) {
|
||||
time_t file_time = (time_t)filetime;
|
||||
printf("filetime: %s", ctime(&file_time));
|
||||
}
|
||||
}
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.5
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLOPT_FILETIME (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,57 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_FILETIME_T.md
|
||||
.TH CURLINFO_FILETIME_T 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_FILETIME_T \- get the remote time of the retrieved document
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_FILETIME_T,
|
||||
curl_off_t *timep);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a curl_off_t to receive the remote time of the retrieved
|
||||
document in number of seconds since January 1 1970 in the GMT/UTC time zone.
|
||||
If you get \-1, it can be because of many reasons (it might be unknown, the
|
||||
server might hide it or the server does not support the command that tells
|
||||
document time etc) and the time of the document is unknown.
|
||||
|
||||
You must ask libcurl to collect this information before the transfer is made,
|
||||
by using the \fICURLOPT_FILETIME(3)\fP option or you unconditionally get a \-1 back.
|
||||
|
||||
This option is an alternative to \fICURLINFO_FILETIME(3)\fP to allow systems with 32
|
||||
bit long variables to extract dates outside of the 32\-bit timestamp range.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects ftp, http and sftp
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
|
||||
/* Ask for filetime */
|
||||
curl_easy_setopt(curl, CURLOPT_FILETIME, 1L);
|
||||
res = curl_easy_perform(curl);
|
||||
if(CURLE_OK == res) {
|
||||
curl_off_t filetime;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_FILETIME_T, &filetime);
|
||||
if((CURLE_OK == res) && (filetime >= 0)) {
|
||||
time_t file_time = (time_t)filetime;
|
||||
printf("filetime: %s", ctime(&file_time));
|
||||
}
|
||||
}
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.59.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLOPT_FILETIME (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,53 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_FTP_ENTRY_PATH.md
|
||||
.TH CURLINFO_FTP_ENTRY_PATH 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_FTP_ENTRY_PATH \- get entry path in FTP server
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_FTP_ENTRY_PATH, char **path);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a char pointer to receive a pointer to a string holding the
|
||||
path of the entry path. That is the initial path libcurl ended up in when
|
||||
logging on to the remote FTP server. This stores a NULL as pointer if
|
||||
something is wrong.
|
||||
|
||||
The \fBpath\fP pointer is NULL or points to private memory. You MUST NOT free
|
||||
- it gets freed when you call \fIcurl_easy_cleanup(3)\fP on the corresponding
|
||||
CURL handle.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects ftp only
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com");
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
/* extract the entry path */
|
||||
char *ep = NULL;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_FTP_ENTRY_PATH, &ep);
|
||||
if(!res && ep) {
|
||||
printf("Entry path was: %s\\n", ep);
|
||||
}
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH HISTORY
|
||||
Works for SFTP since 7.21.4
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.15.4
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,46 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_HEADER_SIZE.md
|
||||
.TH CURLINFO_HEADER_SIZE 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_HEADER_SIZE \- get size of retrieved headers
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_HEADER_SIZE, long *sizep);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a long to receive the total size of all the headers
|
||||
received. Measured in number of bytes.
|
||||
|
||||
The total includes the size of any received headers suppressed by
|
||||
\fICURLOPT_SUPPRESS_CONNECT_HEADERS(3)\fP.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
long size;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_HEADER_SIZE, &size);
|
||||
if(!res)
|
||||
printf("Header size: %ld bytes\\n", size);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.4.1
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_REQUEST_SIZE (3),
|
||||
.BR CURLINFO_SIZE_DOWNLOAD (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,56 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_HTTPAUTH_AVAIL.md
|
||||
.TH CURLINFO_HTTPAUTH_AVAIL 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_HTTPAUTH_AVAIL \- get available HTTP authentication methods
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_HTTPAUTH_AVAIL, long *authp);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a long to receive a bitmask indicating the authentication
|
||||
method(s) available according to the previous response. The meaning of the
|
||||
bits is explained in the \fICURLOPT_HTTPAUTH(3)\fP option for \fIcurl_easy_setopt(3)\fP.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects http only
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
/* extract the available authentication types */
|
||||
long auth;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_HTTPAUTH_AVAIL, &auth);
|
||||
if(!res) {
|
||||
if(!auth)
|
||||
printf("No auth available, perhaps no 401?\\n");
|
||||
else {
|
||||
printf("%s%s%s%s\\n",
|
||||
auth & CURLAUTH_BASIC ? "Basic ":"",
|
||||
auth & CURLAUTH_DIGEST ? "Digest ":"",
|
||||
auth & CURLAUTH_NEGOTIATE ? "Negotiate ":"",
|
||||
auth % CURLAUTH_NTLM ? "NTLM ":"");
|
||||
}
|
||||
}
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.10.8
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_PROXYAUTH_AVAIL (3),
|
||||
.BR CURLOPT_HTTPAUTH (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,46 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_HTTP_CONNECTCODE.md
|
||||
.TH CURLINFO_HTTP_CONNECTCODE 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_HTTP_CONNECTCODE \- get the CONNECT response code
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_HTTP_CONNECTCODE, long *p);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a long to receive the last received HTTP proxy response code
|
||||
to a CONNECT request. The returned value is zero if no such response code was
|
||||
available.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects http only
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* typically CONNECT is used to do HTTPS over HTTP proxies */
|
||||
curl_easy_setopt(curl, CURLOPT_PROXY, "http://127.0.0.1");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
long code;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_HTTP_CONNECTCODE, &code);
|
||||
if(!res && code)
|
||||
printf("The CONNECT response code: %03ld\\n", code);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.10.7
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_RESPONSE_CODE (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,42 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_HTTP_VERSION.md
|
||||
.TH CURLINFO_HTTP_VERSION 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_HTTP_VERSION \- get the http version used in the connection
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_HTTP_VERSION, long *p);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a long to receive the version used in the last http
|
||||
connection done using this handle. The returned value is
|
||||
CURL_HTTP_VERSION_1_0, CURL_HTTP_VERSION_1_1, CURL_HTTP_VERSION_2_0,
|
||||
CURL_HTTP_VERSION_3 or 0 if the version cannot be determined.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects http only
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
long http_version;
|
||||
curl_easy_getinfo(curl, CURLINFO_HTTP_VERSION, &http_version);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.50.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_RESPONSE_CODE (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,63 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_LASTSOCKET.md
|
||||
.TH CURLINFO_LASTSOCKET 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_LASTSOCKET \- get the last socket used
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_LASTSOCKET, long *socket);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Deprecated since 7.45.0. Use \fICURLINFO_ACTIVESOCKET(3)\fP instead.
|
||||
|
||||
Pass a pointer to a long to receive the last socket used by this curl
|
||||
session. If the socket is no longer valid, \-1 is returned. When you finish
|
||||
working with the socket, you must call \fIcurl_easy_cleanup(3)\fP as usual and
|
||||
let libcurl close the socket and cleanup other resources associated with the
|
||||
handle. This is typically used in combination with
|
||||
\fICURLOPT_CONNECT_ONLY(3)\fP.
|
||||
|
||||
NOTE: this API is deprecated since it is not working on win64 where the SOCKET
|
||||
type is 64 bits large while its \(aqlong\(aq is 32 bits. Use the
|
||||
\fICURLINFO_ACTIVESOCKET(3)\fP instead, if possible.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
long sockfd; /* does not work on win64! */
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Do not do the transfer - only connect to host */
|
||||
curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1L);
|
||||
res = curl_easy_perform(curl);
|
||||
if(res != CURLE_OK) {
|
||||
printf("Error: %s\\n", curl_easy_strerror(res));
|
||||
curl_easy_cleanup(curl);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Extract the socket from the curl handle */
|
||||
res = curl_easy_getinfo(curl, CURLINFO_LASTSOCKET, &sockfd);
|
||||
if(!res && sockfd != -1) {
|
||||
/* operate on sockfd */
|
||||
}
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.15.2
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_ACTIVESOCKET (3),
|
||||
.BR CURLOPT_CONNECT_ONLY (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
53
3rdparty/curl/share/man/man3/CURLINFO_LOCAL_IP.3
vendored
53
3rdparty/curl/share/man/man3/CURLINFO_LOCAL_IP.3
vendored
@ -1,53 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_LOCAL_IP.md
|
||||
.TH CURLINFO_LOCAL_IP 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_LOCAL_IP \- get local IP address of last connection
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_LOCAL_IP, char **ip);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a char pointer to receive the pointer to a null\-terminated
|
||||
string holding the IP address of the local end of most recent connection done
|
||||
with this \fBcurl\fP handle. This string may be IPv6 when that is enabled. Note
|
||||
that you get a pointer to a memory area that is reused at next request so you
|
||||
need to copy the string if you want to keep the information.
|
||||
|
||||
The \fBip\fP pointer is NULL or points to private memory. You MUST NOT free \- it
|
||||
gets freed when you call \fIcurl_easy_cleanup(3)\fP on the corresponding CURL
|
||||
handle.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects quic and tcp
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
char *ip;
|
||||
CURLcode res;
|
||||
CURL *curl = curl_easy_init();
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the transfer */
|
||||
res = curl_easy_perform(curl);
|
||||
/* Check for errors */
|
||||
if((res == CURLE_OK) &&
|
||||
!curl_easy_getinfo(curl, CURLINFO_LOCAL_IP, &ip) && ip) {
|
||||
printf("Local IP: %s\\n", ip);
|
||||
}
|
||||
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.21.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_LOCAL_PORT (3),
|
||||
.BR CURLINFO_PRIMARY_IP (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,52 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_LOCAL_PORT.md
|
||||
.TH CURLINFO_LOCAL_PORT 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_LOCAL_PORT \- get the latest local port number
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_LOCAL_PORT, long *portp);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a long to receive the local port number of the most recent
|
||||
connection done with this \fBcurl\fP handle.
|
||||
|
||||
If the connection was done using QUIC, the port number is a UDP port number,
|
||||
otherwise it is a TCP port number.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects quic and tcp
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(CURLE_OK == res) {
|
||||
long port;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_LOCAL_PORT, &port);
|
||||
|
||||
if(CURLE_OK == res) {
|
||||
printf("We used local port: %ld\\n", port);
|
||||
}
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.21.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_LOCAL_IP (3),
|
||||
.BR CURLINFO_PRIMARY_PORT (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,49 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_NAMELOOKUP_TIME.md
|
||||
.TH CURLINFO_NAMELOOKUP_TIME 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_NAMELOOKUP_TIME \- get the name lookup time
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_NAMELOOKUP_TIME,
|
||||
double *timep);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a double to receive the total time in seconds from the start
|
||||
until the name resolving was completed.
|
||||
|
||||
When a redirect is followed, the time from each request is added together.
|
||||
|
||||
See also the TIMES overview in the \fIcurl_easy_getinfo(3)\fP man page.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
double namelookup;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
|
||||
res = curl_easy_perform(curl);
|
||||
if(CURLE_OK == res) {
|
||||
res = curl_easy_getinfo(curl, CURLINFO_NAMELOOKUP_TIME, &namelookup);
|
||||
if(CURLE_OK == res) {
|
||||
printf("Time: %.1f", namelookup);
|
||||
}
|
||||
}
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.4.1
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_NAMELOOKUP_TIME_T (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,50 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_NAMELOOKUP_TIME_T.md
|
||||
.TH CURLINFO_NAMELOOKUP_TIME_T 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_NAMELOOKUP_TIME_T \- get the name lookup time in microseconds
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_NAMELOOKUP_TIME_T,
|
||||
curl_off_t *timep);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a curl_off_t to receive the total time in microseconds
|
||||
from the start until the name resolving was completed.
|
||||
|
||||
When a redirect is followed, the time from each request is added together.
|
||||
|
||||
See also the TIMES overview in the \fIcurl_easy_getinfo(3)\fP man page.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_off_t namelookup;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(CURLE_OK == res) {
|
||||
res = curl_easy_getinfo(curl, CURLINFO_NAMELOOKUP_TIME_T, &namelookup);
|
||||
if(CURLE_OK == res) {
|
||||
printf("Time: %" CURL_FORMAT_CURL_OFF_T ".%06ld", namelookup / 1000000,
|
||||
(long)(namelookup % 1000000));
|
||||
}
|
||||
}
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.61.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_NAMELOOKUP_TIME (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,46 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_NUM_CONNECTS.md
|
||||
.TH CURLINFO_NUM_CONNECTS 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_NUM_CONNECTS \- get number of created connections
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_NUM_CONNECTS, long *nump);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a long to receive how many new connections libcurl had to
|
||||
create to achieve the previous transfer (only the successful connects are
|
||||
counted). Combined with \fICURLINFO_REDIRECT_COUNT(3)\fP you are able to know how
|
||||
many times libcurl successfully reused existing connection(s) or not. See the
|
||||
connection options of \fIcurl_easy_setopt(3)\fP to see how libcurl tries to make
|
||||
persistent connections to save time.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
long connects;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_NUM_CONNECTS, &connects);
|
||||
if(!res)
|
||||
printf("It needed %ld connects\\n", connects);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.12.3
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
51
3rdparty/curl/share/man/man3/CURLINFO_OS_ERRNO.3
vendored
51
3rdparty/curl/share/man/man3/CURLINFO_OS_ERRNO.3
vendored
@ -1,51 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_OS_ERRNO.md
|
||||
.TH CURLINFO_OS_ERRNO 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_OS_ERRNO \- get errno number from last connect failure
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_OS_ERRNO, long *errnop);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a long to receive the errno variable from a connect failure.
|
||||
Note that the value is only set on failure, it is not reset upon a successful
|
||||
operation. The number is OS and system specific.
|
||||
|
||||
libcurl network\-related errors that may have a saved errno are:
|
||||
CURLE_COULDNT_CONNECT, CURLE_FAILED_INIT, CURLE_INTERFACE_FAILED,
|
||||
CURLE_OPERATION_TIMEDOUT, CURLE_RECV_ERROR, CURLE_SEND_ERROR.
|
||||
|
||||
Since 8.8.0 libcurl clears the easy handle\(aqs saved errno before performing the
|
||||
transfer. Prior versions did not clear the saved errno, which means if a saved
|
||||
errno is retrieved it could be from a previous transfer on the same handle.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res != CURLE_OK) {
|
||||
long error;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_OS_ERRNO, &error);
|
||||
if(!res && error) {
|
||||
printf("Errno: %ld\\n", error);
|
||||
}
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.12.2
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,52 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_POSTTRANSFER_TIME_T.md
|
||||
.TH CURLINFO_POSTTRANSFER_TIME_T 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_POSTTRANSFER_TIME_T \- get the time until the last byte is sent
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_POSTTRANSFER_TIME_T,
|
||||
curl_off_t *timep);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a curl_off_t to receive the time, in microseconds,
|
||||
it took from the start until the last byte is sent by libcurl.
|
||||
|
||||
When a redirect is followed, the time from each request is added together.
|
||||
|
||||
See also the TIMES overview in the \fIcurl_easy_getinfo(3)\fP man page.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(CURLE_OK == res) {
|
||||
curl_off_t posttransfer;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_POSTTRANSFER_TIME_T,
|
||||
&posttransfer);
|
||||
if(CURLE_OK == res) {
|
||||
printf("Request sent after: %" CURL_FORMAT_CURL_OFF_T ".%06ld us",
|
||||
posttransfer / 1000000, (long)(posttransfer % 1000000));
|
||||
}
|
||||
}
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 8.10.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_PRETRANSFER_TIME_T (3),
|
||||
.BR CURLOPT_TIMEOUT (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,54 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_PRETRANSFER_TIME.md
|
||||
.TH CURLINFO_PRETRANSFER_TIME 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_PRETRANSFER_TIME \- get the time until the file transfer start
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PRETRANSFER_TIME,
|
||||
double *timep);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a double to receive the time, in seconds, it took from the
|
||||
start until the file transfer is just about to begin.
|
||||
|
||||
This time\-stamp includes all pre\-transfer commands and negotiations that are
|
||||
specific to the particular protocol(s) involved. It includes the sending of
|
||||
the protocol\-specific instructions that trigger a transfer.
|
||||
|
||||
When a redirect is followed, the time from each request is added together.
|
||||
|
||||
See also the TIMES overview in the \fIcurl_easy_getinfo(3)\fP man page.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
double pretransfer;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(CURLE_OK == res) {
|
||||
res = curl_easy_getinfo(curl, CURLINFO_PRETRANSFER_TIME, &pretransfer);
|
||||
if(CURLE_OK == res) {
|
||||
printf("Time: %.1f", pretransfer);
|
||||
}
|
||||
}
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.4.1
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_CONNECT_TIME_T (3),
|
||||
.BR CURLINFO_PRETRANSFER_TIME_T (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,56 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_PRETRANSFER_TIME_T.md
|
||||
.TH CURLINFO_PRETRANSFER_TIME_T 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_PRETRANSFER_TIME_T \- get the time until the file transfer start
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PRETRANSFER_TIME_T,
|
||||
curl_off_t *timep);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a curl_off_t to receive the time, in microseconds, it took
|
||||
from the start until the file transfer is just about to begin.
|
||||
|
||||
This time\-stamp includes all pre\-transfer commands and negotiations that are
|
||||
specific to the particular protocol(s) involved. It includes the sending of
|
||||
the protocol\-specific instructions that trigger a transfer.
|
||||
|
||||
When a redirect is followed, the time from each request is added together.
|
||||
|
||||
See also the TIMES overview in the \fIcurl_easy_getinfo(3)\fP man page.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_off_t pretransfer;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
|
||||
res = curl_easy_perform(curl);
|
||||
if(CURLE_OK == res) {
|
||||
res = curl_easy_getinfo(curl, CURLINFO_PRETRANSFER_TIME_T, &pretransfer);
|
||||
if(CURLE_OK == res) {
|
||||
printf("Time: %" CURL_FORMAT_CURL_OFF_T ".%06ld\\n",
|
||||
pretransfer / 1000000,
|
||||
(long)(pretransfer % 1000000));
|
||||
}
|
||||
}
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.61.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_CONNECT_TIME (3),
|
||||
.BR CURLINFO_PRETRANSFER_TIME_T (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,54 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_PRIMARY_IP.md
|
||||
.TH CURLINFO_PRIMARY_IP 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_PRIMARY_IP \- get IP address of last connection
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PRIMARY_IP, char **ip);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a char pointer to receive the pointer to a null\-terminated
|
||||
string holding the IP address of the most recent connection done with this
|
||||
\fBcurl\fP handle. This string may be IPv6 when that is enabled. Note that you
|
||||
get a pointer to a memory area that is reused at next request so you need to
|
||||
copy the string if you want to keep the information.
|
||||
|
||||
The \fBip\fP pointer is NULL or points to private memory. You MUST NOT free \-
|
||||
it gets freed when you call \fIcurl_easy_cleanup(3)\fP on the corresponding
|
||||
CURL handle.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
char *ip;
|
||||
CURLcode res;
|
||||
CURL *curl = curl_easy_init();
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the transfer */
|
||||
res = curl_easy_perform(curl);
|
||||
/* Check for errors */
|
||||
if((res == CURLE_OK) &&
|
||||
!curl_easy_getinfo(curl, CURLINFO_PRIMARY_IP, &ip) && ip) {
|
||||
printf("IP: %s\\n", ip);
|
||||
}
|
||||
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.19.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_LOCAL_IP (3),
|
||||
.BR CURLINFO_LOCAL_PORT (3),
|
||||
.BR CURLINFO_PRIMARY_PORT (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,48 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_PRIMARY_PORT.md
|
||||
.TH CURLINFO_PRIMARY_PORT 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_PRIMARY_PORT \- get the latest destination port number
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PRIMARY_PORT, long *portp);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a long to receive the destination port of the most recent
|
||||
connection done with this \fBcurl\fP handle.
|
||||
|
||||
This is the destination port of the actual TCP or UDP connection libcurl used.
|
||||
If a proxy was used for the most recent transfer, this is the port number of
|
||||
the proxy, if no proxy was used it is the port number of the most recently
|
||||
accessed URL.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
long port;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_PRIMARY_PORT, &port);
|
||||
if(!res)
|
||||
printf("Connected to remote port: %ld\\n", port);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.21.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_LOCAL_PORT (3),
|
||||
.BR CURLINFO_PRIMARY_IP (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
49
3rdparty/curl/share/man/man3/CURLINFO_PRIVATE.3
vendored
49
3rdparty/curl/share/man/man3/CURLINFO_PRIVATE.3
vendored
@ -1,49 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_PRIVATE.md
|
||||
.TH CURLINFO_PRIVATE 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_PRIVATE \- get the private pointer
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PRIVATE, char **private);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a char pointer to receive the pointer to the private data
|
||||
associated with the curl handle (set with the \fICURLOPT_PRIVATE(3)\fP).
|
||||
Please note that for internal reasons, the value is returned as a char
|
||||
pointer, although effectively being a \(aqvoid *\(aq.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
void *pointer = (void *)0x2345454;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
|
||||
|
||||
/* set the private pointer */
|
||||
curl_easy_setopt(curl, CURLOPT_PRIVATE, pointer);
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
/* extract the private pointer again */
|
||||
res = curl_easy_getinfo(curl, CURLINFO_PRIVATE, &pointer);
|
||||
|
||||
if(res)
|
||||
printf("error: %s\\n", curl_easy_strerror(res));
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.10.3
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLOPT_PRIVATE (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
56
3rdparty/curl/share/man/man3/CURLINFO_PROTOCOL.3
vendored
56
3rdparty/curl/share/man/man3/CURLINFO_PROTOCOL.3
vendored
@ -1,56 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_PROTOCOL.md
|
||||
.TH CURLINFO_PROTOCOL 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_PROTOCOL \- get the protocol used in the connection
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PROTOCOL, long *p);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
This option is deprecated. We strongly recommend using
|
||||
\fICURLINFO_SCHEME(3)\fP instead, because this option cannot return all
|
||||
possible protocols!
|
||||
|
||||
Pass a pointer to a long to receive the version used in the last http
|
||||
connection. The returned value is set to one of the CURLPROTO_* values:
|
||||
|
||||
.nf
|
||||
CURLPROTO_DICT, CURLPROTO_FILE, CURLPROTO_FTP, CURLPROTO_FTPS,
|
||||
CURLPROTO_GOPHER, CURLPROTO_HTTP, CURLPROTO_HTTPS, CURLPROTO_IMAP,
|
||||
CURLPROTO_IMAPS, CURLPROTO_LDAP, CURLPROTO_LDAPS, CURLPROTO_POP3,
|
||||
CURLPROTO_POP3S, CURLPROTO_RTMP, CURLPROTO_RTMPE, CURLPROTO_RTMPS,
|
||||
CURLPROTO_RTMPT, CURLPROTO_RTMPTE, CURLPROTO_RTMPTS, CURLPROTO_RTSP,
|
||||
CURLPROTO_SCP, CURLPROTO_SFTP, CURLPROTO_SMB, CURLPROTO_SMBS, CURLPROTO_SMTP,
|
||||
CURLPROTO_SMTPS, CURLPROTO_TELNET, CURLPROTO_TFTP, CURLPROTO_MQTT
|
||||
.fi
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
long protocol;
|
||||
curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH DEPRECATED
|
||||
Deprecated since 7.85.0.
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.52.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_RESPONSE_CODE (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,57 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_PROXYAUTH_AVAIL.md
|
||||
.TH CURLINFO_PROXYAUTH_AVAIL 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_PROXYAUTH_AVAIL \- get available HTTP proxy authentication methods
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PROXYAUTH_AVAIL,
|
||||
long *authp);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a long to receive a bitmask indicating the authentication
|
||||
method(s) available according to the previous response. The meaning of the
|
||||
bits is explained in the \fICURLOPT_PROXYAUTH(3)\fP option for \fIcurl_easy_setopt(3)\fP.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects http only
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_PROXY, "http://127.0.0.1:80");
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
/* extract the available proxy authentication types */
|
||||
long auth;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_PROXYAUTH_AVAIL, &auth);
|
||||
if(!res) {
|
||||
if(!auth)
|
||||
printf("No proxy auth available, perhaps no 407?\\n");
|
||||
else {
|
||||
printf("%s%s%s%s\\n",
|
||||
auth & CURLAUTH_BASIC ? "Basic ":"",
|
||||
auth & CURLAUTH_DIGEST ? "Digest ":"",
|
||||
auth & CURLAUTH_NEGOTIATE ? "Negotiate ":"",
|
||||
auth % CURLAUTH_NTLM ? "NTLM ":"");
|
||||
}
|
||||
}
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.10.8
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_HTTPAUTH_AVAIL (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,86 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_PROXY_ERROR.md
|
||||
.TH CURLINFO_PROXY_ERROR 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_PROXY_ERROR \- get the detailed (SOCKS) proxy error
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
typedef enum {
|
||||
CURLPX_OK,
|
||||
CURLPX_BAD_ADDRESS_TYPE,
|
||||
CURLPX_BAD_VERSION,
|
||||
CURLPX_CLOSED,
|
||||
CURLPX_GSSAPI,
|
||||
CURLPX_GSSAPI_PERMSG,
|
||||
CURLPX_GSSAPI_PROTECTION,
|
||||
CURLPX_IDENTD,
|
||||
CURLPX_IDENTD_DIFFER,
|
||||
CURLPX_LONG_HOSTNAME,
|
||||
CURLPX_LONG_PASSWD,
|
||||
CURLPX_LONG_USER,
|
||||
CURLPX_NO_AUTH,
|
||||
CURLPX_RECV_ADDRESS,
|
||||
CURLPX_RECV_AUTH,
|
||||
CURLPX_RECV_CONNECT,
|
||||
CURLPX_RECV_REQACK,
|
||||
CURLPX_REPLY_ADDRESS_TYPE_NOT_SUPPORTED,
|
||||
CURLPX_REPLY_COMMAND_NOT_SUPPORTED,
|
||||
CURLPX_REPLY_CONNECTION_REFUSED,
|
||||
CURLPX_REPLY_GENERAL_SERVER_FAILURE,
|
||||
CURLPX_REPLY_HOST_UNREACHABLE,
|
||||
CURLPX_REPLY_NETWORK_UNREACHABLE,
|
||||
CURLPX_REPLY_NOT_ALLOWED,
|
||||
CURLPX_REPLY_TTL_EXPIRED,
|
||||
CURLPX_REPLY_UNASSIGNED,
|
||||
CURLPX_REQUEST_FAILED,
|
||||
CURLPX_RESOLVE_HOST,
|
||||
CURLPX_SEND_AUTH,
|
||||
CURLPX_SEND_CONNECT,
|
||||
CURLPX_SEND_REQUEST,
|
||||
CURLPX_UNKNOWN_FAIL,
|
||||
CURLPX_UNKNOWN_MODE,
|
||||
CURLPX_USER_REJECTED,
|
||||
CURLPX_LAST /* never use */
|
||||
} CURLproxycode;
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PROXY_ERROR, long *detail);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a long to receive a detailed error code when the most recent
|
||||
transfer returned a \fBCURLE_PROXY\fP error. That error code matches the
|
||||
\fBCURLproxycode\fP set.
|
||||
|
||||
The error code is zero (\fBCURLPX_OK\fP) if no response code was available.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_PROXY, "socks5://127.0.0.1");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_PROXY) {
|
||||
long proxycode;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_PROXY_ERROR, &proxycode);
|
||||
if(!res && proxycode)
|
||||
printf("The detailed proxy error: %ld\\n", proxycode);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.73.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_RESPONSE_CODE (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3),
|
||||
.BR libcurl-errors (3)
|
@ -1,59 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_PROXY_SSL_VERIFYRESULT.md
|
||||
.TH CURLINFO_PROXY_SSL_VERIFYRESULT 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_PROXY_SSL_VERIFYRESULT \- get the result of the proxy certificate verification
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PROXY_SSL_VERIFYRESULT,
|
||||
long *result);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a long to receive the result of the certificate verification
|
||||
that was requested (using the \fICURLOPT_PROXY_SSL_VERIFYPEER(3)\fP
|
||||
option. This is only used for HTTPS proxies.
|
||||
|
||||
0 is a positive result. Non\-zero is an error.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
|
||||
|
||||
This option works only with the following TLS backends:
|
||||
GnuTLS and OpenSSL
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
long verifyresult;
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy:443");
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
if(res) {
|
||||
printf("error: %s\\n", curl_easy_strerror(res));
|
||||
curl_easy_cleanup(curl);
|
||||
return 1;
|
||||
}
|
||||
|
||||
res = curl_easy_getinfo(curl, CURLINFO_PROXY_SSL_VERIFYRESULT,
|
||||
&verifyresult);
|
||||
if(!res) {
|
||||
printf("The peer verification said %s\\n",
|
||||
(verifyresult ? "bad" : "fine"));
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.52.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_SSL_VERIFYRESULT (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,51 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_QUEUE_TIME_T.md
|
||||
.TH CURLINFO_QUEUE_TIME_T 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_QUEUE_TIME_T \- time this transfer was queued
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_QUEUE_TIME_T,
|
||||
curl_off_t *timep);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a curl_off_t to receive the time, in microseconds, this
|
||||
transfer was held in a waiting queue before it started "for real". A transfer
|
||||
might be put in a queue if after getting started, it cannot create a new
|
||||
connection etc due to set conditions and limits imposed by the application.
|
||||
|
||||
See also the TIMES overview in the \fIcurl_easy_getinfo(3)\fP man page.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_off_t queue;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(CURLE_OK == res) {
|
||||
res = curl_easy_getinfo(curl, CURLINFO_QUEUE_TIME_T, &queue);
|
||||
if(CURLE_OK == res) {
|
||||
printf("Queued: %" CURL_FORMAT_CURL_OFF_T ".%06ld us", queue / 1000000,
|
||||
(long)(queue % 1000000));
|
||||
}
|
||||
}
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 8.6.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_STARTTRANSFER_TIME_T (3),
|
||||
.BR CURLOPT_TIMEOUT (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,43 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_REDIRECT_COUNT.md
|
||||
.TH CURLINFO_REDIRECT_COUNT 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_REDIRECT_COUNT \- get the number of redirects
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_REDIRECT_COUNT,
|
||||
long *countp);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a long to receive the total number of redirections that were
|
||||
actually followed.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
long redirects;
|
||||
curl_easy_getinfo(curl, CURLINFO_REDIRECT_COUNT, &redirects);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.9.7
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_REDIRECT_URL (3),
|
||||
.BR CURLOPT_FOLLOWLOCATION (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,51 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_REDIRECT_TIME.md
|
||||
.TH CURLINFO_REDIRECT_TIME 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_REDIRECT_TIME \- get the time for all redirection steps
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_REDIRECT_TIME,
|
||||
double *timep);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a double to receive the total time, in seconds, it took for
|
||||
all redirection steps include name lookup, connect, pretransfer and transfer
|
||||
before final transaction was started. \fICURLINFO_REDIRECT_TIME(3)\fP contains
|
||||
the complete execution time for multiple redirections.
|
||||
|
||||
See also the TIMES overview in the \fIcurl_easy_getinfo(3)\fP man page.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects http only
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
double redirect;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(CURLE_OK == res) {
|
||||
res = curl_easy_getinfo(curl, CURLINFO_REDIRECT_TIME, &redirect);
|
||||
if(CURLE_OK == res) {
|
||||
printf("Time: %.1f", redirect);
|
||||
}
|
||||
}
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.9.7
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_REDIRECT_COUNT (3),
|
||||
.BR CURLINFO_REDIRECT_TIME_T (3),
|
||||
.BR CURLINFO_REDIRECT_URL (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,53 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_REDIRECT_TIME_T.md
|
||||
.TH CURLINFO_REDIRECT_TIME_T 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_REDIRECT_TIME_T \- get the time for all redirection steps
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_REDIRECT_TIME_T,
|
||||
curl_off_t *timep);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a curl_off_t to receive the total time, in microseconds, it
|
||||
took for all redirection steps include name lookup, connect, pretransfer and
|
||||
transfer before final transaction was started.
|
||||
\fICURLINFO_REDIRECT_TIME_T(3)\fP holds the complete execution time for
|
||||
multiple redirections.
|
||||
|
||||
See also the TIMES overview in the \fIcurl_easy_getinfo(3)\fP man page.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects http only
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_off_t redirect;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(CURLE_OK == res) {
|
||||
res = curl_easy_getinfo(curl, CURLINFO_REDIRECT_TIME_T, &redirect);
|
||||
if(CURLE_OK == res) {
|
||||
printf("Time: %" CURL_FORMAT_CURL_OFF_T ".%06ld", redirect / 1000000,
|
||||
(long)(redirect % 1000000));
|
||||
}
|
||||
}
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.61.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_REDIRECT_COUNT (3),
|
||||
.BR CURLINFO_REDIRECT_TIME (3),
|
||||
.BR CURLINFO_REDIRECT_URL (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,50 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_REDIRECT_URL.md
|
||||
.TH CURLINFO_REDIRECT_URL 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_REDIRECT_URL \- get the URL a redirect would go to
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_REDIRECT_URL, char **urlp);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a char pointer to receive the URL a redirect \fIwould\fP take
|
||||
you to if you would enable \fICURLOPT_FOLLOWLOCATION(3)\fP. This can come handy if
|
||||
you think using the built\-in libcurl redirect logic is not good enough for you
|
||||
but you would still prefer to avoid implementing all the magic of figuring out
|
||||
the new URL.
|
||||
|
||||
This URL is also set if the \fICURLOPT_MAXREDIRS(3)\fP limit prevented a redirect to
|
||||
happen (since 7.54.1).
|
||||
.SH PROTOCOLS
|
||||
This functionality affects http only
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
char *url = NULL;
|
||||
curl_easy_getinfo(curl, CURLINFO_REDIRECT_URL, &url);
|
||||
if(url)
|
||||
printf("Redirect to: %s\\n", url);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.18.2
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_REDIRECT_COUNT (3),
|
||||
.BR CURLINFO_REDIRECT_TIME_T (3),
|
||||
.BR CURLOPT_FOLLOWLOCATION (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
48
3rdparty/curl/share/man/man3/CURLINFO_REFERER.3
vendored
48
3rdparty/curl/share/man/man3/CURLINFO_REFERER.3
vendored
@ -1,48 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_REFERER.md
|
||||
.TH CURLINFO_REFERER 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_REFERER \- get the used referrer request header
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_REFERER, char **hdrp);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass in a pointer to a char pointer and get the referrer header used in the
|
||||
most recent request.
|
||||
|
||||
The \fBhdrp\fP pointer is NULL or points to private memory you MUST NOT free \-
|
||||
it gets freed when you call \fIcurl_easy_cleanup(3)\fP on the corresponding
|
||||
CURL handle.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects http only
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_REFERER, "https://example.org/referrer");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
char *hdr = NULL;
|
||||
curl_easy_getinfo(curl, CURLINFO_REFERER, &hdr);
|
||||
if(hdr)
|
||||
printf("Referrer header: %s\\n", hdr);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.76.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLOPT_REFERER (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_header (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,44 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_REQUEST_SIZE.md
|
||||
.TH CURLINFO_REQUEST_SIZE 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_REQUEST_SIZE \- get size of sent request
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_REQUEST_SIZE, long *sizep);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a long to receive the total size of the issued
|
||||
requests. This is so far only for HTTP requests. Note that this may be more
|
||||
than one request if \fICURLOPT_FOLLOWLOCATION(3)\fP is enabled.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
long req;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_REQUEST_SIZE, &req);
|
||||
if(!res)
|
||||
printf("Request size: %ld bytes\\n", req);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.4.1
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_HEADER_SIZE (3),
|
||||
.BR CURLINFO_SIZE_DOWNLOAD_T (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,48 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_RESPONSE_CODE.md
|
||||
.TH CURLINFO_RESPONSE_CODE 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_RESPONSE_CODE \- get the last response code
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_RESPONSE_CODE, long *codep);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a long to receive the last received HTTP, FTP, SMTP or LDAP
|
||||
(OpenLDAP only) response code. This option was previously known as
|
||||
CURLINFO_HTTP_CODE in libcurl 7.10.7 and earlier. The stored value is zero if
|
||||
no server response code has been received.
|
||||
|
||||
Note that a proxy\(aqs CONNECT response should be read with
|
||||
\fICURLINFO_HTTP_CONNECTCODE(3)\fP and not this.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects ftp, http, ldap and smtp
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
long response_code;
|
||||
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH NOTES
|
||||
The former name, CURLINFO_HTTP_CODE, was added in 7.4.1. Support for SMTP
|
||||
responses added in 7.25.0, for OpenLDAP in 7.81.0.
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.10.8
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_HTTP_CONNECTCODE (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,50 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_RETRY_AFTER.md
|
||||
.TH CURLINFO_RETRY_AFTER 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_RETRY_AFTER \- returns the Retry\-After retry delay
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_RETRY_AFTER,
|
||||
curl_off_t *retry);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a curl_off_t variable to receive the number of seconds the
|
||||
HTTP server suggests the client should wait until the next request is
|
||||
issued. The information from the "Retry\-After:" header.
|
||||
|
||||
While the HTTP header might contain a fixed date string, the
|
||||
\fICURLINFO_RETRY_AFTER(3)\fP always returns the number of seconds to wait \-
|
||||
or zero if there was no header or the header could not be parsed.
|
||||
.SH DEFAULT
|
||||
Zero if there was no header.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
curl_off_t wait = 0;
|
||||
curl_easy_getinfo(curl, CURLINFO_RETRY_AFTER, &wait);
|
||||
if(wait)
|
||||
printf("Wait for %" CURL_FORMAT_CURL_OFF_T " seconds\\n", wait);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.66.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLOPT_HEADERFUNCTION (3),
|
||||
.BR CURLOPT_STDERR (3),
|
||||
.BR curl_easy_header (3)
|
@ -1,42 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_RTSP_CLIENT_CSEQ.md
|
||||
.TH CURLINFO_RTSP_CLIENT_CSEQ 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_RTSP_CLIENT_CSEQ \- get the next RTSP client CSeq
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_RTSP_CLIENT_CSEQ,
|
||||
long *cseq);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a long to receive the next CSeq that is expected to be used
|
||||
by the application.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects rtsp only
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "rtsp://rtsp.example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
long cseq;
|
||||
curl_easy_getinfo(curl, CURLINFO_RTSP_CLIENT_CSEQ, &cseq);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.20.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_RTSP_CSEQ_RECV (3),
|
||||
.BR CURLINFO_RTSP_SERVER_CSEQ (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,42 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_RTSP_CSEQ_RECV.md
|
||||
.TH CURLINFO_RTSP_CSEQ_RECV 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_RTSP_CSEQ_RECV \- get the recently received CSeq
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_RTSP_CSEQ_RECV, long *cseq);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a long to receive the most recently received CSeq from the
|
||||
server. If your application encounters a \fICURLE_RTSP_CSEQ_ERROR\fP then you
|
||||
may wish to troubleshoot and/or fix the CSeq mismatch by peeking at this
|
||||
value.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects rtsp only
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "rtsp://rtsp.example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
long cseq;
|
||||
curl_easy_getinfo(curl, CURLINFO_RTSP_CSEQ_RECV, &cseq);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.20.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_RTSP_SERVER_CSEQ (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,46 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_RTSP_SERVER_CSEQ.md
|
||||
.TH CURLINFO_RTSP_SERVER_CSEQ 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_RTSP_SERVER_CSEQ \- get the next RTSP server CSeq
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_RTSP_SERVER_CSEQ,
|
||||
long *cseq);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a long to receive the next CSeq that is expected to be used
|
||||
by the application.
|
||||
|
||||
Listening for server initiated requests is not implemented!
|
||||
|
||||
Applications wishing to resume an RTSP session on another connection should
|
||||
retrieve this info before closing the active connection.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects rtsp only
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "rtsp://rtsp.example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
long cseq;
|
||||
curl_easy_getinfo(curl, CURLINFO_RTSP_SERVER_CSEQ, &cseq);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.20.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_RTSP_CSEQ_RECV (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,47 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_RTSP_SESSION_ID.md
|
||||
.TH CURLINFO_RTSP_SESSION_ID 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_RTSP_SESSION_ID \- get RTSP session ID
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_RTSP_SESSION_ID, char **id);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a char pointer to receive a pointer to a string holding the
|
||||
most recent RTSP Session ID.
|
||||
|
||||
Applications wishing to resume an RTSP session on another connection should
|
||||
retrieve this info before closing the active connection.
|
||||
|
||||
The \fBid\fP pointer is NULL or points to private memory. You MUST NOT free \-
|
||||
it gets freed when you call \fIcurl_easy_cleanup(3)\fP on the corresponding
|
||||
CURL handle.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects rtsp only
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "rtsp://rtsp.example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
char *id;
|
||||
curl_easy_getinfo(curl, CURLINFO_RTSP_SESSION_ID, &id);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.20.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_RTSP_CSEQ_RECV (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
52
3rdparty/curl/share/man/man3/CURLINFO_SCHEME.3
vendored
52
3rdparty/curl/share/man/man3/CURLINFO_SCHEME.3
vendored
@ -1,52 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_SCHEME.md
|
||||
.TH CURLINFO_SCHEME 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_SCHEME \- get the URL scheme (sometimes called protocol) used in the connection
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SCHEME, char **scheme);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a char pointer to receive the pointer to a null\-terminated
|
||||
string holding the URL scheme used for the most recent connection done with
|
||||
this CURL \fBhandle\fP.
|
||||
|
||||
The \fBscheme\fP pointer is NULL or points to private memory. You MUST NOT
|
||||
free \- it gets freed when you call \fIcurl_easy_cleanup(3)\fP on the corresponding
|
||||
CURL handle.
|
||||
|
||||
The returned scheme might be upper or lowercase. Do comparisons case
|
||||
insensitively.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res == CURLE_OK) {
|
||||
char *scheme = NULL;
|
||||
curl_easy_getinfo(curl, CURLINFO_SCHEME, &scheme);
|
||||
if(scheme)
|
||||
printf("scheme: %s\\n", scheme); /* scheme: HTTP */
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.52.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_EFFECTIVE_URL (3),
|
||||
.BR CURLINFO_PROTOCOL (3),
|
||||
.BR CURLINFO_RESPONSE_CODE (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,56 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_SIZE_DOWNLOAD.md
|
||||
.TH CURLINFO_SIZE_DOWNLOAD 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_SIZE_DOWNLOAD \- get the number of downloaded bytes
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SIZE_DOWNLOAD, double *dlp);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a double to receive the total amount of bytes that were
|
||||
downloaded. The amount is only for the latest transfer and gets reset again
|
||||
for each new transfer. This counts actual payload data, what\(aqs also commonly
|
||||
called body. All meta and header data is excluded and not included in this
|
||||
number.
|
||||
|
||||
\fICURLINFO_SIZE_DOWNLOAD_T(3)\fP is a newer replacement that returns a more
|
||||
sensible variable type.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the request */
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
/* check the size */
|
||||
double dl;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_SIZE_DOWNLOAD, &dl);
|
||||
if(!res) {
|
||||
printf("Downloaded %.0f bytes\\n", dl);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH DEPRECATED
|
||||
Deprecated since 7.55.0.
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.4.1
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_SIZE_DOWNLOAD_T (3),
|
||||
.BR CURLINFO_SIZE_UPLOAD_T (3),
|
||||
.BR CURLOPT_MAXFILESIZE (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,51 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_SIZE_DOWNLOAD_T.md
|
||||
.TH CURLINFO_SIZE_DOWNLOAD_T 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_SIZE_DOWNLOAD_T \- get the number of downloaded bytes
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SIZE_DOWNLOAD_T,
|
||||
curl_off_t *dlp);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a \fIcurl_off_t\fP to receive the total amount of bytes that
|
||||
were downloaded. The amount is only for the latest transfer and gets reset
|
||||
again for each new transfer. This counts actual payload data, what\(aqs also
|
||||
commonly called body. All meta and header data is excluded from this amount.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the request */
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
/* check the size */
|
||||
curl_off_t dl;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_SIZE_DOWNLOAD_T, &dl);
|
||||
if(!res) {
|
||||
printf("Downloaded %" CURL_FORMAT_CURL_OFF_T " bytes\\n", dl);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.55.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_SIZE_DOWNLOAD (3),
|
||||
.BR CURLINFO_SIZE_UPLOAD_T (3),
|
||||
.BR CURLOPT_MAXFILESIZE (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,52 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_SIZE_UPLOAD.md
|
||||
.TH CURLINFO_SIZE_UPLOAD 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_SIZE_UPLOAD \- get the number of uploaded bytes
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SIZE_UPLOAD,
|
||||
double *uploadp);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a double to receive the total amount of bytes that were
|
||||
uploaded.
|
||||
|
||||
\fICURLINFO_SIZE_UPLOAD_T(3)\fP is a newer replacement that returns a more
|
||||
sensible variable type.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the request */
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
double ul;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_SIZE_UPLOAD, &ul);
|
||||
if(!res) {
|
||||
printf("Uploaded %.0f bytes\\n", ul);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH DEPRECATED
|
||||
Deprecated since 7.55.0.
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.4.1
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_SIZE_DOWNLOAD_T (3),
|
||||
.BR CURLINFO_SIZE_UPLOAD_T (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,47 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_SIZE_UPLOAD_T.md
|
||||
.TH CURLINFO_SIZE_UPLOAD_T 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_SIZE_UPLOAD_T \- get the number of uploaded bytes
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SIZE_UPLOAD_T,
|
||||
curl_off_t *uploadp);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a \fIcurl_off_t\fP to receive the total amount of bytes that
|
||||
were uploaded.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the request */
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
curl_off_t ul;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_SIZE_UPLOAD_T, &ul);
|
||||
if(!res) {
|
||||
printf("Uploaded %" CURL_FORMAT_CURL_OFF_T " bytes\\n", ul);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.55.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_SIZE_DOWNLOAD_T (3),
|
||||
.BR CURLINFO_SIZE_UPLOAD (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,52 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_SPEED_DOWNLOAD.md
|
||||
.TH CURLINFO_SPEED_DOWNLOAD 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_SPEED_DOWNLOAD \- get download speed
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SPEED_DOWNLOAD,
|
||||
double *speed);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a double to receive the average download speed that curl
|
||||
measured for the complete download. Measured in bytes/second.
|
||||
|
||||
\fICURLINFO_SPEED_DOWNLOAD_T(3)\fP is a newer replacement that returns a more
|
||||
sensible variable type.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the request */
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
double speed;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_SPEED_DOWNLOAD, &speed);
|
||||
if(!res) {
|
||||
printf("Download speed %.0f bytes/sec\\n", speed);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH DEPRECATED
|
||||
Deprecated since 7.55.0.
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.4.1
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_SIZE_UPLOAD_T (3),
|
||||
.BR CURLINFO_SPEED_UPLOAD (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,48 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_SPEED_DOWNLOAD_T.md
|
||||
.TH CURLINFO_SPEED_DOWNLOAD_T 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_SPEED_DOWNLOAD_T \- get download speed
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SPEED_DOWNLOAD_T,
|
||||
curl_off_t *speed);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a \fIcurl_off_t\fP to receive the average download speed
|
||||
that curl measured for the complete download. Measured in bytes/second.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the request */
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
curl_off_t speed;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_SPEED_DOWNLOAD_T, &speed);
|
||||
if(!res) {
|
||||
printf("Download speed %" CURL_FORMAT_CURL_OFF_T " bytes/sec\\n",
|
||||
speed);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.55.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_SIZE_UPLOAD_T (3),
|
||||
.BR CURLINFO_SPEED_UPLOAD_T (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,50 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_SPEED_UPLOAD.md
|
||||
.TH CURLINFO_SPEED_UPLOAD 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_SPEED_UPLOAD \- get upload speed
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SPEED_UPLOAD, double *speed);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a double to receive the average upload speed that curl
|
||||
measured for the complete upload. Measured in bytes/second.
|
||||
|
||||
\fICURLINFO_SPEED_UPLOAD_T(3)\fP is a newer replacement that returns a more
|
||||
sensible variable type.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the request */
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
double speed;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_SPEED_UPLOAD, &speed);
|
||||
if(!res) {
|
||||
printf("Upload speed %.0f bytes/sec\\n", speed);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH DEPRECATED
|
||||
Deprecated since 7.55.0.
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.4.1
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_SPEED_DOWNLOAD_T (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,46 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_SPEED_UPLOAD_T.md
|
||||
.TH CURLINFO_SPEED_UPLOAD_T 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_SPEED_UPLOAD_T \- get upload speed
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SPEED_UPLOAD_T,
|
||||
curl_off_t *speed);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a \fIcurl_off_t\fP to receive the average upload speed that
|
||||
curl measured for the complete upload. Measured in bytes/second.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the request */
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
curl_off_t speed;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_SPEED_UPLOAD_T, &speed);
|
||||
if(!res) {
|
||||
printf("Upload speed %" CURL_FORMAT_CURL_OFF_T " bytes/sec\\n", speed);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.55.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_SPEED_DOWNLOAD_T (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,49 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_SSL_ENGINES.md
|
||||
.TH CURLINFO_SSL_ENGINES 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_SSL_ENGINES \- get an slist of OpenSSL crypto\-engines
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SSL_ENGINES,
|
||||
struct curl_slist **engine_list);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass the address of a \(aqstruct curl_slist *\(aq to receive a linked\-list of
|
||||
OpenSSL crypto\-engines supported. Note that engines are normally implemented
|
||||
in separate dynamic libraries. Hence not all the returned engines may be
|
||||
available at runtime. \fBNOTE:\fP you must call \fIcurl_slist_free_all(3)\fP
|
||||
on the list pointer once you are done with it, as libcurl does not free this
|
||||
data for you.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
|
||||
|
||||
This option works only with the following TLS backends:
|
||||
OpenSSL
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
struct curl_slist *engines;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_SSL_ENGINES, &engines);
|
||||
if((res == CURLE_OK) && engines) {
|
||||
/* we have a list, free it when done using it */
|
||||
curl_slist_free_all(engines);
|
||||
}
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.12.3
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLOPT_SSLENGINE (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,58 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_SSL_VERIFYRESULT.md
|
||||
.TH CURLINFO_SSL_VERIFYRESULT 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_SSL_VERIFYRESULT \- get the result of the certificate verification
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SSL_VERIFYRESULT,
|
||||
long *result);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a long to receive the result of the server SSL certificate
|
||||
verification that was requested (using the \fICURLOPT_SSL_VERIFYPEER(3)\fP
|
||||
option).
|
||||
|
||||
0 is a positive result. Non\-zero is an error.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
|
||||
|
||||
This option works only with the following TLS backends:
|
||||
GnuTLS and OpenSSL
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
long verifyresult;
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
if(res) {
|
||||
printf("error: %s\\n", curl_easy_strerror(res));
|
||||
curl_easy_cleanup(curl);
|
||||
return 1;
|
||||
}
|
||||
|
||||
res = curl_easy_getinfo(curl, CURLINFO_SSL_VERIFYRESULT,
|
||||
&verifyresult);
|
||||
if(!res) {
|
||||
printf("The peer verification said %s\\n",
|
||||
(verifyresult ? "bad" : "fine"));
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.5
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_PROXY_SSL_VERIFYRESULT (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,52 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_STARTTRANSFER_TIME.md
|
||||
.TH CURLINFO_STARTTRANSFER_TIME 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_STARTTRANSFER_TIME \- get the time until the first byte is received
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_STARTTRANSFER_TIME,
|
||||
double *timep);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a double to receive the time, in seconds, it took from the
|
||||
start until the first byte is received by libcurl. This includes
|
||||
\fICURLINFO_PRETRANSFER_TIME(3)\fP and also the time the server needs to
|
||||
calculate the result.
|
||||
|
||||
When a redirect is followed, the time from each request is added together.
|
||||
|
||||
See also the TIMES overview in the \fIcurl_easy_getinfo(3)\fP man page.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
double start;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(CURLE_OK == res) {
|
||||
res = curl_easy_getinfo(curl, CURLINFO_STARTTRANSFER_TIME, &start);
|
||||
if(CURLE_OK == res) {
|
||||
printf("Time: %.1f", start);
|
||||
}
|
||||
}
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.9.2
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_STARTTRANSFER_TIME_T (3),
|
||||
.BR CURLOPT_TIMEOUT (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,54 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_STARTTRANSFER_TIME_T.md
|
||||
.TH CURLINFO_STARTTRANSFER_TIME_T 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_STARTTRANSFER_TIME_T \- get the time until the first byte is received
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_STARTTRANSFER_TIME_T,
|
||||
curl_off_t *timep);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a curl_off_t to receive the time, in microseconds,
|
||||
it took from the
|
||||
start until the first byte is received by libcurl. This includes
|
||||
\fICURLINFO_PRETRANSFER_TIME_T(3)\fP and also the time the server needs to
|
||||
calculate the result.
|
||||
|
||||
When a redirect is followed, the time from each request is added together.
|
||||
|
||||
See also the TIMES overview in the \fIcurl_easy_getinfo(3)\fP man page.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_off_t start;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(CURLE_OK == res) {
|
||||
res = curl_easy_getinfo(curl, CURLINFO_STARTTRANSFER_TIME_T, &start);
|
||||
if(CURLE_OK == res) {
|
||||
printf("Time: %" CURL_FORMAT_CURL_OFF_T ".%06ld", start / 1000000,
|
||||
(long)(start % 1000000));
|
||||
}
|
||||
}
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.61.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_STARTTRANSFER_TIME (3),
|
||||
.BR CURLOPT_TIMEOUT (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,60 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_TLS_SESSION.md
|
||||
.TH CURLINFO_TLS_SESSION 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_TLS_SESSION \- get TLS session info
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_TLS_SESSION,
|
||||
struct curl_tlssessioninfo **session);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
\fBThis option has been superseded\fP by \fICURLINFO_TLS_SSL_PTR(3)\fP which
|
||||
was added in 7.48.0. The only reason you would use this option instead is if
|
||||
you could be using a version of libcurl earlier than 7.48.0.
|
||||
|
||||
This option is exactly the same as \fICURLINFO_TLS_SSL_PTR(3)\fP except in the
|
||||
case of OpenSSL. If the session \fIbackend\fP is CURLSSLBACKEND_OPENSSL the
|
||||
session \fIinternals\fP pointer varies depending on the option:
|
||||
|
||||
\fICURLINFO_TLS_SESSION(3)\fP OpenSSL session \fIinternals\fP is \fBSSL_CTX \fP*.
|
||||
|
||||
\fICURLINFO_TLS_SSL_PTR(3)\fP OpenSSL session \fIinternals\fP is \fBSSL \fP*.
|
||||
|
||||
You can obtain an \fBSSL_CTX\fP pointer from an SSL pointer using OpenSSL
|
||||
function \fISSL_get_SSL_CTX(3)\fP. Therefore unless you need compatibility
|
||||
with older versions of libcurl use \fICURLINFO_TLS_SSL_PTR(3)\fP. Refer to
|
||||
that document for more information.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
|
||||
|
||||
This option works only with the following TLS backends:
|
||||
GnuTLS and OpenSSL
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
struct curl_tlssessioninfo *tls;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(res)
|
||||
printf("error: %s\\n", curl_easy_strerror(res));
|
||||
curl_easy_getinfo(curl, CURLINFO_TLS_SESSION, &tls);
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH DEPRECATED
|
||||
Deprecated since 7.48.0
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.34.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_TLS_SSL_PTR (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
140
3rdparty/curl/share/man/man3/CURLINFO_TLS_SSL_PTR.3
vendored
140
3rdparty/curl/share/man/man3/CURLINFO_TLS_SSL_PTR.3
vendored
@ -1,140 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_TLS_SSL_PTR.md
|
||||
.TH CURLINFO_TLS_SSL_PTR 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_TLS_SESSION, CURLINFO_TLS_SSL_PTR \- get TLS session info
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_TLS_SSL_PTR,
|
||||
struct curl_tlssessioninfo **session);
|
||||
|
||||
/* if you need compatibility with libcurl < 7.48.0 use
|
||||
CURLINFO_TLS_SESSION instead: */
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_TLS_SESSION,
|
||||
struct curl_tlssessioninfo **session);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a \fIstruct curl_tlssessioninfo \fP*. The pointer is initialized
|
||||
to refer to a \fIstruct curl_tlssessioninfo \fP* that contains an enum indicating
|
||||
the SSL library used for the handshake and a pointer to the respective
|
||||
internal TLS session structure of this underlying SSL library.
|
||||
|
||||
This option may be useful for example to extract certificate information in a
|
||||
format convenient for further processing, such as manual validation. Refer to
|
||||
the \fBLIMITATIONS\fP section.
|
||||
|
||||
.nf
|
||||
struct curl_tlssessioninfo {
|
||||
curl_sslbackend backend;
|
||||
void *internals;
|
||||
};
|
||||
.fi
|
||||
|
||||
The \fIbackend\fP struct member is one of the defines in the CURLSSLBACKEND_*
|
||||
series: CURLSSLBACKEND_NONE (when built without TLS support),
|
||||
CURLSSLBACKEND_WOLFSSL, CURLSSLBACKEND_SECURETRANSPORT, CURLSSLBACKEND_GNUTLS,
|
||||
CURLSSLBACKEND_MBEDTLS, CURLSSLBACKEND_NSS, CURLSSLBACKEND_OPENSSL or
|
||||
CURLSSLBACKEND_SCHANNEL. (Note that the OpenSSL
|
||||
forks are all reported as just OpenSSL here.)
|
||||
|
||||
The \fIinternals\fP struct member points to a TLS library specific pointer for
|
||||
the active ("in use") SSL connection, with the following underlying types:
|
||||
.IP GnuTLS
|
||||
\fBgnutls_session_t\fP
|
||||
.IP OpenSSL
|
||||
\fICURLINFO_TLS_SESSION(3)\fP: \fBSSL_CTX \fP*
|
||||
|
||||
\fICURLINFO_TLS_SSL_PTR(3)\fP: \fBSSL \fP*
|
||||
Since 7.48.0 the \fIinternals\fP member can point to these other SSL backends
|
||||
as well:
|
||||
.IP mbedTLS
|
||||
\fBmbedTLS_ssl_context \fP*
|
||||
.IP "Secure Channel"
|
||||
\fBCtxtHandle \fP*
|
||||
.IP "Secure Transport"
|
||||
\fBSSLContext \fP*
|
||||
.IP wolfSSL
|
||||
\fBSSL \fP*
|
||||
.PP
|
||||
If the \fIinternals\fP pointer is NULL then either the SSL backend is not
|
||||
supported, an SSL session has not yet been established or the connection is no
|
||||
longer associated with the easy handle (e.g. \fIcurl_easy_perform(3)\fP has
|
||||
returned).
|
||||
.SH LIMITATIONS
|
||||
This option has some limitations that could make it unsafe when it comes to
|
||||
the manual verification of certificates.
|
||||
|
||||
This option only retrieves the first in\-use SSL session pointer for your easy
|
||||
handle, however your easy handle may have more than one in\-use SSL session if
|
||||
using FTP over SSL. That is because the FTP protocol has a control channel and
|
||||
a data channel and one or both may be over SSL. Currently there is no way to
|
||||
retrieve a second in\-use SSL session associated with an easy handle.
|
||||
|
||||
This option has not been thoroughly tested with clear text protocols that can
|
||||
be upgraded/downgraded to/from SSL: FTP, SMTP, POP3, IMAP when used with
|
||||
\fICURLOPT_USE_SSL(3)\fP. Though you can to retrieve the SSL pointer, it is possible
|
||||
that before you can do that, data (including auth) may have already been sent
|
||||
over a connection after it was upgraded.
|
||||
|
||||
Renegotiation. If unsafe renegotiation or renegotiation in a way that the
|
||||
certificate is allowed to change is allowed by your SSL library this may occur
|
||||
and the certificate may change, and data may continue to be sent or received
|
||||
after renegotiation but before you are able to get the (possibly) changed SSL
|
||||
pointer, with the (possibly) changed certificate information.
|
||||
|
||||
Instead of using this option to poll for certificate changes use
|
||||
\fICURLOPT_SSL_CTX_FUNCTION(3)\fP to set a verification callback, if supported.
|
||||
That is safer and does not suffer from any of the problems above.
|
||||
|
||||
How are you using this option? Are you affected by any of these limitations?
|
||||
Please let us know by making a comment at
|
||||
https://github.com/curl/curl/issues/685
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
|
||||
|
||||
This option works only with the following TLS backends:
|
||||
BearSSL, GnuTLS, OpenSSL, Schannel, Secure Transport, mbedTLS and wolfSSL
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
#include <openssl/ssl.h>
|
||||
|
||||
CURL *curl;
|
||||
static size_t wf(void *ptr, size_t size, size_t nmemb, void *stream)
|
||||
{
|
||||
const struct curl_tlssessioninfo *info = NULL;
|
||||
CURLcode res = curl_easy_getinfo(curl, CURLINFO_TLS_SSL_PTR, &info);
|
||||
if(info && !res) {
|
||||
if(CURLSSLBACKEND_OPENSSL == info->backend) {
|
||||
printf("OpenSSL ver. %s\\n", SSL_get_version((SSL*)info->internals));
|
||||
}
|
||||
}
|
||||
return size * nmemb;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
CURLcode res;
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, wf);
|
||||
res = curl_easy_perform(curl);
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
.fi
|
||||
.SH HISTORY
|
||||
This option supersedes \fICURLINFO_TLS_SESSION(3)\fP which was added in 7.34.0.
|
||||
This option is exactly the same as that option except in the case of OpenSSL.
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.48.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_TLS_SESSION (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,50 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_TOTAL_TIME.md
|
||||
.TH CURLINFO_TOTAL_TIME 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_TOTAL_TIME \- get total time of previous transfer
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_TOTAL_TIME, double *timep);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a double to receive the total time in seconds for the
|
||||
previous transfer, including name resolving, TCP connect etc. The double
|
||||
represents the time in seconds, including fractions.
|
||||
|
||||
When a redirect is followed, the time from each request is added together.
|
||||
|
||||
See also the TIMES overview in the \fIcurl_easy_getinfo(3)\fP man page.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
double total;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
|
||||
res = curl_easy_perform(curl);
|
||||
if(CURLE_OK == res) {
|
||||
res = curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME, &total);
|
||||
if(CURLE_OK == res) {
|
||||
printf("Time: %.1f", total);
|
||||
}
|
||||
}
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.4.1
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_TOTAL_TIME_T (3),
|
||||
.BR CURLOPT_TIMEOUT (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,52 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_TOTAL_TIME_T.md
|
||||
.TH CURLINFO_TOTAL_TIME_T 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_TOTAL_TIME_T \- get total time of previous transfer in microseconds
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_TOTAL_TIME_T,
|
||||
curl_off_t *timep);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a curl_off_t to receive the total time in microseconds
|
||||
for the previous transfer, including name resolving, TCP connect etc.
|
||||
The curl_off_t represents the time in microseconds.
|
||||
|
||||
When a redirect is followed, the time from each request is added together.
|
||||
|
||||
See also the TIMES overview in the \fIcurl_easy_getinfo(3)\fP man page.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_off_t total;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
res = curl_easy_perform(curl);
|
||||
if(CURLE_OK == res) {
|
||||
res = curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME_T, &total);
|
||||
if(CURLE_OK == res) {
|
||||
printf("Time: %" CURL_FORMAT_CURL_OFF_T ".%06ld", total / 1000000,
|
||||
(long)(total % 1000000));
|
||||
}
|
||||
}
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 7.61.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_TOTAL_TIME (3),
|
||||
.BR CURLOPT_TIMEOUT (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
@ -1,50 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_USED_PROXY.md
|
||||
.TH CURLINFO_USED_PROXY 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_USED_PROXY \- whether the transfer used a proxy
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_USED_PROXY,
|
||||
long *authp);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a long. It gets set to zero set if no proxy was used in the
|
||||
previous transfer or a non\-zero value if a proxy was used.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
|
||||
curl_easy_setopt(curl, CURLOPT_PROXY, "http://127.0.0.1:80");
|
||||
curl_easy_setopt(curl, CURLOPT_NOPROXY, "example.com");
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
/* extract the available proxy authentication types */
|
||||
long used;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_USED_PROXY, &used);
|
||||
if(!res) {
|
||||
printf("The proxy was %sused\\n", used ? "": "NOT ");
|
||||
}
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 8.7.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLOPT_NOPROXY (3),
|
||||
.BR CURLOPT_PROXY (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
51
3rdparty/curl/share/man/man3/CURLINFO_XFER_ID.3
vendored
51
3rdparty/curl/share/man/man3/CURLINFO_XFER_ID.3
vendored
@ -1,51 +0,0 @@
|
||||
.\" generated by cd2nroff 0.1 from CURLINFO_XFER_ID.md
|
||||
.TH CURLINFO_XFER_ID 3 "2024-10-11" libcurl
|
||||
.SH NAME
|
||||
CURLINFO_XFER_ID \- get the ID of a transfer
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_XFER_ID,
|
||||
curl_off_t *xfer_id);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Pass a pointer to a \fIcurl_off_t\fP to receive the identifier of the
|
||||
current/last transfer done with the handle. Stores \-1 if no transfer
|
||||
has been started yet for the handle.
|
||||
|
||||
The transfer id is unique among all transfers performed using the same
|
||||
connection cache. This is implicitly the case for all transfers in the
|
||||
same multi handle.
|
||||
.SH PROTOCOLS
|
||||
This functionality affects all supported protocols
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
|
||||
|
||||
/* Perform the request */
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
curl_off_t xfer_id;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_XFER_ID, &xfer_id);
|
||||
if(!res) {
|
||||
printf("Transfer ID: %" CURL_FORMAT_CURL_OFF_T "\\n", xfer_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in curl 8.2.0
|
||||
.SH RETURN VALUE
|
||||
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
|
||||
.SH SEE ALSO
|
||||
.BR CURLINFO_CONN_ID (3),
|
||||
.BR curl_easy_getinfo (3),
|
||||
.BR curl_easy_setopt (3)
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user