Mercurial
comparison seobeo/seobeo_internal.h @ 67:6626ec933933
[Seobeo] Separated out Client Server logic. Created test tools.
| author | June Park <parkjune1995@gmail.com> |
|---|---|
| date | Wed, 24 Dec 2025 09:15:55 -0800 |
| parents | a0f0ad5e42eb |
| children | 75de5903355c |
comparison
equal
deleted
inserted
replaced
| 66:a0f0ad5e42eb | 67:6626ec933933 |
|---|---|
| 1 #ifndef SEOBEO_SERVER_INTERNAL_H | 1 #ifndef SEOBEO_SERVER_INTERNAL_H |
| 2 #define SEOBEO_SERVER_INTERNAL_H | 2 #define SEOBEO_SERVER_INTERNAL_H |
| 3 | 3 |
| 4 // SSL | 4 // SSL - conditionally included |
| 5 #include <openssl/ssl.h> | 5 #ifndef SEOBEO_NO_SSL |
| 6 #include <openssl/ssl.h> | |
| 6 #include <openssl/err.h> | 7 #include <openssl/err.h> |
| 8 #define SSL_CTX_TYPE SSL_CTX | |
| 9 #define SSL_TYPE SSL | |
| 10 #else | |
| 11 #define SSL_CTX_TYPE void | |
| 12 #define SSL_TYPE void | |
| 13 #endif | |
| 7 | 14 |
| 8 #ifndef DIRECTORY | 15 #ifndef DIRECTORY |
| 9 #define DIRECTORY | 16 #define DIRECTORY |
| 10 #endif | 17 #endif |
| 11 #include "dowa/dowa.h" | 18 #include "dowa/dowa.h" |
| 20 Seobeo_SocketType type; | 27 Seobeo_SocketType type; |
| 21 boolean connected; | 28 boolean connected; |
| 22 | 29 |
| 23 char *host; | 30 char *host; |
| 24 char *port; | 31 char *port; |
| 25 | 32 |
| 26 SSL_CTX *ssl_ctx; | 33 SSL_CTX_TYPE *ssl_ctx; |
| 27 SSL *ssl; | 34 SSL_TYPE *ssl; |
| 28 | 35 |
| 29 uint8 *read_buffer; | 36 uint8 *read_buffer; |
| 30 uint32 read_buffer_capacity; | 37 uint32 read_buffer_capacity; |
| 31 uint32 read_buffer_len; // current size | 38 uint32 read_buffer_len; // current size |
| 32 uint32 read_buffer_used; // TODO: Implement this for client | 39 uint32 read_buffer_used; // TODO: Implement this for client |
| 62 extern void Seobeo_Web_HandleClientRequest(Seobeo_Handle *cli, Dowa_HashMap *p_html_cache); | 69 extern void Seobeo_Web_HandleClientRequest(Seobeo_Handle *cli, Dowa_HashMap *p_html_cache); |
| 63 | 70 |
| 64 // --- SSL --- // | 71 // --- SSL --- // |
| 65 extern void Seobeo_Web_SSL_Init(); | 72 extern void Seobeo_Web_SSL_Init(); |
| 66 extern void Seobeo_Web_SSL_Cleanup(); // Not used | 73 extern void Seobeo_Web_SSL_Cleanup(); // Not used |
| 74 extern int Seobeo_SSL_Setup_Client(Seobeo_Handle *p_handle, const char *host, int socket_fd); | |
| 75 extern void Seobeo_SSL_Cleanup(Seobeo_Handle *p_handle); | |
| 76 extern int32 Seobeo_SSL_Write(Seobeo_Handle *p_handle, const uint8 *data, uint32 length); | |
| 77 extern int32 Seobeo_SSL_Read(Seobeo_Handle *p_handle, uint8 *buffer, uint32 length); | |
| 67 | 78 |
| 68 // --- Serving using Edge --- // | 79 // --- Serving using Edge --- // |
| 69 extern void *Seobeo_Web_Edge_Worker(void *vargs); | 80 extern void *Seobeo_Web_Edge_Worker(void *vargs); |
| 70 extern void Seobeo_Web_Edge(Seobeo_Handle *p_server_handle, int thread_count, Dowa_HashMap *p_html_cache); | 81 extern void Seobeo_Web_Edge(Seobeo_Handle *p_server_handle, int thread_count, Dowa_HashMap *p_html_cache); |
| 71 extern void Seobeo_Web_Edge_2(Seobeo_Handle *p_server_handle, Dowa_HashMap *p_html_cache); | 82 extern void Seobeo_Web_Edge_2(Seobeo_Handle *p_server_handle, Dowa_HashMap *p_html_cache); |
| 72 | 83 |
| 73 #endif | 84 #endif |
| 74 |