- encodecookies: bool, whether to urlencode the cookies (default: true)<br />
- resetcookies: bool, wheter to reset the cookies<br />
- cookiestore: string, path to a file where cookies are/will be stored<br />
+ - cookiesession: bool, accept (true) or reset (false) sessioncookies<br />
- resume: int, byte offset to start the download from;<br />
if the server supports ranges<br />
- maxfilesize: int, maximum file size that should be downloaded;<br />
- timeout: int, seconds the request may take<br />
- connecttimeout: int, seconds the connect may take<br />
- onprogress: mixed, progress callback<br />
+ - interface: string, outgoing network interface (ifname, ip or hostname)<br />
+ - portrange: array, 2 integers specifying outgoing portrange to try<br />
- ssl: array, with the following options:<br />
cert: string, path to certificate<br />
certtype: string, type of certificate<br />
</li>
</ul>
</div>
- <p><b>Generated at: Wed, 15 Feb 2006 08:40:01 +0100</b></p>
+ <p><b>Generated at: Fri, 17 Feb 2006 17:34:44 +0100</b></p>
</body>
</html>
* - encodecookies: bool, whether to urlencode the cookies (default: true)
* - resetcookies: bool, wheter to reset the cookies
* - cookiestore: string, path to a file where cookies are/will be stored
+ * - cookiesession: bool, accept (true) or reset (false) sessioncookies
* - resume: int, byte offset to start the download from;
* if the server supports ranges
* - maxfilesize: int, maximum file size that should be downloaded;
* - timeout: int, seconds the request may take
* - connecttimeout: int, seconds the connect may take
* - onprogress: mixed, progress callback
+ * - interface: string, outgoing network interface (ifname, ip or hostname)
+ * - portrange: array, 2 integers specifying outgoing portrange to try
* - ssl: array, with the following options:
* cert: string, path to certificate
* certtype: string, type of certificate
HTTP_CURL_OPT(CURLOPT_PROXYAUTH, 0);
HTTP_CURL_OPT(CURLOPT_INTERFACE, NULL);
HTTP_CURL_OPT(CURLOPT_PORT, 0);
+#if HTTP_CURL_VERSION(7,15,2)
+ HTTP_CURL_OPT(CURLOPT_LOCALPORT, 0);
+ HTTP_CURL_OPT(CURLOPT_LOCALPORTRANGE, 0);
+#endif
HTTP_CURL_OPT(CURLOPT_USERPWD, NULL);
HTTP_CURL_OPT(CURLOPT_HTTPAUTH, 0);
HTTP_CURL_OPT(CURLOPT_ENCODING, NULL);
HTTP_CURL_OPT(CURLOPT_USERAGENT, "PECL::HTTP/" PHP_EXT_HTTP_VERSION " (PHP/" PHP_VERSION ")");
HTTP_CURL_OPT(CURLOPT_HTTPHEADER, NULL);
HTTP_CURL_OPT(CURLOPT_COOKIE, NULL);
-#if LIBCURL_VERSION_NUM >= 0x070e01
+#if HTTP_CURL_VERSION(7,14,1)
HTTP_CURL_OPT(CURLOPT_COOKIELIST, NULL);
#endif
HTTP_CURL_OPT(CURLOPT_COOKIEFILE, NULL);
/* outgoing interface */
if ((zoption = http_request_option(request, options, "interface", IS_STRING))) {
HTTP_CURL_OPT(CURLOPT_INTERFACE, Z_STRVAL_P(zoption));
+
+#if HTTP_CURL_VERSION(7,15,2)
+ if ((zoption = http_request_option(request, options, "portrange", IS_ARRAY))) {
+ zval *prs, *pre;
+
+ zend_hash_internal_pointer_reset(Z_ARRVAL_P(zoption));
+ if (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(zoption), (void **) &prs)) {
+ zend_hash_move_forward(Z_ARRVAL_P(zoption));
+ if (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(zoption), (void **) &pre)) {
+ zval *prs_cpy = zval_copy(IS_LONG, *prs), *pre_cpy = zval_copy(IS_LONG, *pre);
+
+ if (Z_LVAL_P(prs_cpy) && Z_LVAL_P(pre_cpy)) {
+ HTTP_CURL_OPT(CURLOPT_LOCALPORT, MIN(Z_LVAL_P(prs_cpy), Z_LVAL_P(pre_cpy)));
+ HTTP_CURL_OPT(CURLOPT_LOCALPORTRANGE, ABS(Z_LVAL_P(prs_cpy)-Z_LVAL_P(pre_cpy))+1L);
+ }
+ zval_free(&prs_cpy);
+ zval_free(&pre_cpy);
+ }
+ }
+ }
+#endif
}
/* another port */
}
} else {
HashPosition pos;
- zval *cookie_val = NULL;
char *cookie_key = NULL;
ulong cookie_idx;
}
}
-#if LIBCURL_VERSION_NUM >= 0x070e01
+#if HTTP_CURL_VERSION(7,14,1)
/* reset cookies */
if ((zoption = http_request_option(request, options, "resetcookies", IS_BOOL)) && Z_LVAL_P(zoption)) {
HTTP_CURL_OPT(CURLOPT_COOKIELIST, "ALL");
HTTP_CURL_INFO(CURLINFO_HTTPAUTH_AVAIL);
HTTP_CURL_INFO(CURLINFO_PROXYAUTH_AVAIL);
HTTP_CURL_INFO(CURLINFO_NUM_CONNECTS);
-#if LIBCURL_VERSION_NUM >= 0x070e01
+#if HTTP_CURL_VERSION(7,14,1)
HTTP_CURL_INFO_EX(CURLINFO_COOKIELIST, "cookies");
#endif
HTTP_CURL_INFO(CURLINFO_OS_ERRNO);