capacitor-freerasp 2.2.2 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/CapacitorFreerasp.podspec +5 -1
  3. package/README.md +8 -8
  4. package/android/build.gradle +3 -3
  5. package/android/src/main/java/com/aheaditec/freerasp/FreeraspPlugin.kt +106 -33
  6. package/android/src/main/java/com/aheaditec/freerasp/PluginThreatHandler.kt +121 -0
  7. package/android/src/main/java/com/aheaditec/freerasp/ScreenProtector.kt +24 -2
  8. package/android/src/main/java/com/aheaditec/freerasp/dispatchers/ExecutionStateDispatcher.kt +38 -0
  9. package/android/src/main/java/com/aheaditec/freerasp/dispatchers/ThreatDispatcher.kt +62 -0
  10. package/android/src/main/java/com/aheaditec/freerasp/events/BaseRaspEvent.kt +7 -0
  11. package/android/src/main/java/com/aheaditec/freerasp/events/RaspExecutionStateEvent.kt +22 -0
  12. package/android/src/main/java/com/aheaditec/freerasp/events/ThreatEvent.kt +71 -0
  13. package/android/src/main/java/com/aheaditec/freerasp/interfaces/PluginExecutionStateListener.kt +7 -0
  14. package/android/src/main/java/com/aheaditec/freerasp/interfaces/PluginThreatListener.kt +9 -0
  15. package/android/src/main/java/com/aheaditec/freerasp/models/CapSuspiciousAppInfo.kt +1 -0
  16. package/android/src/main/java/com/aheaditec/freerasp/utils/Extensions.kt +1 -0
  17. package/android/src/main/java/com/aheaditec/freerasp/utils/RandomGenerator.kt +24 -0
  18. package/android/src/main/java/com/aheaditec/freerasp/utils/Utils.kt +3 -5
  19. package/dist/esm/api/listeners/raspExecutionState.d.ts +3 -0
  20. package/dist/esm/api/listeners/raspExecutionState.js +40 -0
  21. package/dist/esm/api/listeners/raspExecutionState.js.map +1 -0
  22. package/dist/esm/api/listeners/threat.d.ts +3 -0
  23. package/dist/esm/api/listeners/threat.js +104 -0
  24. package/dist/esm/api/listeners/threat.js.map +1 -0
  25. package/dist/esm/api/methods/capacitor.d.ts +4 -0
  26. package/dist/esm/api/methods/capacitor.js +11 -0
  27. package/dist/esm/api/methods/capacitor.js.map +1 -0
  28. package/dist/esm/api/methods/native.d.ts +7 -0
  29. package/dist/esm/api/methods/native.js +36 -0
  30. package/dist/esm/api/methods/native.js.map +1 -0
  31. package/dist/esm/api/nativeModules.d.ts +2 -0
  32. package/dist/esm/api/nativeModules.js +3 -0
  33. package/dist/esm/api/nativeModules.js.map +1 -0
  34. package/dist/esm/channels/raspExecutionState.d.ts +3 -0
  35. package/dist/esm/channels/raspExecutionState.js +27 -0
  36. package/dist/esm/channels/raspExecutionState.js.map +1 -0
  37. package/dist/esm/channels/threat.d.ts +3 -0
  38. package/dist/esm/channels/threat.js +34 -0
  39. package/dist/esm/channels/threat.js.map +1 -0
  40. package/dist/esm/index.d.ts +7 -12
  41. package/dist/esm/index.js +7 -158
  42. package/dist/esm/index.js.map +1 -1
  43. package/dist/esm/models/raspExecutionState.d.ts +6 -0
  44. package/dist/esm/models/raspExecutionState.js +10 -0
  45. package/dist/esm/models/raspExecutionState.js.map +1 -0
  46. package/dist/esm/models/threat.d.ts +27 -0
  47. package/dist/esm/{definitions.js → models/threat.js} +9 -3
  48. package/dist/esm/models/threat.js.map +1 -0
  49. package/dist/esm/{definitions.d.ts → types/types.d.ts} +41 -44
  50. package/dist/esm/types/types.js +2 -0
  51. package/dist/esm/types/types.js.map +1 -0
  52. package/dist/esm/utils/malware.d.ts +3 -0
  53. package/dist/esm/utils/malware.js +22 -0
  54. package/dist/esm/utils/malware.js.map +1 -0
  55. package/dist/esm/utils/utils.d.ts +3 -0
  56. package/dist/esm/utils/utils.js +12 -0
  57. package/dist/esm/utils/utils.js.map +1 -0
  58. package/dist/plugin.cjs.js +197 -76
  59. package/dist/plugin.cjs.js.map +1 -1
  60. package/dist/plugin.js +197 -76
  61. package/dist/plugin.js.map +1 -1
  62. package/ios/Plugin/FreeraspPlugin.m +3 -0
  63. package/ios/Plugin/FreeraspPlugin.swift +36 -77
  64. package/ios/Plugin/Info.plist +1 -1
  65. package/ios/Plugin/TalsecRuntime.xcframework/_CodeSignature/CodeDirectory +0 -0
  66. package/ios/Plugin/TalsecRuntime.xcframework/_CodeSignature/CodeResources +100 -298
  67. package/ios/Plugin/TalsecRuntime.xcframework/_CodeSignature/CodeSignature +0 -0
  68. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CurlWrapper.h +1 -1
  69. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +7 -2
  70. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curl.h +380 -281
  71. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curlver.h +5 -6
  72. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/easy.h +4 -4
  73. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/header.h +1 -1
  74. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/mprintf.h +11 -4
  75. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/multi.h +62 -22
  76. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/options.h +2 -2
  77. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/system.h +76 -164
  78. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/typecheck-gcc.h +947 -0
  79. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +5 -4
  80. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/websockets.h +17 -3
  81. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Info.plist +0 -0
  82. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.abi.json +233 -528
  83. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.private.swiftinterface +7 -3
  84. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  85. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +7 -3
  86. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
  87. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CurlWrapper.h +1 -1
  88. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +14 -4
  89. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +380 -281
  90. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curlver.h +5 -6
  91. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/easy.h +4 -4
  92. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/header.h +1 -1
  93. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/mprintf.h +11 -4
  94. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +62 -22
  95. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +2 -2
  96. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/system.h +76 -164
  97. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/typecheck-gcc.h +947 -0
  98. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +5 -4
  99. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/websockets.h +17 -3
  100. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Info.plist +0 -0
  101. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.abi.json +233 -528
  102. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +7 -3
  103. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  104. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +7 -3
  105. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.abi.json +233 -528
  106. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +7 -3
  107. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  108. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +7 -3
  109. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/TalsecRuntime +0 -0
  110. package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/_CodeSignature/CodeResources +56 -45
  111. package/ios/Plugin/dispatchers/ExecutionStateDispatcher.swift +35 -0
  112. package/ios/Plugin/dispatchers/ThreatDispatcher.swift +36 -0
  113. package/ios/Plugin/models/RaspExecutionStates.swift +15 -0
  114. package/ios/Plugin/models/SecurityThreat.swift +40 -0
  115. package/ios/Plugin/utils/EventIdentifiers.swift +17 -0
  116. package/ios/Plugin/utils/RandomGenerator.swift +23 -0
  117. package/ios/Plugin/utils/Utils.swift +32 -0
  118. package/package.json +15 -10
  119. package/android/src/main/java/com/aheaditec/freerasp/Threat.kt +0 -58
  120. package/android/src/main/java/com/aheaditec/freerasp/ThreatHandler.kt +0 -76
  121. package/dist/esm/definitions.js.map +0 -1
  122. package/dist/esm/utils.d.ts +0 -2
  123. package/dist/esm/utils.js +0 -8
  124. package/dist/esm/utils.js.map +0 -1
  125. package/ios/Plugin/TalsecRuntime.xcframework/_CodeSignature/CodeRequirements-1 +0 -0
@@ -30,28 +30,37 @@
30
30
  */
31
31
 
32
32
  #ifdef CURL_NO_OLDIES
33
- #define CURL_STRICTER
33
+ #define CURL_STRICTER /* not used since 8.11.0 */
34
34
  #endif
35
35
 
36
36
  /* Compile-time deprecation macros. */
37
- #if defined(__GNUC__) && \
38
- ((__GNUC__ > 12) || ((__GNUC__ == 12) && (__GNUC_MINOR__ >= 1 ))) && \
39
- !defined(__INTEL_COMPILER) && \
37
+ #if (defined(__GNUC__) && \
38
+ ((__GNUC__ > 12) || ((__GNUC__ == 12) && (__GNUC_MINOR__ >= 1))) || \
39
+ (defined(__clang__) && __clang_major__ >= 3) || \
40
+ defined(__IAR_SYSTEMS_ICC__)) && \
41
+ !defined(__INTEL_COMPILER) && \
40
42
  !defined(CURL_DISABLE_DEPRECATION) && !defined(BUILDING_LIBCURL)
41
43
  #define CURL_DEPRECATED(version, message) \
