scottmac                                 Fri, 10 Dec 2010 01:45:55 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=306162

Log:
Add more constants to curl_getinfo(), dependent on cURL version installed so 
wrapped in ifdefs

Changed paths:
    U   php/php-src/trunk/ext/curl/interface.c

Modified: php/php-src/trunk/ext/curl/interface.c
===================================================================
--- php/php-src/trunk/ext/curl/interface.c      2010-12-10 01:32:16 UTC (rev 
306161)
+++ php/php-src/trunk/ext/curl/interface.c      2010-12-10 01:45:55 UTC (rev 
306162)
@@ -2315,12 +2315,33 @@
                        create_certinfo(ci, listcode TSRMLS_CC);
                        CAAZ("certinfo", listcode);
                }
+               if (curl_easy_getinfo(ch->cp, CURLINFO_PRIMARY_IP, &s_code) == 
CURLE_OK) {
+                       CAAS("primary_ip", s_code);
+               }
 #endif
+#if LIBCURL_VERSION_NUM > 0x071500
+               if (curl_easy_getinfo(ch->cp, CURLINFO_PRIMARY_PORT, &l_code) 
== CURLE_OK) {
+                       CAAL("primary_port", l_code);
+               }
+               if (curl_easy_getinfo(ch->cp, CURLINFO_LOCAL_IP, &s_code) == 
CURLE_OK) {
+                       CAAS("local_ip", s_code);
+               }
+               if (curl_easy_getinfo(ch->cp, CURLINFO_LOCAL_PORT, &l_code) == 
CURLE_OK) {
+                       CAAL("local_port", l_code);
+               }
+#endif
                if (ch->header.str_len > 0) {
                        CAAS("request_header", ch->header.str);
                }
        } else {
                switch (option) {
+                       /* string variable types */
+#if LIBCURL_VERSION_NUM >= 0x071500
+                       case CURLINFO_PRIMARY_IP:
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071500
+                       case CURLINFO_LOCAL_IP:
+#endif
                        case CURLINFO_PRIVATE:
                        case CURLINFO_EFFECTIVE_URL:
                        case CURLINFO_CONTENT_TYPE: {
@@ -2333,6 +2354,11 @@
                                }
                                break;
                        }
+                       /* Long variable types */
+#if LIBCURL_VERSION_NUM >= 0x071500
+                       case CURLINFO_PRIMARY_PORT:
+                       case CURLINFO_LOCAL_PORT:
+#endif
                        case CURLINFO_HTTP_CODE:
                        case CURLINFO_HEADER_SIZE:
                        case CURLINFO_REQUEST_SIZE:
@@ -2348,6 +2374,7 @@
                                }
                                break;
                        }
+                       /* Double variable types */
                        case CURLINFO_TOTAL_TIME:
                        case CURLINFO_NAMELOOKUP_TIME:
                        case CURLINFO_CONNECT_TIME:

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to