Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esp_http_client_close always returns -1 on an https request (IDFGH-2810) #4872

Closed
sebirdman opened this issue Mar 2, 2020 · 2 comments
Closed

Comments

@sebirdman
Copy link
Contributor

Problem Description

in the current 3.3 stable branch and master branches esp_http_client_close always returns ESP_FAIL. The errno is always 9.

This appears to be a result of transport_ssl.c's implementation of ssl_close where the return value is always -1

static int ssl_close(esp_transport_handle_t t)

static int ssl_close(esp_transport_handle_t t)
{
    int ret = -1;
    transport_ssl_t *ssl = esp_transport_get_context_data(t);
    if (ssl->ssl_initialized) {
        esp_tls_conn_delete(ssl->tls);
        ssl->ssl_initialized = false;
    }
    return ret;
}

because the current implementation of esp_http_client_close always returns the result of esp_transport_close.

This conflicts with the names of the returned values according to the docs: https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/protocols/esp_http_client.html#_CPPv421esp_http_client_close24esp_http_client_handle_t

@github-actions github-actions bot changed the title esp_http_client_close always returns -1 on an https request esp_http_client_close always returns -1 on an https request (IDFGH-2810) Mar 2, 2020
@david-cermak
Copy link
Collaborator

Thanks @sebirdman for posting this issue. Seems like an oversight which needs fixing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants