]> git.seodisparate.com - c_simple_http/log
c_simple_http
3 months agoUpdate Changelog.md, version 1.7.2 dev main 1.7.2
Stephen Seo [Tue, 14 Jan 2025 05:31:15 +0000 (14:31 +0900)]
Update Changelog.md, version 1.7.2

3 months agoUpdate third-party module SimpleArchiver
Stephen Seo [Tue, 14 Jan 2025 05:30:33 +0000 (14:30 +0900)]
Update third-party module SimpleArchiver

3 months agoVersion 1.7.1 1.7.1
Stephen Seo [Wed, 25 Dec 2024 06:03:07 +0000 (15:03 +0900)]
Version 1.7.1

3 months agoFix submodule url
Stephen Seo [Wed, 25 Dec 2024 06:01:29 +0000 (15:01 +0900)]
Fix submodule url

3 months agoUpdate README.md
Stephen Seo [Wed, 25 Dec 2024 05:45:14 +0000 (14:45 +0900)]
Update README.md

4 months agoVersion 1.7 1.7
Stephen Seo [Fri, 29 Nov 2024 03:11:29 +0000 (12:11 +0900)]
Version 1.7

4 months agoFix indexing in `IF`
Stephen Seo [Fri, 29 Nov 2024 03:10:17 +0000 (12:10 +0900)]
Fix indexing in `IF`

Expressions like `{{{!IF SomeVar[2]==true}}}` should work properly now.

4 months agoVersion 1.6 1.6
Stephen Seo [Fri, 29 Nov 2024 02:39:18 +0000 (11:39 +0900)]
Version 1.6

4 months agoFix edge case of IF with FOREACH variable
Stephen Seo [Fri, 29 Nov 2024 02:38:10 +0000 (11:38 +0900)]
Fix edge case of IF with FOREACH variable

4 months agoVersion 1.5 1.5
Stephen Seo [Mon, 25 Nov 2024 08:39:04 +0000 (17:39 +0900)]
Version 1.5

4 months agoUpdate third-party submodule SimpleArchiver
Stephen Seo [Mon, 25 Nov 2024 08:23:17 +0000 (17:23 +0900)]
Update third-party submodule SimpleArchiver

4 months agoUpdate Changelog.md
Stephen Seo [Mon, 25 Nov 2024 07:04:44 +0000 (16:04 +0900)]
Update Changelog.md

4 months agoUse proper format constants for size_t/uintX_t etc
Stephen Seo [Mon, 25 Nov 2024 07:01:49 +0000 (16:01 +0900)]
Use proper format constants for size_t/uintX_t etc

4 months agoUpdate README.md
Stephen Seo [Mon, 25 Nov 2024 05:21:00 +0000 (14:21 +0900)]
Update README.md

4 months agoUpdate Changelog.md
Stephen Seo [Mon, 25 Nov 2024 05:20:28 +0000 (14:20 +0900)]
Update Changelog.md

4 months agoAdd separate flag for generate-static overwrite
Stephen Seo [Mon, 25 Nov 2024 05:17:32 +0000 (14:17 +0900)]
Add separate flag for generate-static overwrite

Previous implementation allowed static files to overwrite existing files
on generate if static-dir was specified and generate-enable-overwrite
was specified. Now, an additional flag
"--generate-static-enable-overwrite" determines if static-dir files
overwrite on generate.

4 months agoUpdate Changelog.md
Stephen Seo [Thu, 21 Nov 2024 12:05:11 +0000 (21:05 +0900)]
Update Changelog.md

4 months agoVersion 1.4 1.4
Stephen Seo [Thu, 21 Nov 2024 05:14:09 +0000 (14:14 +0900)]
Version 1.4

4 months agoUpdate Changelog.md
Stephen Seo [Thu, 21 Nov 2024 05:06:09 +0000 (14:06 +0900)]
Update Changelog.md

4 months agoEnsure http_template.c keeps track of _FILE files
Stephen Seo [Thu, 21 Nov 2024 05:05:33 +0000 (14:05 +0900)]
Ensure http_template.c keeps track of _FILE files

