@@ -134,7 +134,7 @@ static ssize_t tcp_write(esp_tls_t *tls, const char *data, size_t datalen)
134
134
135
135
ssize_t esp_tls_conn_read (esp_tls_t * tls , void * data , size_t datalen )
136
136
{
137
- if (!tls ) {
137
+ if (!tls || ! data ) {
138
138
return -1 ;
139
139
}
140
140
return tls -> read (tls , (char * )data , datalen );
@@ -461,7 +461,10 @@ static inline esp_err_t tcp_connect(const char *host, int hostlen, int port, con
461
461
462
462
static int esp_tls_low_level_conn (const char * hostname , int hostlen , int port , const esp_tls_cfg_t * cfg , esp_tls_t * tls )
463
463
{
464
-
464
+ if (!tls ) {
465
+ ESP_LOGE (TAG , "empty esp_tls parameter" );
466
+ return -1 ;
467
+ }
465
468
esp_err_t esp_ret ;
466
469
/* These states are used to keep a tab on connection progress in case of non-blocking connect,
467
470
and in case of blocking connect these cases will get executed one after the other */
@@ -516,6 +519,7 @@ static int esp_tls_low_level_conn(const char *hostname, int hostlen, int port, c
516
519
}
517
520
}
518
521
/* By now, the connection has been established */
522
+ ESP_LOGD (TAG , "\ncreate_ssl_handle for host: %s:%d\n" , hostname , port );
519
523
esp_ret = create_ssl_handle (hostname , hostlen , cfg , tls );
520
524
if (esp_ret != ESP_OK ) {
521
525
ESP_LOGE (TAG , "create_ssl_handle failed" );
@@ -715,11 +719,17 @@ int esp_tls_server_session_create(esp_tls_cfg_server_t *cfg, int sockfd, esp_tls
715
719
/**
716
720
* @brief Close the server side TLS/SSL connection and free any allocated resources.
717
721
*/
722
+ #ifdef CONFIG_ESP_TLS_USING_WOLFSSL
723
+ int esp_tls_server_session_delete (esp_tls_t * tls )
724
+ {
725
+ return _esp_tls_server_session_delete (tls );
726
+ }
727
+ #else
718
728
void esp_tls_server_session_delete (esp_tls_t * tls )
719
729
{
720
730
return _esp_tls_server_session_delete (tls );
721
731
}
722
-
732
+ #endif
723
733
ssize_t esp_tls_get_bytes_avail (esp_tls_t * tls )
724
734
{
725
735
return _esp_tls_get_bytes_avail (tls );
0 commit comments