* Added request options:
[m6w6/ext-http] / http_request_api.c
index 4ebbc2f..adc3a56 100644 (file)
@@ -161,6 +161,9 @@ PHP_MINIT_FUNCTION(http_request)
        
        HTTP_LONG_CONSTANT("HTTP_AUTH_BASIC", CURLAUTH_BASIC);
        HTTP_LONG_CONSTANT("HTTP_AUTH_DIGEST", CURLAUTH_DIGEST);
+#if HTTP_CURL_VERSION(7,19,3)
+       HTTP_LONG_CONSTANT("HTTP_AUTH_DIGEST_IE", CURLAUTH_DIGEST_IE);
+#endif
        HTTP_LONG_CONSTANT("HTTP_AUTH_NTLM", CURLAUTH_NTLM);
        HTTP_LONG_CONSTANT("HTTP_AUTH_GSSNEG", CURLAUTH_GSSNEGOTIATE);
        HTTP_LONG_CONSTANT("HTTP_AUTH_ANY", CURLAUTH_ANY);
@@ -188,6 +191,9 @@ PHP_MINIT_FUNCTION(http_request)
 #endif
        HTTP_LONG_CONSTANT("HTTP_PROXY_SOCKS5", CURLPROXY_SOCKS5);
        HTTP_LONG_CONSTANT("HTTP_PROXY_HTTP", CURLPROXY_HTTP);
+#if HTTP_CURL_VERSION(7,19,4)
+       TTP_LONG_CONSTANT("HTTP_PROXY_HTTP_1_0", CURLPROXY_HTTP_1_0);
+#endif
        return SUCCESS;
 }
 /* }}} */
@@ -459,11 +465,15 @@ PHP_HTTP_API void _http_request_defaults(http_request *request)
                HTTP_CURL_OPT(CURLOPT_PROGRESSFUNCTION, NULL);
                HTTP_CURL_OPT(CURLOPT_URL, NULL);
                HTTP_CURL_OPT(CURLOPT_NOPROGRESS, 1L);
+#if HTTP_CURL_VERSION(7,19,4)
+               HTTP_CURL_OPT(CURLOPT_NOPROXY, NULL);
+#endif
                HTTP_CURL_OPT(CURLOPT_PROXY, NULL);
                HTTP_CURL_OPT(CURLOPT_PROXYPORT, 0L);
                HTTP_CURL_OPT(CURLOPT_PROXYTYPE, 0L);
                HTTP_CURL_OPT(CURLOPT_PROXYUSERPWD, NULL);
                HTTP_CURL_OPT(CURLOPT_PROXYAUTH, 0L);
+               HTTP_CURL_OPT(CURLOPT_HTTPPROXYTUNNEL, 0L);
                HTTP_CURL_OPT(CURLOPT_DNS_CACHE_TIMEOUT, 60L);
                HTTP_CURL_OPT(CURLOPT_IPRESOLVE, 0);
                HTTP_CURL_OPT(CURLOPT_LOW_SPEED_LIMIT, 0L);
@@ -620,7 +630,16 @@ PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *opti
                if ((zoption = http_request_option(request, options, "proxyauthtype", IS_LONG))) {
                        HTTP_CURL_OPT(CURLOPT_PROXYAUTH, Z_LVAL_P(zoption));
                }
+               /* tunnel */
+               if ((zoption = http_request_option(request, options, "proxytunnel", IS_BOOL)) && Z_BVAL_P(zoption)) {
+                       HTTP_CURL_OPT(CURLOPT_HTTPPROXYTUNNEL, 1L);
+               }
+       }
+#if HTTP_CURL_VERSION(7,19,4)
+       if ((zoption = http_request_option, request, options, "noproxy", IS_STRING))) {
+               HTTP_CURL_OPT(CURLOPT_NOPROXY, Z_STRVAL_P(zoption));
        }
+#endif
 
        /* dns */
        if ((zoption = http_request_option(request, options, "dns_cache_timeout", IS_LONG))) {