Send a valid HTTP response and shutdown the connection.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4679 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-12-17 17:44:54 +00:00
parent 067f546580
commit 7b3a9e0f63
3 changed files with 71 additions and 13 deletions

View File

@ -1,5 +1,7 @@
#pragma once
#include <stddef.h>
typedef struct uv_loop_s uv_loop_t;
typedef struct _tf_http_t tf_http_t;
typedef struct _tf_http_connection_t tf_http_connection_t;
@ -26,4 +28,5 @@ typedef void (tf_http_callback_t)(tf_http_request_t* request);
tf_http_t* tf_http_create(uv_loop_t* loop);
void tf_http_listen(tf_http_t* http, int port);
void tf_http_add_handler(tf_http_t* http, const char* pattern, tf_http_callback_t* callback, void* user_data);
void tf_http_respond(tf_http_request_t* request, int status, const char** headers, int headers_count, void* body, size_t content_length);
void tf_http_destroy(tf_http_t* http);