allow configuring the timeout for http_client, and default to 5 seconds instead of...
authorChuck Hagenbuch <chuck@horde.org>
Wed, 21 Jan 2009 18:47:16 +0000 (13:47 -0500)
committerChuck Hagenbuch <chuck@horde.org>
Wed, 21 Jan 2009 18:47:16 +0000 (13:47 -0500)
framework/Http_Client/lib/Horde/Http/Client.php

index 3470be3..64ca8ff 100644 (file)
@@ -49,6 +49,12 @@ class Horde_Http_Client
     protected $_proxyPass = null;
 
     /**
+     * HTTP timeout
+     * @var fload
+     */
+    protected $_timeout = 5;
+
+    /**
      * The most recent HTTP request
      *
      * An array with these values:
@@ -207,7 +213,9 @@ class Horde_Http_Client
         $opts = array('http' => array(
             'method' => $method,
             'header' => implode("\n", $headers),
-            'content' => $data));
+            'content' => $data,
+            'timeout' => $this->_timeout,
+        ));
 
         // Proxy settings
         if ($this->proxyServer) {