- deprecate HttpRequest::*RawPostData() in favour of ::*Body()
[m6w6/ext-http] / http.c
diff --git a/http.c b/http.c
index eccffd8e0bc7ed4576f5958e7d88db1b41ec35e8..e55b35f67e9cec1641194e8af0e010b163186917 100644 (file)
--- a/http.c
+++ b/http.c
@@ -31,6 +31,7 @@
 #include "php_http_request_method_api.h"
 #ifdef HTTP_HAVE_CURL
 #      include "php_http_request_api.h"
+#      include "php_http_request_pool_api.h"
 #      include "php_http_request_datashare_api.h"
 #      ifdef HTTP_HAVE_PERSISTENT_HANDLES
 #              include "php_http_persistent_handle_api.h"
@@ -289,6 +290,7 @@ PHP_MINIT_FUNCTION(http)
 #ifdef HTTP_HAVE_CURL
 #      ifdef HTTP_HAVE_PERSISTENT_HANDLES
                        (SUCCESS != PHP_MINIT_CALL(http_persistent_handle)) ||
+                       (SUCCESS != PHP_MINIT_CALL(http_request_pool)) ||
 #      endif
                        (SUCCESS != PHP_MINIT_CALL(http_request))       ||
 #      ifdef ZEND_ENGINE_2
@@ -431,6 +433,35 @@ PHP_MINFO_FUNCTION(http)
                        "http.chunked_decode, http.chunked_encode, http.deflate, http.inflate"
 #endif
                );
+#ifdef HTTP_HAVE_PERSISTENT_HANDLES
+               {
+                       phpstr s;
+                       HashTable *ht;
+                       HashPosition pos;
+                       HashKey key = initHashKey(0);
+                       zval **val;
+                       
+                       if ((ht = http_persistent_handle_statall())) {
+                               phpstr_init(&s);
+                               
+                               FOREACH_HASH_KEYVAL(pos, ht, key, val) {
+                                       phpstr_appendf(&s, "%s (%ld), ", key.str, Z_LVAL_PP(val));
+                               }
+                               zend_hash_destroy(ht);
+                               FREE_HASHTABLE(ht);
+                               
+                               PHPSTR_LEN(&s) -= 2; /* get rid of last ", " */
+                               phpstr_fix(&s);
+                               
+                               php_info_print_table_row(2, "Persistent Handles", PHPSTR_VAL(&s));
+                               phpstr_dtor(&s);
+                       } else {
+                               php_info_print_table_row(2, "Persistent Handles", "none");
+                       }
+               }
+#else
+               php_info_print_table_row(2, "Persistent Handles", "disabled");
+#endif
        }
        php_info_print_table_end();