7 skipif(!http_support(HTTP_SUPPORT_REQUESTS), "need request support");
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("%a, %a, %a\n", $provider, $ident, $counts["free"]);
25 http_get("http://www.google.com/", null, $info[]);
27 echo "One free request handle within GLOBAL: ";
28 $h = http_persistent_handles_count();
29 var_dump($h->http_request["GLOBAL"]["free"]);
31 echo "Reusing request handle: ";
32 http_get("http://www.google.com/", null, $info[]);
33 var_dump($info[0]["pretransfer_time"] > 10 * $info[1]["pretransfer_time"], $info[0]["pretransfer_time"], $info[1]["pretransfer_time"]);
35 echo "Handles' been cleaned up:\n";
36 http_persistent_handles_clean();
37 print_r(http_persistent_handles_count());
44 One free request handle within GLOBAL: int(1)
45 Reusing request handle: bool(true)
48 Handles' been cleaned up:
51 [http_request] => Array