Mercurial
view seobeo/seobeo_internal.h @ 65:ecb6ee6a22c3
[Misc] I will no longer drink cool aids of capital P.
| author | June Park <parkjune1995@gmail.com> |
|---|---|
| date | Wed, 24 Dec 2025 06:22:59 -0800 |
| parents | a30944e5719e |
| children | a0f0ad5e42eb |
line wrap: on
line source
#ifndef SEOBEO_SERVER_INTERNAL_H #define SEOBEO_SERVER_INTERNAL_H // SSL #include <openssl/ssl.h> #include <openssl/err.h> #ifndef DIRECTORY #define DIRECTORY #endif #include "dowa/dowa.h" typedef enum { SEOBEO_STREAM_TYPE_SERVER, SEOBEO_STREAM_TYPE_CLIENT, } Seobeo_SocketType; typedef struct { int32 socket; Seobeo_SocketType type; boolean connected; char *host; char *port; SSL_CTX *ssl_ctx; SSL *ssl; uint8 *read_buffer; uint32 read_buffer_capacity; uint32 read_buffer_len; // current size uint32 read_buffer_used; // TODO: Implement this for client uint8 *write_buffer; uint32 write_buffer_capacity; uint32 write_buffer_len; // current size void *file; void *text_copy; char *file_name; atomic_bool destroyed; } Sebeo_Handle, *Seobeo_PHandle; typedef struct { Seobeo_PHandle srv; Dowa_HashMap *cache; } WorkerArgs; typedef enum { SEOBEO_MODE_FORK, SEOBEO_MODE_EDGE, } Seobeo_ServerMode; // --- Parse Header into Dowa Map ---// extern int Seobeo_Web_Header_Parse(Seobeo_PHandle p_handle, Dowa_HashMap *map); // --- Handle Request --- // extern void Seobeo_Web_HandleClientRequest(Seobeo_PHandle cli, Dowa_HashMap *p_html_cache); // --- SSL --- // extern void Seobeo_Web_SSL_Init(); extern void Seobeo_Web_SSL_Cleanup(); // Not used // --- Serving using Edge --- // extern void *Seobeo_Web_Edge_Worker(void *vargs); extern void Seobeo_Web_Edge(Seobeo_PHandle p_server_handle, int thread_count, Dowa_HashMap *p_html_cache); extern void Seobeo_Web_Edge_2(Seobeo_PHandle p_server_handle, Dowa_HashMap *p_html_cache); #endif