From 433fa656afe0caab584d64c52f0647e4163ca04f Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Fri, 7 Aug 2020 05:07:50 +0000 Subject: tool: set port when not specified in --server flag Set the port to 5672 and 5671 in SSL mode in the tools when the --server flag is used, but does not specify a port. Fixes: #621 --- tools/common.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/common.c b/tools/common.c index 13839a8..39c49b1 100644 --- a/tools/common.c +++ b/tools/common.c @@ -240,6 +240,13 @@ static void init_connection_info(struct amqp_connection_info *ci) { if (ci->port < 0 || ci->port > 65535 || port_end == colon + 1 || *port_end != 0) die("bad server port number in '%s'", amqp_server); + } else { + ci->port = 5672; +#if WITH_SSL + if (amqp_ssl) { + ci->port = 5671; + } +#endif } #if WITH_SSL -- cgit v1.2.1