freerasp-react-native 5.3.0 → 6.1.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 (153) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/README.md +2 -0
  3. package/android/build.gradle +3 -3
  4. package/android/proguard-rules.pro +3 -3
  5. package/android/src/main/AndroidManifest.xml +1 -1
  6. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/FreeraspReactNativeModule.kt +177 -17
  7. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/FreeraspReactNativePackage.kt +1 -1
  8. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/PluginThreatHandler.kt +20 -7
  9. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/ScreenProtector.kt +1 -1
  10. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/dispatchers/ExecutionStateDispatcher.kt +3 -3
  11. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/dispatchers/ThreatDispatcher.kt +23 -3
  12. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/events/BaseRaspEvent.kt +1 -1
  13. package/android/src/main/java/app/talsec/rasp/reactnative/events/RaspExecutionStateEvent.kt +22 -0
  14. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/events/ThreatEvent.kt +6 -3
  15. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/exceptions/TalsecException.kt +1 -1
  16. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/interfaces/PluginExecutionStateListener.kt +2 -2
  17. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/interfaces/PluginThreatListener.kt +4 -2
  18. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/models/RNSuspiciousAppInfo.kt +1 -1
  19. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/utils/Extensions.kt +4 -4
  20. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/utils/RandomGenerator.kt +1 -1
  21. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/utils/Utils.kt +1 -1
  22. package/ios/FreeraspReactNative.swift +17 -8
  23. package/ios/TalsecRuntime.xcframework/_CodeSignature/CodeDirectory +0 -0
  24. package/ios/TalsecRuntime.xcframework/_CodeSignature/CodeResources +88 -88
  25. package/ios/TalsecRuntime.xcframework/_CodeSignature/CodeSignature +0 -0
  26. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CurlWrapper.h +1 -1
  27. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +2 -2
  28. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curl.h +292 -265
  29. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curlver.h +10 -11
  30. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/easy.h +4 -6
  31. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/header.h +9 -9
  32. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/multi.h +147 -112
  33. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/options.h +1 -1
  34. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/system.h +14 -23
  35. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/typecheck-gcc.h +420 -403
  36. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +29 -28
  37. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/websockets.h +10 -10
  38. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Info.plist +0 -0
  39. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.abi.json +563 -312
  40. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.private.swiftinterface +10 -3
  41. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  42. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +10 -3
  43. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
  44. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/_CodeSignature/CodeResources +35 -35
  45. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/cacert.pem +483 -1088
  46. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CurlWrapper.h +1 -1
  47. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +4 -4
  48. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +292 -265
  49. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curlver.h +10 -11
  50. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/easy.h +4 -6
  51. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/header.h +9 -9
  52. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +147 -112
  53. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +1 -1
  54. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/system.h +14 -23
  55. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/typecheck-gcc.h +420 -403
  56. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +29 -28
  57. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/websockets.h +10 -10
  58. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Info.plist +0 -0
  59. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.abi.json +548 -297
  60. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +10 -3
  61. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  62. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +10 -3
  63. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.abi.json +548 -297
  64. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +10 -3
  65. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  66. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +10 -3
  67. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/TalsecRuntime +0 -0
  68. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/_CodeSignature/CodeResources +43 -43
  69. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/cacert.pem +483 -1088
  70. package/ios/TalsecRuntimePackage/Package.swift +2 -2
  71. package/ios/dispatchers/ExecutionStateDispatcher.swift +4 -3
  72. package/ios/models/RaspExecutionStates.swift +10 -3
  73. package/ios/utils/EventIdentifiers.swift +2 -2
  74. package/lib/commonjs/api/listeners/raspExecutionState.js +13 -7
  75. package/lib/commonjs/api/listeners/raspExecutionState.js.map +1 -1
  76. package/lib/commonjs/api/listeners/threat.js +19 -8
  77. package/lib/commonjs/api/listeners/threat.js.map +1 -1
  78. package/lib/commonjs/api/methods/internal.js +20 -0
  79. package/lib/commonjs/api/methods/internal.js.map +1 -0
  80. package/lib/commonjs/api/methods/native.js +113 -21
  81. package/lib/commonjs/api/methods/native.js.map +1 -1
  82. package/lib/commonjs/api/methods/reactNative.js +38 -10
  83. package/lib/commonjs/api/methods/reactNative.js.map +1 -1
  84. package/lib/commonjs/channels/raspExecutionState.js +3 -3
  85. package/lib/commonjs/channels/raspExecutionState.js.map +1 -1
  86. package/lib/commonjs/channels/threat.js +4 -4
  87. package/lib/commonjs/channels/threat.js.map +1 -1
  88. package/lib/commonjs/index.js +23 -0
  89. package/lib/commonjs/index.js.map +1 -1
  90. package/lib/commonjs/models/raspExecutionState.js +4 -2
  91. package/lib/commonjs/models/raspExecutionState.js.map +1 -1
  92. package/lib/commonjs/models/threat.js +2 -1
  93. package/lib/commonjs/models/threat.js.map +1 -1
  94. package/lib/commonjs/types/errors.js +50 -0
  95. package/lib/commonjs/types/errors.js.map +1 -0
  96. package/lib/commonjs/types/types.js +4 -0
  97. package/lib/module/api/listeners/raspExecutionState.js +10 -4
  98. package/lib/module/api/listeners/raspExecutionState.js.map +1 -1
  99. package/lib/module/api/listeners/threat.js +16 -5
  100. package/lib/module/api/listeners/threat.js.map +1 -1
  101. package/lib/module/api/methods/internal.js +13 -0
  102. package/lib/module/api/methods/internal.js.map +1 -0
  103. package/lib/module/api/methods/native.js +106 -17
  104. package/lib/module/api/methods/native.js.map +1 -1
  105. package/lib/module/api/methods/reactNative.js +39 -12
  106. package/lib/module/api/methods/reactNative.js.map +1 -1
  107. package/lib/module/channels/raspExecutionState.js +1 -1
  108. package/lib/module/channels/raspExecutionState.js.map +1 -1
  109. package/lib/module/channels/threat.js +2 -2
  110. package/lib/module/channels/threat.js.map +1 -1
  111. package/lib/module/index.js +2 -0
  112. package/lib/module/index.js.map +1 -1
  113. package/lib/module/models/raspExecutionState.js +4 -2
  114. package/lib/module/models/raspExecutionState.js.map +1 -1
  115. package/lib/module/models/threat.js +2 -1
  116. package/lib/module/models/threat.js.map +1 -1
  117. package/lib/module/types/errors.js +41 -0
  118. package/lib/module/types/errors.js.map +1 -0
  119. package/lib/module/types/types.js +1 -1
  120. package/lib/typescript/src/api/listeners/raspExecutionState.d.ts.map +1 -1
  121. package/lib/typescript/src/api/listeners/threat.d.ts.map +1 -1
  122. package/lib/typescript/src/api/methods/internal.d.ts +7 -0
  123. package/lib/typescript/src/api/methods/internal.d.ts.map +1 -0
  124. package/lib/typescript/src/api/methods/native.d.ts +56 -7
  125. package/lib/typescript/src/api/methods/native.d.ts.map +1 -1
  126. package/lib/typescript/src/api/methods/reactNative.d.ts +11 -2
  127. package/lib/typescript/src/api/methods/reactNative.d.ts.map +1 -1
  128. package/lib/typescript/src/channels/threat.d.ts +1 -0
  129. package/lib/typescript/src/channels/threat.d.ts.map +1 -1
  130. package/lib/typescript/src/index.d.ts +2 -0
  131. package/lib/typescript/src/index.d.ts.map +1 -1
  132. package/lib/typescript/src/models/raspExecutionState.d.ts +3 -1
  133. package/lib/typescript/src/models/raspExecutionState.d.ts.map +1 -1
  134. package/lib/typescript/src/models/threat.d.ts +1 -0
  135. package/lib/typescript/src/models/threat.d.ts.map +1 -1
  136. package/lib/typescript/src/types/errors.d.ts +26 -0
  137. package/lib/typescript/src/types/errors.d.ts.map +1 -0
  138. package/lib/typescript/src/types/types.d.ts +61 -26
  139. package/lib/typescript/src/types/types.d.ts.map +1 -1
  140. package/package.json +1 -1
  141. package/src/api/listeners/raspExecutionState.ts +9 -3
  142. package/src/api/listeners/threat.ts +29 -5
  143. package/src/api/methods/internal.ts +13 -0
  144. package/src/api/methods/native.ts +125 -21
  145. package/src/api/methods/reactNative.ts +46 -16
  146. package/src/channels/raspExecutionState.ts +1 -1
  147. package/src/channels/threat.ts +3 -3
  148. package/src/index.tsx +2 -0
  149. package/src/models/raspExecutionState.ts +8 -2
  150. package/src/models/threat.ts +2 -0
  151. package/src/types/errors.ts +57 -0
  152. package/src/types/types.ts +66 -26
  153. package/android/src/main/java/com/freeraspreactnative/events/RaspExecutionStateEvent.kt +0 -18
