comparison seobeo/seobeo_internal.h @ 186:8cf4ec5e2191 hg-web

Fixed merge conflict.
author MrJuneJune <me@mrjunejune.com>
date Fri, 23 Jan 2026 22:38:59 -0800
parents 71ad34a8bc9a a8976a008a9d
children
comparison
equal deleted inserted replaced
176:fed99fc04e12 186:8cf4ec5e2191
22 SEOBEO_STREAM_TYPE_SERVER, 22 SEOBEO_STREAM_TYPE_SERVER,
23 SEOBEO_STREAM_TYPE_CLIENT, 23 SEOBEO_STREAM_TYPE_CLIENT,
24 } Seobeo_SocketType; 24 } Seobeo_SocketType;
25 25
26 typedef struct { 26 typedef struct {
27 int32 socket; 27 int32 socket;
28 Seobeo_SocketType type; 28 Seobeo_SocketType type;
29 boolean connected; 29 boolean connected;
30 30
31 char *host; 31 char *host;
32 char *port; 32 char *port;
33 33
34 SSL_CTX_TYPE *ssl_ctx; 34 SSL_CTX_TYPE *ssl_ctx;
35 SSL_TYPE *ssl; 35 SSL_TYPE *ssl;
36 36
37 uint8 *read_buffer; 37 uint8 *read_buffer;
38 uint32 read_buffer_capacity; 38 uint32 read_buffer_capacity;
39 uint32 read_buffer_len; // current size 39 uint32 read_buffer_len; // current size
40 uint32 read_buffer_used; // TODO: Implement this for client 40 uint32 read_buffer_used; // TODO: Implement this for client
41 41
42 uint8 *write_buffer; 42 uint8 *write_buffer;
43 uint32 write_buffer_capacity; 43 uint32 write_buffer_capacity;
44 uint32 write_buffer_len; // current size 44 uint32 write_buffer_len; // current size
45 45
46 void *file; 46 void *file;
47 void *text_copy; 47 void *text_copy;
48 char *file_name; 48 char *file_name;
49 49
50 atomic_bool destroyed; 50 atomic_bool destroyed;
51
52 // Keep-alive support
53 time_t last_activity; // Timestamp of last request/response
54 boolean keep_alive; // Whether this connection should be kept alive
51 } Seobeo_Handle; 55 } Seobeo_Handle;
52 56
53 // Cached file entry with content and size (for binary file support) 57 // Cached file entry with content and size (for binary file support)
54 typedef struct { 58 typedef struct {
55 char *content; 59 char *content;
92 96
93 // --- Parse Header into Dowa Map ---// 97 // --- Parse Header into Dowa Map ---//
94 extern int Seobeo_Web_Header_Parse(Seobeo_Handle *p_handle, Seobeo_Request_Entry **pp_map, Dowa_Arena *p_arena); 98 extern int Seobeo_Web_Header_Parse(Seobeo_Handle *p_handle, Seobeo_Request_Entry **pp_map, Dowa_Arena *p_arena);
95 99
96 // --- Handle Request --- // 100 // --- Handle Request --- //
97 extern void Seobeo_Web_HandleClientRequest(Seobeo_Handle *cli, Seobeo_Cache_Entry *p_html_cache); 101 /* Handle a client request. Returns TRUE if connection should be kept alive. */
102 extern boolean Seobeo_Web_ClientHandle_Request(Seobeo_Handle *p_cli_handle, Seobeo_Cache_Entry *p_html_cache, boolean use_keep_alive);
98 103
99 // --- SSL --- // 104 // --- SSL --- //
100 extern void Seobeo_Web_SSL_Init(); 105 extern void Seobeo_Web_SSL_Init();
101 extern void Seobeo_Web_SSL_Cleanup(); // Not used 106 extern void Seobeo_Web_SSL_Cleanup(); // Not used
102 extern int Seobeo_SSL_Setup_Client(Seobeo_Handle *p_handle, const char *host, int socket_fd); 107 extern int Seobeo_SSL_Setup_Client(Seobeo_Handle *p_handle, const char *host, int socket_fd);