comparison seobeo/s_web.c @ 16:fb2cff495a60

[Seobeo] Fixed the problem with edge server.
author June Park <parkjune1995@gmail.com>
date Fri, 03 Oct 2025 09:55:51 -0700
parents 114cad94008f
children d97ec3ded2ae
comparison
equal deleted inserted replaced
15:2b9e75756825 16:fb2cff495a60
137 (const uint8*)entry->buffer, 137 (const uint8*)entry->buffer,
138 (uint32)body_size); 138 (uint32)body_size);
139 Seobeo_Handle_Flush(p_cli_handle); 139 Seobeo_Handle_Flush(p_cli_handle);
140 140
141 clean_up: 141 clean_up:
142 Seobeo_Handle_Destroy(p_cli_handle); 142 if (p_cli_handle)
143 Dowa_Arena_Free(p_response_arena); 143 Seobeo_Handle_Destroy(p_cli_handle);
144 Dowa_HashMap_Free(p_req_map); // TODO: Maybe initilized hashmap within the Arena? 144 if (p_response_arena)
145 Dowa_Arena_Free(p_response_arena);
146 if (p_req_map)
147 Dowa_HashMap_Free(p_req_map); // TODO: Maybe initilized hashmap within the Arena?
145 } 148 }
146 149
147 int Seobeo_Web_ParseClientHeader(Seobeo_PHandle p_handle, Dowa_PHashMap map) 150 int Seobeo_Web_ParseClientHeader(Seobeo_PHandle p_handle, Dowa_PHashMap map)
148 { 151 {
149 // 1) Fill read_buffer until we see "\r\n\r\n" 152 // 1) Fill read_buffer until we see "\r\n\r\n"
284 while (1) { 287 while (1) {
285 Seobeo_PHandle cli = 288 Seobeo_PHandle cli =
286 Seobeo_Stream_Handle_Accept(p_server_handle); 289 Seobeo_Stream_Handle_Accept(p_server_handle);
287 if (!cli) continue; 290 if (!cli) continue;
288 291
289 if (fork() == 0) { 292 if (fork() == 0)
293 {
290 Seobeo_Web_HandleClientRequest(cli, 294 Seobeo_Web_HandleClientRequest(cli,
291 p_html_cache); 295 p_html_cache);
292 _exit(0); 296 _exit(0);
293 } 297 }
294 Seobeo_Handle_Destroy(cli); 298 Seobeo_Handle_Destroy(cli);