HTTPRequest::handle_shortcut PHP Method

handle_shortcut() protected method

shortcut handler
protected handle_shortcut ( $event, $args )
    protected function handle_shortcut($event, $args)
    {
        JAXLLogger::debug("executing shortcut '{$event}'");
        switch ($event) {
            // http status code shortcuts
            case 'ok':
            case 'redirect':
            case 'not_modified':
            case 'bad_request':
            case 'not_found':
            case 'internal_error':
                list($headers, $body) = $this->parse_shortcut_args($args);
                $code = $this->shortcuts[$event];
                $this->send_response($code, $headers, $body);
                $this->close();
                return 'closed';
                break;
                // others
            // others
            case 'recv_body':
                // send expect header if required
                if ($this->expect) {
                    $this->expect = false;
                    $this->send_line(100);
                }
                // read data
                $this->read();
                return 'wait_for_body';
                break;
            case 'close':
                $this->close();
                return 'closed';
                break;
        }
    }