public function writeResponse(\MSF\Response $response)
 {
     foreach ($response->oob() as $key => $value) {
         header('HTTP_Z_' . strtoupper($key) . ':' . json_encode($value));
     }
     $response->encodeUsing($this->encoder);
     echo $response->encoded;
     return strlen($response->encoded);
 }
 public function response(\MSF\Response $response)
 {
     $oob = array('client.rpc' => $this->rpc, 'started' => $this->started, 'ended' => microtime(true), 'host' => gethostname());
     $profile = $response->oob('profile');
     if ($profile) {
         $oob['profile'] = $profile;
     }
     // uhh, modifying a response is ugly
     $response->oob('profile', $oob);
     return $response;
 }