5 months agoMore testing of nested FOREACH in example_config
Stephen Seo [Wed, 20 Nov 2024 08:12:10 +0000 (17:12 +0900)]
More testing of nested FOREACH in example_config

5 months agoMore notes about FOREACH in Changelog.md
Stephen Seo [Wed, 20 Nov 2024 07:21:28 +0000 (16:21 +0900)]
More notes about FOREACH in Changelog.md

5 months agoUpdate Changelog.md
Stephen Seo [Wed, 20 Nov 2024 07:16:25 +0000 (16:16 +0900)]
Update Changelog.md

5 months agoImpl. nested FOREACH expressions
Stephen Seo [Wed, 20 Nov 2024 07:05:29 +0000 (16:05 +0900)]
Impl. nested FOREACH expressions

IF/ELSEIF/ELSE/ENDIF and FOREACH/ENDFOREACH can now be nested in each
other in HTML templates.

TODO: Cleanup/refactorings, properly set up "files_map".

5 months agoFix Unit Tests whilst keeping FOREACH working
Stephen Seo [Tue, 19 Nov 2024 12:26:42 +0000 (21:26 +0900)]
Fix Unit Tests whilst keeping FOREACH working

5 months agoImpl. FOREACH and NOTFOREACH
Stephen Seo [Tue, 19 Nov 2024 11:53:11 +0000 (20:53 +0900)]
Impl. FOREACH and NOTFOREACH

TODO: Figure out nested FOREACH or abandon that feature.

5 months agoRefactoring related to `{{{!IF}}}...`
Stephen Seo [Tue, 19 Nov 2024 06:07:40 +0000 (15:07 +0900)]
Refactoring related to `{{{!IF}}}...`

5 months agoAllow nested `{{{!IF}}}...`, fixes
Stephen Seo [Mon, 18 Nov 2024 11:10:45 +0000 (20:10 +0900)]
Allow nested `{{{!IF}}}...`, fixes

5 months agoFix memory leak for array variables
Stephen Seo [Mon, 18 Nov 2024 08:41:20 +0000 (17:41 +0900)]
Fix memory leak for array variables

5 months agoUpdate Changelog.md
Stephen Seo [Mon, 18 Nov 2024 08:10:41 +0000 (17:10 +0900)]
Update Changelog.md

5 months agoImpl. extension of template delimeter expressions
Stephen Seo [Mon, 18 Nov 2024 08:07:07 +0000 (17:07 +0900)]
Impl. extension of template delimeter expressions

Implemented "IF", "ELSEIF", "ELSE", "ENDIF", and "INDEX" for templates.

IF is used like: `{{{!IF Variable==SomeString}}}`.
ELSEIF is used like: `{{{!ELSEIF Variable==AnotherString}}}`.
ELSE is used like: `{{{!ELSE}}}`.
ENDIF is used like: `{{{!ENDIF}}}`.
INDEX is used like: `{{{!INDEX ArrayVar[2]}}}`.

5 months agoRefactor template handling
Stephen Seo [Mon, 18 Nov 2024 04:08:04 +0000 (13:08 +0900)]
Refactor template handling

Split off some code into separate function to be updated for support for
more template features.

5 months agoUpdate third-party submodule SimpleArchiver
Stephen Seo [Fri, 15 Nov 2024 08:42:26 +0000 (17:42 +0900)]
Update third-party submodule SimpleArchiver

5 months agoAllow "multi-valued-key-entries" in ParsedConfig
Stephen Seo [Fri, 15 Nov 2024 07:28:31 +0000 (16:28 +0900)]
Allow "multi-valued-key-entries" in ParsedConfig

This commit begins work on adding more templating features.

5 months agoUpdate Changelog.md, Bump version 1.3 1.3
Stephen Seo [Thu, 14 Nov 2024 01:41:43 +0000 (10:41 +0900)]
Update Changelog.md, Bump version 1.3

5 months agoUpdate Changelog.md
Stephen Seo [Tue, 12 Nov 2024 08:26:33 +0000 (17:26 +0900)]
Update Changelog.md

5 months agoAdd missing NULL check in arg_parse.c
Stephen Seo [Tue, 12 Nov 2024 08:25:52 +0000 (17:25 +0900)]
Add missing NULL check in arg_parse.c

Previous implementation didn't crash because `closedir(...)` is lenient.

5 months agoUpdate Changelog.md
Stephen Seo [Tue, 12 Nov 2024 08:18:21 +0000 (17:18 +0900)]
Update Changelog.md

5 months agoFix erronous buffer declaration
Stephen Seo [Tue, 12 Nov 2024 08:16:58 +0000 (17:16 +0900)]
Fix erronous buffer declaration

5 months agoAdd `strip --strip-unneeded` to debian builds (ci)
Stephen Seo [Tue, 12 Nov 2024 04:49:19 +0000 (13:49 +0900)]
Add `strip --strip-unneeded` to debian builds (ci)

5 months agoUpdate README.md 1.2
Stephen Seo [Tue, 12 Nov 2024 03:06:21 +0000 (12:06 +0900)]
Update README.md

5 months agoUpdate Changelod.md, version 1.2
Stephen Seo [Tue, 12 Nov 2024 03:04:30 +0000 (12:04 +0900)]
Update Changelod.md, version 1.2

5 months agoImpl. copying over "static-dir" files on generate
Stephen Seo [Mon, 11 Nov 2024 06:09:12 +0000 (15:09 +0900)]
Impl. copying over "static-dir" files on generate

5 months agoRemove unused parameter in function in config.c
Stephen Seo [Sun, 10 Nov 2024 12:09:40 +0000 (21:09 +0900)]
Remove unused parameter in function in config.c

5 months agoCleanup by separating "generate" to source files
Stephen Seo [Sun, 10 Nov 2024 12:06:41 +0000 (21:06 +0900)]
Cleanup by separating "generate" to source files

5 months agoCheck if fopen() fails during generating html
Stephen Seo [Sun, 10 Nov 2024 11:47:56 +0000 (20:47 +0900)]
Check if fopen() fails during generating html

5 months agoFix typo in impl. of `--generate-dir=<DIR>`
Stephen Seo [Sun, 10 Nov 2024 11:45:37 +0000 (20:45 +0900)]
Fix typo in impl. of `--generate-dir=<DIR>`

5 months agoImpl. `--generate-dir=<DIR>`
Stephen Seo [Sun, 10 Nov 2024 11:39:49 +0000 (20:39 +0900)]
Impl. `--generate-dir=<DIR>`

Also added flag `--generate-enable-overwrite`.

Resolves https://git.seodisparate.com/stephenseo/c_simple_http/issues/11

5 months agoVersion 1.1 1.1
Stephen Seo [Fri, 8 Nov 2024 06:20:08 +0000 (15:20 +0900)]
Version 1.1

5 months agoUpdate Changelog.md
Stephen Seo [Fri, 8 Nov 2024 05:37:54 +0000 (14:37 +0900)]
Update Changelog.md

5 months agoAllow key/value buffers to be dynamically sized
Stephen Seo [Fri, 8 Nov 2024 05:32:57 +0000 (14:32 +0900)]
Allow key/value buffers to be dynamically sized

Fixes https://git.seodisparate.com/stephenseo/c_simple_http/issues/10

5 months agoRefactor config.c to change c-macros to functions
Stephen Seo [Fri, 8 Nov 2024 05:00:36 +0000 (14:00 +0900)]
Refactor config.c to change c-macros to functions

Resolves https://git.seodisparate.com/stephenseo/c_simple_http/issues/9

5 months agoAdd Changelog.md 1.0
Stephen Seo [Thu, 7 Nov 2024 04:34:06 +0000 (13:34 +0900)]
Add Changelog.md

