diff options
author | Instructor, Computer Systems Technology <jim_parry@bcit.ca> | 2016-10-19 00:28:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-19 00:28:05 +0200 |
commit | 062b7d41d4cf656e481ea6cb5e8ccf1cd4933e20 (patch) | |
tree | 5e6c7c3262328d6a7f98be1f0aa32cb51f2bf691 | |
parent | ed7ac05115c7261a59ad0dcdf03071763d00b0c7 (diff) | |
parent | 2e57058329d6b8a76db8d6f04ff7467ff204a637 (diff) |
Merge pull request #4855 from jim-parry/fix/xmlrpc-timeout
Fix xmlrpc timeout, #4843
-rw-r--r-- | system/libraries/Xmlrpc.php | 5 | ||||
-rw-r--r-- | user_guide_src/source/libraries/xmlrpc.rst | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php index 181a104d0..4be926f0e 100644 --- a/system/libraries/Xmlrpc.php +++ b/system/libraries/Xmlrpc.php @@ -734,6 +734,8 @@ class XML_RPC_Client extends CI_Xmlrpc .'User-Agent: '.$this->xmlrpcName.$r .'Content-Length: '.strlen($msg->payload).$r.$r .$msg->payload; + + stream_set_timeout($fp,$this->timeout); // set timeout for subsequent operations for ($written = $timestamp = 0, $length = strlen($op); $written < $length; $written += $result) { @@ -753,9 +755,6 @@ class XML_RPC_Client extends CI_Xmlrpc $result = FALSE; break; } - - usleep(250000); - continue; } else { diff --git a/user_guide_src/source/libraries/xmlrpc.rst b/user_guide_src/source/libraries/xmlrpc.rst index 4d7ed66d5..04be8d52d 100644 --- a/user_guide_src/source/libraries/xmlrpc.rst +++ b/user_guide_src/source/libraries/xmlrpc.rst @@ -490,6 +490,10 @@ Class Reference $this->xmlrpc->timeout(6); + This timeout period will be used both for an initial connection to + the remote server, as well as for getting a response from it. + Make sure you set the timeout before calling `send_request`. + .. php:method:: method($function) :param string $function: Method name |