update: recvfile and sendfile callbacks and more ctx function implementations

This commit is contained in:
ngn
2024-07-05 16:27:11 +03:00
parent 6045f73478
commit 98e5c861df
21 changed files with 1359 additions and 429 deletions

View File

@ -6,14 +6,14 @@
#define DATA_DIR "./examples"
int main(int argc, char *argv[]) {
int ret = EXIT_FAILURE;
int ret = EXIT_FAILURE;
lm_ctx_t ctx;
if (argc != 2) {
printf("usage: %s <host>\n", argv[0]);
return ret;
}
lm_ctx_t ctx;
lm_ctx_init(&ctx);
if (!lm_ctx_set_data(&ctx, DATA_DIR)) {
@ -26,10 +26,9 @@ int main(int argc, char *argv[]) {
goto end;
}
lm_ctx_pool_get_info(&ctx, false, false, NULL, NULL);
lm_ctx_pool_get_list(&ctx, false, false, NULL, NULL);
lm_ctx_sync(&ctx, false, NULL, NULL);
if (!lm_ctx_pool_serve(&ctx, argv[1], 10)) {
if (!lm_ctx_serve(&ctx, argv[1], 10)) {
printf("failed to serve the pools: %s (%d)\n", lm_strerror(), lm_error());
goto end;
}