From 53c2503a1a90c3c8d9626598e7995b153a54c898 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 23 Jan 2008 11:41:08 +0000 Subject: [PATCH] Updated socket client git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8566 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_socketClient.inc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gosa-core/include/class_socketClient.inc b/gosa-core/include/class_socketClient.inc index c082f4748..6b2dafddf 100644 --- a/gosa-core/include/class_socketClient.inc +++ b/gosa-core/include/class_socketClient.inc @@ -131,12 +131,22 @@ class Socket_Client stream_set_blocking($this->handle,0); $start = microtime(); - while(strlen($str) == 0 || !$this->_is_timeout($start)) { + /* Read while + * nothing was read yet + * the timelimit reached + * there is not data left on the socket. + */ + while(TRUE){ usleep(10000); $data = fread($this->handle, 1024000); if($data && strlen($data)>0) { $str .= $data; } else { + if(strlen($str) != 0){ + break; + } + } + if($this->_is_timeout($start)){ break; } } -- 2.30.2