5353#include "curlver.h" /* libcurl version defines */
5454#include "system.h" /* determine things run-time */
5555
56- /*
57- * Define CURL_WIN32 when build target is Win32 API
58- */
59-
60- #if (defined(_WIN32 ) || defined(__WIN32__ ) || defined(WIN32 )) && \
61- !defined(__SYMBIAN32__ )
62- #define CURL_WIN32
63- #endif
64-
6556#include <stdio.h>
6657#include <limits.h>
6758
68- #if ( defined(__FreeBSD__ ) && ( __FreeBSD__ >= 2 ) ) || defined(__MidnightBSD__ )
59+ #if defined(__FreeBSD__ ) || defined(__MidnightBSD__ )
6960/* Needed for __FreeBSD_version or __MidnightBSD_version symbol definition */
70- #include <osreldate .h>
61+ #include <sys/param .h>
7162#endif
7263
7364/* The include stuff here below is mainly for time_t! */
7465#include <sys/types.h>
7566#include <time.h>
7667
77- #if defined(CURL_WIN32 ) && !defined(_WIN32_WCE ) && !defined(__CYGWIN__ )
68+ #if defined(_WIN32 ) && !defined(_WIN32_WCE ) && !defined(__CYGWIN__ )
7869#if !(defined(_WINSOCKAPI_ ) || defined(_WINSOCK_H ) || \
7970 defined(__LWIP_OPT_H__ ) || defined(LWIP_HDR_OPT_H ))
8071/* The check above prevents the winsock2 inclusion if winsock.h already was
8879 libc5-based Linux systems. Only include it on systems that are known to
8980 require it! */
9081#if defined(_AIX ) || defined(__NOVELL_LIBC__ ) || defined(__NetBSD__ ) || \
91- defined(__minix ) || defined(__SYMBIAN32__ ) || defined( __INTEGRITY ) || \
82+ defined(__minix ) || defined(__INTEGRITY ) || \
9283 defined(ANDROID ) || defined(__ANDROID__ ) || defined(__OpenBSD__ ) || \
9384 defined(__CYGWIN__ ) || defined(AMIGA ) || defined(__NuttX__ ) || \
9485 (defined(__FreeBSD_version ) && (__FreeBSD_version < 800000 )) || \
9586 (defined(__MidnightBSD_version ) && (__MidnightBSD_version < 100000 )) || \
96- defined(__sun__ ) || defined(__serenity__ )
87+ defined(__sun__ ) || defined(__serenity__ ) || defined( __vxworks__ )
9788#include <sys/select.h>
9889#endif
9990
100- #if !defined(CURL_WIN32 ) && !defined(_WIN32_WCE )
91+ #if !defined(_WIN32 ) && !defined(_WIN32_WCE )
10192#include <sys/socket.h>
10293#endif
10394
104- #if !defined(CURL_WIN32 )
95+ #if !defined(_WIN32 )
10596#include <sys/time.h>
10697#endif
10798
@@ -128,7 +119,7 @@ typedef void CURLSH;
128119
129120#ifdef CURL_STATICLIB
130121# define CURL_EXTERN
131- #elif defined(CURL_WIN32 ) || defined( __SYMBIAN32__ ) || \
122+ #elif defined(_WIN32 ) || \
132123 (__has_declspec_attribute (dllexport ) && \
133124 __has_declspec_attribute (dllimport ))
134125# if defined(BUILDING_LIBCURL )
@@ -144,7 +135,7 @@ typedef void CURLSH;
144135
145136#ifndef curl_socket_typedef
146137/* socket typedef */
147- #if defined(CURL_WIN32 ) && !defined(__LWIP_OPT_H__ ) && !defined(LWIP_HDR_OPT_H )
138+ #if defined(_WIN32 ) && !defined(__LWIP_OPT_H__ ) && !defined(LWIP_HDR_OPT_H )
148139typedef SOCKET curl_socket_t ;
149140#define CURL_SOCKET_BAD INVALID_SOCKET
150141#else
@@ -159,9 +150,9 @@ typedef enum {
159150 CURLSSLBACKEND_NONE = 0 ,
160151 CURLSSLBACKEND_OPENSSL = 1 ,
161152 CURLSSLBACKEND_GNUTLS = 2 ,
162- CURLSSLBACKEND_NSS = 3 ,
153+ CURLSSLBACKEND_NSS CURL_DEPRECATED ( 8.3 .0 , "") = 3 ,
163154 CURLSSLBACKEND_OBSOLETE4 = 4 , /* Was QSOSSL. */
164- CURLSSLBACKEND_GSKIT = 5 ,
155+ CURLSSLBACKEND_GSKIT CURL_DEPRECATED ( 8.3 .0 , "") = 5 ,
165156 CURLSSLBACKEND_POLARSSL CURL_DEPRECATED (7.69 .0 , "") = 6 ,
166157 CURLSSLBACKEND_WOLFSSL = 7 ,
167158 CURLSSLBACKEND_SCHANNEL = 8 ,
@@ -640,16 +631,17 @@ typedef enum {
640631 CURLE_PROXY , /* 97 - proxy handshake error */
641632 CURLE_SSL_CLIENTCERT , /* 98 - client-side certificate required */
642633 CURLE_UNRECOVERABLE_POLL , /* 99 - poll/select returned fatal error */
634+ CURLE_TOO_LARGE , /* 100 - a value/data met its maximum */
643635 CURL_LAST /* never use! */
644636} CURLcode ;
645637
646638#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
647639 the obsolete stuff removed! */
648640
649- /* Previously obsolete error code re-used in 7.38.0 */
641+ /* Previously obsolete error code reused in 7.38.0 */
650642#define CURLE_OBSOLETE16 CURLE_HTTP2
651643
652- /* Previously obsolete error codes re-used in 7.24.0 */
644+ /* Previously obsolete error codes reused in 7.24.0 */
653645#define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED
654646#define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT
655647
@@ -781,7 +773,7 @@ typedef enum {
781773 CURLPROXY_HTTP_1_0 = 1 , /* added in 7.19.4, force to use CONNECT
782774 HTTP/1.0 */
783775 CURLPROXY_HTTPS = 2 , /* HTTPS but stick to HTTP/1 added in 7.52.0 */
784- CURLPROXY_HTTPS2 = 3 , /* HTTPS and attempt HTTP/2 added in 8.1 .0 */
776+ CURLPROXY_HTTPS2 = 3 , /* HTTPS and attempt HTTP/2 added in 8.2 .0 */
785777 CURLPROXY_SOCKS4 = 4 , /* support added in 7.15.2, enum existed already
786778 in 7.10 */
787779 CURLPROXY_SOCKS5 = 5 , /* added in 7.10 */
@@ -1358,7 +1350,7 @@ typedef enum {
13581350 operation slower and is less friendly for the network. */
13591351 CURLOPT (CURLOPT_FRESH_CONNECT , CURLOPTTYPE_LONG , 74 ),
13601352
1361- /* Set to explicitly forbid the upcoming transfer's connection to be re-used
1353+ /* Set to explicitly forbid the upcoming transfer's connection to be reused
13621354 when done. Do not use this unless you're absolutely sure of this, as it
13631355 makes the operation slower and is less friendly for the network. */
13641356 CURLOPT (CURLOPT_FORBID_REUSE , CURLOPTTYPE_LONG , 75 ),
@@ -1652,7 +1644,7 @@ typedef enum {
16521644 CURLOPT (CURLOPT_SOCKOPTFUNCTION , CURLOPTTYPE_FUNCTIONPOINT , 148 ),
16531645 CURLOPT (CURLOPT_SOCKOPTDATA , CURLOPTTYPE_CBPOINT , 149 ),
16541646
1655- /* set to 0 to disable session ID re-use for this transfer, default is
1647+ /* set to 0 to disable session ID reuse for this transfer, default is
16561648 enabled (== 1) */
16571649 CURLOPT (CURLOPT_SSL_SESSIONID_CACHE , CURLOPTTYPE_LONG , 150 ),
16581650
@@ -1854,7 +1846,8 @@ typedef enum {
18541846 /* allow GSSAPI credential delegation */
18551847 CURLOPT (CURLOPT_GSSAPI_DELEGATION , CURLOPTTYPE_VALUES , 210 ),
18561848
1857- /* Set the name servers to use for DNS resolution */
1849+ /* Set the name servers to use for DNS resolution.
1850+ * Only supported by the c-ares DNS backend */
18581851 CURLOPT (CURLOPT_DNS_SERVERS , CURLOPTTYPE_STRINGPOINT , 211 ),
18591852
18601853 /* Time-out accept operations (currently for FTP only) after this amount
@@ -2113,7 +2106,7 @@ typedef enum {
21132106 CURLOPT (CURLOPT_SASL_AUTHZID , CURLOPTTYPE_STRINGPOINT , 289 ),
21142107
21152108 /* allow RCPT TO command to fail for some recipients */
2116- CURLOPT (CURLOPT_MAIL_RCPT_ALLLOWFAILS , CURLOPTTYPE_LONG , 290 ),
2109+ CURLOPT (CURLOPT_MAIL_RCPT_ALLOWFAILS , CURLOPTTYPE_LONG , 290 ),
21172110
21182111 /* the private SSL-certificate as a "blob" */
21192112 CURLOPT (CURLOPT_SSLCERT_BLOB , CURLOPTTYPE_BLOB , 291 ),
@@ -2207,6 +2200,12 @@ typedef enum {
22072200 /* Can leak things, gonna exit() soon */
22082201 CURLOPT (CURLOPT_QUICK_EXIT , CURLOPTTYPE_LONG , 322 ),
22092202
2203+ /* set a specific client IP for HAProxy PROXY protocol header? */
2204+ CURLOPT (CURLOPT_HAPROXY_CLIENT_IP , CURLOPTTYPE_STRINGPOINT , 323 ),
2205+
2206+ /* millisecond version */
2207+ CURLOPT (CURLOPT_SERVER_RESPONSE_TIMEOUT_MS , CURLOPTTYPE_LONG , 324 ),
2208+
22102209 CURLOPT_LASTENTRY /* the last unused */
22112210} CURLoption ;
22122211
@@ -2235,6 +2234,9 @@ typedef enum {
22352234/* */
22362235#define CURLOPT_FTP_RESPONSE_TIMEOUT CURLOPT_SERVER_RESPONSE_TIMEOUT
22372236
2237+ /* Added in 8.2.0 */
2238+ #define CURLOPT_MAIL_RCPT_ALLLOWFAILS CURLOPT_MAIL_RCPT_ALLOWFAILS
2239+
22382240#else
22392241/* This is set if CURL_NO_OLDIES is defined at compile-time */
22402242#undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */
@@ -2725,6 +2727,20 @@ CURL_EXTERN CURLcode curl_global_init_mem(long flags,
27252727 */
27262728CURL_EXTERN void curl_global_cleanup (void );
27272729
2730+ /*
2731+ * NAME curl_global_trace()
2732+ *
2733+ * DESCRIPTION
2734+ *
2735+ * curl_global_trace() can be invoked at application start to
2736+ * configure which components in curl should participate in tracing.
2737+
2738+ * This function is thread-safe if CURL_VERSION_THREADSAFE is set in the
2739+ * curl_version_info_data.features flag (fetch by curl_version_info()).
2740+
2741+ */
2742+ CURL_EXTERN CURLcode curl_global_trace (const char * config );
2743+
27282744/* linked-list structure for the CURLOPT_QUOTE option (and other) */
27292745struct curl_slist {
27302746 char * data ;
@@ -2804,13 +2820,14 @@ CURL_EXTERN void curl_slist_free_all(struct curl_slist *list);
28042820 */
28052821CURL_EXTERN time_t curl_getdate (const char * p , const time_t * unused );
28062822
2807- /* info about the certificate chain, only for OpenSSL, GnuTLS, Schannel, NSS
2808- and GSKit builds. Asked for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */
2823+ /* info about the certificate chain, for SSL backends that support it. Asked
2824+ for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */
28092825struct curl_certinfo {
28102826 int num_of_certs ; /* number of certificates with information */
28112827 struct curl_slist * * certinfo ; /* for each index in this array, there's a
2812- linked list with textual information in the
2813- format "name: value" */
2828+ linked list with textual information for a
2829+ certificate in the format "name:content".
2830+ eg "Subject:foo", "Issuer:bar", etc. */
28142831};
28152832
28162833/* Information about the SSL library used and the respective internal SSL
@@ -2918,7 +2935,10 @@ typedef enum {
29182935 CURLINFO_REFERER = CURLINFO_STRING + 60 ,
29192936 CURLINFO_CAINFO = CURLINFO_STRING + 61 ,
29202937 CURLINFO_CAPATH = CURLINFO_STRING + 62 ,
2921- CURLINFO_LASTONE = 62
2938+ CURLINFO_XFER_ID = CURLINFO_OFF_T + 63 ,
2939+ CURLINFO_CONN_ID = CURLINFO_OFF_T + 64 ,
2940+ CURLINFO_QUEUE_TIME_T = CURLINFO_OFF_T + 65 ,
2941+ CURLINFO_LASTONE = 65
29222942} CURLINFO ;
29232943
29242944/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
@@ -3197,6 +3217,7 @@ CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
31973217#include "options.h"
31983218#include "header.h"
31993219#include "websockets.h"
3220+ #include "mprintf.h"
32003221
32013222/* the typechecker doesn't work in C++ (yet) */
32023223#if defined(__GNUC__ ) && defined(__GNUC_MINOR__ ) && \
0 commit comments