2
0
Fork 0

Send 400 if header parsing failed

personal/stbuehler/wip
Stefan Bühler 2009-07-17 12:18:28 +02:00
parent 68b32499f9
commit fe54d1fe9d
1 changed files with 10 additions and 2 deletions

View File

@ -162,8 +162,16 @@ static gboolean connection_handle_read(liConnection *con) {
case LI_HANDLER_ERROR:
case LI_HANDLER_COMEBACK: /* unexpected */
/* unparsable header */
li_connection_error(con);
return FALSE;
if (CORE_OPTION(LI_CORE_OPTION_DEBUG_REQUEST_HANDLING).boolean) {
VR_DEBUG(vr, "%s", "parsing header failed");
}
con->keep_alive = FALSE;
con->mainvr->response.http_status = 400;
li_vrequest_handle_direct(con->mainvr);
con->state = LI_CON_STATE_WRITE;
con->in->is_closed = TRUE;
forward_response_body(con);
return TRUE;
}
con->wrk->stats.requests++;