mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-05-18 15:46:56 +08:00
fix(mqtt): Fix a bug of MQTT when disable WS or WSS
This commit is contained in:
@ -406,6 +406,7 @@ esp_err_t esp_mqtt_client_set_uri(esp_mqtt_client_handle_t client, const char *u
|
||||
client->config->path = create_string(uri + puri.field_data[UF_PATH].off, puri.field_data[UF_PATH].len);
|
||||
}
|
||||
if (client->config->path) {
|
||||
#if MQTT_ENABLE_WSS || MQTT_ENABLE_WS
|
||||
esp_transport_handle_t trans = esp_transport_list_get_transport(client->transport_list, "ws");
|
||||
if (trans) {
|
||||
esp_transport_ws_set_path(trans, client->config->path);
|
||||
@ -414,6 +415,7 @@ esp_err_t esp_mqtt_client_set_uri(esp_mqtt_client_handle_t client, const char *u
|
||||
if (trans) {
|
||||
esp_transport_ws_set_path(trans, client->config->path);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (puri.field_data[UF_PORT].len) {
|
||||
|
Reference in New Issue
Block a user