feat(tcp_transport): add an api to configure the addr family

This commit is contained in:
Xu Si Yu
2024-12-19 12:28:49 +08:00
parent 72a684c1f0
commit 074be51f83
4 changed files with 47 additions and 3 deletions

View File

@@ -128,6 +128,15 @@ typedef enum {
HTTP_AUTH_TYPE_DIGEST, /*!< HTTP Digest authentication */
} esp_http_client_auth_type_t;
/*
* @brief HTTP Address type
*/
typedef enum {
HTTP_ADDR_TYPE_UNSPEC = AF_UNSPEC, /**< Unspecified address family. */
HTTP_ADDR_TYPE_INET = AF_INET, /**< IPv4 address family. */
HTTP_ADDR_TYPE_INET6 = AF_INET6, /**< IPv6 address family. */
} esp_http_client_addr_type_t;
/**
* @brief HTTP configuration
*/
@@ -189,6 +198,7 @@ typedef struct {
#if CONFIG_ESP_HTTP_CLIENT_ENABLE_CUSTOM_TRANSPORT
struct esp_transport_item_t *transport;
#endif
esp_http_client_addr_type_t addr_type; /*!< Address type used in http client configurations */
} esp_http_client_config_t;
/**