Compare commits
No commits in common. "0ecb8d68017a7da596fadc591655f7844fc282db" and "8e58873ea94ad208d2b9c845a4c17e4006a32ce4" have entirely different histories.
0ecb8d6801
...
8e58873ea9
6 changed files with 3 additions and 16 deletions
|
@ -2,10 +2,6 @@
|
|||
|
||||
## Upcoming Changes
|
||||
|
||||
Add flag `--generate-static-enable-overwrite`. This flag enables overwriting of
|
||||
files from static-dir to generate-dir (if static-dir was specified). Previous
|
||||
implementation relied on `--generate-enable-ovewrite` for this behavior.
|
||||
|
||||
## Version 1.4
|
||||
|
||||
Implemented "IF", "ELSEIF", "ELSE", "ENDIF", and "INDEX" for templates.
|
||||
|
@ -83,7 +79,3 @@ Features:
|
|||
- Reload configuration on SIGUSR1 or by listening (enabled by cmd parameter).
|
||||
- Cache served html (enabled by cmd parameter).
|
||||
- Serve static files from "static-dir" (enabled by cmd parameter).
|
||||
|
||||
<!--
|
||||
vim: textwidth=80 et sw=2 ts=2 sts=2
|
||||
-->
|
||||
|
|
|
@ -17,7 +17,6 @@ A simple HTTP/1.1 server written in C.
|
|||
--enable-static-dir=<DIR>
|
||||
--generate-dir=<DIR>
|
||||
--generate-enable-overwrite
|
||||
--generate-static-enable-overwrite
|
||||
|
||||
## Changelog
|
||||
|
||||
|
|
|
@ -46,7 +46,6 @@ void print_usage(void) {
|
|||
puts(" --enable-static-dir=<DIR>");
|
||||
puts(" --generate-dir=<DIR>");
|
||||
puts(" --generate-enable-overwrite");
|
||||
puts(" --generate-static-enable-overwrite");
|
||||
}
|
||||
|
||||
Args parse_args(int32_t argc, char **argv) {
|
||||
|
@ -190,8 +189,6 @@ Args parse_args(int32_t argc, char **argv) {
|
|||
}
|
||||
} else if (strcmp(argv[0], "--generate-enable-overwrite") == 0) {
|
||||
args.flags |= 4;
|
||||
} else if (strcmp(argv[0], "--generate-static-enable-overwrite") == 0) {
|
||||
args.flags |= 8;
|
||||
} else {
|
||||
fprintf(stderr, "ERROR: Invalid args!\n");
|
||||
print_usage();
|
||||
|
|
|
@ -29,7 +29,6 @@ typedef struct Args {
|
|||
// xxxx xx0x - disable listen on config file for reloading.
|
||||
// xxxx xx1x - enable listen on config file for reloading.
|
||||
// xxxx x1xx - enable overwrite on generate.
|
||||
// xxxx 1xxx - enable overwrite on generate for static dir.
|
||||
uint16_t flags;
|
||||
uint16_t port;
|
||||
// Does not need to be free'd, this should point to a string in argv.
|
||||
|
|
|
@ -363,7 +363,7 @@ int main(int argc, char **argv) {
|
|||
puts("Static dir option specified, copying over static dir entries...");
|
||||
if (c_simple_http_static_copy_over_dir(args.static_dir,
|
||||
args.generate_dir,
|
||||
(args.flags & 8) != 0 ? 1 : 0)
|
||||
(args.flags & 4) != 0 ? 1 : 0)
|
||||
!= 0) {
|
||||
fprintf(stderr, "ERROR during static-dir-entires copying!\n");
|
||||
return 1;
|
||||
|
|
|
@ -421,8 +421,8 @@ int c_simple_http_static_copy_over_dir(const char *from,
|
|||
if (fd) {
|
||||
fprintf(
|
||||
stderr,
|
||||
"WARNING \"%s\" already exists and "
|
||||
"--generate-static-enable-overwrite not specified, skipping!\n",
|
||||
"WARNING \"%s\" already exists and --generate-enable-overwrite not "
|
||||
"specified, skipping!\n",
|
||||
combined_to);
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue