#if HTTP_CURL_VERSION(7,15,2)
HTTP_LONG_CONSTANT("HTTP_PROXY_SOCKS4", CURLPROXY_SOCKS4);
+#endif
+#if HTTP_CURL_VERSION(7,18,0)
+ HTTP_LONG_CONSTANT("HTTP_PROXY_SOCKS4A", CURLPROXY_SOCKS4A);
+ HTTP_LONG_CONSTANT("HTTP_PROXY_SOCKS5_HOSTNAME", CURLPROXY_SOCKS5_HOSTNAME);
#endif
HTTP_LONG_CONSTANT("HTTP_PROXY_SOCKS5", CURLPROXY_SOCKS5);
HTTP_LONG_CONSTANT("HTTP_PROXY_HTTP", CURLPROXY_HTTP);
HTTP_CURL_OPT(CURLOPT_HTTP_TRANSFER_DECODING, 0L);
#endif
HTTP_CURL_OPT(CURLOPT_FOLLOWLOCATION, 0L);
+#if HTTP_CURL_VERSION(7,19,1)
+ HTTP_CURL_OPT(CURLOPT_POSTREDIR, 0L);
+#elif HTTP_CURL_VERSION(7,17,1)
+ HTTP_CURL_OPT(CURLOPT_POST301, 0L);
+#endif
HTTP_CURL_OPT(CURLOPT_UNRESTRICTED_AUTH, 0L);
HTTP_CURL_OPT(CURLOPT_REFERER, NULL);
HTTP_CURL_OPT(CURLOPT_USERAGENT, "PECL::HTTP/" PHP_HTTP_VERSION " (PHP/" PHP_VERSION ")");
HTTP_CURL_OPT(CURLOPT_SSL_VERIFYPEER, 0L);
HTTP_CURL_OPT(CURLOPT_SSL_VERIFYHOST, 0L);
HTTP_CURL_OPT(CURLOPT_SSL_CIPHER_LIST, NULL);
+#if HTTP_CURL_VERSION(7,19,0)
+ HTTP_CURL_OPT(CURLOPT_ISSUERCERT, NULL);
+ #if defined(HTTP_HAVE_OPENSSL)
+ HTTP_CURL_OPT(CURLOPT_CRLFILE, NULL);
+ #endif
+#endif
+#if HTTP_CURL_VERSION(7,19,1) && defined(HTTP_HAVE_OPENSSL)
+ HTTP_CURL_OPT(CURLOPT_CERTINFO, NULL);
+#endif
#ifdef HTTP_CURL_CAINFO
HTTP_CURL_OPT(CURLOPT_CAINFO, HTTP_CURL_CAINFO);
#else
if ((zoption = http_request_option(request, options, "port", IS_LONG))) {
HTTP_CURL_OPT(CURLOPT_PORT, Z_LVAL_P(zoption));
}
+
+ /* RFC4007 zone_id */
+#if HTTP_CURL_VERSION(7,19,0)
+ if ((zoption = http_request_option(request, options, "address_scope", IS_LONG))) {
+ HTTP_CURL_OPT(CURLOPT_ADDRESS_SCOPE, Z_LVAL_P(zoption));
+ }
+#endif
/* auth */
if ((zoption = http_request_option(request, options, "httpauth", IS_STRING)) && Z_STRLEN_P(zoption)) {
if ((zoption = http_request_option(request, options, "unrestrictedauth", IS_BOOL))) {
HTTP_CURL_OPT(CURLOPT_UNRESTRICTED_AUTH, Z_LVAL_P(zoption));
}
+#if HTTP_CURL_VERSION(7,17,1)
+ if ((zoption = http_request_option(request, options, "postredir", IS_BOOL))) {
+# if HTTP_CURL_VERSION(7,19,1)
+ HTTP_CURL_OPT(CURLOPT_POSTREDIR, Z_BVAL_P(zoption) ? 1L : 0L);
+# else
+ HTTP_CURL_OPT(CURLOPT_POST301, Z_BVAL_P(zoption) ? 1L : 0L);
+# endif
+ }
+#endif
}
/* retries, defaults to 0 */
HTTP_CURL_OPT_STRING(CURLOPT_CAPATH, -3, 1);
HTTP_CURL_OPT_STRING(CURLOPT_RANDOM_FILE, -3, 1);
HTTP_CURL_OPT_STRING(CURLOPT_EGDSOCKET, -3, 1);
+#if HTTP_CURL_VERSION(7,19,0)
+ HTTP_CURL_OPT_STRING(CURLOPT_ISSUERCERT, -3, 1);
+ #if defined(HTTP_HAVE_OPENSSL)
+ HTTP_CURL_OPT_STRING(CURLOPT_CRLFILE, -3, 1);
+ #endif
+#endif
+#if HTTP_CURL_VERSION(7,19,1) && defined(HTTP_HAVE_OPENSSL)
+ HTTP_CURL_OPT_LONG(CURLOPT_CERTINFO, -3);
+#endif
}
}
}
curl_slist_free_all(s);
}
#endif
+#if HTTP_CURL_VERSION(7,18,2)
+ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_REDIRECT_URL, &c)) {
+ add_assoc_string_ex(&array, "redirect_url", sizeof("redirect_url"), c ? c : "", 1);
+ }
+#endif
+#if HTTP_CURL_VERSION(7,19,0)
+ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_PRIMARY_IP, &c)) {
+ add_assoc_string_ex(&array, "primary_ip", sizeof("primary_ip"), c ? c : "", 1);
+ }
+#endif
+#if HTTP_CURL_VERSION(7,19,0)
+ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_APPCONNECT_TIME, &d)) {
+ add_assoc_double_ex(&array, "appconnect_time", sizeof("appconnect_time"), d);
+ }
+#endif
+#if HTTP_CURL_VERSION(7,19,1) && defined(HTTP_HAVE_OPENSSL)
+ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_CERTINFO, &s)) {
+ MAKE_STD_ZVAL(subarray);
+ array_init(subarray);
+ for (p = s; p; p = p->next) {
+ add_next_index_string(subarray, p->data, 1);
+ }
+ add_assoc_zval_ex(&array, "certinfo", sizeof("certinfo"), subarray);
+ curl_slist_free_all(s);
+ }
+#endif
/* END */
add_assoc_string_ex(&array, "error", sizeof("error"), http_request_storage_get(request->ch)->errorbuffer, 1);
}
<license>BSD, revised</license>
<notes><![CDATA[
* Implement Request #14408 (Add a customizable timeout for HttpRequestPool::socketSelect)
+* Added request options:
+ - postredir: enforcing RFC conformig POST after redirect (libcurl >= 7.17.1)
+ - address_scope: RFC4007 zone_id (libcurl >= 7.19.0)
+ - ssl->issuercert: validate peer certificate issuer (libcurl >= 7.19.0)
+ - ssl->crlfile: require CRL check (libcurl >= 7.19.0 with openssl)
+ - ssl->certinfo: enable the certinfo gatherer (libcurl >= 7.19.1 with openssl)
+* Added proxytype request option constants:
+ - HTTP_PROXY_SOCKS4A
+ - HTTP_PROXY_SOCKS5_HOSTNAME
+* Added request info members:
+ - redirect_url (libcurl >= 7.18.2)
+ - primary_ip (libcurl >= 7.19.0)
+ - appconnect_time (libcurl >= 7.19.0)
+ - certinfo (libcurl >= 7.19.1 with openssl)
]]></notes>
<contents>
<dir name="/">
}
$ifdefs = array(
- 'COOKIELIST' => '7,14,1'
+ 'COOKIELIST' => 'HTTP_CURL_VERSION(7,14,1)',
+ 'PRIMARY_IP' => 'HTTP_CURL_VERSION(7,19,0)',
+ 'APPCONNECT_TIME' => 'HTTP_CURL_VERSION(7,19,0)',
+ 'REDIRECT_URL' => 'HTTP_CURL_VERSION(7,18,2)',
+ 'CERTINFO' => 'HTTP_CURL_VERSION(7,19,1) && defined(HTTP_HAVE_OPENSSL)'
);
$exclude = array(
'PRIVATE', 'LASTSOCKET', 'FTP_ENTRY_PATH'
foreach ($infos as $info) {
list(, $full, $short, $type) = $info;
if (in_array($short, $exclude)) continue;
- if (isset($ifdefs[$short])) printf("#if HTTP_CURL_VERSION(%s)\n", $ifdefs[$short]);
+ if (isset($ifdefs[$short])) printf("#if %s\n", $ifdefs[$short]);
printf($templates[$type], $full, strtolower((isset($translate[$short])) ? $translate[$short] : $short));
if (isset($ifdefs[$short])) printf("#endif\n");
}