@@ -32,22 +32,22 @@
32
32
 
33
33
  /* This is the version number of the libcurl package from which this header
34
34
  file origins: */
35
- #define LIBCURL_VERSION "8.16.0"
35
+ #define LIBCURL_VERSION "8.22.0"
36
36
 
37
37
  /* The numeric version number is also available "in parts" by using these
38
38
  defines: */
39
39
  #define LIBCURL_VERSION_MAJOR 8
40
- #define LIBCURL_VERSION_MINOR 16
40
+ #define LIBCURL_VERSION_MINOR 22
41
41
  #define LIBCURL_VERSION_PATCH 0
42
42
  /* This is the numeric version of the libcurl version number, meant for easier
43
- parsing and comparisons by programs. The LIBCURL_VERSION_NUM define will
44
- always follow this syntax:
43
+ parsing and comparisons by programs. The LIBCURL_VERSION_NUM define always
44
+ follows this syntax:
45
45
 
46
46
  0xXXYYZZ
47
47
 
48
48
  Where XX, YY and ZZ are the main version, release and patch numbers in
49
49
  hexadecimal (using 8 bits each). All three numbers are always represented
50
- using two digits. 1.2 would appear as "0x010200" while version 9.11.7
50
+ using two digits. Version 1.2 would appear as "0x010200" while 9.11.7
51
51
  appears as "0x090b07".
52
52
 
53
53
  This 6-digit (24 bits) hexadecimal number does not show pre-release number,
@@ -56,9 +56,8 @@
56
56
 
57
57
  Note: This define is the full hex number and _does not_ use the
58
58
  CURL_VERSION_BITS() macro since curl's own configure script greps for it
59
- and needs it to contain the full number.
60
- */
61
- #define LIBCURL_VERSION_NUM 0x081000
59
+ and needs it to contain the full number. */
60
+ #define LIBCURL_VERSION_NUM 0x081600
62
61
 
