mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-23 20:11:49 +00:00
harden WS, uniformize RFC citation
This commit is contained in:
1 parent
2cf96bcb19
commit
8996d96443
11 files changed
+63
-51
No files matched your search
+11
-7
@@ -113,7 +113,9 @@ extern "C" {
|
||||
|
||||
|
||||
#if MG_ARCH == MG_ARCH_ARMGCC
|
||||
#ifndef _POSIX_TIMERS // Some newlib builds, e.g. Espressif's, define it
|
||||
#define _POSIX_TIMERS
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#if !defined(MG_ENABLE_LWIP) || !MG_ENABLE_LWIP
|
||||
@@ -189,16 +191,18 @@ extern "C" {
|
||||
#define MG_TLS MG_TLS_BUILTIN
|
||||
#endif
|
||||
|
||||
#if !defined(MG_OTA) && defined(STM32F1) || defined(STM32F2) || \
|
||||
defined(STM32F4) || defined(STM32F7)
|
||||
#ifndef MG_OTA // Pick OTA for the STM32 family, unless set by the user
|
||||
#if defined(STM32F1) || defined(STM32F2) || defined(STM32F4) || \
|
||||
defined(STM32F7)
|
||||
#define MG_OTA MG_OTA_STM32F
|
||||
#elif !defined(MG_OTA) && defined(STM32H5)
|
||||
#elif defined(STM32H5)
|
||||
#define MG_OTA MG_OTA_STM32H5
|
||||
#elif !defined(MG_OTA) && defined(STM32H7)
|
||||
#elif defined(STM32H7)
|
||||
#define MG_OTA MG_OTA_STM32H7
|
||||
#elif !defined(MG_OTA) && defined(STM32C5)
|
||||
#elif defined(STM32C5)
|
||||
#define MG_OTA MG_OTA_STM32C5
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// use HAL-defined execute-in-ram section
|
||||
#ifndef MG_IRAM
|
||||
@@ -3408,7 +3412,7 @@ void mg_ws_upgrade(struct mg_connection *, struct mg_http_message *,
|
||||
// mg_ws_connect(), mg_ws_upgrade(), mg_ws_printf(), mg_ws_wrap()
|
||||
// Notes:
|
||||
// op is one of WEBSOCKET_OP_*. Client connections are automatically masked
|
||||
// per RFC 6455. On OOM, the return value can be smaller than header + len.
|
||||
// per RFC-6455. On OOM, the return value can be smaller than header + len.
|
||||
// Data is appended to c->send and sent by a later mg_mgr_poll() call.
|
||||
size_t mg_ws_send(struct mg_connection *, const void *buf, size_t len, int op);
|
||||
|
||||
@@ -3717,7 +3721,7 @@ struct mg_dns_message {
|
||||
char name[256]; // Host name
|
||||
};
|
||||
|
||||
// DNS wire-format header (RFC 1035). All fields are in network byte order;
|
||||
// DNS wire-format header (RFC-1035). All fields are in network byte order;
|
||||
// use mg_ntohs() to read them.
|
||||
struct mg_dns_header {
|
||||
uint16_t txnid; // Transaction ID, matched between query and response
|
||||
|
||||
Reference in new issue
Block a user