diff --git a/CHANGELOG.md b/CHANGELOG.md index 1790cc2..43c89a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * LNM - Lander Network Module * Rewrite of the event loop & HTTP loop - * Fully independent library + * Fully independent library, maintained in its own repository * Numerous improvements * Streaming of headers * Allow custom & an arbitrary number of response headers @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Automatically support HEAD requests for all GET requests * Event loop uses `epoll` instead of `poll` * Configurable multithreading using `epoll` + * Trie-based router (no more RegEx) * Landerctl * `-c` flag to use custom config file (useful for testing) @@ -27,6 +28,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Removed Content-Disposition header for files +## Removed + +* Secure routes with a specified key (e.g. `/sl/:key`), as these were identical + to `/s/:key` routes + ## [0.2.0](https://git.rustybever.be/Chewing_Bever/lander/src/tag/0.2.0) ### Added diff --git a/Makefile b/Makefile index cedc8b8..9cd57fe 100644 --- a/Makefile +++ b/Makefile @@ -106,14 +106,12 @@ $(BUILD_DIR)/$(TEST_DIR)/%.c.o: $(TEST_DIR)/%.c lint: clang-format -n --Werror $(SRCS) $(SRCS_H) $(SRCS_H_INTERNAL) make -C lsm lint - make -C lnm lint make -C landerctl lint .PHONY: fmt fmt: clang-format -i $(SRCS) $(SRCS_H) $(SRCS_H_INTERNAL) make -C lsm fmt - make -C lnm fmt make -C landerctl fmt .PHONY: check @@ -130,7 +128,6 @@ check: -j$(shell nproc) \ $(SRCS) make -C lsm check - make -C lnm check make -C landerctl check .PHONY: clean diff --git a/src/lander/lander_post.c b/src/lander/lander_post.c index a5beaaf..7befe03 100644 --- a/src/lander/lander_post.c +++ b/src/lander/lander_post.c @@ -34,10 +34,10 @@ bool lander_insert_entry(lnm_http_loop_ctx *ctx, bool secure) { if (key_len == 0) { // Generate a random key to insert key_len = secure ? 16 : 4; - char *key_s = malloc((key_len + 1) * sizeof(char)); + key_s = malloc((key_len + 1) * sizeof(char)); - randomize_key(key_s, key_len); - lsm_str_init(&key, key_s); + randomize_key((char *)key_s, key_len); + lsm_str_init(&key, (char *)key_s); } else { lsm_str_init_copy_n(&key, key_s, key_len); } diff --git a/src/main.c b/src/main.c index 4ac8911..f0f8e65 100644 --- a/src/main.c +++ b/src/main.c @@ -6,7 +6,6 @@ #include "lnm/log.h" #include "lander.h" -#include "log.h" const char *lander_server = "lander/" LANDER_VERSION; @@ -102,7 +101,7 @@ int main() { srand(time(NULL)); lnm_log_init_global(); - lnm_log_register_stdout(lnm_log_level_debug); + lnm_log_register_stdout(lnm_log_level_info); ENV(api_key, "LANDER_API_KEY"); ENV_OPT(port_str, "LANDER_PORT", "18080"); @@ -131,13 +130,4 @@ int main() { lsm_store_size(c_gctx->store)); lnm_http_loop *hl = loop_init(c_gctx, api_key); lnm_http_loop_run(hl, port, 1, 0); - - /* http_loop *hl = http_loop_init( */ - /* lander_routes, sizeof(lander_routes) / sizeof(lander_routes[0]), - * c_gctx, */ - /* lander_ctx_init, (void (*)(void *))lander_ctx_reset, */ - /* (void (*)(void *))lander_ctx_free); */ - /* http_loop_set_api_key(hl, api_key); */ - - /* http_loop_run(hl, port); */ }