mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-07-17 19:13:52 +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);
|
client->config->path = create_string(uri + puri.field_data[UF_PATH].off, puri.field_data[UF_PATH].len);
|
||||||
}
|
}
|
||||||
if (client->config->path) {
|
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");
|
esp_transport_handle_t trans = esp_transport_list_get_transport(client->transport_list, "ws");
|
||||||
if (trans) {
|
if (trans) {
|
||||||
esp_transport_ws_set_path(trans, client->config->path);
|
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) {
|
if (trans) {
|
||||||
esp_transport_ws_set_path(trans, client->config->path);
|
esp_transport_ws_set_path(trans, client->config->path);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (puri.field_data[UF_PORT].len) {
|
if (puri.field_data[UF_PORT].len) {
|
||||||
|
Reference in New Issue
Block a user