You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Curl >= 7.80.0 supports declaring a function for `CURLOPT_PREREQFUNCTION` option
that gets called after Curl establishes a connection (including the TLS handshake
for HTTPS connections), but before the actual request is made.
The callable must return either `CURL_PREREQFUNC_OK` or `CURL_PREREQFUNC_ABORT` to
allow or abort the request.
This adds support for it to PHP with required ifdef.
- libc: https://curl.se/libcurl/c/CURLOPT_PREREQFUNCTION.html
Co-Authored-By: Gina Peter Bnayard <girgias@php.net>
string(41) "operation aborted by pre-request callback"
135
+
int(42)
136
+
137
+
Testing with CURL_PREREQFUNC_OK
138
+
string(8) "callback"
139
+
int(5)
140
+
string(10) "CurlHandle"
141
+
bool(true)
142
+
bool(true)
143
+
bool(true)
144
+
bool(true)
145
+
string(0) ""
146
+
string(0) ""
147
+
int(0)
148
+
149
+
Testing with curl_copy_handle
150
+
string(8) "callback"
151
+
int(5)
152
+
string(10) "CurlHandle"
153
+
bool(true)
154
+
bool(true)
155
+
bool(true)
156
+
bool(true)
157
+
string(0) ""
158
+
string(0) ""
159
+
int(0)
160
+
161
+
Testing with no return type
162
+
The CURLOPT_PREREQFUNCTION callback must return either CURL_PREREQFUNC_OK or CURL_PREREQFUNC_ABORT
163
+
164
+
Testing with invalid type
165
+
The CURLOPT_PREREQFUNCTION callback must return either CURL_PREREQFUNC_OK or CURL_PREREQFUNC_ABORT
166
+
167
+
Testing with invalid value
168
+
The CURLOPT_PREREQFUNCTION callback must return either CURL_PREREQFUNC_OK or CURL_PREREQFUNC_ABORT
169
+
170
+
Testing with invalid option value
171
+
curl_setopt(): Argument #3 ($value) must be a valid callback for option CURLOPT_PREREQFUNCTION, no array or string given
172
+
173
+
Testing with invalid option callback
174
+
curl_setopt(): Argument #3 ($value) must be a valid callback for option CURLOPT_PREREQFUNCTION, function "function_does_not_exist" not found or invalid function name
0 commit comments