Skip to content
Snippets Groups Projects
Unverified Commit 2c0f8292 authored by J. Burfeind's avatar J. Burfeind Committed by GitHub
Browse files

gluon-neighbour-info: end before timeout (#2185)

End the process after one result in case -l is not given
and destination address is unicast.
Reduces singleshot execution time from timeout seconds to around 150ms.

resolves #2184
parent 2ecbe488
No related branches found
No related tags found
No related merge requests found
...@@ -44,7 +44,8 @@ void usage() { ...@@ -44,7 +44,8 @@ void usage() {
puts(" -t <sec> timeout in seconds (default: 3)"); puts(" -t <sec> timeout in seconds (default: 3)");
puts(" -s <event> output as server-sent events of type <event>"); puts(" -s <event> output as server-sent events of type <event>");
puts(" or without type if <event> is the empty string"); puts(" or without type if <event> is the empty string");
puts(" -c <count> only wait for at most <count> replies"); puts(" -c <count> only wait for at most <count> replies (default: 1");
puts(" if -l is not given for unicast destination addresses)");
puts(" -l after timeout (or <count> replies if -c is given),"); puts(" -l after timeout (or <count> replies if -c is given),");
puts(" send another request and loop forever"); puts(" send another request and loop forever");
puts(" -h this help\n"); puts(" -h this help\n");
...@@ -232,6 +233,10 @@ int main(int argc, char **argv) { ...@@ -232,6 +233,10 @@ int main(int argc, char **argv) {
} }
} }
if (!loop && !IN6_IS_ADDR_MULTICAST(&client_addr.sin6_addr)) {
max_count=1;
}
if (sse) { if (sse) {
fputs("Content-Type: text/event-stream\n\n", stdout); fputs("Content-Type: text/event-stream\n\n", stdout);
fflush(stdout); fflush(stdout);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment