From 8472d072ceb7edaf4264d5049cb019656d639b1a Mon Sep 17 00:00:00 2001 From: Jindong Zhang Date: Fri, 3 Nov 2023 01:22:29 +0800 Subject: [PATCH] local_listen is supported in oneshot mode --- src/portforward.c | 4 ++-- src/repl.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/portforward.c b/src/portforward.c index a6bfc00..6383c17 100644 --- a/src/portforward.c +++ b/src/portforward.c @@ -280,7 +280,7 @@ void portforward_transparent_server_pipe(port_listen_t *pe) { static void portforward_service_handler(port_listen_t *pe) { int new_sd; int listen_fd = pe->local_fd; - // set_running_task_changed(1); + set_running_task_changed(1); while (true) { if ((new_sd = accept(listen_fd, NULL, NULL)) >= 0) { pthread_t *worker = (pthread_t *)malloc(sizeof(pthread_t)); // TODO(jdz) free @@ -298,7 +298,7 @@ static void portforward_service_handler(port_listen_t *pe) { log_info("abort the accept"); } } - // set_running_task_changed(-1); + set_running_task_changed(-1); return; } diff --git a/src/repl.c b/src/repl.c index ed97cd1..df48634 100644 --- a/src/repl.c +++ b/src/repl.c @@ -360,7 +360,7 @@ actionfinder_t action_table[] = { {"local_listen", portforward_func, "port forward bind on local host", "local_listen [local_host] [local_port] [remote_host] [remote_port]\n" "when remote_port==0, the service listen on remote_port will be a " - "socks5+http proxy server.", NULL}, + "socks5+http proxy server.", FLAG_ONESHOT}, {"remote_listen", portforward_func, "port forward bind on remote host", "remote_listen [remote_host] [remote_port] [local_host] [local_port]\n" "when local_port==0, the service listen on remote_port will be a "