Skip to content

Commit c1e5790

Browse files
committed
Partly address issue 26: log when not listening for reads or writes
Also, don't log an "initialized" message until initialization has finished.
1 parent 88bf1e0 commit c1e5790

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

handlersocket/handlersocket.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ struct daemon_handlersocket_data {
4949
static int
5050
daemon_handlersocket_init(void *p)
5151
{
52-
DENA_VERBOSE(10, fprintf(stderr, "handlersocket: initialized\n"));
5352
config conf;
5453
conf["use_epoll"] = handlersocket_epoll ? "1" : "0";
5554
if (handlersocket_address) {
@@ -83,6 +82,10 @@ daemon_handlersocket_init(void *p)
8382
}
8483
ap->hssvr_rd = hstcpsvr_i::create(conf);
8584
ap->hssvr_rd->start_listen();
85+
listening = true;
86+
} else {
87+
DENA_VERBOSE(10, fprintf(stderr, "handlersocket: not listening "
88+
"for reads\n"));
8689
}
8790
if (handlersocket_port_wr != 0) {
8891
if (handlersocket_threads_wr > 0) {
@@ -96,9 +99,13 @@ daemon_handlersocket_init(void *p)
9699
}
97100
ap->hssvr_wr = hstcpsvr_i::create(conf);
98101
ap->hssvr_wr->start_listen();
102+
} else {
103+
DENA_VERBOSE(10, fprintf(stderr, "handlersocket: not listening "
104+
"for writes\n"));
99105
}
100106
st_plugin_int *const plugin = static_cast<st_plugin_int *>(p);
101107
plugin->data = ap.release();
108+
DENA_VERBOSE(10, fprintf(stderr, "handlersocket: initialized\n"));
102109
return 0;
103110
}
104111

0 commit comments

Comments
 (0)