Skip to content

Commit cbccc5c

Browse files
committed
Updates from review
1 parent 0aa706a commit cbccc5c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/mqtt_broker.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2707,7 +2707,9 @@ static int BrokerHandle_Connect(BrokerClient* bc, int rx_len,
27072707
"broker: LWT payload too large (%u > %d) sock=%d",
27082708
(unsigned)mc.lwt_msg->total_len,
27092709
BROKER_MAX_WILL_PAYLOAD_LEN, (int)bc->sock);
2710-
return 0; /* reject CONNECT */
2710+
ack.return_code =
2711+
MQTT_CONNECT_ACK_CODE_REFUSED_UNAVAIL;
2712+
goto send_connack;
27112713
}
27122714
else {
27132715
wp_len = (word16)mc.lwt_msg->total_len;
@@ -2867,6 +2869,7 @@ static int BrokerHandle_Connect(BrokerClient* bc, int rx_len,
28672869
}
28682870
#endif
28692871

2872+
send_connack:
28702873
rc = MqttEncode_ConnectAck(bc->tx_buf, BROKER_CLIENT_TX_SZ(bc), &ack);
28712874
if (rc > 0) {
28722875
WBLOG_INFO(broker, "broker: CONNACK send sock=%d code=%d", (int)bc->sock,

0 commit comments

Comments
 (0)