42
44
  __attribute__((deprecated("since " # version ". " message)))
45
+ #ifdef __IAR_SYSTEMS_ICC__
46
+ #define CURL_IGNORE_DEPRECATION(statements) \
47
+ _Pragma("diag_suppress=Pe1444") \
48
+ statements \
49
+ _Pragma("diag_default=Pe1444")
50
+ #else
43
51
  #define CURL_IGNORE_DEPRECATION(statements) \
44
52
  _Pragma("GCC diagnostic push") \
45
53
  _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
46
54
  statements \
47
55
  _Pragma("GCC diagnostic pop")
56
+ #endif
48
57
  #else
49
58
  #define CURL_DEPRECATED(version, message)
50
59
  #define CURL_IGNORE_DEPRECATION(statements) statements
51
60
  #endif
52
61
 
53
62
  #include "curlver.h" /* libcurl version defines */
54
- #include "system.h" /* determine things run-time */
63
+ #include "system.h" /* determine things runtime */
55
64
 
56
65
  #include <stdio.h>
57
66
  #include <limits.h>
@@ -68,8 +77,8 @@
68
77
  #if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)
69
78
  #if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || \
70
79
  defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H))
71
- /* The check above prevents the winsock2 inclusion if winsock.h already was
72
- included, since they can't co-exist without problems */
80
+ /* The check above prevents the winsock2.h inclusion if winsock.h already was
81
+ included, since they cannot co-exist without problems */
73
82
  #include <winsock2.h>
74
83
  #include <ws2tcpip.h>
75
84
  #endif
@@ -88,41 +97,34 @@
88
97
  #include <sys/select.h>
89
98
  #endif
90
99
 
91
- #if !defined(_WIN32) && !defined(_WIN32_WCE)
100
+ #ifndef _WIN32
92
101
  #include <sys/socket.h>
93
- #endif
94
-
95
- #if !defined(_WIN32)
96
102
  #include <sys/time.h>
97
103
  #endif
98
104
 
99
- /* Compatibility for non-Clang compilers */
100
- #ifndef __has_declspec_attribute
101
- # define __has_declspec_attribute(x) 0
102
- #endif
103
-
104
- #ifdef __cplusplus
105
+ #ifdef __cplusplus
105
106
  extern "C" {
106
107
  #endif
107
108
 
108
- #if defined(BUILDING_LIBCURL) || defined(CURL_STRICTER)
109
- typedef struct Curl_easy CURL;
110
- typedef struct Curl_share CURLSH;
111
- #else
112
109
  typedef void CURL;
113
110
  typedef void CURLSH;
114
- #endif
115
111
 
116
112
  /*
117
113
  * libcurl external API function linkage decorations.
118
114
  */
119
115
 
116
+ #ifdef __has_declspec_attribute
117
+ #define CURL_HAS_DECLSPEC_ATTRIBUTE(x) __has_declspec_attribute(x)
118
+ #else
119
+ #define CURL_HAS_DECLSPEC_ATTRIBUTE(x) 0
120
+ #endif
121
+
120
122
  #ifdef CURL_STATICLIB
121
123
  # define CURL_EXTERN
122
124
  #elif defined(_WIN32) || \
123
- (__has_declspec_attribute(dllexport) && \
124
- __has_declspec_attribute(dllimport))
125
- # if defined(BUILDING_LIBCURL)
125
+ (CURL_HAS_DECLSPEC_ATTRIBUTE(dllexport) && \
126
+ CURL_HAS_DECLSPEC_ATTRIBUTE(dllimport))
127
+ # ifdef BUILDING_LIBCURL
126
128
  # define CURL_EXTERN __declspec(dllexport)
127
129
  # else
128
130
  # define CURL_EXTERN __declspec(dllimport)
@@ -156,11 +158,11 @@ typedef enum {
156
158
  CURLSSLBACKEND_POLARSSL CURL_DEPRECATED(7.69.0, "") = 6,
157
159
  CURLSSLBACKEND_WOLFSSL = 7,
158
160
  CURLSSLBACKEND_SCHANNEL = 8,
159
- CURLSSLBACKEND_SECURETRANSPORT = 9,
161
+ CURLSSLBACKEND_SECURETRANSPORT CURL_DEPRECATED(8.15.0, "") = 9,
160
162
  CURLSSLBACKEND_AXTLS CURL_DEPRECATED(7.61.0, "") = 10,
161
163
  CURLSSLBACKEND_MBEDTLS = 11,
162
164
  CURLSSLBACKEND_MESALINK CURL_DEPRECATED(7.82.0, "") = 12,
163
- CURLSSLBACKEND_BEARSSL = 13,
165
+ CURLSSLBACKEND_BEARSSL CURL_DEPRECATED(8.15.0, "") = 13,
164
166
  CURLSSLBACKEND_RUSTLS = 14
165
167
  } curl_sslbackend;
166
168
 
@@ -173,6 +175,16 @@ typedef enum {
173
175
  #define CURLSSLBACKEND_CYASSL CURLSSLBACKEND_WOLFSSL
174
176
  #define CURLSSLBACKEND_DARWINSSL CURLSSLBACKEND_SECURETRANSPORT
175
177
 
178
+ /* bits for the CURLOPT_FOLLOWLOCATION option */
179
+ #define CURLFOLLOW_ALL 1L /* generic follow redirects */
180
+
181
+ /* Do not use the custom method in the follow-up request if the HTTP code
182
+ instructs so (301, 302, 303). */
183
+ #define CURLFOLLOW_OBEYCODE 2L
184
+
185
+ /* Only use the custom method in the first request, always reset in the next */
186
+ #define CURLFOLLOW_FIRSTONLY 3L
187
+
176
188
  struct curl_httppost {
177
189
  struct curl_httppost *next; /* next entry in the list */
178
190
  char *name; /* pointer to allocated name */
@@ -189,9 +201,9 @@ struct curl_httppost {
189
201
  files */
190
202
  long flags; /* as defined below */
191
203
 
192
- /* specified content is a file name */
204
+ /* specified content is a filename */
193
205
  #define CURL_HTTPPOST_FILENAME (1<<0)
194
- /* specified content is a file name */
206
+ /* specified content is a filename */
195
207
  #define CURL_HTTPPOST_READFILE (1<<1)
196
208
  /* name is only stored pointer do not free in formfree */
197
209
  #define CURL_HTTPPOST_PTRNAME (1<<2)
@@ -207,8 +219,8 @@ struct curl_httppost {
207
219
  /* use size in 'contentlen', added in 7.46.0 */
208
220
  #define CURL_HTTPPOST_LARGE (1<<7)
209
221
 
210
- char *showfilename; /* The file name to show. If not set, the
211
- actual file name will be used (if this
222
+ char *showfilename; /* The filename to show. If not set, the
223
+ actual filename will be used (if this
212
224
  is a file part) */
213
225
  void *userp; /* custom pointer used for
214
226
  HTTPPOST_CALLBACK posts */
@@ -245,12 +257,12 @@ typedef int (*curl_xferinfo_callback)(void *clientp,
245
257
  #endif
246
258
 
247
259
  #ifndef CURL_MAX_WRITE_SIZE
248
- /* Tests have proven that 20K is a very bad buffer size for uploads on
249
- Windows, while 16K for some odd reason performed a lot better.
250
- We do the ifndef check to allow this value to easier be changed at build
251
- time for those who feel adventurous. The practical minimum is about
252
- 400 bytes since libcurl uses a buffer of this size as a scratch area
253
- (unrelated to network send operations). */
260
+ /* Tests have proven that 20K is a bad buffer size for uploads on Windows,
261
+ while 16K for some odd reason performed a lot better. We do the ifndef
262
+ check to allow this value to easier be changed at build time for those
263
+ who feel adventurous. The practical minimum is about 400 bytes since
264
+ libcurl uses a buffer of this size as a scratch area (unrelated to
265
+ network send operations). */
254
266
  #define CURL_MAX_WRITE_SIZE 16384
255
267
  #endif
256
268
 
@@ -350,13 +362,13 @@ typedef long (*curl_chunk_bgn_callback)(const void *transfer_info,
350
362
  download of an individual chunk finished.
351
363
  Note! After this callback was set then it have to be called FOR ALL chunks.
352
364
  Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC.
353
- This is the reason why we don't need "transfer_info" parameter in this
365
+ This is the reason why we do not need "transfer_info" parameter in this
354
366
  callback and we are not interested in "remains" parameter too. */
355
367
  typedef long (*curl_chunk_end_callback)(void *ptr);
356
368
 
357
369
  /* return codes for FNMATCHFUNCTION */
358
370
  #define CURL_FNMATCHFUNC_MATCH 0 /* string corresponds to the pattern */
359
- #define CURL_FNMATCHFUNC_NOMATCH 1 /* pattern doesn't match the string */
371
+ #define CURL_FNMATCHFUNC_NOMATCH 1 /* pattern does not match the string */
360
372
  #define CURL_FNMATCHFUNC_FAIL 2 /* an error occurred */
361
373
 
362
374
  /* callback type for wildcard downloading pattern matching. If the
@@ -368,7 +380,7 @@ typedef int (*curl_fnmatch_callback)(void *ptr,
368
380
  /* These are the return codes for the seek callbacks */
369
381
  #define CURL_SEEKFUNC_OK 0
370
382
  #define CURL_SEEKFUNC_FAIL 1 /* fail the entire transfer */
371
- #define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking can't be done, so
383
+ #define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking cannot be done, so
372
384
  libcurl might try other means instead */
373
385
  typedef int (*curl_seek_callback)(void *instream,
374
386
  curl_off_t offset,
@@ -451,7 +463,7 @@ typedef curlioerr (*curl_ioctl_callback)(CURL *handle,
451
463
  #ifndef CURL_DID_MEMORY_FUNC_TYPEDEFS
452
464
  /*
453
465
  * The following typedef's are signatures of malloc, free, realloc, strdup and
454
- * calloc respectively. Function pointers of these types can be passed to the
466
+ * calloc respectively. Function pointers of these types can be passed to the
455
467
  * curl_global_init_mem() function to set user defined memory management
456
468
  * callback routines.
457
469
  */
@@ -539,22 +551,22 @@ typedef enum {
539
551
  CURLE_WRITE_ERROR, /* 23 */
540
552
  CURLE_OBSOLETE24, /* 24 - NOT USED */
541
553
  CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */
542
- CURLE_READ_ERROR, /* 26 - couldn't open/read from file */
554
+ CURLE_READ_ERROR, /* 26 - could not open/read from file */
543
555
  CURLE_OUT_OF_MEMORY, /* 27 */
544
556
  CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */
545
557
  CURLE_OBSOLETE29, /* 29 - NOT USED */
546
558
  CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */
547
559
  CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */
548
560
  CURLE_OBSOLETE32, /* 32 - NOT USED */
549
- CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */
550
- CURLE_HTTP_POST_ERROR, /* 34 */
561
+ CURLE_RANGE_ERROR, /* 33 - RANGE "command" did not work */
562
+ CURLE_OBSOLETE34, /* 34 */
551
563
  CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */
552
- CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */
564
+ CURLE_BAD_DOWNLOAD_RESUME, /* 36 - could not resume download */
553
565
  CURLE_FILE_COULDNT_READ_FILE, /* 37 */
554
566
  CURLE_LDAP_CANNOT_BIND, /* 38 */
555
567
  CURLE_LDAP_SEARCH_FAILED, /* 39 */
556
568
  CURLE_OBSOLETE40, /* 40 - NOT USED */
557
- CURLE_FUNCTION_NOT_FOUND, /* 41 - NOT USED starting with 7.53.0 */
569
+ CURLE_OBSOLETE41, /* 41 - NOT USED starting with 7.53.0 */
558
570
  CURLE_ABORTED_BY_CALLBACK, /* 42 */
559
571
  CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */
560
572
  CURLE_OBSOLETE44, /* 44 - NOT USED */
@@ -573,9 +585,9 @@ typedef enum {
573
585
  CURLE_RECV_ERROR, /* 56 - failure in receiving network data */
574
586
  CURLE_OBSOLETE57, /* 57 - NOT IN USE */
575
587
  CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */
576
- CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */
588
+ CURLE_SSL_CIPHER, /* 59 - could not use specified cipher */
577
589
  CURLE_PEER_FAILED_VERIFICATION, /* 60 - peer's certificate or fingerprint
578
- wasn't verified fine */
590
+ was not verified fine */
579
591
  CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized/bad encoding */
580
592
  CURLE_OBSOLETE62, /* 62 - NOT IN USE since 7.82.0 */
581
593
  CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */
@@ -604,7 +616,7 @@ typedef enum {
604
616
  CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL
605
617
  connection */
606
618
  CURLE_AGAIN, /* 81 - socket is not ready for send/recv,
607
- wait till it's ready and try again (Added
619
+ wait till it is ready and try again (Added
608
620
  in 7.18.2) */
609
621
  CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or
610
622
  wrong format (Added in 7.19.0) */
@@ -639,6 +651,12 @@ typedef enum {
639
651
  #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
640
652
  the obsolete stuff removed! */
641
653
 
654
+ /* removed in 7.53.0 */
655
+ #define CURLE_FUNCTION_NOT_FOUND CURLE_OBSOLETE41
656
+
657
+ /* removed in 7.56.0 */
658
+ #define CURLE_HTTP_POST_ERROR CURLE_OBSOLETE34
659
+
642
660
  /* Previously obsolete error code reused in 7.38.0 */
643
661
  #define CURLE_OBSOLETE16 CURLE_HTTP2
644
662
 
@@ -713,6 +731,8 @@ typedef enum {
713
731
  with them. */
714
732
  #define CURLOPT_WRITEINFO CURLOPT_OBSOLETE40
715
733
  #define CURLOPT_CLOSEPOLICY CURLOPT_OBSOLETE72
734
+ #define CURLOPT_OBSOLETE72 9999
735
+ #define CURLOPT_OBSOLETE40 9999
716
736
 
717
737
  #endif /* !CURL_NO_OLDIES */
718
738
 
@@ -763,25 +783,29 @@ typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length);
763
783
 
764
784
  typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl, /* easy handle */
765
785
  void *ssl_ctx, /* actually an OpenSSL
766
- or WolfSSL SSL_CTX,
786
+ or wolfSSL SSL_CTX,
767
787
  or an mbedTLS
768
788
  mbedtls_ssl_config */
769
789
  void *userptr);
770
790
 
791
+ #define CURLPROXY_HTTP 0L /* added in 7.10, new in 7.19.4 default is
792
+ to use CONNECT HTTP/1.1 */
793
+ #define CURLPROXY_HTTP_1_0 1L /* force to use CONNECT HTTP/1.0
794
+ added in 7.19.4 */
795
+ #define CURLPROXY_HTTPS 2L /* HTTPS but stick to HTTP/1
796
+ added in 7.52.0 */
797
+ #define CURLPROXY_HTTPS2 3L /* HTTPS and attempt HTTP/2
798
+ added in 8.2.0 */
799
+ #define CURLPROXY_SOCKS4 4L /* support added in 7.15.2, enum existed
800
+ already in 7.10 */
801
+ #define CURLPROXY_SOCKS5 5L /* added in 7.10 */
802
+ #define CURLPROXY_SOCKS4A 6L /* added in 7.18.0 */
803
+ #define CURLPROXY_SOCKS5_HOSTNAME 7L /* Use the SOCKS5 protocol but pass along
804
+ the hostname rather than the IP
805
+ address. added in 7.18.0 */
806
+
771
807
  typedef enum {
772
- CURLPROXY_HTTP = 0, /* added in 7.10, new in 7.19.4 default is to use
773
- CONNECT HTTP/1.1 */
774
- CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT
775
- HTTP/1.0 */
776
- CURLPROXY_HTTPS = 2, /* HTTPS but stick to HTTP/1 added in 7.52.0 */
777
- CURLPROXY_HTTPS2 = 3, /* HTTPS and attempt HTTP/2 added in 8.2.0 */
778
- CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already
779
- in 7.10 */
780
- CURLPROXY_SOCKS5 = 5, /* added in 7.10 */
781
- CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */
782
- CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the
783
- host name rather than the IP address. added
784
- in 7.18.0 */
808
+ CURLPROXY_LAST = 8 /* never use */
785
809
  } curl_proxytype; /* this enum was added in 7.10 */
786
810
 
787
811
  /*
@@ -789,11 +813,11 @@ typedef enum {
789
813
  *
790
814
  * CURLAUTH_NONE - No HTTP authentication
791
815
  * CURLAUTH_BASIC - HTTP Basic authentication (default)
792
- * CURLAUTH_DIGEST - HTTP DizsWt authentication
816
+ * CURLAUTH_DIGEST - HTTP DiGlHt authentication
793
817
  * CURLAUTH_NEGOTIATE - HTTP Negotiate (SPNEGO) authentication
794
818
  * CURLAUTH_GSSNEGOTIATE - Alias for CURLAUTH_NEGOTIATE (deprecated)
795
819
  * CURLAUTH_NTLM - HTTP NTLM authentication
796
- * CURLAUTH_DIGEST_IE - HTTP DizsWt authentication with IE flavour
820
+ * CURLAUTH_DIGEST_IE - HTTP DiGlHt authentication with IE flavour
797
821
  * CURLAUTH_NTLM_WB - HTTP NTLM authentication delegated to winbind helper
798
822
  * CURLAUTH_BEARER - HTTP Bearer token authentication
799
823
  * CURLAUTH_ONLY - Use together with a single other type to force no
@@ -822,19 +846,19 @@ typedef enum {
822
846
  #define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE)
823
847
  #define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
824
848
 
825
- #define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */
826
- #define CURLSSH_AUTH_NONE 0 /* none allowed, silly but complete */
827
- #define CURLSSH_AUTH_PUBLICKEY (1<<0) /* public/private key files */
828
- #define CURLSSH_AUTH_PASSWORD (1<<1) /* password */
829
- #define CURLSSH_AUTH_HOST (1<<2) /* host key files */
830
- #define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */
831
- #define CURLSSH_AUTH_AGENT (1<<4) /* agent (ssh-agent, pageant...) */
832
- #define CURLSSH_AUTH_GSSAPI (1<<5) /* gssapi (kerberos, ...) */
849
+ #define CURLSSH_AUTH_ANY ~0L /* all types supported by the server */
850
+ #define CURLSSH_AUTH_NONE 0L /* none allowed, silly but complete */
851
+ #define CURLSSH_AUTH_PUBLICKEY (1L<<0) /* public/private key files */
852
+ #define CURLSSH_AUTH_PASSWORD (1L<<1) /* password */
853
+ #define CURLSSH_AUTH_HOST (1L<<2) /* host key files */
854
+ #define CURLSSH_AUTH_KEYBOARD (1L<<3) /* keyboard interactive */
855
+ #define CURLSSH_AUTH_AGENT (1L<<4) /* agent (ssh-agent, pageant...) */
856
+ #define CURLSSH_AUTH_GSSAPI (1L<<5) /* gssapi (kerberos, ...) */
833
857
  #define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY
834
858
 
835
- #define CURLGSSAPI_DELEGATION_NONE 0 /* no delegation (default) */
836
- #define CURLGSSAPI_DELEGATION_POLICY_FLAG (1<<0) /* if permitted by policy */
837
- #define CURLGSSAPI_DELEGATION_FLAG (1<<1) /* delegate always */
859
+ #define CURLGSSAPI_DELEGATION_NONE 0L /* no delegation (default) */
860
+ #define CURLGSSAPI_DELEGATION_POLICY_FLAG (1L<<0) /* if permitted by policy */
861
+ #define CURLGSSAPI_DELEGATION_FLAG (1L<<1) /* delegate always */
838
862
 
839
863
  #define CURL_ERROR_SIZE 256
840
864
 
@@ -860,7 +884,7 @@ enum curl_khstat {
860
884
  CURLKHSTAT_FINE_ADD_TO_FILE,
861
885
  CURLKHSTAT_FINE,
862
886
  CURLKHSTAT_REJECT, /* reject the connection, return an error */
863
- CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now.
887
+ CURLKHSTAT_DEFER, /* do not accept it, but we cannot answer right now.
864
888
  Causes a CURLE_PEER_FAILED_VERIFICATION error but the
865
889
  connection will be left intact etc */
866
890
  CURLKHSTAT_FINE_REPLACE, /* accept and replace the wrong key */
@@ -894,12 +918,13 @@ typedef int
894
918
 
895
919
 
896
920
  /* parameter for the CURLOPT_USE_SSL option */
921
+ #define CURLUSESSL_NONE 0L /* do not attempt to use SSL */
922
+ #define CURLUSESSL_TRY 1L /* try using SSL, proceed anyway otherwise */
923
+ #define CURLUSESSL_CONTROL 2L /* SSL for the control connection or fail */
924
+ #define CURLUSESSL_ALL 3L /* SSL for all communication or fail */
925
+
897
926
  typedef enum {
898
- CURLUSESSL_NONE, /* do not attempt to use SSL */
899
- CURLUSESSL_TRY, /* try using SSL, proceed anyway otherwise */
900
- CURLUSESSL_CONTROL, /* SSL for the control connection or fail */
901
- CURLUSESSL_ALL, /* SSL for all communication or fail */
902
- CURLUSESSL_LAST /* not an option, never use */
927
+ CURLUSESSL_LAST = 4 /* not an option, never use */
903
928
  } curl_usessl;
904
929
 
905
930
  /* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */
@@ -909,28 +934,31 @@ typedef enum {
909
934
  have introduced work-arounds for this flaw but those work-arounds sometimes
910
935
  make the SSL communication fail. To regain functionality with those broken
911
936
  servers, a user can this way allow the vulnerability back. */
912
- #define CURLSSLOPT_ALLOW_BEAST (1<<0)
937
+ #define CURLSSLOPT_ALLOW_BEAST (1L<<0)
913
938
 
914
939
  /* - NO_REVOKE tells libcurl to disable certificate revocation checks for those
915
940
  SSL backends where such behavior is present. */
916
- #define CURLSSLOPT_NO_REVOKE (1<<1)
941
+ #define CURLSSLOPT_NO_REVOKE (1L<<1)
917
942
 
918
943
  /* - NO_PARTIALCHAIN tells libcurl to *NOT* accept a partial certificate chain
919
944
  if possible. The OpenSSL backend has this ability. */
920
- #define CURLSSLOPT_NO_PARTIALCHAIN (1<<2)
945
+ #define CURLSSLOPT_NO_PARTIALCHAIN (1L<<2)
921
946
 
922
947
  /* - REVOKE_BEST_EFFORT tells libcurl to ignore certificate revocation offline
923
948
  checks and ignore missing revocation list for those SSL backends where such
924
949
  behavior is present. */
925
- #define CURLSSLOPT_REVOKE_BEST_EFFORT (1<<3)
950
+ #define CURLSSLOPT_REVOKE_BEST_EFFORT (1L<<3)
926
951
 
927
952
  /* - CURLSSLOPT_NATIVE_CA tells libcurl to use standard certificate store of
928
953
  operating system. Currently implemented under MS-Windows. */
929
- #define CURLSSLOPT_NATIVE_CA (1<<4)
954
+ #define CURLSSLOPT_NATIVE_CA (1L<<4)
930
955
 
931
956
  /* - CURLSSLOPT_AUTO_CLIENT_CERT tells libcurl to automatically locate and use
932
957
  a client certificate for authentication. (Schannel) */
933
- #define CURLSSLOPT_AUTO_CLIENT_CERT (1<<5)
958
+ #define CURLSSLOPT_AUTO_CLIENT_CERT (1L<<5)
959
+
960
+ /* If possible, send data using TLS 1.3 early data */
961
+ #define CURLSSLOPT_EARLYDATA (1L<<6)
934
962
 
935
963
  /* The default connection attempt delay in milliseconds for happy eyeballs.
936
964
  CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.3 and happy-eyeballs-timeout-ms.d document
@@ -955,51 +983,62 @@ typedef enum {
955
983
  #endif /* !CURL_NO_OLDIES */
956
984
 
957
985
  /* parameter for the CURLOPT_FTP_SSL_CCC option */
986
+ #define CURLFTPSSL_CCC_NONE 0L /* do not send CCC */
987
+ #define CURLFTPSSL_CCC_PASSIVE 1L /* Let the server initiate the shutdown */
988
+ #define CURLFTPSSL_CCC_ACTIVE 2L /* Initiate the shutdown */
989
+
958
990
  typedef enum {
959
- CURLFTPSSL_CCC_NONE, /* do not send CCC */
960
- CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */
961
- CURLFTPSSL_CCC_ACTIVE, /* Initiate the shutdown */
962
- CURLFTPSSL_CCC_LAST /* not an option, never use */
991
+ CURLFTPSSL_CCC_LAST = 3 /* not an option, never use */
963
992
  } curl_ftpccc;
964
993
 
965
994
  /* parameter for the CURLOPT_FTPSSLAUTH option */
995
+ #define CURLFTPAUTH_DEFAULT 0L /* let libcurl decide */
996
+ #define CURLFTPAUTH_SSL 1L /* use "AUTH SSL" */
997
+ #define CURLFTPAUTH_TLS 2L /* use "AUTH TLS" */
998
+
966
999
  typedef enum {
967
- CURLFTPAUTH_DEFAULT, /* let libcurl decide */
968
- CURLFTPAUTH_SSL, /* use "AUTH SSL" */
969
- CURLFTPAUTH_TLS, /* use "AUTH TLS" */
970
- CURLFTPAUTH_LAST /* not an option, never use */
1000
+ CURLFTPAUTH_LAST = 3 /* not an option, never use */
971
1001
  } curl_ftpauth;
972
1002
 
973
1003
  /* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */
1004
+ #define CURLFTP_CREATE_DIR_NONE 0L /* do NOT create missing dirs! */
1005
+ #define CURLFTP_CREATE_DIR 1L /* (FTP/SFTP) if CWD fails, try MKD and
1006
+ then CWD again if MKD succeeded, for
1007
+ SFTP this does similar magic */
1008
+ #define CURLFTP_CREATE_DIR_RETRY 2L /* (FTP only) if CWD fails, try MKD and
1009
+ then CWD again even if MKD failed! */
1010
+
974
1011
  typedef enum {
975
- CURLFTP_CREATE_DIR_NONE, /* do NOT create missing dirs! */
976
- CURLFTP_CREATE_DIR, /* (FTP/SFTP) if CWD fails, try MKD and then CWD
977
- again if MKD succeeded, for SFTP this does
978
- similar magic */
979
- CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD
980
- again even if MKD failed! */
981
- CURLFTP_CREATE_DIR_LAST /* not an option, never use */
1012
+ CURLFTP_CREATE_DIR_LAST = 3 /* not an option, never use */
982
1013
  } curl_ftpcreatedir;
983
1014
 
984
1015
  /* parameter for the CURLOPT_FTP_FILEMETHOD option */
1016
+ #define CURLFTPMETHOD_DEFAULT 0L /* let libcurl pick */
1017
+ #define CURLFTPMETHOD_MULTICWD 1L /* single CWD operation for each path
1018
+ part */
1019
+ #define CURLFTPMETHOD_NOCWD 2L /* no CWD at all */
1020
+ #define CURLFTPMETHOD_SINGLECWD 3L /* one CWD to full dir, then work on file */
1021
+
985
1022
  typedef enum {
986
- CURLFTPMETHOD_DEFAULT, /* let libcurl pick */
987
- CURLFTPMETHOD_MULTICWD, /* single CWD operation for each path part */
988
- CURLFTPMETHOD_NOCWD, /* no CWD at all */
989
- CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */
990
- CURLFTPMETHOD_LAST /* not an option, never use */
1023
+ CURLFTPMETHOD_LAST = 4 /* not an option, never use */
991
1024
  } curl_ftpmethod;
992
1025
 
993
1026
  /* bitmask defines for CURLOPT_HEADEROPT */
994
- #define CURLHEADER_UNIFIED 0
995
- #define CURLHEADER_SEPARATE (1<<0)
1027
+ #define CURLHEADER_UNIFIED 0L
1028
+ #define CURLHEADER_SEPARATE (1L<<0)
996
1029
 
997
1030
  /* CURLALTSVC_* are bits for the CURLOPT_ALTSVC_CTRL option */
998
- #define CURLALTSVC_READONLYFILE (1<<2)
999
- #define CURLALTSVC_H1 (1<<3)
1000
- #define CURLALTSVC_H2 (1<<4)
1001
- #define CURLALTSVC_H3 (1<<5)
1002
-
1031
+ #define CURLALTSVC_READONLYFILE (1L<<2)
1032
+ #define CURLALTSVC_H1 (1L<<3)
1033
+ #define CURLALTSVC_H2 (1L<<4)
1034
+ #define CURLALTSVC_H3 (1L<<5)
1035
+
1036
+ /* bitmask values for CURLOPT_UPLOAD_FLAGS */
1037
+ #define CURLULFLAG_ANSWERED (1L<<0)
1038
+ #define CURLULFLAG_DELETED (1L<<1)
1039
+ #define CURLULFLAG_DRAFT (1L<<2)
1040
+ #define CURLULFLAG_FLAGGED (1L<<3)
1041
+ #define CURLULFLAG_SEEN (1L<<4)
1003
1042
 
1004
1043
  struct curl_hstsentry {
1005
1044
  char *name;
@@ -1028,42 +1067,42 @@ typedef CURLSTScode (*curl_hstswrite_callback)(CURL *easy,
1028
1067
  void *userp);
1029
1068
 
1030
1069
  /* CURLHSTS_* are bits for the CURLOPT_HSTS option */
1031
- #define CURLHSTS_ENABLE (long)(1<<0)
1032
- #define CURLHSTS_READONLYFILE (long)(1<<1)
1070
+ #define CURLHSTS_ENABLE (1L<<0)
1071
+ #define CURLHSTS_READONLYFILE (1L<<1)
1033
1072
 
1034
1073
  /* The CURLPROTO_ defines below are for the **deprecated** CURLOPT_*PROTOCOLS
1035
1074
  options. Do not use. */
1036
- #define CURLPROTO_HTTP (1<<0)
1037
- #define CURLPROTO_HTTPS (1<<1)
1038
- #define CURLPROTO_FTP (1<<2)
1039
- #define CURLPROTO_FTPS (1<<3)
1040
- #define CURLPROTO_SCP (1<<4)
1041
- #define CURLPROTO_SFTP (1<<5)
1042
- #define CURLPROTO_TELNET (1<<6)
1043
- #define CURLPROTO_LDAP (1<<7)
1044
- #define CURLPROTO_LDAPS (1<<8)
1045
- #define CURLPROTO_DICT (1<<9)
1046
- #define CURLPROTO_FILE (1<<10)
1047
- #define CURLPROTO_TFTP (1<<11)
1048
- #define CURLPROTO_IMAP (1<<12)
1049
- #define CURLPROTO_IMAPS (1<<13)
1050
- #define CURLPROTO_POP3 (1<<14)
1051
- #define CURLPROTO_POP3S (1<<15)
1052
- #define CURLPROTO_SMTP (1<<16)
1053
- #define CURLPROTO_SMTPS (1<<17)
1054
- #define CURLPROTO_RTSP (1<<18)
1055
- #define CURLPROTO_RTMP (1<<19)
1056
- #define CURLPROTO_RTMPT (1<<20)
1057
- #define CURLPROTO_RTMPE (1<<21)
1058
- #define CURLPROTO_RTMPTE (1<<22)
1059
- #define CURLPROTO_RTMPS (1<<23)
1060
- #define CURLPROTO_RTMPTS (1<<24)
1061
- #define CURLPROTO_GOPHER (1<<25)
1062
- #define CURLPROTO_SMB (1<<26)
1063
- #define CURLPROTO_SMBS (1<<27)
1064
- #define CURLPROTO_MQTT (1<<28)
1065
- #define CURLPROTO_GOPHERS (1<<29)
1066
- #define CURLPROTO_ALL (~0) /* enable everything */
1075
+ #define CURLPROTO_HTTP (1L<<0)
1076
+ #define CURLPROTO_HTTPS (1L<<1)
1077
+ #define CURLPROTO_FTP (1L<<2)
1078
+ #define CURLPROTO_FTPS (1L<<3)
1079
+ #define CURLPROTO_SCP (1L<<4)
1080
+ #define CURLPROTO_SFTP (1L<<5)
1081
+ #define CURLPROTO_TELNET (1L<<6)
1082
+ #define CURLPROTO_LDAP (1L<<7)
1083
+ #define CURLPROTO_LDAPS (1L<<8)
1084
+ #define CURLPROTO_DICT (1L<<9)
1085
+ #define CURLPROTO_FILE (1L<<10)
1086
+ #define CURLPROTO_TFTP (1L<<11)
1087
+ #define CURLPROTO_IMAP (1L<<12)
1088
+ #define CURLPROTO_IMAPS (1L<<13)
1089
+ #define CURLPROTO_POP3 (1L<<14)
1090
+ #define CURLPROTO_POP3S (1L<<15)
1091
+ #define CURLPROTO_SMTP (1L<<16)
1092
+ #define CURLPROTO_SMTPS (1L<<17)
1093
+ #define CURLPROTO_RTSP (1L<<18)
1094
+ #define CURLPROTO_RTMP (1L<<19)
1095
+ #define CURLPROTO_RTMPT (1L<<20)
1096
+ #define CURLPROTO_RTMPE (1L<<21)
1097
+ #define CURLPROTO_RTMPTE (1L<<22)
1098
+ #define CURLPROTO_RTMPS (1L<<23)
1099
+ #define CURLPROTO_RTMPTS (1L<<24)
1100
+ #define CURLPROTO_GOPHER (1L<<25)
1101
+ #define CURLPROTO_SMB (1L<<26)
1102
+ #define CURLPROTO_SMBS (1L<<27)
1103
+ #define CURLPROTO_MQTT (1L<<28)
1104
+ #define CURLPROTO_GOPHERS (1L<<29)
1105
+ #define CURLPROTO_ALL (~0L) /* enable everything */
1067
1106
 
1068
1107
  /* long may be 32 or 64 bits, but we should never depend on anything else
1069
1108
  but 32 */
@@ -1080,7 +1119,7 @@ typedef CURLSTScode (*curl_hstswrite_callback)(CURL *easy,
1080
1119
  #define CURLOPT(na,t,nu) na = t + nu
1081
1120
  #define CURLOPTDEPRECATED(na,t,nu,v,m) na CURL_DEPRECATED(v,m) = t + nu
1082
1121
 
1083
- /* CURLOPT aliases that make no run-time difference */
1122
+ /* CURLOPT aliases that make no runtime difference */
1084
1123
 
1085
1124
  /* 'char *' argument to a string with a trailing zero */
1086
1125
  #define CURLOPTTYPE_STRINGPOINT CURLOPTTYPE_OBJECTPOINT
@@ -1125,7 +1164,7 @@ typedef enum {
1125
1164
  /* Specified file stream to upload from (use as input): */
1126
1165
  CURLOPT(CURLOPT_READDATA, CURLOPTTYPE_CBPOINT, 9),
1127
1166
 
1128
- /* Buffer to receive error messazsW in, must be at least CURL_ERROR_SIZE
1167
+ /* Buffer to receive error messaGlH in, must be at least CURL_ERROR_SIZE
1129
1168
  * bytes big. */
1130
1169
  CURLOPT(CURLOPT_ERRORBUFFER, CURLOPTTYPE_OBJECTPOINT, 10),
1131
1170
 
@@ -1147,7 +1186,7 @@ typedef enum {
1147
1186
  *
1148
1187
  * For large file support, there is also a _LARGE version of the key
1149
1188
  * which takes an off_t type, allowing platforms with larger off_t
1150
- * sizes to handle larger files. See below for INFILESIZE_LARGE.
1189
+ * sizes to handle larger files. See below for INFILESIZE_LARGE.
1151
1190
  */
1152
1191
  CURLOPT(CURLOPT_INFILESIZE, CURLOPTTYPE_LONG, 14),
1153
1192
 
@@ -1180,7 +1219,7 @@ typedef enum {
1180
1219
  *
1181
1220
  * Note there is also a _LARGE version of this key which uses
1182
1221
  * off_t types, allowing for large file offsets on platforms which
1183
- * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE.
1222
+ * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE.
1184
1223
  */
1185
1224
  CURLOPT(CURLOPT_RESUME_FROM, CURLOPTTYPE_LONG, 21),
1186
1225
 
@@ -1242,8 +1281,7 @@ typedef enum {
1242
1281
  /* send linked-list of post-transfer QUOTE commands */
1243
1282
  CURLOPT(CURLOPT_POSTQUOTE, CURLOPTTYPE_SLISTPOINT, 39),
1244
1283
 
1245
- /* OBSOLETE, do not use! */
1246
- CURLOPT(CURLOPT_OBSOLETE40, CURLOPTTYPE_OBJECTPOINT, 40),
1284
+ /* 40 is not used */
1247
1285
 
1248
1286
  /* talk a lot */
1249
1287
  CURLOPT(CURLOPT_VERBOSE, CURLOPTTYPE_LONG, 41),
@@ -1316,9 +1354,9 @@ typedef enum {
1316
1354
  /* Set the interface string to use as outgoing network interface */
1317
1355
  CURLOPT(CURLOPT_INTERFACE, CURLOPTTYPE_STRINGPOINT, 62),
1318
1356
 
1319
- /* Set the krb4/5 security level, this also enables krb4/5 awareness. This
1320
- * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
1321
- * is set but doesn't match one of these, 'private' will be used. */
1357
+ /* Set the krb4/5 security level, this also enables krb4/5 awareness. This
1358
+ * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
1359
+ * is set but does not match one of these, 'private' will be used. */
1322
1360
  CURLOPT(CURLOPT_KRBLEVEL, CURLOPTTYPE_STRINGPOINT, 63),
1323
1361
 
1324
1362
  /* Set if we should verify the peer in ssl handshake, set 1 to verify. */
@@ -1344,22 +1382,20 @@ typedef enum {
1344
1382
  /* Max amount of cached alive connections */
1345
1383
  CURLOPT(CURLOPT_MAXCONNECTS, CURLOPTTYPE_LONG, 71),
1346
1384
 
1347
- /* OBSOLETE, do not use! */
1348
- CURLOPT(CURLOPT_OBSOLETE72, CURLOPTTYPE_LONG, 72),
1349
-
1385
+ /* 72 = OBSOLETE */
1350
1386
  /* 73 = OBSOLETE */
1351
1387
 
1352
1388
  /* Set to explicitly use a new connection for the upcoming transfer.
1353
- Do not use this unless you're absolutely sure of this, as it makes the
1389
+ Do not use this unless you are absolutely sure of this, as it makes the
1354
1390
  operation slower and is less friendly for the network. */
1355
1391
  CURLOPT(CURLOPT_FRESH_CONNECT, CURLOPTTYPE_LONG, 74),
1356
1392
 
1357
1393
  /* Set to explicitly forbid the upcoming transfer's connection to be reused
1358
- when done. Do not use this unless you're absolutely sure of this, as it
1394
+ when done. Do not use this unless you are absolutely sure of this, as it
1359
1395
  makes the operation slower and is less friendly for the network. */
1360
1396
  CURLOPT(CURLOPT_FORBID_REUSE, CURLOPTTYPE_LONG, 75),
1361
1397
 
1362
- /* Set to a file name that contains random data for libcurl to use to
1398
+ /* Set to a filename that contains random data for libcurl to use to
1363
1399
  seed the random engine when doing SSL connects. */
1364
1400
  CURLOPTDEPRECATED(CURLOPT_RANDOM_FILE, CURLOPTTYPE_STRINGPOINT, 76,
1365
1401
  7.84.0, "Serves no purpose anymore"),
@@ -1386,11 +1422,11 @@ typedef enum {
1386
1422
  * provided hostname. */
1387
1423
  CURLOPT(CURLOPT_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 81),
1388
1424
 
1389
- /* Specify which file name to write all known cookies in after completed
1390
- operation. Set file name to "-" (dash) to make it go to stdout. */
1425
+ /* Specify which filename to write all known cookies in after completed
1426
+ operation. Set filename to "-" (dash) to make it go to stdout. */
1391
1427
  CURLOPT(CURLOPT_COOKIEJAR, CURLOPTTYPE_STRINGPOINT, 82),
1392
1428
 
1393
- /* Specify which SSL ciphers to use */
1429
+ /* Specify which TLS 1.2 (1.1, 1.0) ciphers to use */
1394
1430
  CURLOPT(CURLOPT_SSL_CIPHER_LIST, CURLOPTTYPE_STRINGPOINT, 83),
1395
1431
 
1396
1432
  /* Specify which HTTP version to use! This must be set to one of the
@@ -1486,7 +1522,7 @@ typedef enum {
1486
1522
  CURLOPT(CURLOPT_HTTPAUTH, CURLOPTTYPE_VALUES, 107),
1487
1523
 
1488
1524
  /* Set the ssl context callback function, currently only for OpenSSL or
1489
- WolfSSL ssl_ctx, or mbedTLS mbedtls_ssl_config in the second argument.
1525
+ wolfSSL ssl_ctx, or mbedTLS mbedtls_ssl_config in the second argument.
1490
1526
  The function must match the curl_ssl_ctx_callback prototype. */
1491
1527
  CURLOPT(CURLOPT_SSL_CTX_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 108),
1492
1528
 
@@ -1505,8 +1541,8 @@ typedef enum {
1505
1541
  Note that setting multiple bits may cause extra network round-trips. */
1506
1542
  CURLOPT(CURLOPT_PROXYAUTH, CURLOPTTYPE_VALUES, 111),
1507
1543
 
1508
- /* Option that chanzsW the timeout, in seconds, associated with getting a
1509
- response. This is different from transfer timeout time and essentially
1544
+ /* Option that chanGlH the timeout, in seconds, associated with getting a
1545
+ response. This is different from transfer timeout time and essentially
1510
1546
  places a demand on the server to acknowledge commands in a timely
1511
1547
  manner. For FTP, SMTP, IMAP and POP3. */
1512
1548
  CURLOPT(CURLOPT_SERVER_RESPONSE_TIMEOUT, CURLOPTTYPE_LONG, 112),
@@ -1520,7 +1556,7 @@ typedef enum {
1520
1556
  an HTTP or FTP server.
1521
1557
 
1522
1558
  Note there is also _LARGE version which adds large file support for
1523
- platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */
1559
+ platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */
1524
1560
  CURLOPT(CURLOPT_MAXFILESIZE, CURLOPTTYPE_LONG, 114),
1525
1561
 
1526
1562
  /* See the comment for INFILESIZE above, but in short, specifies
@@ -1528,17 +1564,17 @@ typedef enum {
1528
1564
  */
1529
1565
  CURLOPT(CURLOPT_INFILESIZE_LARGE, CURLOPTTYPE_OFF_T, 115),
1530
1566
 
1531
- /* Sets the continuation offset. There is also a CURLOPTTYPE_LONG version
1567
+ /* Sets the continuation offset. There is also a CURLOPTTYPE_LONG version
1532
1568
  * of this; look above for RESUME_FROM.
1533
1569
  */
1534
1570
  CURLOPT(CURLOPT_RESUME_FROM_LARGE, CURLOPTTYPE_OFF_T, 116),
1535
1571
 
1536
1572
  /* Sets the maximum size of data that will be downloaded from
1537
- * an HTTP or FTP server. See MAXFILESIZE above for the LONG version.
1573
+ * an HTTP or FTP server. See MAXFILESIZE above for the LONG version.
1538
1574
  */
1539
1575
  CURLOPT(CURLOPT_MAXFILESIZE_LARGE, CURLOPTTYPE_OFF_T, 117),
1540
1576
 
1541
- /* Set this option to the file name of your .netrc file you want libcurl
1577
+ /* Set this option to the filename of your .netrc file you want libcurl
1542
1578
  to parse (using the CURLOPT_NETRC option). If not set, libcurl will do
1543
1579
  a poor attempt to find the user's home directory and check for a .netrc
1544
1580
  file in there. */
@@ -1685,7 +1721,7 @@ typedef enum {
1685
1721
 
1686
1722
  /* Callback function for opening socket (instead of socket(2)). Optionally,
1687
1723
  callback is able change the address or refuse to connect returning
1688
- CURL_SOCKET_BAD. The callback should have type
1724
+ CURL_SOCKET_BAD. The callback should have type
1689
1725
  curl_opensocket_callback */
1690
1726
  CURLOPT(CURLOPT_OPENSOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 163),
1691
1727
  CURLOPT(CURLOPT_OPENSOCKETDATA, CURLOPTTYPE_CBPOINT, 164),
@@ -1755,7 +1791,7 @@ typedef enum {
1755
1791
  CURLOPTDEPRECATED(CURLOPT_REDIR_PROTOCOLS, CURLOPTTYPE_LONG, 182,
1756
1792
  7.85.0, "Use CURLOPT_REDIR_PROTOCOLS_STR"),
1757
1793
 
1758
- /* set the SSH knownhost file name to use */
1794
+ /* set the SSH knownhost filename to use */
1759
1795
  CURLOPT(CURLOPT_SSH_KNOWNHOSTS, CURLOPTTYPE_STRINGPOINT, 183),
1760
1796
 
1761
1797
  /* set the SSH host key callback, must point to a curl_sshkeycallback
@@ -1836,7 +1872,7 @@ typedef enum {
1836
1872
  future libcurl release.
1837
1873
 
1838
1874
  libcurl will ask for the compressed methods it knows of, and if that
1839
- isn't any, it will not ask for transfer-encoding at all even if this
1875
+ is not any, it will not ask for transfer-encoding at all even if this
1840
1876
  option is set to 1.
1841
1877
 
1842
1878
  */
@@ -1927,7 +1963,8 @@ typedef enum {
1927
1963
  CURLOPT(CURLOPT_SSL_VERIFYSTATUS, CURLOPTTYPE_LONG, 232),
1928
1964
 
1929
1965
  /* Set if we should enable TLS false start. */
1930
- CURLOPT(CURLOPT_SSL_FALSESTART, CURLOPTTYPE_LONG, 233),
1966
+ CURLOPTDEPRECATED(CURLOPT_SSL_FALSESTART, CURLOPTTYPE_LONG, 233,
1967
+ 8.15.0, "Has no function"),
1931
1968
 
1932
1969
  /* Do not squash dot-dot sequences */
1933
1970
  CURLOPT(CURLOPT_PATH_AS_IS, CURLOPTTYPE_LONG, 234),
@@ -1938,7 +1975,7 @@ typedef enum {
1938
1975
  /* Service Name */
1939
1976
  CURLOPT(CURLOPT_SERVICE_NAME, CURLOPTTYPE_STRINGPOINT, 236),
1940
1977
 
1941
- /* Wait/don't wait for pipe/mutex to clarify */
1978
+ /* Wait/do not wait for pipe/mutex to clarify */
1942
1979
  CURLOPT(CURLOPT_PIPEWAIT, CURLOPTTYPE_LONG, 237),
1943
1980
 
1944
1981
  /* Set the protocol used when curl is given a URL without a protocol */
@@ -1947,10 +1984,10 @@ typedef enum {
1947
1984
  /* Set stream weight, 1 - 256 (default is 16) */
1948
1985
  CURLOPT(CURLOPT_STREAM_WEIGHT, CURLOPTTYPE_LONG, 239),
1949
1986
 
1950
- /* Set stream dependency on another CURL handle */
1987
+ /* Set stream dependency on another curl handle */
1951
1988
  CURLOPT(CURLOPT_STREAM_DEPENDS, CURLOPTTYPE_OBJECTPOINT, 240),
1952
1989
 
1953
- /* Set E-xclusive stream dependency on another CURL handle */
1990
+ /* Set E-xclusive stream dependency on another curl handle */
1954
1991
  CURLOPT(CURLOPT_STREAM_DEPENDS_E, CURLOPTTYPE_OBJECTPOINT, 241),
1955
1992
 
1956
1993
  /* Do not send any tftp option requests to the server */
@@ -2014,7 +2051,7 @@ typedef enum {
2014
2051
  /* password for the SSL private key for proxy */
2015
2052
  CURLOPT(CURLOPT_PROXY_KEYPASSWD, CURLOPTTYPE_STRINGPOINT, 258),
2016
2053
 
2017
- /* Specify which SSL ciphers to use for proxy */
2054
+ /* Specify which TLS 1.2 (1.1, 1.0) ciphers to use for proxy */
2018
2055
  CURLOPT(CURLOPT_PROXY_SSL_CIPHER_LIST, CURLOPTTYPE_STRINGPOINT, 259),
2019
2056
 
2020
2057
  /* CRL file for proxy */
@@ -2099,7 +2136,7 @@ typedef enum {
2099
2136
  /* alt-svc control bitmask */
2100
2137
  CURLOPT(CURLOPT_ALTSVC_CTRL, CURLOPTTYPE_LONG, 286),
2101
2138
 
2102
- /* alt-svc cache file name to possibly read from/write to */
2139
+ /* alt-svc cache filename to possibly read from/write to */
2103
2140
  CURLOPT(CURLOPT_ALTSVC, CURLOPTTYPE_STRINGPOINT, 287),
2104
2141
 
2105
2142
  /* maximum age (idle time) of a connection to consider it for reuse
@@ -2125,13 +2162,13 @@ typedef enum {
2125
2162
 
2126
2163
  /* the EC curves requested by the TLS client (RFC 8422, 5.1);
2127
2164
  * OpenSSL support via 'set_groups'/'set_curves':
2128
- * https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_groups.html
2165
+ * https://docs.openssl.org/master/man3/SSL_CTX_set1_curves/
2129
2166
  */
2130
2167
  CURLOPT(CURLOPT_SSL_EC_CURVES, CURLOPTTYPE_STRINGPOINT, 298),
2131
2168
 
2132
2169
  /* HSTS bitmask */
2133
2170
  CURLOPT(CURLOPT_HSTS_CTRL, CURLOPTTYPE_LONG, 299),
2134
- /* HSTS file name */
2171
+ /* HSTS filename */
2135
2172
  CURLOPT(CURLOPT_HSTS, CURLOPTTYPE_STRINGPOINT, 300),
2136
2173
 
2137
2174
  /* HSTS read callback */
@@ -2195,7 +2232,7 @@ typedef enum {
2195
2232
  /* specify which protocols that libcurl is allowed to follow directs to */
2196
2233
  CURLOPT(CURLOPT_REDIR_PROTOCOLS_STR, CURLOPTTYPE_STRINGPOINT, 319),
2197
2234
 
2198
- /* websockets options */
2235
+ /* WebSockets options */
2199
2236
  CURLOPT(CURLOPT_WS_OPTIONS, CURLOPTTYPE_LONG, 320),
2200
2237
 
2201
2238
  /* CA cache timeout */
@@ -2210,9 +2247,17 @@ typedef enum {
2210
2247
  /* millisecond version */
2211
2248
  CURLOPT(CURLOPT_SERVER_RESPONSE_TIMEOUT_MS, CURLOPTTYPE_LONG, 324),
2212
2249
 
2213
- /* set ECH configuration */
2250
+ /* set ECH configuration */
2214
2251
  CURLOPT(CURLOPT_ECH, CURLOPTTYPE_STRINGPOINT, 325),
2215
2252
 
2253
+ /* maximum number of keepalive probes (Linux, *BSD, macOS, etc.) */
2254
+ CURLOPT(CURLOPT_TCP_KEEPCNT, CURLOPTTYPE_LONG, 326),
2255
+
2256
+ CURLOPT(CURLOPT_UPLOAD_FLAGS, CURLOPTTYPE_LONG, 327),
2257
+
2258
+ /* set TLS supported signature algorithms */
2259
+ CURLOPT(CURLOPT_SSL_SIGNATURE_ALGORITHMS, CURLOPTTYPE_STRINGPOINT, 328),
2260
+
2216
2261
  CURLOPT_LASTENTRY /* the last unused */
2217
2262
  } CURLoption;
2218
2263
 
@@ -2253,34 +2298,33 @@ typedef enum {
2253
2298
  /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host
2254
2299
  name resolves addresses using more than one IP protocol version, this
2255
2300
  option might be handy to force libcurl to use a specific IP version. */
2256
- #define CURL_IPRESOLVE_WHATEVER 0 /* default, uses addresses to all IP
2301
+ #define CURL_IPRESOLVE_WHATEVER 0L /* default, uses addresses to all IP
2257
2302
  versions that your system allows */
2258
- #define CURL_IPRESOLVE_V4 1 /* uses only IPv4 addresses/connections */
2259
- #define CURL_IPRESOLVE_V6 2 /* uses only IPv6 addresses/connections */
2303
+ #define CURL_IPRESOLVE_V4 1L /* uses only IPv4 addresses/connections */
2304
+ #define CURL_IPRESOLVE_V6 2L /* uses only IPv6 addresses/connections */
2260
2305
 
2261
2306
  /* Convenient "aliases" */
2262
2307
  #define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER
2263
2308
 
2264
- /* These enums are for use with the CURLOPT_HTTP_VERSION option. */
2265
- enum {
2266
- CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd
2267
- like the library to choose the best possible
2268
- for us! */
2269
- CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */
2270
- CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */
2271
- CURL_HTTP_VERSION_2_0, /* please use HTTP 2 in the request */
2272
- CURL_HTTP_VERSION_2TLS, /* use version 2 for HTTPS, version 1.1 for HTTP */
2273
- CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE, /* please use HTTP 2 without HTTP/1.1
2274
- Upgrade */
2275
- CURL_HTTP_VERSION_3 = 30, /* Use HTTP/3, fallback to HTTP/2 or HTTP/1 if
2276
- needed. For HTTPS only. For HTTP, this option
2277
- makes libcurl return error. */
2278
- CURL_HTTP_VERSION_3ONLY = 31, /* Use HTTP/3 without fallback. For HTTPS
2279
- only. For HTTP, this makes libcurl
2280
- return error. */
2281
-
2282
- CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
2283
- };
2309
+ /* These constants are for use with the CURLOPT_HTTP_VERSION option. */
2310
+ #define CURL_HTTP_VERSION_NONE 0L /* setting this means we do not care, and
2311
+ that we would like the library to choose
2312
+ the best possible for us! */
2313
+ #define CURL_HTTP_VERSION_1_0 1L /* please use HTTP 1.0 in the request */
2314
+ #define CURL_HTTP_VERSION_1_1 2L /* please use HTTP 1.1 in the request */
2315
+ #define CURL_HTTP_VERSION_2_0 3L /* please use HTTP 2 in the request */
2316
+ #define CURL_HTTP_VERSION_2TLS 4L /* use version 2 for HTTPS, version 1.1 for
2317
+ HTTP */
2318
+ #define CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE 5L /* please use HTTP 2 without
2319
+ HTTP/1.1 Upgrade */
2320
+ #define CURL_HTTP_VERSION_3 30L /* Use HTTP/3, fallback to HTTP/2 or
2321
+ HTTP/1 if needed. For HTTPS only. For
2322
+ HTTP, this option makes libcurl
2323
+ return error. */
2324
+ #define CURL_HTTP_VERSION_3ONLY 31L /* Use HTTP/3 without fallback. For
2325
+ HTTPS only. For HTTP, this makes
2326
+ libcurl return error. */
2327
+ #define CURL_HTTP_VERSION_LAST 32L /* *ILLEGAL* http version */
2284
2328
 
2285
2329
  /* Convenience definition simple because the name of the version is HTTP/2 and
2286
2330
  not 2.0. The 2_0 version of the enum name was set while the version was
@@ -2290,46 +2334,47 @@ enum {
2290
2334
  /*
2291
2335
  * Public API enums for RTSP requests
2292
2336
  */
2293
- enum {
2294
- CURL_RTSPREQ_NONE, /* first in list */
2295
- CURL_RTSPREQ_OPTIONS,
2296
- CURL_RTSPREQ_DESCRIBE,
2297
- CURL_RTSPREQ_ANNOUNCE,
2298
- CURL_RTSPREQ_SETUP,
2299
- CURL_RTSPREQ_PLAY,
2300
- CURL_RTSPREQ_PAUSE,
2301
- CURL_RTSPREQ_TEARDOWN,
2302
- CURL_RTSPREQ_GET_PARAMETER,
2303
- CURL_RTSPREQ_SET_PARAMETER,
2304
- CURL_RTSPREQ_RECORD,
2305
- CURL_RTSPREQ_RECEIVE,
2306
- CURL_RTSPREQ_LAST /* last in list */
2307
- };
2337
+
2338
+ #define CURL_RTSPREQ_NONE 0L
2339
+ #define CURL_RTSPREQ_OPTIONS 1L
2340
+ #define CURL_RTSPREQ_DESCRIBE 2L
2341
+ #define CURL_RTSPREQ_ANNOUNCE 3L
2342
+ #define CURL_RTSPREQ_SETUP 4L
2343
+ #define CURL_RTSPREQ_PLAY 5L
2344
+ #define CURL_RTSPREQ_PAUSE 6L
2345
+ #define CURL_RTSPREQ_TEARDOWN 7L
2346
+ #define CURL_RTSPREQ_GET_PARAMETER 8L
2347
+ #define CURL_RTSPREQ_SET_PARAMETER 9L
2348
+ #define CURL_RTSPREQ_RECORD 10L
2349
+ #define CURL_RTSPREQ_RECEIVE 11L
2350
+ #define CURL_RTSPREQ_LAST 12L /* not used */
2308
2351
 
2309
2352
  /* These enums are for use with the CURLOPT_NETRC option. */
2353
+ #define CURL_NETRC_IGNORED 0L /* The .netrc will never be read.
2354
+ This is the default. */
2355
+ #define CURL_NETRC_OPTIONAL 1L /* A user:password in the URL will be preferred
2356
+ to one in the .netrc. */
2357
+ #define CURL_NETRC_REQUIRED 2L /* A user:password in the URL will be ignored.
2358
+ Unless one is set programmatically, the
2359
+ .netrc will be queried. */
2310
2360
  enum CURL_NETRC_OPTION {
2311
- CURL_NETRC_IGNORED, /* The .netrc will never be read.
2312
- * This is the default. */
2313
- CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred
2314
- * to one in the .netrc. */
2315
- CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored.
2316
- * Unless one is set programmatically, the .netrc
2317
- * will be queried. */
2318
- CURL_NETRC_LAST
2361
+ /* we set a single member here, just to make sure we still provide the enum,
2362
+ but the values to use are defined above with L suffixes */
2363
+ CURL_NETRC_LAST = 3
2319
2364
  };
2320
2365
 
2321
- #define CURL_SSLVERSION_DEFAULT 0
2322
- #define CURL_SSLVERSION_TLSv1 1 /* TLS 1.x */
2323
- #define CURL_SSLVERSION_SSLv2 2
2324
- #define CURL_SSLVERSION_SSLv3 3
2325
- #define CURL_SSLVERSION_TLSv1_0 4
2326
- #define CURL_SSLVERSION_TLSv1_1 5
2327
- #define CURL_SSLVERSION_TLSv1_2 6
2328
- #define CURL_SSLVERSION_TLSv1_3 7
2366
+ #define CURL_SSLVERSION_DEFAULT 0L
2367
+ #define CURL_SSLVERSION_TLSv1 1L /* TLS 1.x */
2368
+ #define CURL_SSLVERSION_SSLv2 2L
2369
+ #define CURL_SSLVERSION_SSLv3 3L
2370
+ #define CURL_SSLVERSION_TLSv1_0 4L
2371
+ #define CURL_SSLVERSION_TLSv1_1 5L
2372
+ #define CURL_SSLVERSION_TLSv1_2 6L
2373
+ #define CURL_SSLVERSION_TLSv1_3 7L
2329
2374
 
2330
- #define CURL_SSLVERSION_LAST 8 /* never use, keep last */
2375
+ #define CURL_SSLVERSION_LAST 8L /* never use, keep last */
2331
2376
 
2332
- #define CURL_SSLVERSION_MAX_NONE 0
2377
+ #define CURL_SSLVERSION_MAX_NONE 0L
2333
2378
  #define CURL_SSLVERSION_MAX_DEFAULT (CURL_SSLVERSION_TLSv1 << 16)
2334
2379
  #define CURL_SSLVERSION_MAX_TLSv1_0 (CURL_SSLVERSION_TLSv1_0 << 16)
2335
2380
  #define CURL_SSLVERSION_MAX_TLSv1_1 (CURL_SSLVERSION_TLSv1_1 << 16)
@@ -2339,10 +2384,13 @@ enum CURL_NETRC_OPTION {
2339
2384
  /* never use, keep last */
2340
2385
  #define CURL_SSLVERSION_MAX_LAST (CURL_SSLVERSION_LAST << 16)
2341
2386
 
2387
+ #define CURL_TLSAUTH_NONE 0L
2388
+ #define CURL_TLSAUTH_SRP 1L
2389
+
2342
2390
  enum CURL_TLSAUTH {
2343
- CURL_TLSAUTH_NONE,
2344
- CURL_TLSAUTH_SRP,
2345
- CURL_TLSAUTH_LAST /* never use, keep last */
2391
+ /* we set a single member here, just to make sure we still provide the enum,
2392
+ but the values to use are defined above with L suffixes */
2393
+ CURL_TLSAUTH_LAST = 2
2346
2394
  };
2347
2395
 
2348
2396
  /* symbols to use with CURLOPT_POSTREDIR.
@@ -2350,21 +2398,23 @@ enum CURL_TLSAUTH {
2350
2398
  can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302
2351
2399
  | CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */
2352
2400
 
2353
- #define CURL_REDIR_GET_ALL 0
2354
- #define CURL_REDIR_POST_301 1
2355
- #define CURL_REDIR_POST_302 2
2356
- #define CURL_REDIR_POST_303 4
2401
+ #define CURL_REDIR_GET_ALL 0L
2402
+ #define CURL_REDIR_POST_301 1L
2403
+ #define CURL_REDIR_POST_302 2L
2404
+ #define CURL_REDIR_POST_303 4L
2357
2405
  #define CURL_REDIR_POST_ALL \
2358
2406
  (CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303)
2359
2407
 
2360
- typedef enum {
2361
- CURL_TIMECOND_NONE,
2362
-
2363
- CURL_TIMECOND_IFMODSINCE,
2364
- CURL_TIMECOND_IFUNMODSINCE,
2365
- CURL_TIMECOND_LASTMOD,
2408
+ #define CURL_TIMECOND_NONE 0L
2409
+ #define CURL_TIMECOND_IFMODSINCE 1L
2410
+ #define CURL_TIMECOND_IFUNMODSINCE 2L
2411
+ #define CURL_TIMECOND_LASTMOD 3L
2366
2412
 
2367
- CURL_TIMECOND_LAST
2413
+ typedef enum {
2414
+ /* we set a single member here, just to make sure we still provide
2415
+ the enum typedef, but the values to use are defined above with L
2416
+ suffixes */
2417
+ CURL_TIMECOND_LAST = 4
2368
2418
  } curl_TimeCond;
2369
2419
 
2370
2420
  /* Special size_t value signaling a null-terminated string. */
@@ -2380,7 +2430,7 @@ typedef struct curl_mime curl_mime; /* Mime context. */
2380
2430
  typedef struct curl_mimepart curl_mimepart; /* Mime part context. */
2381
2431
 
2382
2432
  /* CURLMIMEOPT_ defines are for the CURLOPT_MIME_OPTIONS option. */
2383
- #define CURLMIMEOPT_FORMESCAPE (1<<0) /* Use backslash-escaping for forms. */
2433
+ #define CURLMIMEOPT_FORMESCAPE (1L<<0) /* Use backslash-escaping for forms. */
2384
2434
 
2385
2435
  /*
2386
2436
  * NAME curl_mime_init()
@@ -2425,7 +2475,7 @@ CURL_EXTERN CURLcode curl_mime_name(curl_mimepart *part, const char *name);
2425
2475
  *
2426
2476
  * DESCRIPTION
2427
2477
  *
2428
- * Set mime part remote file name.
2478
+ * Set mime part remote filename.
2429
2479
  */
2430
2480
  CURL_EXTERN CURLcode curl_mime_filename(curl_mimepart *part,
2431
2481
  const char *filename);
@@ -2634,7 +2684,7 @@ CURL_EXTERN char *curl_getenv(const char *variable);
2634
2684
  *
2635
2685
  * DESCRIPTION
2636
2686
  *
2637
- * Returns a static ascii string of the libcurl version.
2687
+ * Returns a static ASCII string of the libcurl version.
2638
2688
  */
2639
2689
  CURL_EXTERN char *curl_version(void);
2640
2690
 
@@ -2706,10 +2756,10 @@ CURL_EXTERN CURLcode curl_global_init(long flags);
2706
2756
  * DESCRIPTION
2707
2757
  *
2708
2758
  * curl_global_init() or curl_global_init_mem() should be invoked exactly once
2709
- * for each application that uses libcurl. This function can be used to
2759
+ * for each application that uses libcurl. This function can be used to
2710
2760
  * initialize libcurl and set user defined memory management callback
2711
- * functions. Users can implement memory management routines to check for
2712
- * memory leaks, check for mis-use of the curl library etc. User registered
2761
+ * functions. Users can implement memory management routines to check for
2762
+ * memory leaks, check for misuse of the curl library etc. User registered
2713
2763
  * callback routines will be invoked by this library instead of the system
2714
2764
  * memory management routines like malloc, free etc.
2715
2765
  */
@@ -2760,17 +2810,17 @@ struct curl_slist {
2760
2810
  * *before* curl_global_init().
2761
2811
  *
2762
2812
  * The backend can be identified by the id (e.g. CURLSSLBACKEND_OPENSSL). The
2763
- * backend can also be specified via the name parameter (passing -1 as id).
2764
- * If both id and name are specified, the name will be ignored. If neither id
2765
- * nor name are specified, the function will fail with
2766
- * CURLSSLSET_UNKNOWN_BACKEND and set the "avail" pointer to the
2767
- * NULL-terminated list of available backends.
2813
+ * backend can also be specified via the name parameter (passing -1 as id). If
2814
+ * both id and name are specified, the name will be ignored. If neither id nor
2815
+ * name are specified, the function will fail with CURLSSLSET_UNKNOWN_BACKEND
2816
+ * and set the "avail" pointer to the NULL-terminated list of available
2817
+ * backends.
2768
2818
  *
2769
2819
  * Upon success, the function returns CURLSSLSET_OK.
2770
2820
  *
2771
2821
  * If the specified SSL backend is not available, the function returns
2772
- * CURLSSLSET_UNKNOWN_BACKEND and sets the "avail" pointer to a NULL-terminated
2773
- * list of available SSL backends.
2822
+ * CURLSSLSET_UNKNOWN_BACKEND and sets the "avail" pointer to a
2823
+ * NULL-terminated list of available SSL backends.
2774
2824
  *
2775
2825
  * The SSL backend can be set only once. If it has already been set, a
2776
2826
  * subsequent attempt to change it will result in a CURLSSLSET_TOO_LATE.
@@ -2827,7 +2877,7 @@ CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused);
2827
2877
  for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */
2828
2878
  struct curl_certinfo {
2829
2879
  int num_of_certs; /* number of certificates with information */
2830
- struct curl_slist **certinfo; /* for each index in this array, there's a
2880
+ struct curl_slist **certinfo; /* for each index in this array, there is a
2831
2881
  linked list with textual information for a
2832
2882
  certificate in the format "name:content".
2833
2883
  eg "Subject:foo", "Issuer:bar", etc. */
@@ -2942,7 +2992,11 @@ typedef enum {
2942
2992
  CURLINFO_CONN_ID = CURLINFO_OFF_T + 64,
2943
2993
  CURLINFO_QUEUE_TIME_T = CURLINFO_OFF_T + 65,
2944
2994
  CURLINFO_USED_PROXY = CURLINFO_LONG + 66,
2945
- CURLINFO_LASTONE = 66
2995
+ CURLINFO_POSTTRANSFER_TIME_T = CURLINFO_OFF_T + 67,
2996
+ CURLINFO_EARLYDATA_SENT_T = CURLINFO_OFF_T + 68,
2997
+ CURLINFO_HTTPAUTH_USED = CURLINFO_LONG + 69,
2998
+ CURLINFO_PROXYAUTH_USED = CURLINFO_LONG + 70,
2999
+ CURLINFO_LASTONE = 70
2946
3000
  } CURLINFO;
2947
3001
 
2948
3002
  /* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
@@ -3018,7 +3072,7 @@ typedef enum {
3018
3072
  } CURLSHcode;
3019
3073
 
3020
3074
  typedef enum {
3021
- CURLSHOPT_NONE, /* don't use */
3075
+ CURLSHOPT_NONE, /* do not use */
3022
3076
  CURLSHOPT_SHARE, /* specify a data type to share */
3023
3077
  CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */
3024
3078
  CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */
@@ -3056,7 +3110,7 @@ typedef enum {
3056
3110
  /* The 'CURLVERSION_NOW' is the symbolic name meant to be used by
3057
3111
  basically all programs ever that want to get version information. It is
3058
3112
  meant to be a built-in version number for what kind of struct the caller
3059
- expects. If the struct ever chanzsW, we redefine the NOW to another enum
3113
+ expects. If the struct ever chanGlH, we redefine the NOW to another enum
3060
3114
  from above. */
3061
3115
  #define CURLVERSION_NOW CURLVERSION_TWELFTH
3062
3116
 
@@ -3177,8 +3231,8 @@ CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion);
3177
3231
  * DESCRIPTION
3178
3232
  *
3179
3233
  * The curl_easy_strerror function may be used to turn a CURLcode value
3180
- * into the equivalent human readable error string. This is useful
3181
- * for printing meaningful error messazsW.
3234
+ * into the equivalent human readable error string. This is useful
3235
+ * for printing meaningful error messaGlH.
3182
3236
  */
3183
3237
  CURL_EXTERN const char *curl_easy_strerror(CURLcode);
3184
3238
 
@@ -3188,8 +3242,8 @@ CURL_EXTERN const char *curl_easy_strerror(CURLcode);
3188
3242
  * DESCRIPTION
3189
3243
  *
3190
3244
  * The curl_share_strerror function may be used to turn a CURLSHcode value
3191
- * into the equivalent human readable error string. This is useful
3192
- * for printing meaningful error messazsW.
3245
+ * into the equivalent human readable error string. This is useful
3246
+ * for printing meaningful error messaGlH.
3193
3247
  */
3194
3248
  CURL_EXTERN const char *curl_share_strerror(CURLSHcode);
3195
3249
 
@@ -3213,7 +3267,51 @@ CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
3213
3267
  #define CURLPAUSE_ALL (CURLPAUSE_RECV|CURLPAUSE_SEND)
3214
3268
  #define CURLPAUSE_CONT (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT)
3215
3269
 
3216
- #ifdef __cplusplus
3270
+ /*
3271
+ * NAME curl_easy_ssls_import()
3272
+ *
3273
+ * DESCRIPTION
3274
+ *
3275
+ * The curl_easy_ssls_import function adds a previously exported SSL session
3276
+ * to the SSL session cache of the easy handle (or the underlying share).
3277
+ */
3278
+ CURL_EXTERN CURLcode curl_easy_ssls_import(CURL *handle,
3279
+ const char *session_key,
3280
+ const unsigned char *shmac,
3281
+ size_t shmac_len,
3282
+ const unsigned char *sdata,
3283
+ size_t sdata_len);
3284
+
3285
+ /* This is the curl_ssls_export_cb callback prototype. It
3286
+ * is passed to curl_easy_ssls_export() to extract SSL sessions/tickets. */
3287
+ typedef CURLcode curl_ssls_export_cb(CURL *handle,
3288
+ void *userptr,
3289
+ const char *session_key,
3290
+ const unsigned char *shmac,
3291
+ size_t shmac_len,
3292
+ const unsigned char *sdata,
3293
+ size_t sdata_len,
3294
+ curl_off_t valid_until,
3295
+ int ietf_tls_id,
3296
+ const char *alpn,
3297
+ size_t earlydata_max);
3298
+
3299
+ /*
3300
+ * NAME curl_easy_ssls_export()
3301
+ *
3302
+ * DESCRIPTION
3303
+ *
3304
+ * The curl_easy_ssls_export function iterates over all SSL sessions stored
3305
+ * in the easy handle (or underlying share) and invokes the passed
3306
+ * callback.
3307
+ *
3308
+ */
3309
+ CURL_EXTERN CURLcode curl_easy_ssls_export(CURL *handle,
3310
+ curl_ssls_export_cb *export_fn,
3311
+ void *userptr);
3312
+
3313
+
3314
+ #ifdef __cplusplus
3217
3315
  } /* end of extern "C" */
3218
3316
  #endif
3219
3317
 
@@ -3227,9 +3325,10 @@ CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
3227
3325
  #include "websockets.h"
3228
3326
  #include "mprintf.h"
3229
3327
 
3230
- /* the typechecker doesn't work in C++ (yet) */
3231
- #if defined(__GNUC__) && defined(__GNUC_MINOR__) && \
3232
- ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \
3328
+ /* the typechecker does not work in C++ (yet) */
3329
+ #if ((defined(__GNUC__) && defined(__GNUC_MINOR__) && \
3330
+ ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) || \
3331
+ (defined(__clang__) && __clang_major__ >= 14)) && \
3233
3332
  !defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK)
3234
3333
  #include "typecheck-gcc.h"
3235
3334
  #else