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

Fix dropped SSL connection when buffer gets full. #4820

Merged
merged 3 commits into from
Feb 22, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions libraries/WiFiClientSecure/src/ssl_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,11 @@ int send_ssl_data(sslclient_context *ssl_client, const uint8_t *data, uint16_t l
log_v("Writing HTTP request with %d bytes...", len); //for low level debug
int ret = -1;

if ((ret = mbedtls_ssl_write(&ssl_client->ssl_ctx, data, len)) <= 0){
log_v("Handling error %d", ret); //for low level debug
return handle_error(ret);
} else{
log_v("Returning with %d bytes written", ret); //for low level debug
while ((ret = mbedtls_ssl_write(&ssl_client->ssl_ctx, data, len)) <= 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a note on this part in the 2.0.0 PR :) could you please have a look?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done both! :)

if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE && ret < 0) {
log_v("Handling error %d", ret); //for low level debug
return handle_error(ret);
}
}

return ret;
Expand Down