webserver.php
changeset 64 ee64bb096f56
parent 63 af239423ed15
child 67 c4aefad02ce4
--- a/webserver.php	Tue Dec 23 17:37:51 2008 -0500
+++ b/webserver.php	Tue Dec 23 20:20:35 2008 -0500
@@ -265,7 +265,7 @@
         if ( is_string($targetgroup) )
         {
           $targetgroup = posix_getgrnam($targetgroup);
-          $targetgroup = $targetgroup['uid'];
+          $targetgroup = $targetgroup['gid'];
         }
         // make sure all info is valid
         if ( !is_int($targetuser) || !is_int($targetgroup) )
@@ -624,6 +624,10 @@
         if ( preg_match('/^HTTP_/', $key) )
           unset($_SERVER[$key]);
       }
+      if ( !isset($_SERVER['SERVER_SOFTWARE']) )
+      {
+        $_SERVER['SERVER_SOFTWARE'] =& $this->server_string;
+      }
       unset($client_headers[0]);
       foreach ( $client_headers as $line )
       {
@@ -2126,7 +2130,15 @@
   
   function write($data)
   {
-    return @fwrite($this->sock, $data);
+    $data = str_split($data, 8096);
+    foreach ( $data as $chunk )
+    {
+      while ( !@fwrite($this->sock, $chunk) )
+      {
+        usleep(50000);
+      }
+    }
+    return true;
   }
   
   function is_eof()