63
62
  /*
64
63
  * This is the date and time when the full source package was created. The
@@ -69,10 +68,10 @@
69
68
  *
70
69
  * "2007-11-23"
71
70
  */
72
- #define LIBCURL_TIMESTAMP "2025-09-10"
71
+ #define LIBCURL_TIMESTAMP "2026-09-02"
73
72
 
74
- #define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z))
75
- #define CURL_AT_LEAST_VERSION(x,y,z) \
73
+ #define CURL_VERSION_BITS(x, y, z) ((x) << 16 | (y) << 8 | (z))
74
+ #define CURL_AT_LEAST_VERSION(x, y, z) \
76
75
  (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
77
76
 
78
77
  #endif /* CURLINC_CURLVER_H */
@@ -50,15 +50,14 @@ CURL_EXTERN void curl_easy_cleanup(CURL *curl);
50
50
  *
51
51
  * Request internal information from the curl session with this function.
52
52
  * The third argument MUST be pointing to the specific type of the used option
53
- * which is documented in each manpage of the option. The data pointed to
54
- * will be filled in accordingly and can be relied upon only if the function
53
+ * which is documented in each man page of the option. The data pointed to
54
+ * is filled in accordingly and can be relied upon only if the function
55
55
  * returns CURLE_OK. This function is intended to get used *AFTER* a performed
56
56
  * transfer, all results from this function are undefined until the transfer
57
57
  * is completed.
58
58
  */
59
59
  CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
60
60
 
61
-
62
61
  /*
63
62
  * NAME curl_easy_duphandle()
64
63
  *
@@ -67,7 +66,7 @@ CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
67
66
  * Creates a new curl session handle with the same options set for the handle
68
67
  * passed in. Duplicating a handle could only be a matter of cloning data and
69
68
  * options, internal state info and things like persistent connections cannot
70
- * be transferred. It is useful in multithreaded applications when you can run
69
+ * be transferred. It is useful in multi-threaded applications when you can run
71
70
  * curl_easy_duphandle() for each new thread to avoid a series of identical
72
71
  * curl_easy_setopt() invokes in every thread.
73
72
  */
@@ -79,7 +78,7 @@ CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl);
79
78
  * DESCRIPTION
80
79
  *
81
80
  * Re-initializes a curl handle to the default values. This puts back the
82
- * handle to the same state as it was in when it was just created.
81
+ * handle to the same state as it was in when it was created.
83
82
  *
84
83
  * It does keep: live connections, the Session ID cache, the DNS cache and the
85
84
  * cookies.
@@ -108,7 +107,6 @@ CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,
108
107
  CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,
109
108
  size_t buflen, size_t *n);
110
109
 
