From 327cff80ca71ec736e0c7689777ccefcf62de9b3 Mon Sep 17 00:00:00 2001 From: cajus Date: Tue, 19 Feb 2008 15:55:02 +0000 Subject: [PATCH] Updated for ping git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8964 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_gosaSupportDaemon.inc | 13 +++++++++++++ gosa-core/include/class_socketClient.inc | 3 +-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/gosa-core/include/class_gosaSupportDaemon.inc b/gosa-core/include/class_gosaSupportDaemon.inc index b712d7614..4427592eb 100644 --- a/gosa-core/include/class_gosaSupportDaemon.inc +++ b/gosa-core/include/class_gosaSupportDaemon.inc @@ -590,6 +590,19 @@ class gosaSupportDaemon } + static function ping($target) + { + if (tests::is_mac($target)){ + /* Get communication object */ + $d= new gosaSupportDaemon(TRUE,0.5); + + $answer= $d->_send("
gosa_ping
GOSA$target
", TRUE); + return (count($answer) ? TRUE:FALSE); + } + + return (FALSE); + } + } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: diff --git a/gosa-core/include/class_socketClient.inc b/gosa-core/include/class_socketClient.inc index 2812e2688..7219459bc 100644 --- a/gosa-core/include/class_socketClient.inc +++ b/gosa-core/include/class_socketClient.inc @@ -62,7 +62,7 @@ class Socket_Client private function decrypt($data) { /* decrypt data */ - if($this->b_encrypt){ + if($this->b_encrypt && strlen($data)){ $data = base64_decode($data); mcrypt_generic_init($this->td, $this->ckey, $this->iv); $data = mdecrypt_generic($this->td, $data); @@ -140,7 +140,6 @@ class Socket_Client } } if((microtime(TRUE) - $start) > $this->timeout ){ - trigger_error(sprintf("Exceeded timeout %f while reading from socket",$this->timeout)); break; } } -- 2.30.2