@@ -1033,7 +1033,7 @@ switch_status_t mosq_connect(mosquitto_connection_t *connection)
1033
1033
unsigned port ;
1034
1034
1035
1035
if (!connection ) {
1036
- log (SWITCH_LOG_ERROR , "mosq_connect() profile %s failed because connection name is NULL\n" , connection -> profile_name );
1036
+ log (SWITCH_LOG_ERROR , "mosq_connect() failed because connection name is NULL\n" );
1037
1037
return SWITCH_STATUS_GENERR ;
1038
1038
}
1039
1039
@@ -1130,7 +1130,7 @@ switch_status_t mosq_loop_stop(mosquitto_connection_t *connection, switch_bool_t
1130
1130
* This is part of the threaded client interface.
1131
1131
* Call this once to stop the network thread previously created with mosquitto_loop_start.
1132
1132
* This call will block until the network thread finishes.
1133
- * For the network thread to end, you must have previously called mosquitto_disconnect or have set the
1133
+ * For the network thread to end, you must have previously called mosquitto_disconnect or have set the
1134
1134
* force parameter to true.
1135
1135
*
1136
1136
* mosq A valid mosquitto instance.
@@ -1256,13 +1256,11 @@ switch_status_t mosq_new(mosquitto_profile_t *profile, mosquitto_connection_t *c
1256
1256
userdata -> profile = profile ;
1257
1257
userdata -> connection = connection ;
1258
1258
1259
- if (connection -> client_id == NULL ) {
1260
- if (connection -> clean_session == SWITCH_FALSE ) {
1261
- log (SWITCH_LOG_INFO , "mosquitto_new() profile %s connection %s called with NULL client_id, forcing clean_session to TRUE\n" , profile -> name , connection -> name );
1262
- clean_session = SWITCH_TRUE ;
1263
- }
1264
- }
1265
- clean_session = connection -> clean_session ;
1259
+ if (connection -> client_id != NULL ) {
1260
+ clean_session = connection -> clean_session ;
1261
+ } else {
1262
+ log (SWITCH_LOG_INFO , "mosquitto_new() profile %s connection %s called with NULL client_id, forcing clean_session to TRUE\n" , profile -> name , connection -> name );
1263
+ }
1266
1264
1267
1265
log (SWITCH_LOG_DEBUG , "mosquitto_new() being called with profile %s connection %s clean_session %s client_id %s\n" , profile -> name , connection -> name , clean_session ? "True" : "False" , connection -> client_id );
1268
1266
@@ -1297,7 +1295,7 @@ switch_status_t mosq_new(mosquitto_profile_t *profile, mosquitto_connection_t *c
1297
1295
/**
1298
1296
* @brief This routine frees memory associated with a mosquitto client instance
1299
1297
*
1300
- * @details This routine frees memowy associated with a mosquitto client instance and also frees memory allocated
1298
+ * @details This routine frees memowy associated with a mosquitto client instance and also frees memory allocated
1301
1299
* for the userdata structure associated with this client instance
1302
1300
*
1303
1301
* @param[in] *mosq Pointer to the mosquitto client instance
@@ -1320,7 +1318,7 @@ switch_status_t mosq_destroy(mosquitto_connection_t *connection)
1320
1318
log (SWITCH_LOG_ERROR , "mosq_destroy() called with NULL mosquitto client instance\n" );
1321
1319
return SWITCH_STATUS_GENERR ;
1322
1320
}
1323
-
1321
+
1324
1322
#if LIBMOSQUITTO_VERSION_NUMBER >= 1006008
1325
1323
userdata = mosquitto_userdata (connection -> mosq );
1326
1324
if (!userdata ) {
@@ -1536,7 +1534,7 @@ switch_status_t mosq_startup(void)
1536
1534
} else {
1537
1535
status = initialize_profiles ();
1538
1536
}
1539
-
1537
+
1540
1538
return status ;
1541
1539
}
1542
1540
0 commit comments