111
-
112
110
  /*
113
111
  * NAME curl_easy_upkeep()
114
112
  *
@@ -31,18 +31,18 @@ extern "C" {
31
31
  struct curl_header {
32
32
  char *name; /* this might not use the same case */
33
33
  char *value;
34
- size_t amount; /* number of headers using this name */
34
+ size_t amount; /* number of headers using this name */
35
35
  size_t index; /* ... of this instance, 0 or higher */
36
36
  unsigned int origin; /* see bits below */
37
37
  void *anchor; /* handle privately used by libcurl */
38
38
  };
39
39
 
40
40
  /* 'origin' bits */
41
- #define CURLH_HEADER (1<<0) /* plain server header */
42
- #define CURLH_TRAILER (1<<1) /* trailers */
43
- #define CURLH_CONNECT (1<<2) /* CONNECT headers */
44
- #define CURLH_1XX (1<<3) /* 1xx headers */
45
- #define CURLH_PSEUDO (1<<4) /* pseudo headers */
41
+ #define CURLH_HEADER (1 << 0) /* plain server header */
42
+ #define CURLH_TRAILER (1 << 1) /* trailers */
43
+ #define CURLH_CONNECT (1 << 2) /* CONNECT headers */
44
+ #define CURLH_1XX (1 << 3) /* 1xx headers */
45
+ #define CURLH_PSEUDO (1 << 4) /* pseudo headers */
46
46
 
47
47
  typedef enum {
48
48
  CURLHE_OK,
@@ -55,14 +55,14 @@ typedef enum {
55
55
  CURLHE_NOT_BUILT_IN /* if API was disabled in the build */
56
56
  } CURLHcode;
57
57
 
58
- CURL_EXTERN CURLHcode curl_easy_header(CURL *easy,
58
+ CURL_EXTERN CURLHcode curl_easy_header(CURL *curl,
59
59
  const char *name,
60
- size_t index,
60
+ size_t nameindex,
61
61
  unsigned int origin,
62
62
  int request,
63
63
  struct curl_header **hout);
64
64
 
65
- CURL_EXTERN struct curl_header *curl_easy_nextheader(CURL *easy,
65
+ CURL_EXTERN struct curl_header *curl_easy_nextheader(CURL *curl,
66
66
  unsigned int origin,
67
67
  int request,
68
68
  struct curl_header *prev);
@@ -24,20 +24,20 @@
24
24
  *
25
25
  ***************************************************************************/
26
26
  /*
27
- This is an "external" header file. Do not give away any internals here!
28
-
29
- GOALS
30
-
31
- o Enable a "pull" interface. The application that uses libcurl decides where
32
- and when to ask libcurl to get/send data.
33
-
34
- o Enable multiple simultaneous transfers in the same thread without making it
35
- complicated for the application.
36
-
37
- o Enable the application to select() on its own file descriptors and curl's
38
- file descriptors simultaneous easily.
39
-
40
- */
27
+ * This is an "external" header file. Do not give away any internals here!
28
+ *
29
+ * GOALS
30
+ *
31
+ * o Enable a "pull" interface. The application that uses libcurl decides where
32
+ * and when to ask libcurl to get/send data.
33
+ *
34
+ * o Enable multiple simultaneous transfers in the same thread without making
35
+ * it complicated for the application.
36
+ *
37
+ * o Enable the application to select() on its own file descriptors and curl's
38
+ * file descriptors simultaneous easily.
39
+ *
40
+ */
41
41
 
42
42
  /*
43
43
  * This header file should not really need to include "curl.h" since curl.h
@@ -77,9 +77,8 @@ typedef enum {
77
77
  CURLM_LAST
78
78
  } CURLMcode;
79
79
 
80
- /* just to make code nicer when using curl_multi_socket() you can now check
81
- for CURLM_CALL_MULTI_SOCKET too in the same style it works for
82
- curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */
80
+ /* You can check for CURLM_CALL_MULTI_SOCKET too in the same style it works
81
+ for curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */
83
82
  #define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM
84
83
 
85
84
  /* bitmask bits for CURLMOPT_PIPELINING */
@@ -133,29 +132,29 @@ CURL_EXTERN CURLM *curl_multi_init(void);
133
132
  *
134
133
  * Returns: CURLMcode type, general multi error code.
135
134
  */
136
- CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle,
137
- CURL *curl_handle);
138
-
139
- /*
140
- * Name: curl_multi_remove_handle()
141
- *
142
- * Desc: removes a curl handle from the multi stack again
143
- *
144
- * Returns: CURLMcode type, general multi error code.
145
- */
146
- CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
147
- CURL *curl_handle);
148
-
149
- /*
150
- * Name: curl_multi_fdset()
151
- *
152
- * Desc: Ask curl for its fd_set sets. The app can use these to select() or
153
- * poll() on. We want curl_multi_perform() called as soon as one of
154
- * them are ready.
155
- *
156
- * Returns: CURLMcode type, general multi error code.
157
- */
158
- CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
135
+ CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *m,
136
+ CURL *curl);
137
+
138
+ /*
139
+ * Name: curl_multi_remove_handle()
140
+ *
141
+ * Desc: removes a curl handle from the multi stack again
142
+ *
143
+ * Returns: CURLMcode type, general multi error code.
144
+ */
145
+ CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *m,
146
+ CURL *curl);
147
+
148
+ /*
149
+ * Name: curl_multi_fdset()
150
+ *
151
+ * Desc: Ask curl for its fd_set sets. The app can use these to select() or
152
+ * poll() on. We want curl_multi_perform() called as soon as one of
153
+ * them are ready.
154
+ *
155
+ * Returns: CURLMcode type, general multi error code.
156
+ */
157
+ CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *m,
159
158
  fd_set *read_fd_set,
