Remove private.h

This commit is contained in:
Sergey Lyubka 2021-10-22 19:41:26 +01:00
parent 054475ddbf
commit 42c89732c8
7 changed files with 12 additions and 18 deletions

View File

@ -114,7 +114,6 @@ int mg_base64_decode(const char *src, int n, char *dst) {
struct dns_data { struct dns_data {
struct dns_data *next; struct dns_data *next;
struct mg_connection *c; struct mg_connection *c;
@ -173,8 +172,8 @@ static size_t mg_dns_parse_name_depth(const uint8_t *s, size_t len, size_t ofs,
return i; return i;
} }
static size_t mg_dns_parse_name(const uint8_t *s, size_t n, size_t ofs, char *dst, static size_t mg_dns_parse_name(const uint8_t *s, size_t n, size_t ofs,
size_t dstlen) { char *dst, size_t dstlen) {
return mg_dns_parse_name_depth(s, n, ofs, dst, dstlen, 0); return mg_dns_parse_name_depth(s, n, ofs, dst, dstlen, 0);
} }
@ -300,7 +299,7 @@ static void dns_cb(struct mg_connection *c, int ev, void *ev_data,
} }
static void mg_dns_send(struct mg_connection *c, const struct mg_str *name, static void mg_dns_send(struct mg_connection *c, const struct mg_str *name,
uint16_t txnid, bool ipv6) { uint16_t txnid, bool ipv6) {
struct { struct {
struct mg_dns_header header; struct mg_dns_header header;
uint8_t data[256]; uint8_t data[256];
@ -755,7 +754,6 @@ struct mg_fs mg_fs_posix = {p_stat, p_list, p_open, p_close,
// Multipart POST example: // Multipart POST example:
// --xyz // --xyz
// Content-Disposition: form-data; name="val" // Content-Disposition: form-data; name="val"
@ -2077,7 +2075,6 @@ void mg_md5_final(mg_md5_ctx *ctx, unsigned char digest[16]) {
#define MQTT_CLEAN_SESSION 0x02 #define MQTT_CLEAN_SESSION 0x02
#define MQTT_HAS_WILL 0x04 #define MQTT_HAS_WILL 0x04
#define MQTT_WILL_RETAIN 0x20 #define MQTT_WILL_RETAIN 0x20
@ -2853,7 +2850,6 @@ struct mg_connection *mg_sntp_connect(struct mg_mgr *mgr, const char *url,
#if MG_ENABLE_SOCKET #if MG_ENABLE_SOCKET
#if defined(_WIN32) && MG_ENABLE_WINSOCK #if defined(_WIN32) && MG_ENABLE_WINSOCK
#define MG_SOCK_ERRNO WSAGetLastError() #define MG_SOCK_ERRNO WSAGetLastError()
@ -3161,7 +3157,8 @@ static void setsockopts(struct mg_connection *c) {
setsockopt(FD(c), SOL_TCP, TCP_QUICKACK, (char *) &on, sizeof(on)); setsockopt(FD(c), SOL_TCP, TCP_QUICKACK, (char *) &on, sizeof(on));
#endif #endif
setsockopt(FD(c), SOL_SOCKET, SO_KEEPALIVE, (char *) &on, sizeof(on)); setsockopt(FD(c), SOL_SOCKET, SO_KEEPALIVE, (char *) &on, sizeof(on));
#if (defined(ESP32) && ESP32) || (defined(ESP8266) && ESP8266) || defined(__linux__) #if (defined(ESP32) && ESP32) || (defined(ESP8266) && ESP8266) || \
defined(__linux__)
int idle = 60; int idle = 60;
setsockopt(FD(c), IPPROTO_TCP, TCP_KEEPIDLE, &idle, sizeof(idle)); setsockopt(FD(c), IPPROTO_TCP, TCP_KEEPIDLE, &idle, sizeof(idle));
#endif #endif
@ -4548,7 +4545,6 @@ unsigned long mg_millis(void) {
struct ws_msg { struct ws_msg {
uint8_t flags; uint8_t flags;
size_t header_len; size_t header_len;

View File

@ -1,6 +1,5 @@
#include "dns.h" #include "dns.h"
#include "log.h" #include "log.h"
#include "private.h"
#include "str.h" #include "str.h"
#include "timer.h" #include "timer.h"
#include "util.h" #include "util.h"
@ -63,8 +62,8 @@ static size_t mg_dns_parse_name_depth(const uint8_t *s, size_t len, size_t ofs,
return i; return i;
} }
static size_t mg_dns_parse_name(const uint8_t *s, size_t n, size_t ofs, char *dst, static size_t mg_dns_parse_name(const uint8_t *s, size_t n, size_t ofs,
size_t dstlen) { char *dst, size_t dstlen) {
return mg_dns_parse_name_depth(s, n, ofs, dst, dstlen, 0); return mg_dns_parse_name_depth(s, n, ofs, dst, dstlen, 0);
} }
@ -190,7 +189,7 @@ static void dns_cb(struct mg_connection *c, int ev, void *ev_data,
} }
static void mg_dns_send(struct mg_connection *c, const struct mg_str *name, static void mg_dns_send(struct mg_connection *c, const struct mg_str *name,
uint16_t txnid, bool ipv6) { uint16_t txnid, bool ipv6) {
struct { struct {
struct mg_dns_header header; struct mg_dns_header header;
uint8_t data[256]; uint8_t data[256];

View File

@ -3,7 +3,6 @@
#include "base64.h" #include "base64.h"
#include "log.h" #include "log.h"
#include "net.h" #include "net.h"
#include "private.h"
#include "ssi.h" #include "ssi.h"
#include "util.h" #include "util.h"
#include "version.h" #include "version.h"

View File

@ -3,7 +3,6 @@
#include "base64.h" #include "base64.h"
#include "event.h" #include "event.h"
#include "log.h" #include "log.h"
#include "private.h"
#include "url.h" #include "url.h"
#include "util.h" #include "util.h"

View File

@ -2,7 +2,6 @@
#include "event.h" #include "event.h"
#include "log.h" #include "log.h"
#include "net.h" #include "net.h"
#include "private.h"
#include "str.h" #include "str.h"
#include "timer.h" #include "timer.h"
#include "tls.h" #include "tls.h"
@ -316,7 +315,8 @@ static void setsockopts(struct mg_connection *c) {
setsockopt(FD(c), SOL_TCP, TCP_QUICKACK, (char *) &on, sizeof(on)); setsockopt(FD(c), SOL_TCP, TCP_QUICKACK, (char *) &on, sizeof(on));
#endif #endif
setsockopt(FD(c), SOL_SOCKET, SO_KEEPALIVE, (char *) &on, sizeof(on)); setsockopt(FD(c), SOL_SOCKET, SO_KEEPALIVE, (char *) &on, sizeof(on));
#if (defined(ESP32) && ESP32) || (defined(ESP8266) && ESP8266) || defined(__linux__) #if (defined(ESP32) && ESP32) || (defined(ESP8266) && ESP8266) || \
defined(__linux__)
int idle = 60; int idle = 60;
setsockopt(FD(c), IPPROTO_TCP, TCP_KEEPIDLE, &idle, sizeof(idle)); setsockopt(FD(c), IPPROTO_TCP, TCP_KEEPIDLE, &idle, sizeof(idle));
#endif #endif

View File

@ -3,7 +3,6 @@
#include "base64.h" #include "base64.h"
#include "http.h" #include "http.h"
#include "log.h" #include "log.h"
#include "private.h"
#include "sha1.h" #include "sha1.h"
#include "url.h" #include "url.h"
#include "util.h" #include "util.h"

View File

@ -2,6 +2,8 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *, size_t); extern "C" int LLVMFuzzerTestOneInput(const uint8_t *, size_t);
#else
int LLVMFuzzerTestOneInput(const uint8_t *, size_t);
#endif #endif
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {