]> granicus.if.org Git - php/commitdiff
add new CURL options
authorStanislav Malyshev <stas@php.net>
Fri, 13 Mar 2009 19:43:49 +0000 (19:43 +0000)
committerStanislav Malyshev <stas@php.net>
Fri, 13 Mar 2009 19:43:49 +0000 (19:43 +0000)
ext/curl/interface.c

index 01145658307016f483fd318e87f7943b90ef12e3..0834c3b9a63da28f0f114372529bdb1d48dbae2d 100644 (file)
@@ -630,6 +630,24 @@ PHP_MINIT_FUNCTION(curl)
        REGISTER_CURL_CONSTANT(CURLFTPSSL_ALL);
 #endif
 
+#if LIBCURL_VERSION_NUM >= 0x071304
+       REGISTER_CURL_CONSTANT(CURLOPT_REDIR_PROTOCOLS);
+       REGISTER_CURL_CONSTANT(CURLOPT_PROTOCOLS);
+       REGISTER_CURL_CONSTANT(CURLPROTO_HTTP);
+       REGISTER_CURL_CONSTANT(CURLPROTO_HTTPS);
+       REGISTER_CURL_CONSTANT(CURLPROTO_FTP);
+       REGISTER_CURL_CONSTANT(CURLPROTO_FTPS);
+       REGISTER_CURL_CONSTANT(CURLPROTO_SCP);
+       REGISTER_CURL_CONSTANT(CURLPROTO_SFTP);
+       REGISTER_CURL_CONSTANT(CURLPROTO_TELNET);
+       REGISTER_CURL_CONSTANT(CURLPROTO_LDAP);
+       REGISTER_CURL_CONSTANT(CURLPROTO_LDAPS);
+       REGISTER_CURL_CONSTANT(CURLPROTO_DICT);
+       REGISTER_CURL_CONSTANT(CURLPROTO_FILE);
+       REGISTER_CURL_CONSTANT(CURLPROTO_TFTP);
+       REGISTER_CURL_CONSTANT(CURLPROTO_ALL);
+#endif
+
 #ifdef PHP_CURL_NEED_OPENSSL_TSL
        if (!CRYPTO_get_id_callback()) {
                int i, c = CRYPTO_num_locks();
@@ -1302,6 +1320,10 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
                case CURLOPT_COOKIESESSION:
 #if LIBCURL_VERSION_NUM > 0x070b01 /* CURLOPT_TCP_NODELAY is available since curl 7.11.2 */
                case CURLOPT_TCP_NODELAY:
+#endif
+#if LIBCURL_VERSION_NUM >= 0x71304
+               case CURLOPT_REDIR_PROTOCOLS:
+               case CURLOPT_PROTOCOLS:
 #endif
                        convert_to_long_ex(zvalue);
                        error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue));