mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-06-18 21:03:17 +08:00
feat(http): Modify for esp8266
This commit is contained in:
@ -4,5 +4,5 @@ idf_component_register(SRCS "esp_http_client.c"
|
||||
"lib/http_utils.c"
|
||||
INCLUDE_DIRS "include"
|
||||
PRIV_INCLUDE_DIRS "lib/include"
|
||||
REQUIRES nghttp
|
||||
PRIV_REQUIRES mbedtls lwip esp-tls tcp_transport)
|
||||
REQUIRES http_parser
|
||||
PRIV_REQUIRES mbedtls lwip esp-tls tcp_transport tcpip_adapter)
|
||||
|
@ -14,4 +14,10 @@ menu "ESP HTTP client"
|
||||
This option will enable HTTP Basic Authentication. It is disabled by default as Basic
|
||||
auth uses unencrypted encoding, so it introduces a vulnerability when not using TLS
|
||||
|
||||
config HTTP_BUF_SIZE
|
||||
int "Default HTTP Buffer Size (both send and receive)"
|
||||
default 512
|
||||
range 512 1460
|
||||
help
|
||||
Set HTTP Buffer Size. The larger buffer size will make send and receive more size packet once.
|
||||
endmenu
|
||||
|
@ -24,7 +24,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define DEFAULT_HTTP_BUF_SIZE (512)
|
||||
#define DEFAULT_HTTP_BUF_SIZE CONFIG_HTTP_BUF_SIZE
|
||||
|
||||
typedef struct esp_http_client *esp_http_client_handle_t;
|
||||
typedef struct esp_http_client_event *esp_http_client_event_handle_t;
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
#include "esp_netif.h"
|
||||
#include "lwip/sockets.h"
|
||||
#include "esp32/rom/md5_hash.h"
|
||||
#include "rom/md5_hash.h"
|
||||
#include "mbedtls/base64.h"
|
||||
|
||||
#include "esp_system.h"
|
||||
@ -81,6 +81,10 @@ char *http_auth_digest(const char *username, const char *password, esp_http_auth
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (auth_data->algorithm == NULL) {
|
||||
auth_data->algorithm = "md5";
|
||||
}
|
||||
|
||||
ha1 = calloc(1, MD5_MAX_LEN);
|
||||
HTTP_MEM_CHECK(TAG, ha1, goto _digest_exit);
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
#ifndef _HTTP_HEADER_H_
|
||||
#define _HTTP_HEADER_H_
|
||||
|
||||
#include "sys/queue.h"
|
||||
#include "rom/queue.h"
|
||||
#include "esp_err.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
Reference in New Issue
Block a user