diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-12-09 20:44:54 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-12-09 20:44:54 +0000 |
commit | 6b8ed4f7d702030af11d9b6b1d4f969fa9ec0e14 (patch) | |
tree | 8519d6d27e7c3b5bb6a014f11492cc1f198f61f3 /src/resperf.c | |
parent | Adding upstream version 2.8.0. (diff) | |
download | dnsperf-6b8ed4f7d702030af11d9b6b1d4f969fa9ec0e14.tar.xz dnsperf-6b8ed4f7d702030af11d9b6b1d4f969fa9ec0e14.zip |
Adding upstream version 2.9.0.upstream/2.9.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/resperf.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/resperf.c b/src/resperf.c index a62c819..ac41b38 100644 --- a/src/resperf.c +++ b/src/resperf.c @@ -255,6 +255,8 @@ static void setup(int argc, char** argv) const char* doh_method = DEFAULT_DOH_METHOD; const char* local_suppress = 0; + size_t num_queries_per_conn = 0; + sock_family = AF_UNSPEC; server_port = 0; local_port = DEFAULT_LOCAL_PORT; @@ -337,6 +339,8 @@ static void setup(int argc, char** argv) "the HTTP method to use for DNS-over-HTTPS: GET or POST", DEFAULT_DOH_METHOD, &doh_method); perf_long_opt_add("suppress", perf_opt_string, "message[,message,...]", "suppress messages/warnings, see dnsperf(1) man-page for list of message types", NULL, &local_suppress); + perf_long_opt_add("num-queries-per-conn", perf_opt_uint, "queries", + "Number of queries to send per connection", NULL, &num_queries_per_conn); perf_opt_parse(argc, argv); @@ -428,6 +432,9 @@ static void setup(int argc, char** argv) if (!socks[i]) { perf_log_fatal("perf_net_opensocket(): no socket returned, out of memory?"); } + if (num_queries_per_conn && socks[i]->num_queries_per_conn) { + socks[i]->num_queries_per_conn(socks[i], num_queries_per_conn, query_timeout); + } } } @@ -738,7 +745,9 @@ try_process_response(unsigned int sockindex) size_t idx = qid * nsocks + sockindex; if (idx >= max_outstanding || queries[idx].list != &outstanding_list) { - perf_log_warning("received a response with an unexpected id: %u", qid); + if (!suppress.unexpected) { + perf_log_warning("received a response with an unexpected id: %u", qid); + } return; } q = &queries[idx]; |