Fix thumbnail copying for incremental index, fix incremental index when there are no new updates, add option for JSON logs output

This commit is contained in:
2022-11-23 20:45:47 -05:00
parent 4ec54c9a32
commit c18557e360
14 changed files with 133 additions and 26 deletions

View File

@@ -20,6 +20,13 @@ static struct mg_http_serve_opts DefaultServeOpts = {
};
__always_inline
static char *address_to_string(struct mg_addr *addr) {
static char address_to_string_buf[INET6_ADDRSTRLEN];
return mg_ntoa(addr, address_to_string_buf, sizeof(address_to_string_buf));
}
static void send_response_line(struct mg_connection *nc, int status_code, size_t length, char *extra_headers) {
mg_printf(
nc,
@@ -592,6 +599,11 @@ static void ev_router(struct mg_connection *nc, int ev, void *ev_data, UNUSED(vo
}
}
LOG_DEBUGF("serve.c", "<%s> GET %s",
address_to_string(&(nc->rem)),
hm->uri
)
if (mg_http_match_uri(hm, "/")) {
search_index(nc, hm);
} else if (mg_http_match_uri(hm, "/favicon.ico")) {

File diff suppressed because one or more lines are too long