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:
parent
1bbafb817d
commit
d36f5cf020
|
@ -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);
|
// ESP_LOG_BUFFER_HEX(TAG, output_buffer, output_len);
|
||||||
free(output_buffer);
|
free(output_buffer);
|
||||||
output_buffer = NULL;
|
output_buffer = NULL;
|
||||||
output_len = 0;
|
|
||||||
}
|
}
|
||||||
|
output_len = 0;
|
||||||
break;
|
break;
|
||||||
case HTTP_EVENT_DISCONNECTED:
|
case HTTP_EVENT_DISCONNECTED:
|
||||||
ESP_LOGI(TAG, "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) {
|
if (output_buffer != NULL) {
|
||||||
free(output_buffer);
|
free(output_buffer);
|
||||||
output_buffer = NULL;
|
output_buffer = NULL;
|
||||||
output_len = 0;
|
|
||||||
}
|
}
|
||||||
|
output_len = 0;
|
||||||
ESP_LOGI(TAG, "Last esp error code: 0x%x", err);
|
ESP_LOGI(TAG, "Last esp error code: 0x%x", err);
|
||||||
ESP_LOGI(TAG, "Last mbedtls failure: 0x%x", mbedtls_err);
|
ESP_LOGI(TAG, "Last mbedtls failure: 0x%x", mbedtls_err);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue