- better fix
[m6w6/ext-http] / tests / HttpRequestPool_002.phpt
index 053f1f6b76804c3d769b229c516f1f3e4aeaf1dd..a85e81755efa0e0caf97ff76d5c82958ed6540a2 100644 (file)
@@ -4,6 +4,10 @@ extending HttpRequestPool
 <?php
 include 'skip.inc';
 checkcls('HttpRequestPool');
+checkurl('ch.php.net');
+checkurl('at.php.net');
+checkurl('de.php.net');
+checkurl('www.php.net');
 ?>
 --FILE--
 <?php
@@ -14,21 +18,23 @@ class MyPool extends HttpRequestPool
        public function send()
        {
                while ($this->socketPerform()) {
-                       $this->handleRequests();
                        if (!$this->socketSelect()) {
                                throw new HttpSocketException;
                        }
                }
-               $this->handleRequests();
        }
        
-       private function handleRequests()
+       protected final function socketPerform()
        {
+               $result = parent::socketPerform();
+               
                echo ".";
                foreach ($this->getFinishedRequests() as $r) {
                        echo "=", $r->getResponseCode(), "=";
                        $this->detach($r);
                }
+               
+               return $result;
        }
 }
 
@@ -45,5 +51,5 @@ echo "\nDone\n";
 ?>
 --EXPECTREGEX--
 .+TEST
-\.+=200=\.+=200=\.+=200=\.+=200=
+\.*=200=\.*=200=\.*=200=\.*=200=
 Done