6 skipif(!http_support(HTTP_SUPPORT_REQUESTS), "need request support");
7 skipif(!function_exists('zend_thread_id'), "need ZTS build");
10 http.persistent.handles.limit=-1
11 http.persistent.handles.ident=GLOBAL
16 echo "No free handles!\n";
17 foreach (http_persistent_handles_count() as $provider => $idents) {
18 foreach ((array)$idents as $ident => $counts) {
19 if (!empty($counts["free"])) {
20 printf("%s, %s, %s\n", $provider, $ident, $counts["free"]);
25 http_get("http://www.google.com/", null, $info[]);
27 echo "One free request handle within GLOBAL: ";
28 var_dump(http_persistent_handles_count()->http_request["GLOBAL"]["free"]);
30 echo "Reusing request handle: ";
31 http_get("http://www.google.com/", null, $info[]);
32 var_dump($info[0]["pretransfer_time"] > 10 * $info[1]["pretransfer_time"], $info[0]["pretransfer_time"], $info[1]["pretransfer_time"]);
34 echo "Handles' been cleaned up:\n";
35 http_persistent_handles_clean();
36 print_r(http_persistent_handles_count());
43 One free request handle within GLOBAL: int(1)
44 Reusing request handle: bool(true)
47 Handles' been cleaned up:
50 [http_request] => Array
60 [http_request_datashare] => Array
70 [http_request_datashare_lock] => Array
80 [http_request_pool] => Array