|
|
@ -84,7 +84,8 @@ sandbox_receive_and_parse_client_request(struct sandbox *sandbox)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef LOG_HTTP_PARSER
|
|
|
|
#ifdef LOG_HTTP_PARSER
|
|
|
|
debuglog("Sandbox: %lu http_parser_execute(%p, %p, %p, %lu)", sandbox->id, parser, settings, buf, len);
|
|
|
|
debuglog("Sandbox: %lu http_parser_execute(%p, %p, %p, %zu\n)", sandbox->id, parser, settings, buf,
|
|
|
|
|
|
|
|
recved);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
size_t nparsed = http_parser_execute(parser, settings, buf, recved);
|
|
|
|
size_t nparsed = http_parser_execute(parser, settings, buf, recved);
|
|
|
|
|
|
|
|
|
|
|
@ -96,6 +97,14 @@ sandbox_receive_and_parse_client_request(struct sandbox *sandbox)
|
|
|
|
goto err;
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (recved == 0 && !sandbox->http_request.message_end) {
|
|
|
|
|
|
|
|
#ifdef LOG_HTTP_PARSER
|
|
|
|
|
|
|
|
debuglog("Sandbox %lu: Received 0, but parsing was incomplete\n", sandbox->id);
|
|
|
|
|
|
|
|
http_request_print(&sandbox->http_request);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
goto err;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sandbox->request_response_data_length += nparsed;
|
|
|
|
sandbox->request_response_data_length += nparsed;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -324,15 +333,8 @@ err:
|
|
|
|
/* Send a 400 error back to the client */
|
|
|
|
/* Send a 400 error back to the client */
|
|
|
|
client_socket_send(sandbox->client_socket_descriptor, 400);
|
|
|
|
client_socket_send(sandbox->client_socket_descriptor, 400);
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef LOG_TOTAL_REQS_RESPS
|
|
|
|
|
|
|
|
if (rc >= 0) {
|
|
|
|
|
|
|
|
atomic_fetch_add(&runtime_total_4XX_responses, 1);
|
|
|
|
|
|
|
|
debuglog("At %llu, Sandbox %lu - 4XX\n", __getcycles(), sandbox->id);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
software_interrupt_disable();
|
|
|
|
software_interrupt_disable();
|
|
|
|
client_socket_close(sandbox->client_socket_descriptor);
|
|
|
|
sandbox_close_http(sandbox);
|
|
|
|
sandbox_set_as_error(sandbox, SANDBOX_RUNNING);
|
|
|
|
sandbox_set_as_error(sandbox, SANDBOX_RUNNING);
|
|
|
|
goto done;
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
}
|
|
|
|