160
159
  fd_set *write_fd_set,
161
160
  fd_set *exc_fd_set,
@@ -169,7 +168,7 @@ CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
169
168
  *
170
169
  * Returns: CURLMcode type, general multi error code.
171
170
  */
172
- CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle,
171
+ CURL_EXTERN CURLMcode curl_multi_wait(CURLM *m,
173
172
  struct curl_waitfd extra_fds[],
174
173
  unsigned int extra_nfds,
175
174
  int timeout_ms,
@@ -183,7 +182,7 @@ CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle,
183
182
  *
184
183
  * Returns: CURLMcode type, general multi error code.
185
184
  */
186
- CURL_EXTERN CURLMcode curl_multi_poll(CURLM *multi_handle,
185
+ CURL_EXTERN CURLMcode curl_multi_poll(CURLM *m,
187
186
  struct curl_waitfd extra_fds[],
188
187
  unsigned int extra_nfds,
189
188
  int timeout_ms,
@@ -196,60 +195,60 @@ CURL_EXTERN CURLMcode curl_multi_poll(CURLM *multi_handle,
196
195
  *
197
196
  * Returns: CURLMcode type, general multi error code.
198
197
  */
199
- CURL_EXTERN CURLMcode curl_multi_wakeup(CURLM *multi_handle);
200
-
201
- /*
202
- * Name: curl_multi_perform()
203
- *
204
- * Desc: When the app thinks there is data available for curl it calls this
205
- * function to read/write whatever there is right now. This returns
206
- * as soon as the reads and writes are done. This function does not
207
- * require that there actually is data available for reading or that
208
- * data can be written, it can be called just in case. It returns
209
- * the number of handles that still transfer data in the second
210
- * argument's integer-pointer.
211
- *
212
- * Returns: CURLMcode type, general multi error code. *NOTE* that this only
213
- * returns errors etc regarding the whole multi stack. There might
214
- * still have occurred problems on individual transfers even when
215
- * this returns OK.
216
- */
217
- CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,
198
+ CURL_EXTERN CURLMcode curl_multi_wakeup(CURLM *m);
199
+
200
+ /*
201
+ * Name: curl_multi_perform()
202
+ *
203
+ * Desc: When the app thinks there is data available for curl it calls this
204
+ * function to read/write whatever there is right now. This returns
205
+ * as soon as the reads and writes are done. This function does not
206
+ * require that there actually is data available for reading or that
207
+ * data can be written, it can be called. It returns the number of
208
+ * handles that still transfer data in the second argument's
209
+ * integer-pointer.
210
+ *
211
+ * Returns: CURLMcode type, general multi error code. *NOTE* that this only
212
+ * returns errors etc regarding the whole multi stack. There might
213
+ * still have occurred problems on individual transfers even when
214
+ * this returns OK.
215
+ */
216
+ CURL_EXTERN CURLMcode curl_multi_perform(CURLM *m,
218
217
  int *running_handles);
219
218
 
220
- /*
221
- * Name: curl_multi_cleanup()
222
- *
223
- * Desc: Cleans up and removes a whole multi stack. It does not free or
224
- * touch any individual easy handles in any way. We need to define
225
- * in what state those handles will be if this function is called
226
- * in the middle of a transfer.
227
- *
228
- * Returns: CURLMcode type, general multi error code.
229
- */
230
- CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
219
+ /*
220
+ * Name: curl_multi_cleanup()
221
+ *
222
+ * Desc: Cleans up and removes a whole multi stack. It does not free or
223
+ * touch any individual easy handles in any way. We need to define
224
+ * in what state those handles are going to be if this function is
225
+ * called in the middle of a transfer.
226
+ *
227
+ * Returns: CURLMcode type, general multi error code.
228
+ */
229
+ CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *m);
231
230
 
232
231
  /*
233
232
  * Name: curl_multi_info_read()
234
233
  *
235
234
  * Desc: Ask the multi handle if there is any messages/informationals from
236
235
  * the individual transfers. Messages include informationals such as
237
- * error code from the transfer or just the fact that a transfer is
236
+ * error code from the transfer or the fact that a transfer is
238
237
  * completed. More details on these should be written down as well.
239
238
  *
240
- * Repeated calls to this function will return a new struct each
241
- * time, until a special "end of msgs" struct is returned as a signal
242
- * that there is no more to get at this point.
239
+ * Repeated calls to this function return a new struct each time,
240
+ * until a special "end of msgs" struct is returned as a signal that
241
+ * there is no more to get at this point.
243
242
  *
244
- * The data the returned pointer points to will not survive calling
243
+ * The data the returned pointer points to does not survive calling
245
244
  * curl_multi_cleanup().
246
245
  *
247
246
  * The 'CURLMsg' struct is meant to be simple and only contain basic
248
- * information. If more involved information is wanted, we will
249
- * provide the particular "transfer handle" in that struct and that
247
+ * information. If more involved information is wanted, we provide
248
+ * the particular "transfer handle" in that struct and that
250
249
  * should/could/would be used in subsequent curl_easy_getinfo() calls
251
250
  * (or similar). The point being that we must never expose complex
252
- * structs to applications, as then we will undoubtably get backwards
251
+ * structs to applications, as then we undoubtably get backwards
253
252
  * compatibility problems in the future.
254
253
  *
255
254
  * Returns: A pointer to a filled-in struct, or NULL if it failed or ran out
@@ -257,7 +256,7 @@ CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
257
256
  * queue (after this read) in the integer the second argument points
258
257
  * to.
259
258
  */
260
- CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,
259
+ CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *m,
261
260
  int *msgs_in_queue);
262
261
 
263
262
  /*
@@ -269,7 +268,7 @@ CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,
269
268
  *
270
269
  * Returns: A pointer to a null-terminated error message.
271
270
  */
272
- CURL_EXTERN const char *curl_multi_strerror(CURLMcode);
271
+ CURL_EXTERN const char *curl_multi_strerror(CURLMcode error);
273
272
 
274
273
  /*
275
274
  * Name: curl_multi_socket() and
@@ -278,7 +277,7 @@ CURL_EXTERN const char *curl_multi_strerror(CURLMcode);
278
277
  * Desc: An alternative version of curl_multi_perform() that allows the
279
278
  * application to pass in one of the file descriptors that have been
280
279
  * detected to have "action" on them and let libcurl perform.
281
- * See manpage for details.
280
+ * See man page for details.
282
281
  */
283
282
  #define CURL_POLL_NONE 0
284
283
  #define CURL_POLL_IN 1
@@ -309,27 +308,27 @@ typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */
309
308
  *
310
309
  * Returns: The callback should return zero.
311
310
  */
312
- typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */
311
+ typedef int (*curl_multi_timer_callback)(CURLM *m, /* multi handle */
313
312
  long timeout_ms, /* see above */
314
313
  void *userp); /* private callback
315
314
  pointer */
316
315
 
317
316
  CURL_EXTERN CURLMcode CURL_DEPRECATED(7.19.5, "Use curl_multi_socket_action()")
318
- curl_multi_socket(CURLM *multi_handle, curl_socket_t s, int *running_handles);
317
+ curl_multi_socket(CURLM *m, curl_socket_t s, int *running_handles);
319
318
 
320
- CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle,
319
+ CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *m,
321
320
  curl_socket_t s,
322
321
  int ev_bitmask,
323
322
  int *running_handles);
324
323
 
325
324
  CURL_EXTERN CURLMcode CURL_DEPRECATED(7.19.5, "Use curl_multi_socket_action()")
326
- curl_multi_socket_all(CURLM *multi_handle, int *running_handles);
325
+ curl_multi_socket_all(CURLM *m, int *running_handles);
327
326
 
328
327
  #ifndef CURL_ALLOW_OLD_MULTI_SOCKET
329
328
  /* This macro below was added in 7.16.3 to push users who recompile to use
330
- the new curl_multi_socket_action() instead of the old curl_multi_socket()
331
- */
332
- #define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z)
329
+ * the new curl_multi_socket_action() instead of the old curl_multi_socket()
330
+ */
331
+ #define curl_multi_socket(x, y, z) curl_multi_socket_action(x, y, 0, z)
333
332
  #endif
334
333
 
335
334
  /*
@@ -341,8 +340,8 @@ curl_multi_socket_all(CURLM *multi_handle, int *running_handles);
341
340
  *
342
341
  * Returns: CURLM error code.
343
342
  */
344
- CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,
345
- long *milliseconds);
343
+ CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *m,
344
+ long *timeout_ms);
346
345
 
