esp_http_client_example.c: Add fix to clear length of received data in case user_data buffer is passed

This commit is contained in:
Shubham Kulkarni 2020-06-16 15:02:19 +05:30
parent 1bbafb817d
commit d36f5cf020

View File

@ -87,8 +87,8 @@ esp_err_t _http_event_handler(esp_http_client_event_t *evt)
// ESP_LOG_BUFFER_HEX(TAG, output_buffer, output_len);
free(output_buffer);
output_buffer = NULL;
output_len = 0;
}
output_len = 0;
break;
case HTTP_EVENT_DISCONNECTED:
ESP_LOGI(TAG, "HTTP_EVENT_DISCONNECTED");
@ -98,8 +98,8 @@ esp_err_t _http_event_handler(esp_http_client_event_t *evt)
if (output_buffer != NULL) {
free(output_buffer);
output_buffer = NULL;
output_len = 0;
}
output_len = 0;
ESP_LOGI(TAG, "Last esp error code: 0x%x", err);
ESP_LOGI(TAG, "Last mbedtls failure: 0x%x", mbedtls_err);
}