7 skipif(!http_support(HTTP_SUPPORT_REQUESTS), "need request support");
8 skipif(function_exists('zend_thread_id'), "need non-ZTS build");
11 http.persistent.handles.limit=-1
12 http.persistent.handles.ident=GLOBAL
17 echo "No free handles!\n";
18 foreach (http_persistent_handles_count() as $provider => $idents) {
19 foreach ((array)$idents as $ident => $counts) {
20 if (!empty($counts["free"])) {
21 printf("%a, %a, %a\n", $provider, $ident, $counts["free"]);
26 http_get("http://www.google.com/", null, $info[]);
28 echo "One free request handle within GLOBAL: ";
29 $h = http_persistent_handles_count();
30 var_dump($h->http_request["GLOBAL"]["free"]);
32 echo "Reusing request handle: ";
33 http_get("http://www.google.com/", null, $info[]);
34 var_dump($info[0]["pretransfer_time"] > 10 * $info[1]["pretransfer_time"], $info[0]["pretransfer_time"], $info[1]["pretransfer_time"]);
36 echo "Handles' been cleaned up:\n";
37 http_persistent_handles_clean();
38 print_r(http_persistent_handles_count());
45 One free request handle within GLOBAL: int(1)
46 Reusing request handle: bool(true)
49 Handles' been cleaned up:
52 [http_request] => Array
62 [http_request_datashare] => Array
72 [http_request_pool] => Array