comparison seobeo/s_web.c @ 33:c0f6c8c7829f

[Seobeo] Linux epoll. Set the client socket to be nonblocking so that it doesn't stop loading when two different threads handle different client calls. I might have problem with socket not being cleaned up properly so need to check that.
author MrJuneJune <me@mrjunejune.com>
date Fri, 10 Oct 2025 06:59:32 -0700
parents 947b81010aba
children 6c322f9c2cb9
comparison
equal deleted inserted replaced
32:08a465eec50b 33:c0f6c8c7829f
200 (uint32)strlen(p_response_header)); 200 (uint32)strlen(p_response_header));
201 Seobeo_Handle_Queue(p_cli_handle, 201 Seobeo_Handle_Queue(p_cli_handle,
202 (const uint8*)entry->buffer, 202 (const uint8*)entry->buffer,
203 (uint32)body_size); 203 (uint32)body_size);
204 Seobeo_Handle_Flush(p_cli_handle); 204 Seobeo_Handle_Flush(p_cli_handle);
205 printf("DONE\n\n\n");
205 } 206 }
206 else if (strcmp(method, "POST") == 0) 207 else if (strcmp(method, "POST") == 0)
207 { 208 {
208 // --- TODO: Add POST logic here --- 209 // --- TODO: Add POST logic here ---
209 Seobeo_Web_Header_Generate(p_response_header, 210 Seobeo_Web_Header_Generate(p_response_header,
245 Seobeo_Handle_Queue(p_cli_handle, 246 Seobeo_Handle_Queue(p_cli_handle,
246 (const uint8*)p_response_header, 247 (const uint8*)p_response_header,
247 (uint32)strlen(p_response_header)); 248 (uint32)strlen(p_response_header));
248 Seobeo_Handle_Flush(p_cli_handle); 249 Seobeo_Handle_Flush(p_cli_handle);
249 } 250 }
251 goto clean_up;
250 252
251 clean_up: 253 clean_up:
254 printf("CLEAN UP\n\n\n");
252 if (p_cli_handle) 255 if (p_cli_handle)
256 {
257 printf("CLEAN UP called on client handle\n\n\n");
253 Seobeo_Handle_Destroy(p_cli_handle); 258 Seobeo_Handle_Destroy(p_cli_handle);
259 }
254 if (p_response_arena) 260 if (p_response_arena)
255 Dowa_Arena_Destroy(p_response_arena); 261 Dowa_Arena_Destroy(p_response_arena);
256 } 262 }
257 263
258 264