Code

Updated socket client
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 23 Jan 2008 11:41:08 +0000 (11:41 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 23 Jan 2008 11:41:08 +0000 (11:41 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8566 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_socketClient.inc

index c082f4748821896eae03e8232dd6ddc278d7d326..6b2dafddfe0757f2fcd79715fff2c0321d3f63b6 100644 (file)
@@ -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;
                        }
                }