|
|
|
@ -162,6 +162,7 @@ int mqtt3_bridge_connect(struct mosquitto_db *db, struct mosquitto *context)
|
|
|
|
|
mqtt3_db_messages_delete(context);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(context->bridge->local_username){
|
|
|
|
|
rc = mosquitto_unpwd_check(db, context->bridge->local_username, context->bridge->local_password);
|
|
|
|
|
switch(rc){
|
|
|
|
|
case MOSQ_ERR_SUCCESS:
|
|
|
|
@ -176,6 +177,10 @@ int mqtt3_bridge_connect(struct mosquitto_db *db, struct mosquitto *context)
|
|
|
|
|
_mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Unknown error in authentication for bridge %s.", context->id);
|
|
|
|
|
return rc;
|
|
|
|
|
}
|
|
|
|
|
}else if(!db->config->allow_anonymous){
|
|
|
|
|
_mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Bridge %s requires a username on local broker.", context->id);
|
|
|
|
|
return MOSQ_ERR_AUTH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Delete all local subscriptions even for clean_session==false. We don't
|
|
|
|
|
* remove any messages and the next loop carries out the resubscription
|
|
|
|
|