Skip to content

Commit ede5adc

Browse files
committed
Fix dropped SSL connection when send buffer runs full.
1 parent 0a52fd0 commit ede5adc

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

libraries/WiFiClientSecure/src/ssl_client.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,17 +241,14 @@ int data_to_read(sslclient_context *ssl_client)
241241

242242
int send_ssl_data(sslclient_context *ssl_client, const uint8_t *data, uint16_t len)
243243
{
244-
log_v("Writing HTTP request..."); //for low level debug
245244
int ret = -1;
246245

247246
while ((ret = mbedtls_ssl_write(&ssl_client->ssl_ctx, data, len)) <= 0) {
248-
if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) {
247+
if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE && ret < 0) {
249248
return handle_error(ret);
250249
}
251250
}
252251

253-
len = ret;
254-
//log_v("%d bytes written", len); //for low level debug
255252
return ret;
256253
}
257254

0 commit comments

Comments
 (0)