Skip to content

Commit a09ffbc

Browse files
jim-parrynarfbg
authored andcommitted
Merge pull request bcit-ci#4855 from jim-parry/fix/xmlrpc-timeout
Fix xmlrpc timeout, bcit-ci#4843
1 parent a9e5773 commit a09ffbc

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

system/libraries/Xmlrpc.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ public function sendPayload($msg)
734734
.'User-Agent: '.$this->xmlrpcName.$r
735735
.'Content-Length: '.strlen($msg->payload).$r.$r
736736
.$msg->payload;
737+
738+
stream_set_timeout($fp,$this->timeout); // set timeout for subsequent operations
737739

738740
for ($written = $timestamp = 0, $length = strlen($op); $written < $length; $written += $result)
739741
{
@@ -753,9 +755,6 @@ public function sendPayload($msg)
753755
$result = FALSE;
754756
break;
755757
}
756-
757-
usleep(250000);
758-
continue;
759758
}
760759
else
761760
{

user_guide_src/source/libraries/xmlrpc.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,10 @@ Class Reference
490490

491491
$this->xmlrpc->timeout(6);
492492

493+
This timeout period will be used both for an initial connection to
494+
the remote server, as well as for getting a response from it.
495+
Make sure you set the timeout before calling `send_request`.
496+
493497
.. php:method:: method($function)
494498
495499
:param string $function: Method name

0 commit comments

Comments
 (0)