347
346
  typedef enum {
348
347
  /* This is the socket callback function pointer */
@@ -351,10 +350,10 @@ typedef enum {
351
350
  /* This is the argument passed to the socket callback */
352
351
  CURLOPT(CURLMOPT_SOCKETDATA, CURLOPTTYPE_OBJECTPOINT, 2),
353
352
 
354
- /* set to 1 to enable pipelining for this multi handle */
353
+ /* set to 1 to enable pipelining for this multi handle */
355
354
  CURLOPT(CURLMOPT_PIPELINING, CURLOPTTYPE_LONG, 3),
356
355
 
357
- /* This is the timer callback function pointer */
356
+ /* This is the timer callback function pointer */
358
357
  CURLOPT(CURLMOPT_TIMERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 4),
359
358
 
360
359
  /* This is the argument passed to the timer callback */
@@ -370,11 +369,11 @@ typedef enum {
370
369
  CURLOPT(CURLMOPT_MAX_PIPELINE_LENGTH, CURLOPTTYPE_LONG, 8),
371
370
 
372
371
  /* a connection with a content-length longer than this
373
- will not be considered for pipelining */
372
+ is not considered for pipelining */
374
373
  CURLOPT(CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE, CURLOPTTYPE_OFF_T, 9),
375
374
 
376
375
  /* a connection with a chunk length longer than this
377
- will not be considered for pipelining */
376
+ is not considered for pipelining */
378
377
  CURLOPT(CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE, CURLOPTTYPE_OFF_T, 10),
379
378
 
380
379
  /* a list of site names(+port) that are blocked from pipelining */
@@ -398,20 +397,36 @@ typedef enum {
398
397
  /* network has changed, adjust caches/connection reuse */
399
398
  CURLOPT(CURLMOPT_NETWORK_CHANGED, CURLOPTTYPE_LONG, 17),
400
399
 
400
+ /* This is the notify callback function pointer */
401
+ CURLOPT(CURLMOPT_NOTIFYFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 18),
402
+
403
+ /* This is the argument passed to the notify callback */
404
+ CURLOPT(CURLMOPT_NOTIFYDATA, CURLOPTTYPE_OBJECTPOINT, 19),
405
+
406
+ /* maximum number of threads used with threaded DNS resolver */
407
+ CURLOPT(CURLMOPT_RESOLVE_THREADS_MAX, CURLOPTTYPE_LONG, 20),
408
+
409
+ /* set to 1L for not joining threads when multi is cleaned up */
410
+ CURLOPT(CURLMOPT_QUICK_EXIT, CURLOPTTYPE_LONG, 21),
411
+
401
412
  CURLMOPT_LASTENTRY /* the last unused */
402
413
  } CURLMoption;
403
414
 
404
415
  /* Definition of bits for the CURLMOPT_NETWORK_CHANGED argument: */
405
416
 
417
+ /* - CURLMNWC_CLEAR_ALL tells libcurl to clear "everything" that could be
418
+ associated with this network, including both connections and DNS data. */
419
+ #define CURLMNWC_CLEAR_ALL (1L << 0)
420
+
406
421
  /* - CURLMNWC_CLEAR_CONNS tells libcurl to prevent further reuse of existing
407
- connections. Connections that are idle will be closed. Ongoing transfers
408
- will continue with the connection they have. */
409
- #define CURLMNWC_CLEAR_CONNS (1L<<0)
422
+ connections. Connections that are idle are closed. Ongoing transfers do
423
+ continue with the connection they have. */
424
+ #define CURLMNWC_CLEAR_CONNS (1L << 1)
410
425
 
411
- /* - CURLMNWC_CLEAR_DNS tells libcurl to prevent further reuse of existing
412
- connections. Connections that are idle will be closed. Ongoing transfers
413
- will continue with the connection they have. */
414
- #define CURLMNWC_CLEAR_DNS (1L<<0)
426
+ /* - CURLMNWC_CLEAR_DNS tells libcurl to clear the DNS cache associated with
427
+ this multi handle. Ongoing transfers keep using their already resolved
428
+ addresses, but future name resolutions are performed again. */
429
+ #define CURLMNWC_CLEAR_DNS (1L << 2)
415
430
 
416
431
  /*
417
432
  * Name: curl_multi_setopt()
@@ -420,10 +435,9 @@ typedef enum {
420
435
  *
421
436
  * Returns: CURLM error code.
422
437
  */
423
- CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,
438
+ CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *m,
424
439
  CURLMoption option, ...);
425
440
 
426
-
427
441
  /*
428
442
  * Name: curl_multi_assign()
429
443
  *
@@ -433,7 +447,7 @@ CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,
433
447
  *
434
448
  * Returns: CURLM error code.
435
449
  */
436
- CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,
450
+ CURL_EXTERN CURLMcode curl_multi_assign(CURLM *m,
437
451
  curl_socket_t sockfd, void *sockp);
438
452
 
439
453
  /*
@@ -446,8 +460,7 @@ CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,
446
460
  *
447
461
  * Returns: NULL on failure, otherwise a CURL **array pointer
448
462
  */
449
- CURL_EXTERN CURL **curl_multi_get_handles(CURLM *multi_handle);
450
-
463
+ CURL_EXTERN CURL **curl_multi_get_handles(CURLM *m);
451
464
 
452
465
  typedef enum {
453
466
  CURLMINFO_NONE, /* first, never use this */
@@ -464,7 +477,9 @@ typedef enum {
464
477
  * be read via `curl_multi_info_read()`. */
465
478
  CURLMINFO_XFERS_DONE = 4,
466
479
  /* The total number of easy handles added to the multi handle, ever. */
467
- CURLMINFO_XFERS_ADDED = 5
480
+ CURLMINFO_XFERS_ADDED = 5,
481
+
482
+ CURLMINFO_LASTENTRY /* the last unused */
468
483
  } CURLMinfo_offt;
469
484
 
470
485
  /*
@@ -474,7 +489,7 @@ typedef enum {
474
489
  *
475
490
  * Returns: CULRM_OK or error when value could not be obtained.
476
491
  */
477
- CURL_EXTERN CURLMcode curl_multi_get_offt(CURLM *multi_handle,
492
+ CURL_EXTERN CURLMcode curl_multi_get_offt(CURLM *m,
478
493
  CURLMinfo_offt info,
479
494
  curl_off_t *pvalue);
480
495
 
@@ -509,15 +524,35 @@ typedef int (*curl_push_callback)(CURL *parent,
509
524
  *
510
525
  * Desc: Ask curl for fds for polling. The app can use these to poll on.
511
526
  * We want curl_multi_perform() called as soon as one of them are
512
- * ready. Passing zero size allows to get just a number of fds.
527
+ * ready. Passing zero size allows to get a number of fds.
513
528
  *
514
529
  * Returns: CURLMcode type, general multi error code.
515
530
  */
516
- CURL_EXTERN CURLMcode curl_multi_waitfds(CURLM *multi,
531
+ CURL_EXTERN CURLMcode curl_multi_waitfds(CURLM *m,
517
532
  struct curl_waitfd *ufds,
518
533
  unsigned int size,
519
534
  unsigned int *fd_count);
520
535
 
536
+ /*
537
+ * Notifications dispatched by a multi handle, when enabled.
538
+ */
539
+ #define CURLMNOTIFY_INFO_READ 0
540
+ #define CURLMNOTIFY_EASY_DONE 1
541
+
542
+ /*
543
+ * Callback to install via CURLMOPT_NOTIFYFUNCTION.
544
+ */
545
+ typedef void (*curl_notify_callback)(CURLM *m,
546
+ unsigned int notification,
547
+ CURL *easy,
548
+ void *user_data);
549
+
550
+ CURL_EXTERN CURLMcode curl_multi_notify_disable(CURLM *m,
551
+ unsigned int notification);
552
+
553
+ CURL_EXTERN CURLMcode curl_multi_notify_enable(CURLM *m,
554
+ unsigned int notification);
555
+
521
556
  #ifdef __cplusplus
522
557
  } /* end of extern "C" */
523
558
  #endif
@@ -44,7 +44,7 @@ typedef enum {
44
44
 
45
45
  /* "alias" means it is provided for old programs to remain functional,
46
46
  we prefer another name */
47
- #define CURLOT_FLAG_ALIAS (1<<0)
47
+ #define CURLOT_FLAG_ALIAS (1 << 0)
48
48
 
49
49
  /* The CURLOPTTYPE_* id ranges can still be used to figure out what type/size
50
50
  to use for curl_easy_setopt() for the given id */