Fix some http request lifetime issues, and follow the same lowercase convention for headers.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4690 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-12-21 17:45:06 +00:00
parent 86046e52f0
commit 38ab32dad9
3 changed files with 59 additions and 9 deletions

View File

@ -21,6 +21,7 @@ typedef struct _tf_http_request_t
struct phr_header* headers;
int headers_count;
void* user_data;
int ref_count;
} tf_http_request_t;
typedef void (tf_http_callback_t)(tf_http_request_t* request);
@ -31,3 +32,6 @@ void tf_http_add_handler(tf_http_t* http, const char* pattern, tf_http_callback_
void tf_http_respond(tf_http_request_t* request, int status, const char** headers, int headers_count, const void* body, size_t content_length);
size_t tf_http_get_body(const tf_http_request_t* request, const void** out_data);
void tf_http_destroy(tf_http_t* http);
void tf_http_request_ref(tf_http_request_t* request);
void tf_http_request_release(tf_http_request_t* request);