This commit is contained in:
Max Lv
2017-12-20 09:20:01 +08:00
parent 83e637cc57
commit 3ed6019e1f
4 changed files with 26 additions and 25 deletions
+10 -10
View File
@@ -1629,6 +1629,11 @@ main(int argc, char **argv)
ev_signal_init(&sigchld_watcher, signal_cb, SIGCHLD);
ev_signal_start(EV_DEFAULT, &sigchld_watcher);
if (strcmp(local_addr, ":") > 0)
LOGI("listening at [%s]:%s", local_addr, local_port);
else
LOGI("listening at %s:%s", local_addr, local_port);
struct ev_loop *loop = EV_DEFAULT;
if (mode != UDP_ONLY) {
@@ -1674,11 +1679,6 @@ main(int argc, char **argv)
else
#endif
if (strcmp(local_addr, ":") > 0)
LOGI("listening at [%s]:%s", local_addr, local_port);
else
LOGI("listening at %s:%s", local_addr, local_port);
// setuid
if (user != NULL && !run_as(user)) {
FATAL("failed to switch user");
@@ -1795,6 +1795,11 @@ _start_ss_local_server(profile_t profile, ss_local_callback callback, void *udat
listen_ctx.iface = NULL;
listen_ctx.mptcp = mptcp;
if (strcmp(local_addr, ":") > 0)
LOGI("listening at [%s]:%s", local_addr, local_port_str);
else
LOGI("listening at %s:%s", local_addr, local_port_str);
if (mode != UDP_ONLY) {
// Setup socket
int listenfd;
@@ -1823,11 +1828,6 @@ _start_ss_local_server(profile_t profile, ss_local_callback callback, void *udat
get_sockaddr_len(addr), mtu, crypto, timeout, NULL);
}
if (strcmp(local_addr, ":") > 0)
LOGI("listening at [%s]:%s", local_addr, local_port_str);
else
LOGI("listening at %s:%s", local_addr, local_port_str);
// Init connections
cork_dllist_init(&connections);
+7 -6
View File
@@ -1236,6 +1236,13 @@ main(int argc, char **argv)
listen_ctx_t *listen_ctx_current = &listen_ctx;
do {
if (listen_ctx_current->tos) {
LOGI("listening at %s:%s (TOS 0x%x)", local_addr, local_port, listen_ctx_current->tos);
} else {
LOGI("listening at %s:%s", local_addr, local_port);
}
if (mode != UDP_ONLY) {
// Setup socket
int listenfd;
@@ -1273,12 +1280,6 @@ main(int argc, char **argv)
LOGI("TCP relay disabled");
}
if (listen_ctx_current->tos) {
LOGI("listening at %s:%s (TOS 0x%x)", local_addr, local_port, listen_ctx_current->tos);
} else {
LOGI("listening at %s:%s", local_addr, local_port);
}
// Handle additionals TOS/DSCP listening ports
if (dscp_num > 0) {
listen_ctx_current = (listen_ctx_t *)ss_malloc(sizeof(listen_ctx_t));
+7 -7
View File
@@ -1845,6 +1845,11 @@ main(int argc, char **argv)
host = "127.0.0.1";
}
if (host && strcmp(host, ":") > 0)
LOGI("tcp server listening at [%s]:%s", host, server_port);
else
LOGI("tcp server listening at %s:%s", host ? host : "0.0.0.0", server_port);
// Bind to port
int listenfd;
listenfd = create_and_bind(host, server_port, mptcp);
@@ -1867,11 +1872,6 @@ main(int argc, char **argv)
ev_io_init(&listen_ctx->io, accept_cb, listenfd, EV_READ);
ev_io_start(loop, &listen_ctx->io);
if (host && strcmp(host, ":") > 0)
LOGI("tcp server listening at [%s]:%s", host, server_port);
else
LOGI("tcp server listening at %s:%s", host ? host : "0.0.0.0", server_port);
if (plugin != NULL)
break;
}
@@ -1884,12 +1884,12 @@ main(int argc, char **argv)
if (plugin != NULL) {
port = plugin_port;
}
// Setup UDP
init_udprelay(host, port, mtu, crypto, atoi(timeout), iface);
if (host && strcmp(host, ":") > 0)
LOGI("udp server listening at [%s]:%s", host, port);
else
LOGI("udp server listening at %s:%s", host ? host : "0.0.0.0", port);
// Setup UDP
init_udprelay(host, port, mtu, crypto, atoi(timeout), iface);
}
}
+2 -2
View File
@@ -1108,6 +1108,8 @@ main(int argc, char **argv)
listen_ctx.iface = iface;
listen_ctx.mptcp = mptcp;
LOGI("listening at %s:%s", local_addr, local_port);
struct ev_loop *loop = EV_DEFAULT;
if (mode != UDP_ONLY) {
@@ -1147,8 +1149,6 @@ main(int argc, char **argv)
LOGI("TCP relay disabled");
}
LOGI("listening at %s:%s", local_addr, local_port);
// setuid
if (user != NULL && !run_as(user)) {
FATAL("failed to switch user");