Pack the assets into a ZIP bundle

This commit is contained in:
kamkow1
2025-06-27 20:11:42 +02:00
parent 447362c74d
commit 2badc915d6
8 changed files with 122 additions and 118 deletions

13
main.c
View File

@ -103,13 +103,6 @@ void event_handler(struct mg_connection *conn, int ev, void *ev_data)
} else if (ev == MG_EV_WAKEUP) {
struct mg_str *data = (struct mg_str *)ev_data;
Route_Result *result = (Route_Result *)data->buf;
defer {
for (size_t i = 0; i < result->headers.count; i++) {
free(result->headers.items[i]);
}
list_free(&result->headers);
sb_free(&result->body);
}
Gebs_String_Builder sb = {0};
defer { sb_free(&sb); }
@ -125,6 +118,12 @@ void event_handler(struct mg_connection *conn, int ev, void *ev_data)
char *path = result->body.items;
mg_http_serve_file(conn, ev_data, path, &(struct mg_http_serve_opts){0});
}
for (size_t i = 0; i < result->headers.count; i++) {
free(result->headers.items[i]);
}
list_free(&result->headers);
sb_free(&result->body);
}
}