51d3f8471566ea20346b3af505448b394dc5ff35
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.
cHTTP
This is an HTTP library for C, featuring an HTTP(S) server, HTTP(S) client, and much more!
Contributing
Contributions are welcome! The following are some notes on how to work with the codebase. Don't worry if you get something wrong. I will remind you.
The source code in the src/ directory is intended to be be amalgamated into a single file before compilation. The amalgamation is not only intended as a distribution method, but also as easy-access documentation, and therefore need to be readable. For this reasons:
- You never need need to include other cHTTP source files
- All inclusions of third-party headers are to be placed inside
src/includes.h - All files must start with a single empty line, unless they start with an overview comment of the file, in which case they must have no empty lines at the beginning of the file.
- All files must end with a single empty line.
Languages
C
98.9%
Python
0.9%
Makefile
0.2%