]> granicus.if.org Git - esp-idf/commitdiff
transport_ws: Stop connecting when the parent's connect call has failed
authorBas Verhoeven <b.verhoeven@homewizard.nl>
Tue, 12 Mar 2019 09:44:27 +0000 (10:44 +0100)
committerDavid Cermak <cermak@espressif.com>
Thu, 4 Apr 2019 14:14:42 +0000 (16:14 +0200)
Merges https://github.com/espressif/esp-idf/pull/3164

components/tcp_transport/transport_ws.c

index a3b97bf925c6581c7fc00087241c2dc5f0255f05..74f339a0ad88fe68a0cf49df5c3135bcbf32a5d5 100644 (file)
@@ -80,7 +80,8 @@ static int ws_connect(esp_transport_handle_t t, const char *host, int port, int
 {
     transport_ws_t *ws = esp_transport_get_context_data(t);
     if (esp_transport_connect(ws->parent, host, port, timeout_ms) < 0) {
-        ESP_LOGE(TAG, "Error connect to ther server");
+        ESP_LOGE(TAG, "Error connect to the server");
+        return -1;
     }
 
     unsigned char random_key[16];