mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(esp_http_client): Fix esp_http_client async mode
Closes https://github.com/espressif/esp-idf/issues/12358
This commit is contained in:
parent
25f729c758
commit
61d4775027
@ -1116,7 +1116,12 @@ static int esp_http_client_get_data(esp_http_client_handle_t client)
|
||||
|
||||
int rlen = esp_transport_read(client->transport, res_buffer->data, client->buffer_size_rx, client->timeout_ms);
|
||||
if (rlen >= 0) {
|
||||
http_parser_execute(client->parser, client->parser_settings, res_buffer->data, rlen);
|
||||
// When tls error is ESP_TLS_ERR_SSL_WANT_READ (-0x6900), esp_trasnport_read returns ERR_TCP_TRANSPORT_CONNECTION_TIMEOUT (0x0).
|
||||
// We should not execute http_parser_execute() on this condition as it sets the internal state machine in an
|
||||
// invalid state.
|
||||
if (!(client->is_async && rlen == 0)) {
|
||||
http_parser_execute(client->parser, client->parser_settings, res_buffer->data, rlen);
|
||||
}
|
||||
}
|
||||
return rlen;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user