Mercurial
comparison seobeo/s_web.c @ 121:7b1719fa918c
[Seobeo] Added web socket server.
| author | June Park <parkjune1995@gmail.com> |
|---|---|
| date | Thu, 08 Jan 2026 06:45:10 -0800 |
| parents | c39582f937e5 |
| children | dbf14f84d51c |
comparison
equal
deleted
inserted
replaced
| 120:cbbf78b17cfa | 121:7b1719fa918c |
|---|---|
| 131 goto clean_up; | 131 goto clean_up; |
| 132 } | 132 } |
| 133 | 133 |
| 134 void *p_path_kv = Dowa_HashMap_Get_Ptr(p_req_map, "Path"); | 134 void *p_path_kv = Dowa_HashMap_Get_Ptr(p_req_map, "Path"); |
| 135 const char *path = p_path_kv ? ((Seobeo_Request_Entry*)p_path_kv)->value : "/"; | 135 const char *path = p_path_kv ? ((Seobeo_Request_Entry*)p_path_kv)->value : "/"; |
| 136 | |
| 137 // --- Check for WebSocket upgrade request --- | |
| 138 if (Seobeo_WebSocket_Server_Handle_Upgrade(p_cli_handle, p_req_map, path)) | |
| 139 { | |
| 140 Seobeo_Log(SEOBEO_INFO, "WebSocket connection established\n"); | |
| 141 if (p_request_arena) | |
| 142 Dowa_Arena_Free(p_request_arena); | |
| 143 if (p_response_arena) | |
| 144 Dowa_Arena_Free(p_response_arena); | |
| 145 return; | |
| 146 } | |
| 136 | 147 |
| 137 // --- Try to match API route first --- | 148 // --- Try to match API route first --- |
| 138 Seobeo_Route_Handler handler = Seobeo_Router_Find_Handler(method, path, &p_req_map, p_request_arena); | 149 Seobeo_Route_Handler handler = Seobeo_Router_Find_Handler(method, path, &p_req_map, p_request_arena); |
| 139 if (handler != NULL) | 150 if (handler != NULL) |
| 140 { | 151 { |