Commit Graph
14 Commits
Author SHA1 Message Date
cozis fe1c0d5b86 Draft of the Set-Cookie header parser 2025-11-22 22:31:29 +01:00
Claudeandcozis 51d3f84715 Address code review feedback for HTTP client and server
Based on code review feedback:

Client improvements:
- Remove redundant capacity check in http_client_get_builder
  (already verified num_conns < capacity)
- Fix generation counter - no longer reset to zero when allocating
  connections, only incremented on request send
- Add HTTP_Method parameter to http_request_builder_url instead
  of hardcoding GET method
- Free connection resources when http_request_builder_send fails
  (invalid host mode or socket_connect failure)

Server bug fix:
- Fix ready queue indexing in http_server_next_request
  Changed: &server->conns[server->ready_head]
  To: &server->conns[server->ready[server->ready_head]]
  This bug would have caused incorrect connection retrieval

All changes maintain consistency with the codebase style and
improve robustness of error handling.
2025-11-21 20:37:18 +01:00
Claude 2d407b63c2 Fix TODOs unrelated to HTTP client
- Add documentation comments for print_bytes() and HTTP_UNPACK macro in src/basic.h
- Improve error handling in src/socket.c: add checks for ioctlsocket, socket creation,
  and connection failures; implement socket_manager_wakeup with proper signaling;
  consume wakeup signals; add memory cleanup for registered names
- Add header validation in src/server.c to prevent HTTP response splitting attacks
- Enhance HTTP parsing in src/parse.c: support percent-encoded characters in userinfo,
  expand HTTP methods without request bodies, add response body detection logic,
  improve cookie parsing comments
- Document unused 'ad' parameter in src/secure_context.c SNI callback
2025-11-21 19:07:51 +00:00
cozis 879dc74e34 First version of the refactor 2025-11-21 12:53:03 +01:00
cozis 17ad7ad383 Add http_match_host and update 060_virtual_hosts_over_https.c 2025-10-17 12:10:35 +02:00
cozis a4f8f3abb7 Fix missing definition of SIZEOF 2025-09-23 09:44:36 +02:00
cozis 477d4bec4c Remove duplicate declaration of is_digit 2025-09-23 09:36:27 +02:00
cozis d2fa677ac8 Add http_get_cookie, http_get_param, http_get_param_i 2025-09-21 10:47:48 +02:00
cozis b1021deb15 Add secure field to HTTP_Request to mark whether the underlying connection uses TLS or not 2025-09-18 09:19:38 +02:00
cozis a63e68f969 Add support for Transfer-Encoding 2025-07-28 16:32:31 +02:00
cozis 58f8ace725 Add global state initialization functions 2025-07-21 21:37:02 +02:00
cozis acf4746611 Simplify amalgamation script 2025-07-21 02:21:33 +02:00
cozis dba15c946e Rename http.c/.h to chttp.c/.h and improve amalgamation formatting 2025-07-20 18:33:51 +02:00
cozis 51cae898f8 Rewrite 2025-07-20 16:46:08 +02:00