From 42c89732c86d79e5f4a19214779afb8daf513011 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Fri, 22 Oct 2021 19:41:26 +0100 Subject: [PATCH] Remove private.h --- mongoose.c | 14 +++++--------- src/dns.c | 7 +++---- src/http.c | 1 - src/mqtt.c | 1 - src/sock.c | 4 ++-- src/ws.c | 1 - test/fuzz.c | 2 ++ 7 files changed, 12 insertions(+), 18 deletions(-) diff --git a/mongoose.c b/mongoose.c index 45b66c1f..3d00eaf1 100644 --- a/mongoose.c +++ b/mongoose.c @@ -114,7 +114,6 @@ int mg_base64_decode(const char *src, int n, char *dst) { - struct dns_data { struct dns_data *next; 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; } -static size_t mg_dns_parse_name(const uint8_t *s, size_t n, size_t ofs, char *dst, - size_t dstlen) { +static size_t mg_dns_parse_name(const uint8_t *s, size_t n, size_t ofs, + char *dst, size_t dstlen) { 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, - uint16_t txnid, bool ipv6) { + uint16_t txnid, bool ipv6) { struct { struct mg_dns_header header; 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: // --xyz // 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_HAS_WILL 0x04 #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 defined(_WIN32) && MG_ENABLE_WINSOCK #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)); #endif 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; setsockopt(FD(c), IPPROTO_TCP, TCP_KEEPIDLE, &idle, sizeof(idle)); #endif @@ -4548,7 +4545,6 @@ unsigned long mg_millis(void) { - struct ws_msg { uint8_t flags; size_t header_len; diff --git a/src/dns.c b/src/dns.c index 4e6879c4..0f9a8563 100644 --- a/src/dns.c +++ b/src/dns.c @@ -1,6 +1,5 @@ #include "dns.h" #include "log.h" -#include "private.h" #include "str.h" #include "timer.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; } -static size_t mg_dns_parse_name(const uint8_t *s, size_t n, size_t ofs, char *dst, - size_t dstlen) { +static size_t mg_dns_parse_name(const uint8_t *s, size_t n, size_t ofs, + char *dst, size_t dstlen) { 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, - uint16_t txnid, bool ipv6) { + uint16_t txnid, bool ipv6) { struct { struct mg_dns_header header; uint8_t data[256]; diff --git a/src/http.c b/src/http.c index 1e8f8122..891ba787 100644 --- a/src/http.c +++ b/src/http.c @@ -3,7 +3,6 @@ #include "base64.h" #include "log.h" #include "net.h" -#include "private.h" #include "ssi.h" #include "util.h" #include "version.h" diff --git a/src/mqtt.c b/src/mqtt.c index 61ddb756..a777a1e1 100644 --- a/src/mqtt.c +++ b/src/mqtt.c @@ -3,7 +3,6 @@ #include "base64.h" #include "event.h" #include "log.h" -#include "private.h" #include "url.h" #include "util.h" diff --git a/src/sock.c b/src/sock.c index d268ea2d..bfbc2527 100644 --- a/src/sock.c +++ b/src/sock.c @@ -2,7 +2,6 @@ #include "event.h" #include "log.h" #include "net.h" -#include "private.h" #include "str.h" #include "timer.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)); #endif 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; setsockopt(FD(c), IPPROTO_TCP, TCP_KEEPIDLE, &idle, sizeof(idle)); #endif diff --git a/src/ws.c b/src/ws.c index fc30c302..eb335d02 100644 --- a/src/ws.c +++ b/src/ws.c @@ -3,7 +3,6 @@ #include "base64.h" #include "http.h" #include "log.h" -#include "private.h" #include "sha1.h" #include "url.h" #include "util.h" diff --git a/test/fuzz.c b/test/fuzz.c index 4da95b98..75ea5108 100644 --- a/test/fuzz.c +++ b/test/fuzz.c @@ -2,6 +2,8 @@ #ifdef __cplusplus extern "C" int LLVMFuzzerTestOneInput(const uint8_t *, size_t); +#else +int LLVMFuzzerTestOneInput(const uint8_t *, size_t); #endif int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {