http_client: disconnect event to read last occurred error in esp-tls

This commit is contained in:
David Cermak
2019-04-23 21:29:34 +02:00
parent 587739391c
commit a001eb39bf
2 changed files with 9 additions and 2 deletions
+1 -1
View File
@@ -1145,7 +1145,7 @@ int esp_http_client_write(esp_http_client_handle_t client, const char *buffer, i
esp_err_t esp_http_client_close(esp_http_client_handle_t client)
{
if (client->state >= HTTP_STATE_INIT) {
http_dispatch_event(client, HTTP_EVENT_DISCONNECTED, NULL, 0);
http_dispatch_event(client, HTTP_EVENT_DISCONNECTED, esp_transport_get_error_handle(client->transport), 0);
client->state = HTTP_STATE_INIT;
return esp_transport_close(client->transport);
}