webserver.php
changeset 56 53b0f0d7ff6f
parent 53 a6b339665650
child 57 31ce64a3ff6c
equal deleted inserted replaced
55:b8a3c9c54fbe 56:53b0f0d7ff6f
   506       }
   506       }
   507       
   507       
   508       // fork off if possible
   508       // fork off if possible
   509       if ( function_exists('pcntl_fork') && $this->allow_fork && !$this->in_keepalive )
   509       if ( function_exists('pcntl_fork') && $this->allow_fork && !$this->in_keepalive )
   510       {
   510       {
   511         if ( $this->threader->fork() == Threader::FORK_CHILD )
   511         $fork_result = $this->threader->fork();
       
   512         if ( $fork_result == Threader::FORK_CHILD )
   512         {
   513         {
   513           // this is the child
   514           // this is the child
   514           define('HTTPD_WS_CHILD', 1);
   515           define('HTTPD_WS_CHILD', 1);
   515         }
   516         }
   516         else
   517         else
   517         {
   518         {
   518           // we are the parent, continue listening
   519           // we are the parent, continue listening
   519           $remote->soft_shutdown();
   520           $remote->soft_shutdown();
   520           $this->child_list[] = $pid;
   521           $this->child_list[] = $fork_result;
   521           continue;
   522           continue;
   522         }
   523         }
   523       }
   524       }
   524       
   525       
   525       $this->in_keepalive = false;
   526       $this->in_keepalive = false;