Skip to content
Snippets Groups Projects
Commit aa015d63 authored by rswindell's avatar rswindell
Browse files

Log 'client blocked' messages before closing the socket descriptor, which

changes its valid to INVALID_SOCKET (-1)
parent 9d8b37f2
No related branches found
No related tags found
No related merge requests found
...@@ -4393,11 +4393,11 @@ void http_session_thread(void* arg) ...@@ -4393,11 +4393,11 @@ void http_session_thread(void* arg)
&& host->h_aliases[i]!=NULL;i++) && host->h_aliases[i]!=NULL;i++)
lprintf(LOG_INFO,"%04d HostAlias: %s", session.socket, host->h_aliases[i]); lprintf(LOG_INFO,"%04d HostAlias: %s", session.socket, host->h_aliases[i]);
if(trashcan(&scfg,host_name,"host")) { if(trashcan(&scfg,host_name,"host")) {
lprintf(LOG_NOTICE,"%04d !CLIENT BLOCKED in host.can: %s", session.socket, host_name);
close_socket(&session.socket); close_socket(&session.socket);
sem_wait(&session.output_thread_terminated); sem_wait(&session.output_thread_terminated);
sem_destroy(&session.output_thread_terminated); sem_destroy(&session.output_thread_terminated);
RingBufDispose(&session.outbuf); RingBufDispose(&session.outbuf);
lprintf(LOG_NOTICE,"%04d !CLIENT BLOCKED in host.can: %s", session.socket, host_name);
thread_down(); thread_down();
session_threads--; session_threads--;
return; return;
...@@ -4406,11 +4406,11 @@ void http_session_thread(void* arg) ...@@ -4406,11 +4406,11 @@ void http_session_thread(void* arg)
/* host_ip wasn't defined in http_session_thread */ /* host_ip wasn't defined in http_session_thread */
if(trashcan(&scfg,session.host_ip,"ip")) { if(trashcan(&scfg,session.host_ip,"ip")) {
lprintf(LOG_NOTICE,"%04d !CLIENT BLOCKED in ip.can: %s", session.socket, session.host_ip);
close_socket(&session.socket); close_socket(&session.socket);
sem_wait(&session.output_thread_terminated); sem_wait(&session.output_thread_terminated);
sem_destroy(&session.output_thread_terminated); sem_destroy(&session.output_thread_terminated);
RingBufDispose(&session.outbuf); RingBufDispose(&session.outbuf);
lprintf(LOG_NOTICE,"%04d !CLIENT BLOCKED in ip.can: %s", session.socket, session.host_ip);
thread_down(); thread_down();
session_threads--; session_threads--;
return; return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment