Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ public String getID() {

@Override
public void onConnect(InterceptConnectMessage msg) {
if (msg.getClientID() == null || msg.getClientID().trim().isEmpty()) {
LOG.error(
"Connection refused: client_id is missing or empty. A valid client_id is required to establish a connection.");
}
if (!clientIdToSessionMap.containsKey(msg.getClientID())) {
MqttClientSession session = new MqttClientSession(msg.getClientID());
sessionManager.login(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3650,8 +3650,10 @@ public SettableFuture<ConfigTaskResult> dropDatabase(
}

public static void unsetDatabaseIfNotExist(final String database, final IClientSession session) {
if (database.equals(session.getDatabaseName())) {
session.setDatabaseName(null);
if (session != null) {
if (database.equals(session.getDatabaseName())) {
session.setDatabaseName(null);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private IConfig createBrokerConfig(IoTDBConfig iotDBConfig) {
BrokerConstants.DATA_PATH_PROPERTY_NAME, String.valueOf(iotDBConfig.getMqttDataPath()));
properties.setProperty(BrokerConstants.IMMEDIATE_BUFFER_FLUSH_PROPERTY_NAME, "true");
properties.setProperty(BrokerConstants.ALLOW_ANONYMOUS_PROPERTY_NAME, "false");
properties.setProperty(BrokerConstants.ALLOW_ZERO_BYTE_CLIENT_ID_PROPERTY_NAME, "true");
properties.setProperty(BrokerConstants.ALLOW_ZERO_BYTE_CLIENT_ID_PROPERTY_NAME, "false");
properties.setProperty(
BrokerConstants.NETTY_MAX_BYTES_PROPERTY_NAME,
String.valueOf(iotDBConfig.getMqttMaxMessageSize()));
Expand Down
Loading