From 46b2cfef1cd0f43734403dd710887abd6b00ef1a Mon Sep 17 00:00:00 2001 From: afeiszli Date: Mon, 30 May 2022 12:56:58 -0400 Subject: [PATCH] removing port fallback --- netclient/functions/mqpublish.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/netclient/functions/mqpublish.go b/netclient/functions/mqpublish.go index baaa70dc..31c84694 100644 --- a/netclient/functions/mqpublish.go +++ b/netclient/functions/mqpublish.go @@ -169,6 +169,9 @@ func checkBroker(broker string, port string) error { if broker == "" { return errors.New("error: broker address is blank") } + if port == "" { + return errors.New("error: broker port is blank") + } _, err := net.LookupIP(broker) if err != nil { return errors.New("nslookup failed for broker ... check dns records") @@ -178,10 +181,6 @@ func checkBroker(broker string, port string) error { if err != nil { logger.Log(1, "error converting port to int: "+err.Error()) } - if intPort == 0 { - logger.Log(1, "port unset in config. Using default of 8883, which may be incorrect.") - intPort = 8883 - } pinger.SetTarget(&ping.Target{ Protocol: ping.TCP, Host: broker,