From e7714a6c0911a42ead7934934334b7d330b36e87 Mon Sep 17 00:00:00 2001 From: Mark Slee Date: Thu, 11 Jan 2007 01:26:00 +0000 Subject: [PATCH] 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 --- lib/php/src/transport/TSocket.php | 2 +- lib/php/src/transport/TSocketPool.php | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) 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); } -- 2.17.1