Mercurial
comparison seobeo/s_web.c @ 66:a0f0ad5e42eb
[Misc] taking out capital P stuff.
| author | June Park <parkjune1995@gmail.com> |
|---|---|
| date | Wed, 24 Dec 2025 06:34:19 -0800 |
| parents | ecb6ee6a22c3 |
| children | 6626ec933933 |
comparison
equal
deleted
inserted
replaced
| 65:ecb6ee6a22c3 | 66:a0f0ad5e42eb |
|---|---|
| 53 "\r\n", | 53 "\r\n", |
| 54 status, status_text, content_type, content_length | 54 status, status_text, content_type, content_length |
| 55 ); | 55 ); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void Seobeo_Web_HandleClientRequest(Seobeo_PHandle p_cli_handle, | 58 void Seobeo_Web_HandleClientRequest(Seobeo_Handle *p_cli_handle, |
| 59 Dowa_HashMap *p_html_cache) | 59 Dowa_HashMap *p_html_cache) |
| 60 { | 60 { |
| 61 printf("p_cli_handle: %p", p_cli_handle); | 61 printf("p_cli_handle: %p", p_cli_handle); |
| 62 Dowa_HashEntry *entry = NULL; | 62 Dowa_HashEntry *entry = NULL; |
| 63 Dowa_HashMap *p_current = p_html_cache; | 63 Dowa_HashMap *p_current = p_html_cache; |
| 258 Dowa_Arena_Destroy(p_response_arena); | 258 Dowa_Arena_Destroy(p_response_arena); |
| 259 return; | 259 return; |
| 260 } | 260 } |
| 261 | 261 |
| 262 | 262 |
| 263 int Seobeo_Web_Header_Parse(Seobeo_PHandle p_handle, Dowa_HashMap *map) | 263 int Seobeo_Web_Header_Parse(Seobeo_Handle *p_handle, Dowa_HashMap *map) |
| 264 { | 264 { |
| 265 // 1) Fill read_buffer until we see "\r\n\r\n" | 265 // 1) Fill read_buffer until we see "\r\n\r\n" |
| 266 while (1) | 266 while (1) |
| 267 { | 267 { |
| 268 int r = Seobeo_Handle_Read(p_handle); | 268 int r = Seobeo_Handle_Read(p_handle); |
| 467 { | 467 { |
| 468 perror("Dowa_Cache_Folder"); | 468 perror("Dowa_Cache_Folder"); |
| 469 return -1; | 469 return -1; |
| 470 } | 470 } |
| 471 | 471 |
| 472 Seobeo_PHandle p_server_handle = | 472 Seobeo_Handle *p_server_handle = |
| 473 Seobeo_Stream_Handle_Server_Create(NULL, port); | 473 Seobeo_Stream_Handle_Server_Create(NULL, port); |
| 474 if (p_server_handle->socket < 0) return 1; | 474 if (p_server_handle->socket < 0) return 1; |
| 475 | 475 |
| 476 printf("Listening on port %s\n", port); | 476 printf("Listening on port %s\n", port); |
| 477 | 477 |
| 485 sa.sa_flags = SA_RESTART; | 485 sa.sa_flags = SA_RESTART; |
| 486 sigaction(SIGCHLD, &sa, NULL); | 486 sigaction(SIGCHLD, &sa, NULL); |
| 487 | 487 |
| 488 while (1) | 488 while (1) |
| 489 { | 489 { |
| 490 Seobeo_PHandle p_cli_handle = | 490 Seobeo_Handle *p_cli_handle = |
| 491 Seobeo_Stream_Handle_Server_Accept(p_server_handle); | 491 Seobeo_Stream_Handle_Server_Accept(p_server_handle); |
| 492 if (!p_cli_handle) continue; | 492 if (!p_cli_handle) continue; |
| 493 | 493 |
| 494 if (fork() == 0) | 494 if (fork() == 0) |
| 495 { | 495 { |
| 512 | 512 |
| 513 int Seobeo_Web_Client_Get(const char *host, | 513 int Seobeo_Web_Client_Get(const char *host, |
| 514 const char *port, | 514 const char *port, |
| 515 const char *path) | 515 const char *path) |
| 516 { | 516 { |
| 517 Seobeo_PHandle h = Seobeo_Stream_Handle_Client_Create(host, port, TRUE); | 517 Seobeo_Handle *h = Seobeo_Stream_Handle_Client_Create(host, port, TRUE); |
| 518 if (!h || h->socket < 0) | 518 if (!h || h->socket < 0) |
| 519 { | 519 { |
| 520 if (h) | 520 if (h) |
| 521 Seobeo_Handle_Destroy(h); | 521 Seobeo_Handle_Destroy(h); |
| 522 return -1; | 522 return -1; |