Mercurial
view seobeo/seobeo_internal.h @ 59:e06bc03d9618
[Color Game] Making game with a friend.
| author | June Park <parkjune1995@gmail.com> |
|---|---|
| date | Sat, 20 Dec 2025 10:53:13 -0800 |
| parents | 84672efec192 |
| children | ea9ef388ab97 |
line wrap: on
line source
#ifndef SEOBEO_SERVER_INTERNAL_H #define SEOBEO_SERVER_INTERNAL_H // SSL #include <openssl/ssl.h> #include <openssl/err.h> #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_PHashMap cache; int evfd; // epoll‐fd or kqueue‐fd } 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_PHashMap map); // --- Handle Request --- // extern void Seobeo_Web_HandleClientRequest(Seobeo_PHandle cli, Dowa_PHashMap 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_PHashMap p_html_cache); extern void Seobeo_Web_Edge_2(Seobeo_PHandle p_server_handle, Dowa_PHashMap p_html_cache); #endif