Skip to content
Snippets Groups Projects
Commit 301b9302 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix "clients remain" log line issue introduced in 2eb58683

The service clients count is now a protected int, so deal. On Windows, this was resulting in the "total" and "served" values logged as 4294967295.
parent 1d585115
No related branches found
No related tags found
No related merge requests found
...@@ -1167,7 +1167,7 @@ static void js_service_thread(void* arg) ...@@ -1167,7 +1167,7 @@ static void js_service_thread(void* arg)
} }
FREE_AND_NULL(service_client.subscan); FREE_AND_NULL(service_client.subscan);
protected_uint32_adjust(&service->clients, -1); ulong remain = protected_uint32_adjust(&service->clients, -1);
update_clients(); update_clients();
#ifdef _WIN32 #ifdef _WIN32
...@@ -1178,8 +1178,8 @@ static void js_service_thread(void* arg) ...@@ -1178,8 +1178,8 @@ static void js_service_thread(void* arg)
thread_down(); thread_down();
if(service->log_level >= LOG_INFO) if(service->log_level >= LOG_INFO)
lprintf(LOG_INFO,"%04d %s service thread terminated (%u clients remain, %lu total, %lu served)" lprintf(LOG_INFO,"%04d %s service thread terminated (%lu clients remain, %lu total, %lu served)"
,socket, service->protocol, service->clients, active_clients(), service->served); ,socket, service->protocol, remain, active_clients(), service->served);
client_off(socket); client_off(socket);
close_socket(socket); close_socket(socket);
...@@ -1486,7 +1486,7 @@ static void native_service_thread(void* arg) ...@@ -1486,7 +1486,7 @@ static void native_service_thread(void* arg)
system(fullcmd); system(fullcmd);
protected_uint32_adjust(&service->clients, -1); ulong remain = protected_uint32_adjust(&service->clients, -1);
update_clients(); update_clients();
#ifdef _WIN32 #ifdef _WIN32
...@@ -1497,8 +1497,8 @@ static void native_service_thread(void* arg) ...@@ -1497,8 +1497,8 @@ static void native_service_thread(void* arg)
thread_down(); thread_down();
if(service->log_level >= LOG_INFO) if(service->log_level >= LOG_INFO)
lprintf(LOG_INFO,"%04d %s service thread terminated (%u clients remain, %lu total, %lu served)" lprintf(LOG_INFO,"%04d %s service thread terminated (%lu clients remain, %lu total, %lu served)"
,socket, service->protocol, service->clients, active_clients(), service->served); ,socket, service->protocol, remain, active_clients(), service->served);
client_off(socket); client_off(socket);
close_socket(socket); close_socket(socket);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment