mirror of
https://github.com/simon987/sist2.git
synced 2025-12-13 23:39:04 +00:00
Fixes for new mongoose version
This commit is contained in:
@@ -16,9 +16,24 @@ database_t *web_get_database(int index_id);
|
||||
|
||||
__always_inline
|
||||
static char *web_address_to_string(struct mg_addr *addr) {
|
||||
static char address_to_string_buf[INET6_ADDRSTRLEN];
|
||||
static char address_to_string_buf[64];
|
||||
|
||||
mg_snprintf(address_to_string_buf, sizeof(address_to_string_buf), "%I", addr);
|
||||
if (addr->is_ip6) {
|
||||
snprintf(address_to_string_buf, sizeof(address_to_string_buf),
|
||||
"%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x",
|
||||
addr->ip[0], addr->ip[1],
|
||||
addr->ip[2], addr->ip[3],
|
||||
addr->ip[4], addr->ip[5],
|
||||
addr->ip[6], addr->ip[7],
|
||||
addr->ip[8], addr->ip[9],
|
||||
addr->ip[10], addr->ip[11],
|
||||
addr->ip[12], addr->ip[13],
|
||||
addr->ip[14], addr->ip[15]);
|
||||
} else {
|
||||
snprintf(address_to_string_buf, sizeof(address_to_string_buf),
|
||||
"%d.%d.%d.%d",
|
||||
addr->ip[0], addr->ip[1], addr->ip[2], addr->ip[3]);
|
||||
}
|
||||
|
||||
return address_to_string_buf;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user