From 68dc04479dc9c916398c0090100d2525708036d9 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 16 Aug 2013 08:02:50 +0000 Subject: [PATCH] Add --test option. This will be used to control the printing of test messages that say when a connection is ready to use, to reduce delays in ncat-test. --- ncat/ncat_core.c | 2 ++ ncat/ncat_core.h | 2 ++ ncat/ncat_main.c | 3 +++ 3 files changed, 7 insertions(+) diff --git a/ncat/ncat_core.c b/ncat/ncat_core.c index 3a2c25ede..51af9a813 100644 --- a/ncat/ncat_core.c +++ b/ncat/ncat_core.c @@ -191,6 +191,8 @@ void options_init(void) o.nsock_engine = 0; + o.test = 0; + o.numsrcrtes = 0; o.srcrteptr = 4; diff --git a/ncat/ncat_core.h b/ncat/ncat_core.h index c523a9b89..0dca7ef8c 100644 --- a/ncat/ncat_core.h +++ b/ncat/ncat_core.h @@ -180,6 +180,8 @@ struct options { struct addrset denyset; int httpserver; int nsock_engine; + /* Output messages useful for testing to stderr? */ + int test; /* Loose source-routing stuff */ struct in_addr srcrtes[8]; diff --git a/ncat/ncat_main.c b/ncat/ncat_main.c index ea22a6ff6..d6c2bdbe7 100644 --- a/ncat/ncat_main.c +++ b/ncat/ncat_main.c @@ -309,6 +309,7 @@ int main(int argc, char *argv[]) {"proxy-type", required_argument, NULL, 0}, {"proxy-auth", required_argument, NULL, 0}, {"nsock-engine", required_argument, NULL, 0}, + {"test", no_argument, NULL, 0}, #ifdef HAVE_OPENSSL {"ssl", no_argument, &o.ssl, 1}, {"ssl-cert", required_argument, NULL, 0}, @@ -471,6 +472,8 @@ int main(int argc, char *argv[]) if (nsock_set_default_engine(optarg) < 0) bye("Unknown or non-available engine: %s.", optarg); o.nsock_engine = 1; + } else if (strcmp(long_options[option_index].name, "test") == 0) { + o.test = 1; } else if (strcmp(long_options[option_index].name, "broker") == 0) { o.broker = 1; /* --broker implies --listen. */