summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Antonuk <alan.antonuk@gmail.com>2020-08-07 05:07:50 +0000
committerAlan Antonuk <alan.antonuk@gmail.com>2020-08-07 05:23:18 +0000
commit433fa656afe0caab584d64c52f0647e4163ca04f (patch)
treea92b022af895c1cf952bc30c8d69c2066982c8af
parentf182c13765e2a653da3bd9c3b49cac92e8dbd9fa (diff)
downloadrabbitmq-c-fix_621.tar.gz
tool: set port when not specified in --server flagfix_621
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
-rw-r--r--tools/common.c7
1 files changed, 7 insertions, 0 deletions
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