Skip to content

Commit 43896eb

Browse files
committed
Fix for espressif#3460 issue
1 parent 9d547a8 commit 43896eb

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

Diff for: libraries/WiFiClientSecure/src/ssl_client.cpp

+4-10
Original file line numberDiff line numberDiff line change
@@ -276,24 +276,18 @@ int data_to_read(sslclient_context *ssl_client)
276276
return res;
277277
}
278278

279-
280279
int send_ssl_data(sslclient_context *ssl_client, const uint8_t *data, uint16_t len)
281280
{
282-
log_v("Writing HTTP request..."); //for low level debug
281+
log_v("Writing HTTP request with %d bytes...", len); //for low level debug
283282
int ret = -1;
284283

285-
while ((ret = mbedtls_ssl_write(&ssl_client->ssl_ctx, data, len)) <= 0) {
286-
if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) {
287-
return handle_error(ret);
288-
}
289-
}
284+
if ((ret = mbedtls_ssl_write(&ssl_client->ssl_ctx, data, len)) <= 0)
285+
return handle_error(ret);
290286

291-
len = ret;
292-
//log_v("%d bytes written", len); //for low level debug
287+
log_v("Returning with %d bytes written", ret); //for low level debug
293288
return ret;
294289
}
295290

296-
297291
int get_ssl_receive(sslclient_context *ssl_client, uint8_t *data, int length)
298292
{
299293
//log_d( "Reading HTTP response..."); //for low level debug

0 commit comments

Comments
 (0)