-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Closing HTTPS sockets returns ESP_FAIL - due to two lwip_close calls (IDFGH-4321) #6163
Comments
github-actions
bot
changed the title
Closing HTTPS sockets returns ESP_FAIL - due to two lwip_close calls
Closing HTTPS sockets returns ESP_FAIL - due to two lwip_close calls (IDFGH-4321)
Nov 25, 2020
Thanks for reporting, we will look into. |
@istokm Thank you for reporting the issue and also suggesting the fix, the fix has already been merged internally. Should be updated on github in a couple of days. |
ghost
mentioned this issue
Dec 3, 2020
espressif-bot
pushed a commit
that referenced
this issue
Jan 9, 2021
espressif-bot
pushed a commit
that referenced
this issue
Feb 2, 2021
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
v4.3-dev-1721-g9bcf8ad19
xtensa-esp32-elf-gcc (crosstool-NG esp-2020r3) 8.4.0
Problem Description
A call to
esp_http_client_close
- after opening a connection to a HTTPS server - results inESP_FAIL
&errno
being set to 9, which is Bad file number.I've tracked the issue to
lwip_close
being indirectly called twice inesp-idf/components/esp-tls/esp_tls.c
Lines 103 to 116 in 178b122
Once through
esp-idf/components/esp-tls/esp_tls.c
Line 107 in 178b122
esp-idf/components/esp-tls/esp_tls.c
Line 109 in 178b122
What is the correct course of action here? I'd suggest completely removing the call to
close
inesp_tls_conn_destroy
(L109) as_esp_tls_conn_delete
already calls the same function with the same parameter. Or, if it's there for the offchance thattls->is_tls
is false, I'd change the if statement (L108) toif (tls->sockfd >= 0 && !tls->is_tls)
.Debug Logs
The text was updated successfully, but these errors were encountered: