]>
git.seodisparate.com - c_simple_http/log
Stephen Seo [Wed, 30 Oct 2024 06:41:56 +0000 (15:41 +0900)]
Update README.md
Stephen Seo [Wed, 30 Oct 2024 06:41:07 +0000 (15:41 +0900)]
Move test static file to "example_static_dir/"
Stephen Seo [Wed, 30 Oct 2024 05:42:27 +0000 (14:42 +0900)]
Update third-party submodule SimpleArchiver
Stephen Seo [Wed, 30 Oct 2024 05:42:00 +0000 (14:42 +0900)]
Update README.md
Stephen Seo [Wed, 30 Oct 2024 05:29:03 +0000 (14:29 +0900)]
Fix test crashing if "xdg-mime" did not exist
Stephen Seo [Wed, 30 Oct 2024 05:17:49 +0000 (14:17 +0900)]
Add option --enable-static-dir=<DIR>, use static
Stephen Seo [Wed, 30 Oct 2024 04:24:36 +0000 (13:24 +0900)]
Update c_simple_http_get_file(...) in static.c
Add option to not fetch mime-type and default to
"application/octet-stream".
Stephen Seo [Tue, 29 Oct 2024 05:56:52 +0000 (14:56 +0900)]
Add enum for result info when getting static file
Stephen Seo [Tue, 29 Oct 2024 04:45:38 +0000 (13:45 +0900)]
Close read-pipe on xdg-mime's side in static.c
The pipe probably doesn't need to be closed since it is closed by
c_simple_http and the forked process stops while it is the only other
thing with that read-pipe-fd. However, it probably would be best to
close it so that during runtime all pipe fd's are closed after use.
Stephen Seo [Tue, 29 Oct 2024 03:42:24 +0000 (12:42 +0900)]
Work on fetching static file and mime-type
Stephen Seo [Thu, 26 Sep 2024 07:33:07 +0000 (16:33 +0900)]
Update README.md
Stephen Seo [Thu, 26 Sep 2024 04:04:58 +0000 (13:04 +0900)]
Update README.md
Stephen Seo [Thu, 26 Sep 2024 03:59:27 +0000 (12:59 +0900)]
Merge branch 'dev'
Resolves https://git.seodisparate.com/stephenseo/c_simple_http/issues/3
Stephen Seo [Thu, 26 Sep 2024 03:38:51 +0000 (12:38 +0900)]
Update README.md
Stephen Seo [Thu, 26 Sep 2024 03:37:45 +0000 (12:37 +0900)]
Impl. cache file lifetime checking
By default cache files are invalidated when the are aged for longer than
1 week. This "timeout-time" can be modified with a paramter/argument.
Stephen Seo [Thu, 26 Sep 2024 02:51:42 +0000 (11:51 +0900)]
Reload config file if cache is older than config
Stephen Seo [Wed, 25 Sep 2024 07:23:04 +0000 (16:23 +0900)]
Sleep in test to ensure changed file timestamp
Stephen Seo [Wed, 25 Sep 2024 07:12:25 +0000 (16:12 +0900)]
Impl. html cache (mostly done)
TODO: Invalidate cache if it is too old.
Stephen Seo [Wed, 25 Sep 2024 04:28:42 +0000 (13:28 +0900)]
backport: Fix type set "extra" var on string part
Stephen Seo [Wed, 25 Sep 2024 04:28:42 +0000 (13:28 +0900)]
Fix type when setting "extra" var on string part
Stephen Seo [Wed, 25 Sep 2024 04:14:01 +0000 (13:14 +0900)]
backport: StringPart's extra type to uintptr_t
Stephen Seo [Tue, 24 Sep 2024 05:53:28 +0000 (14:53 +0900)]
Update example config
Stephen Seo [Wed, 25 Sep 2024 04:14:01 +0000 (13:14 +0900)]
Change StringPart's extra type to uintptr_t
Stephen Seo [Wed, 25 Sep 2024 04:10:44 +0000 (13:10 +0900)]
Impl. c_simple_http_cache_filename_to_path(...)
Stephen Seo [Mon, 23 Sep 2024 10:44:51 +0000 (19:44 +0900)]
backport: "Connection: close" in response headers
The current implementation always closes the connection after sending
the response, so it should notify the client to close the connection.
Stephen Seo [Tue, 24 Sep 2024 05:53:28 +0000 (14:53 +0900)]
backport: remove extra '/' in URI, config changes
Stephen Seo [Tue, 24 Sep 2024 04:16:34 +0000 (13:16 +0900)]
backport: unesc. percent-encoded uri, string parts
Resolves https://git.seodisparate.com/stephenseo/c_simple_http/issues/6
Stephen Seo [Tue, 24 Sep 2024 04:16:34 +0000 (13:16 +0900)]
Unescape percent-encoded uri when handling request
Resolves https://git.seodisparate.com/stephenseo/c_simple_http/issues/6
Stephen Seo [Mon, 23 Sep 2024 10:44:51 +0000 (19:44 +0900)]
Use "Connection: close" in response headers
The current implementation always closes the connection after sending
the response, so it should notify the client to close the connection.
Stephen Seo [Mon, 23 Sep 2024 08:42:02 +0000 (17:42 +0900)]
Impl. alternate delimeter creating cache-filename
Stephen Seo [Mon, 23 Sep 2024 06:10:39 +0000 (15:10 +0900)]
Fix use-after-free in path-to-filename function
Stephen Seo [Mon, 23 Sep 2024 05:58:28 +0000 (14:58 +0900)]
Impl. path-to-cache-filename, fixes to strip-path
Stephen Seo [Mon, 23 Sep 2024 05:09:25 +0000 (14:09 +0900)]
Refactor http_template to use String_Part
Stephen Seo [Sun, 22 Sep 2024 10:09:07 +0000 (19:09 +0900)]
Fix potential memory leak
Fixes https://git.seodisparate.com/stephenseo/c_simple_http/issues/5
Stephen Seo [Sun, 22 Sep 2024 06:44:04 +0000 (15:44 +0900)]
Add WIP html_cache
Stephen Seo [Sun, 22 Sep 2024 06:39:35 +0000 (15:39 +0900)]
Add helper to create string parts and combine them
Stephen Seo [Sun, 22 Sep 2024 05:43:28 +0000 (14:43 +0900)]
Minor fix
Stephen Seo [Sun, 22 Sep 2024 05:42:41 +0000 (14:42 +0900)]
Add new arg for program: --enable-cache-dir=<DIR>
Stephen Seo [Sun, 22 Sep 2024 05:26:50 +0000 (14:26 +0900)]
Update .gitignore
Stephen Seo [Sun, 22 Sep 2024 05:26:07 +0000 (14:26 +0900)]
Change template generation: output used filenames
Stephen Seo [Sat, 21 Sep 2024 09:46:21 +0000 (18:46 +0900)]
Update third-party submodule SimpleArchiver
Stephen Seo [Sat, 21 Sep 2024 05:41:02 +0000 (14:41 +0900)]
Use volatile for global variables
These globals are accessed in signal handling, so they need to be
volatile.
Resolves https://git.seodisparate.com/stephenseo/c_simple_http/issues/4
Stephen Seo [Sat, 21 Sep 2024 03:02:18 +0000 (12:02 +0900)]
Update globals to use "fast" int type
Stephen Seo [Sat, 21 Sep 2024 02:59:05 +0000 (11:59 +0900)]
Update third-party submodule SimpleArchiver
Stephen Seo [Fri, 20 Sep 2024 12:45:51 +0000 (21:45 +0900)]
Use stdint.h types instead of int, long, etc.
Stephen Seo [Fri, 20 Sep 2024 12:45:18 +0000 (21:45 +0900)]
Update third_party submodule SimpleArchiver
Stephen Seo [Mon, 16 Sep 2024 03:04:21 +0000 (12:04 +0900)]
Add tests for c_simple_http_strip_path(...)
Stephen Seo [Mon, 16 Sep 2024 02:20:15 +0000 (11:20 +0900)]
Fix case where URL has extra trailing '/'
Stephen Seo [Fri, 13 Sep 2024 02:40:01 +0000 (11:40 +0900)]
Update third-party submodule SimpleArchiver
Stephen Seo [Thu, 12 Sep 2024 05:55:51 +0000 (14:55 +0900)]
Minor fix
Stephen Seo [Wed, 11 Sep 2024 04:28:06 +0000 (13:28 +0900)]
Minor fix to Makefile
Stephen Seo [Wed, 11 Sep 2024 04:18:38 +0000 (13:18 +0900)]
CI: Run unit tests on Release build as well
Stephen Seo [Wed, 11 Sep 2024 04:11:55 +0000 (13:11 +0900)]
Update Makefile
Some cleanup.
Use certain build flags only in "RELEASE" mode.
Stephen Seo [Wed, 11 Sep 2024 04:03:09 +0000 (13:03 +0900)]
Revert "Update CMakeLists.txt"
This reverts commit
4aa338c9c3b75de810c5f2c28c0e797e3f2c1327 .
The compiler flags added by this commit was already handled.
Stephen Seo [Wed, 11 Sep 2024 04:01:09 +0000 (13:01 +0900)]
Update CMakeLists.txt
Stephen Seo [Wed, 11 Sep 2024 03:58:29 +0000 (12:58 +0900)]
Update CMakeLists.txt
Stephen Seo [Wed, 11 Sep 2024 03:56:00 +0000 (12:56 +0900)]
Add hardening compiler flags to Makefile
Stephen Seo [Wed, 11 Sep 2024 03:49:01 +0000 (12:49 +0900)]
Update third-party submodule SimpleArchiver
Stephen Seo [Tue, 10 Sep 2024 12:44:10 +0000 (21:44 +0900)]
Cleanup: removed unused pointer in internal struct
Stephen Seo [Tue, 10 Sep 2024 12:18:10 +0000 (21:18 +0900)]
Fix potential "strlen(NULL)"
Stephen Seo [Tue, 10 Sep 2024 10:22:47 +0000 (19:22 +0900)]
Minor refactoring/fixes
Stephen Seo [Tue, 10 Sep 2024 09:01:45 +0000 (18:01 +0900)]
Minor refactoring
Stephen Seo [Tue, 10 Sep 2024 06:39:16 +0000 (15:39 +0900)]
Minor refactoring
Stephen Seo [Tue, 10 Sep 2024 06:34:26 +0000 (15:34 +0900)]
Make config reloading more robust
Stephen Seo [Tue, 10 Sep 2024 05:00:57 +0000 (14:00 +0900)]
Update README.md
Stephen Seo [Tue, 10 Sep 2024 04:55:16 +0000 (13:55 +0900)]
Impl. hot reloading of config and on SIGUSR1
Resolves https://git.seodisparate.com/stephenseo/c_simple_http/issues/2
Stephen Seo [Mon, 9 Sep 2024 08:01:41 +0000 (17:01 +0900)]
Fix "unfixed" "count" from previous commit
Stephen Seo [Mon, 9 Sep 2024 07:59:46 +0000 (16:59 +0900)]
Fix typo when returning 500 error
Stephen Seo [Mon, 9 Sep 2024 04:53:58 +0000 (13:53 +0900)]
Minor fixes/cleanup
Stephen Seo [Mon, 9 Sep 2024 03:39:47 +0000 (12:39 +0900)]
Refactor "print request headers"
Resolves https://git.seodisparate.com/stephenseo/c_simple_http/issues/1
Stephen Seo [Mon, 9 Sep 2024 02:32:05 +0000 (11:32 +0900)]
Update third-party submodule SimpleArchiver
Also fixes related to the updated third-party submodule.
Stephen Seo [Fri, 6 Sep 2024 08:30:37 +0000 (17:30 +0900)]
Impl. print of specific headers arg/option
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.
Stephen Seo [Fri, 6 Sep 2024 07:40:36 +0000 (16:40 +0900)]
Add flag to disable peer address printing
Minor teak in main to make Args const.
Stephen Seo [Fri, 6 Sep 2024 07:32:47 +0000 (16:32 +0900)]
Debug print only in Debug builds
Stephen Seo [Fri, 6 Sep 2024 06:57:46 +0000 (15:57 +0900)]
Only allow protocol "HTTP/1.1"
Stephen Seo [Fri, 6 Sep 2024 06:55:21 +0000 (15:55 +0900)]
Add support for different error responses
Stephen Seo [Fri, 6 Sep 2024 06:33:31 +0000 (15:33 +0900)]
Remove "?" or "#" starting suffixes from path
These suffixes may break loading the correct html template.
Stephen Seo [Fri, 6 Sep 2024 05:30:33 +0000 (14:30 +0900)]
Update third party submodule SimpleArchiver
Stephen Seo [Fri, 6 Sep 2024 04:47:31 +0000 (13:47 +0900)]
update README.md
Stephen Seo [Fri, 6 Sep 2024 04:43:25 +0000 (13:43 +0900)]
Fix warnings
Stephen Seo [Fri, 6 Sep 2024 04:24:28 +0000 (13:24 +0900)]
Add CMakeLists.txt, update .gitignore
Stephen Seo [Fri, 6 Sep 2024 04:16:31 +0000 (13:16 +0900)]
Update README.md
Stephen Seo [Fri, 6 Sep 2024 04:11:00 +0000 (13:11 +0900)]
Add README.md, ensure listening port is printed
Stephen Seo [Fri, 6 Sep 2024 03:49:32 +0000 (12:49 +0900)]
Minor tweaks/fixes
Add example config using "_FILE" variables.
Increase limit of config value size from 256 to 1024.
Stephen Seo [Fri, 6 Sep 2024 03:42:18 +0000 (12:42 +0900)]
Add more example.config stuff
Stephen Seo [Fri, 6 Sep 2024 03:03:03 +0000 (12:03 +0900)]
Fix invalid read when checking for "_FILE" vars
Stephen Seo [Fri, 6 Sep 2024 02:56:52 +0000 (11:56 +0900)]
Minor tweak to listening port info output
Stephen Seo [Fri, 6 Sep 2024 02:53:28 +0000 (11:53 +0900)]
Impl. handling HTTP/1.1 requests
TODO:
Handle errors other than 404 Not Found.
Stephen Seo [Thu, 5 Sep 2024 07:25:49 +0000 (16:25 +0900)]
Use ${CC} and "CC ?= gcc" in Makefile
Stephen Seo [Thu, 5 Sep 2024 07:18:28 +0000 (16:18 +0900)]
Fix inconsistent http_template output size
Stephen Seo [Thu, 5 Sep 2024 07:12:50 +0000 (16:12 +0900)]
Add "output" size parameter to http_template fn
Stephen Seo [Thu, 5 Sep 2024 05:07:42 +0000 (14:07 +0900)]
Remove temporary files created by unit test on end
Stephen Seo [Thu, 5 Sep 2024 05:02:25 +0000 (14:02 +0900)]
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.
Stephen Seo [Wed, 4 Sep 2024 08:51:07 +0000 (17:51 +0900)]
Add action/workflow to run unit tests
Stephen Seo [Wed, 4 Sep 2024 08:32:09 +0000 (17:32 +0900)]
config parsing: Handle when config has no endline
Put duplicate code into a macro/defines function.
Stephen Seo [Wed, 4 Sep 2024 08:22:44 +0000 (17:22 +0900)]
Test using "HTML_FILE" var, fixes
Stephen Seo [Wed, 4 Sep 2024 06:33:47 +0000 (15:33 +0900)]
Minor formatting fix
Stephen Seo [Wed, 4 Sep 2024 06:32:14 +0000 (15:32 +0900)]
Update submodule third-party SimpleArchiver
Stephen Seo [Wed, 4 Sep 2024 06:26:20 +0000 (15:26 +0900)]
Set up tests for http_template, fixes
Stephen Seo [Tue, 3 Sep 2024 07:20:18 +0000 (16:20 +0900)]
WIP untested Impl. html generation from templates