X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http.c;h=e55b35f67e9cec1641194e8af0e010b163186917;hp=eccffd8e0bc7ed4576f5958e7d88db1b41ec35e8;hb=accf1817e811a7edabd687ef6105983f39f13942;hpb=fa6e9a361695e1c273266c79d0d27ff19059bb8a diff --git a/http.c b/http.c index eccffd8..e55b35f 100644 --- 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();