From 7a5685f3ee50fc1aab16f17bd3394e26543e1240 Mon Sep 17 00:00:00 2001 From: Dong Heng Date: Tue, 10 Dec 2019 14:26:22 +0800 Subject: [PATCH] feat(esp-tls): modify esp-tls structure members' offset of platform dependece --- components/esp-tls/esp_tls.h | 44 ++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/components/esp-tls/esp_tls.h b/components/esp-tls/esp_tls.h index bd93764e..7e9e0b51 100644 --- a/components/esp-tls/esp_tls.h +++ b/components/esp-tls/esp_tls.h @@ -249,6 +249,28 @@ typedef struct esp_tls_cfg_server { * @brief ESP-TLS Connection Handle */ typedef struct esp_tls { + int sockfd; /*!< Underlying socket file descriptor. */ + + ssize_t (*_read)(struct esp_tls *tls, char *data, size_t datalen); /*!< Callback function for reading data from TLS/SSL + connection. */ + + ssize_t (*_write)(struct esp_tls *tls, const char *data, size_t datalen); /*!< Callback function for writing data to TLS/SSL + connection. */ + + esp_tls_conn_state_t conn_state; /*!< ESP-TLS Connection state */ + + fd_set rset; /*!< read file descriptors */ + + fd_set wset; /*!< write file descriptors */ + + bool is_tls; /*!< indicates connection type (TLS or NON-TLS) */ + + esp_tls_role_t role; /*!< esp-tls role + - ESP_TLS_CLIENT + - ESP_TLS_SERVER */ + + esp_tls_error_handle_t error_handle; /*!< handle to error descriptor */ + #ifdef CONFIG_ESP_TLS_USING_MBEDTLS mbedtls_ssl_context ssl; /*!< TLS/SSL context */ @@ -282,28 +304,6 @@ typedef struct esp_tls { void *priv_ctx; void *priv_ssl; #endif - int sockfd; /*!< Underlying socket file descriptor. */ - - ssize_t (*_read)(struct esp_tls *tls, char *data, size_t datalen); /*!< Callback function for reading data from TLS/SSL - connection. */ - - ssize_t (*_write)(struct esp_tls *tls, const char *data, size_t datalen); /*!< Callback function for writing data to TLS/SSL - connection. */ - - esp_tls_conn_state_t conn_state; /*!< ESP-TLS Connection state */ - - fd_set rset; /*!< read file descriptors */ - - fd_set wset; /*!< write file descriptors */ - - bool is_tls; /*!< indicates connection type (TLS or NON-TLS) */ - - esp_tls_role_t role; /*!< esp-tls role - - ESP_TLS_CLIENT - - ESP_TLS_SERVER */ - - esp_tls_error_handle_t error_handle; /*!< handle to error descriptor */ - } esp_tls_t;