forked from cory/tildefriends
js: Move the global 404 response to C.
This commit is contained in:
@ -107,6 +107,7 @@ static const char* _http_connection_get_header(const tf_http_connection_t* conne
|
||||
static void _http_connection_destroy(tf_http_connection_t* connection, const char* reason);
|
||||
static void _http_timer_reset(tf_http_connection_t* connection);
|
||||
static void _http_tls_update(tf_http_connection_t* connection);
|
||||
static void _http_builtin_404_handler(tf_http_request_t* request);
|
||||
|
||||
tf_http_t* tf_http_create(uv_loop_t* loop)
|
||||
{
|
||||
@ -196,6 +197,10 @@ static void _http_connection_on_close(uv_handle_t* handle)
|
||||
static void _http_request_destroy(tf_http_request_t* request)
|
||||
{
|
||||
tf_http_close_callback* on_close = request->on_close;
|
||||
if (request->connection && !request->connection->is_response_sent)
|
||||
{
|
||||
_http_builtin_404_handler(request);
|
||||
}
|
||||
if (on_close)
|
||||
{
|
||||
tf_trace_t* trace = request->http->trace;
|
||||
|
Reference in New Issue
Block a user