From f8c44ab2e6107b5fca3c7375b368c18ef7704fc0 Mon Sep 17 00:00:00 2001 From: spl3g Date: Wed, 19 Mar 2025 18:10:25 +0300 Subject: Add http_log function --- lib/http.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 489775e..e033eff 100644 --- a/lib/http.h +++ b/lib/http.h @@ -14,6 +14,7 @@ #include #include #include +#include #include "const_strings.h" #include "arena_strings.h" @@ -89,6 +90,12 @@ struct server { context global_ctx; }; +typedef enum { + HTTP_INFO = 0, + HTTP_WARNING, + HTTP_ERROR, +} http_log_level; + typedef enum { CONTINUE = 100, SWITCHING_PROTOCOLS = 101, @@ -124,6 +131,7 @@ typedef enum { const_string get_response_string(response_code code); void *get_in_addr(struct sockaddr *sa); int get_in_port(struct sockaddr *sa); +void http_log(http_log_level log, char *fmt, ...); void set_context_value(arena *arena, context *ctx, context_value kv); void *get_context_value(context *ctx, const_string key); -- cgit v1.2.3