summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/clients.c2
-rw-r--r--src/listener.c2
-rw-r--r--src/sig_handler.c4
-rw-r--r--src/tcpproxy.c4
4 files changed, 8 insertions, 4 deletions
diff --git a/src/clients.c b/src/clients.c
index a1c8840..4175603 100644
--- a/src/clients.c
+++ b/src/clients.c
@@ -211,7 +211,7 @@ void clients_print(clients_t* list)
client_t* c = (client_t*)tmp->data_;
if(c) {
// TODO: print useful info
- printf("client %d <-> %d: tba...\n", c->fd_[0], c->fd_[1]);
+ log_printf(NOTICE, "client #%d/%d: tba...", c->fd_[0], c->fd_[1]);
}
tmp = tmp->next_;
}
diff --git a/src/listener.c b/src/listener.c
index 0c0415e..e3d36cb 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -328,7 +328,7 @@ void listeners_print(listeners_t* list)
case ACTIVE: state = 'a'; break;
case ZOMBIE: state = 'z'; break;
}
- printf("listener [%c] #%d: %s -> %s%s%s\n", state, l->fd_, ls ? ls : "(null)", rs ? rs : "(null)", ss ? " with source " : "", ss ? ss : "");
+ log_printf(NOTICE, "[%c] listener #%d: %s -> %s%s%s", state, l->fd_, ls ? ls : "(null)", rs ? rs : "(null)", ss ? " with source " : "", ss ? ss : "");
if(ls) free(ls);
if(rs) free(rs);
if(ss) free(ss);
diff --git a/src/sig_handler.c b/src/sig_handler.c
index 7c3d45b..cc385cb 100644
--- a/src/sig_handler.c
+++ b/src/sig_handler.c
@@ -120,8 +120,8 @@ int signal_handle()
case SIGQUIT: log_printf(NOTICE, "SIG-Quit caught, exitting"); return_value = 1; break;
case SIGTERM: log_printf(NOTICE, "SIG-Term caught, exitting"); return_value = 1; break;
case SIGHUP: log_printf(NOTICE, "SIG-Hup caught"); return_value = 2; break;
- case SIGUSR1: log_printf(NOTICE, "SIG-Usr1 caught"); break;
- case SIGUSR2: log_printf(NOTICE, "SIG-Usr2 caught"); break;
+ case SIGUSR1: log_printf(NOTICE, "SIG-Usr1 caught"); return_value = 3; break;
+ case SIGUSR2: log_printf(NOTICE, "SIG-Usr2 caught"); return_value = 4; break;
default: log_printf(WARNING, "unknown signal %d caught, ignoring", sig); break;
}
sigdelset(&set, sig);
diff --git a/src/tcpproxy.c b/src/tcpproxy.c
index 1007b80..7645c39 100644
--- a/src/tcpproxy.c
+++ b/src/tcpproxy.c
@@ -81,6 +81,10 @@ int main_loop(options_t* opt, listeners_t* listeners)
log_printf(NOTICE, "ignoring SIGHUP: no config file specified");
return_value = 0;
+ } else if(return_value == 3) {
+ listeners_print(listeners);
+ } else if(return_value == 4) {
+ clients_print(&clients);
}
}