From: Mark Slee Date: Thu, 11 Jan 2007 01:26:00 +0000 (+0000) Subject: Fix call_user_func bug on debugHandler_ X-Git-Tag: 0.2.0~1567 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=e7714a6c0911a42ead7934934334b7d330b36e87;p=common%2Fthrift.git Fix call_user_func bug on debugHandler_ Reviewed By: lucas git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664905 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/lib/php/src/transport/TSocket.php b/lib/php/src/transport/TSocket.php index c193305d..c33a352a 100644 --- a/lib/php/src/transport/TSocket.php +++ b/lib/php/src/transport/TSocket.php @@ -147,7 +147,7 @@ class TSocket extends TTransport { if ($this->handle_ === FALSE) { $error = 'TSocket: Could not connect to '.$this->host_.':'.$this->port_; if ($this->debug_) { - $this->debugHandler_($error); + call_user_func($this->debugHandler_, $error); } throw new Exception($error); } diff --git a/lib/php/src/transport/TSocketPool.php b/lib/php/src/transport/TSocketPool.php index 5edac383..8036bea1 100644 --- a/lib/php/src/transport/TSocketPool.php +++ b/lib/php/src/transport/TSocketPool.php @@ -182,9 +182,10 @@ class TSocketPool extends TSocket { if ($elapsed > $retryInterval) { $retryIntervalPassed = TRUE; if ($this->debug_) { - $this->debugHandler_('TSocketPool: retryInterval '. - '('.$this->retryInterval_.') '. - 'has passed for host '.$host.':'.$port); + call_user_func($this->debugHandler_, + 'TSocketPool: retryInterval '. + '('.$this->retryInterval_.') '. + 'has passed for host '.$host.':'.$port); } } } @@ -238,9 +239,10 @@ class TSocketPool extends TSocket { // Log and cache this failure if ($consecfails >= $this->maxConsecutiveFailures_) { if ($this->debug_) { - $this->debugHandler_('TSocketPool: marking '.$host.':'.$port. - ' as down for '.$this->retryInterval.' secs '. - 'after '.$consecfails.' failed attempts.'); + call_user_func($this->debugHandler_, + 'TSocketPool: marking '.$host.':'.$port. + ' as down for '.$this->retryInterval.' secs '. + 'after '.$consecfails.' failed attempts.'); } // Store the failure time apc_store($failtimeKey, time()); @@ -262,7 +264,7 @@ class TSocketPool extends TSocket { $hostlist = implode(',', $hosts); $error .= '('.$hostlist.')'; if ($this->debug_) { - $this->debugHandler_($error); + call_user_func($this->debugHandler_, $error); } throw new Exception($error); }