void cgi_http_process(cgi_http_connection_t *connection)
{
    HTTP_STATUS hstatus = cgi_http_process_read(connection);
    if (hstatus == BAD_REQUEST) {
        cgi_url_dltrie_t *url_dltrie = cgi_url_dltrie_default_root();
        cgi_url_dltrie_find(url_dltrie, "/error.html")(connection);
    } else {
        cgi_http_parse_param(connection);
        cgi_http_process_write(connection);
    }
    cgi_http_connection_write(connection);
}
示例#2
0
void cgi_http_process(cgi_http_connection_t *connection)
{
    HTTP_STATUS hstatus = cgi_http_process_read(connection);
    if (hstatus == BAD_REQUEST) {
        cgi_url_dltrie_t *url_dltrie = cgi_url_dltrie_default_root();
        cgi_url_dltrie_find(url_dltrie, "/error.html")(connection);
    } else {
        cgi_http_parse_param(connection);
        cgi_http_process_write(connection);
    }
    cgi_event_dispatcher_modfd(connection->dispatcher,
                               connection->sockfd, EPOLLOUT);
}