5 months agoFix invalid "closedir(...)" on NULL ptr
Stephen Seo [Thu, 7 Nov 2024 04:30:59 +0000 (13:30 +0900)]
Fix invalid "closedir(...)" on NULL ptr

5 months agoAdd build_releases.yaml action/workflow
Stephen Seo [Thu, 7 Nov 2024 04:25:34 +0000 (13:25 +0900)]
Add build_releases.yaml action/workflow

5 months agoMinor refactoring
Stephen Seo [Wed, 6 Nov 2024 05:47:47 +0000 (14:47 +0900)]
Minor refactoring

Accept connections until there are no more connections to accept in a
single iteration.

5 months agoMinor refactorings
Stephen Seo [Mon, 4 Nov 2024 07:25:19 +0000 (16:25 +0900)]
Minor refactorings

5 months agoFix possible double-close of connection fd
Stephen Seo [Mon, 4 Nov 2024 06:40:25 +0000 (15:40 +0900)]
Fix possible double-close of connection fd

5 months agoHandle multiple connections simultaneously
Stephen Seo [Mon, 4 Nov 2024 06:22:58 +0000 (15:22 +0900)]
Handle multiple connections simultaneously

This commit changes the implementationt to store connected clients
file-descriptors and to iterate through them all periodically to handle
requests and to time-out stale connections. This means that even if one
connection is in progress, the program can still handle new connections
from other clients.

Note this does this not by threads but by taking advantage of
non-blocking io to handle each connection.

Fixes https://git.seodisparate.com/stephenseo/c_simple_http/issues/8 .

5 months agoRefactor static_validate_path
Stephen Seo [Sun, 3 Nov 2024 09:20:26 +0000 (18:20 +0900)]
Refactor static_validate_path

5 months agoAdd timeout to incoming connections
Stephen Seo [Sun, 3 Nov 2024 09:11:50 +0000 (18:11 +0900)]
Add timeout to incoming connections

5 months agoFix free'd buf not being set to NULL
Stephen Seo [Sun, 3 Nov 2024 08:55:09 +0000 (17:55 +0900)]
Fix free'd buf not being set to NULL

5 months agoFix potential invalid path when fetching static
Stephen Seo [Sun, 3 Nov 2024 08:54:55 +0000 (17:54 +0900)]
Fix potential invalid path when fetching static

5 months agoProperly handle 404 when checking static-dir
Stephen Seo [Wed, 30 Oct 2024 06:52:27 +0000 (15:52 +0900)]
Properly handle 404 when checking static-dir

5 months agoUpdate README.md
Stephen Seo [Wed, 30 Oct 2024 06:41:56 +0000 (15:41 +0900)]
Update README.md

5 months agoMove test static file to "example_static_dir/"
Stephen Seo [Wed, 30 Oct 2024 06:41:07 +0000 (15:41 +0900)]
Move test static file to "example_static_dir/"

5 months agoUpdate third-party submodule SimpleArchiver
Stephen Seo [Wed, 30 Oct 2024 05:42:27 +0000 (14:42 +0900)]
Update third-party submodule SimpleArchiver

5 months agoUpdate README.md
Stephen Seo [Wed, 30 Oct 2024 05:42:00 +0000 (14:42 +0900)]
Update README.md

5 months agoFix test crashing if "xdg-mime" did not exist
Stephen Seo [Wed, 30 Oct 2024 05:29:03 +0000 (14:29 +0900)]
Fix test crashing if "xdg-mime" did not exist

5 months agoAdd option --enable-static-dir=<DIR>, use static
Stephen Seo [Wed, 30 Oct 2024 05:17:49 +0000 (14:17 +0900)]
Add option --enable-static-dir=<DIR>, use static

5 months agoUpdate c_simple_http_get_file(...) in static.c
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".

5 months agoAdd enum for result info when getting static file
Stephen Seo [Tue, 29 Oct 2024 05:56:52 +0000 (14:56 +0900)]
Add enum for result info when getting static file

5 months agoClose read-pipe on xdg-mime's side in static.c
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.

