Commit graph

157 commits

Author SHA1 Message Date
31fa6bdd0c Update README.md
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 10s
2024-09-10 14:00:57 +09:00
bf7bfe5c86 Impl. hot reloading of config and on SIGUSR1
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 40s
Resolves #2
2024-09-10 13:55:16 +09:00
bc879408fe Fix "unfixed" "count" from previous commit
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 2s
2024-09-09 17:01:41 +09:00
615a3e95e5 Fix typo when returning 500 error
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 5s
2024-09-09 16:59:46 +09:00
952808aefc Minor fixes/cleanup
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 5s
2024-09-09 13:53:58 +09:00
3bace3286f Refactor "print request headers"
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 2s
Resolves #1
2024-09-09 12:41:15 +09:00
2791714f2c Update third-party submodule SimpleArchiver
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 3s
Also fixes related to the updated third-party submodule.
2024-09-09 11:32:05 +09:00
9294108f13 Impl. print of specific headers arg/option
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 2s
TODO: Maybe refactor this to use a hash-map or something similar to
speed up the process. If N = number-of-headers-to-print and M =
size-of-request-buffer, then currrently this will take O(N*M) time.
2024-09-06 17:30:37 +09:00
fcad980593 Add flag to disable peer address printing
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 33s
Minor teak in main to make Args const.
2024-09-06 16:40:36 +09:00
274f0af887 Debug print only in Debug builds 2024-09-06 16:32:47 +09:00
c9c21105f6 Only allow protocol "HTTP/1.1"
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 33s
2024-09-06 15:57:46 +09:00
c194555527 Add support for different error responses 2024-09-06 15:55:21 +09:00
42d97e03b3 Remove "?" or "#" starting suffixes from path
These suffixes may break loading the correct html template.
2024-09-06 15:33:31 +09:00
0196588f51 Update third party submodule SimpleArchiver
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 33s
2024-09-06 14:30:33 +09:00
3c620d852a update README.md
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 2s
2024-09-06 13:47:31 +09:00
21f3a3a103 Fix warnings
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 2s
2024-09-06 13:43:25 +09:00
af942c927b Add CMakeLists.txt, update .gitignore 2024-09-06 13:24:28 +09:00
6cfaf4edd8 Update README.md
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 32s
2024-09-06 13:16:31 +09:00
a9864542b3 Add README.md, ensure listening port is printed
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 2s
2024-09-06 13:11:00 +09:00
d89117430d Minor tweaks/fixes
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 32s
Add example config using "_FILE" variables.

Increase limit of config value size from 256 to 1024.
2024-09-06 12:49:32 +09:00
b12029984f Add more example.config stuff 2024-09-06 12:42:18 +09:00
2d215b4a4e Fix invalid read when checking for "_FILE" vars
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 31s
2024-09-06 12:03:03 +09:00
bcb4c3c711 Minor tweak to listening port info output
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 32s
2024-09-06 11:56:52 +09:00
9be6ac32bf Impl. handling HTTP/1.1 requests
TODO:
    Handle errors other than 404 Not Found.
2024-09-06 11:56:00 +09:00
3f70c52551 Use ${CC} and "CC ?= gcc" in Makefile
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 2s
2024-09-05 16:25:49 +09:00
dd5934351e Fix inconsistent http_template output size
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 2s
2024-09-05 16:18:28 +09:00
8a9637d941 Add "output" size parameter to http_template fn 2024-09-05 16:12:50 +09:00
676b98751d Remove temporary files created by unit test on end
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 33s
2024-09-05 14:07:42 +09:00
229e3a330f Impl. ".*_FILE" variables for templates
If there exists a "{{{something_FILE}}}" (a variable ending with
"_FILE"), then the loaded variable will be treated as a filename and its
contents will be put in the html template.
2024-09-05 14:02:25 +09:00
8e799ef34a Add action/workflow to run unit tests
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 2s
2024-09-04 17:51:07 +09:00
e458c6e87b config parsing: Handle when config has no endline
Put duplicate code into a macro/defines function.
2024-09-04 17:37:16 +09:00
2d96295555 Test using "HTML_FILE" var, fixes 2024-09-04 17:22:44 +09:00
1d5fb6bbbd Minor formatting fix 2024-09-04 15:33:47 +09:00
69f5f7664a Update submodule third-party SimpleArchiver 2024-09-04 15:32:14 +09:00
2f5ea544e5 Set up tests for http_template, fixes 2024-09-04 15:26:20 +09:00
4d400c43be WIP untested Impl. html generation from templates 2024-09-03 16:20:18 +09:00
0b9f0e38f8 WIP some work on http req/response handling 2024-09-02 13:51:10 +09:00
0022bf8b39 Add more documentation about how src/config works 2024-09-02 13:25:30 +09:00
a8f41eec7f Update third_party submodule SimpleArchiver 2024-09-01 15:43:59 +09:00
52d99b7f56 Update third_party submodule SimpleArchiver 2024-09-01 15:16:08 +09:00
1811f65a13 Update Makefile: recompile if header has changed 2024-09-01 12:36:04 +09:00
3cf84b44ec Update documentation for config parsing 2024-08-31 16:55:09 +09:00
f5507c8412 Move config-related code from http.c to config.c
Also make config-related code more generic and improve unit tests of
config parsing.
2024-08-31 16:48:24 +09:00
edffbf0656 Cleanup usage of third-party headers 2024-08-31 14:43:53 +09:00
b4a56a7918 WIP Impl. config file parsing for http templates
TODO:
    Still need to test "HTML_FILE".
    Response to HTTP request.
2024-08-30 18:11:03 +09:00
efd4b39311 WIP html template handling for http response
TODO:
    Test html template handling so that it works.
    Respond to http requests properly.
2024-08-30 14:16:20 +09:00
d5a02de85e Add third_party SimpleArchiver (data structures)
Reusing the data structures implemented in the SimpleArchiver project.
2024-08-30 11:58:11 +09:00
77945f34b9 Add hint to error when binding socket 2024-08-29 16:48:43 +09:00
d46f617b4a Print connecting peer's address 2024-08-29 16:45:28 +09:00
b48f1890bf Return fail on failing to bind socket 2024-08-29 16:45:14 +09:00