Code

msgPool
[gosa.git] / gosa-core / include / class_socketClient.inc
index 2812e26880eab4dd50b5455bc3d2eb204d4b7348..cda5e68d314ea224030ebdede61695a3c88aa834 100644 (file)
@@ -1,4 +1,24 @@
 <?php
+/*
+ * This code is part of GOsa (http://www.gosa-project.org)
+ * Copyright (C) 2003-2008 GONICUS GmbH
+ *
+ * ID: $$Id$$
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 class Socket_Client
 {
@@ -62,7 +82,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 +160,6 @@ class Socket_Client
         }
       }
       if((microtime(TRUE) - $start) > $this->timeout ){      
-        trigger_error(sprintf("Exceeded timeout %f while reading from socket",$this->timeout));
         break;
       }
     }