5 months agoWork on fetching static file and mime-type
Stephen Seo [Tue, 29 Oct 2024 03:42:24 +0000 (12:42 +0900)]
Work on fetching static file and mime-type

6 months agoUpdate README.md
Stephen Seo [Thu, 26 Sep 2024 07:33:07 +0000 (16:33 +0900)]
Update README.md

6 months agoUpdate README.md
Stephen Seo [Thu, 26 Sep 2024 04:04:58 +0000 (13:04 +0900)]
Update README.md

6 months agoMerge branch 'dev'
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

6 months agoUpdate README.md
Stephen Seo [Thu, 26 Sep 2024 03:38:51 +0000 (12:38 +0900)]
Update README.md

6 months agoImpl. cache file lifetime checking
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.

6 months agoReload config file if cache is older than config
Stephen Seo [Thu, 26 Sep 2024 02:51:42 +0000 (11:51 +0900)]
Reload config file if cache is older than config

6 months agoSleep in test to ensure changed file timestamp
Stephen Seo [Wed, 25 Sep 2024 07:23:04 +0000 (16:23 +0900)]
Sleep in test to ensure changed file timestamp

6 months agoImpl. html cache (mostly done)
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.

6 months agobackport: Fix type set "extra" var on string part
Stephen Seo [Wed, 25 Sep 2024 04:28:42 +0000 (13:28 +0900)]
backport: Fix type set "extra" var on string part

6 months agoFix type when setting "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

6 months agobackport: StringPart's extra type to uintptr_t
Stephen Seo [Wed, 25 Sep 2024 04:14:01 +0000 (13:14 +0900)]
backport: StringPart's extra type to uintptr_t

6 months agoUpdate example config
Stephen Seo [Tue, 24 Sep 2024 05:53:28 +0000 (14:53 +0900)]
Update example config

6 months agoChange StringPart's extra type to uintptr_t
Stephen Seo [Wed, 25 Sep 2024 04:14:01 +0000 (13:14 +0900)]
Change StringPart's extra type to uintptr_t

6 months agoImpl. c_simple_http_cache_filename_to_path(...)
Stephen Seo [Wed, 25 Sep 2024 04:10:44 +0000 (13:10 +0900)]
Impl. c_simple_http_cache_filename_to_path(...)

6 months agobackport: "Connection: close" in response headers
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.

6 months agobackport: remove extra '/' in URI, config changes
Stephen Seo [Tue, 24 Sep 2024 05:53:28 +0000 (14:53 +0900)]
backport: remove extra '/' in URI, config changes

6 months agobackport: unesc. percent-encoded uri, string parts
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

6 months agoUnescape percent-encoded uri when handling request
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

6 months agoUse "Connection: close" in response headers
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.

6 months agoImpl. alternate delimeter creating cache-filename
Stephen Seo [Mon, 23 Sep 2024 08:42:02 +0000 (17:42 +0900)]
Impl. alternate delimeter creating cache-filename

6 months agoFix use-after-free in path-to-filename function
Stephen Seo [Mon, 23 Sep 2024 06:10:39 +0000 (15:10 +0900)]
Fix use-after-free in path-to-filename function

6 months agoImpl. path-to-cache-filename, fixes to strip-path
Stephen Seo [Mon, 23 Sep 2024 05:58:28 +0000 (14:58 +0900)]
Impl. path-to-cache-filename, fixes to strip-path

6 months agoRefactor http_template to use String_Part
Stephen Seo [Mon, 23 Sep 2024 05:09:25 +0000 (14:09 +0900)]
Refactor http_template to use String_Part

6 months agoFix potential memory leak
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

6 months agoAdd WIP html_cache
Stephen Seo [Sun, 22 Sep 2024 06:44:04 +0000 (15:44 +0900)]
Add WIP html_cache

6 months agoAdd helper to create string parts and combine them
Stephen Seo [Sun, 22 Sep 2024 06:39:35 +0000 (15:39 +0900)]
Add helper to create string parts and combine them