mirror of
https://github.com/cesanta/mongoose.git
synced 2025-06-07 09:27:05 +08:00
MG_DISABLE_MQTT -> MG_ENABLE_MQTT
PUBLISHED_FROM=34e6028b68e286f81be7ba0f8ae73b760f144131
This commit is contained in:
parent
75059d1bdc
commit
b298d46a40
@ -4,7 +4,6 @@ title: Disabling flags
|
||||
|
||||
- `MG_DISABLE_HTTP_WEBSOCKET` disable HTTP + WebSocket protocol support
|
||||
- `MG_DISABLE_HTTP_DIGEST_AUTH` disable HTTP Digest (MD5) authorisation support
|
||||
- `MG_DISABLE_MQTT` disable MQTT support
|
||||
- `MG_DISABLE_SHA1` disable SHA1 support (used by WebSocket)
|
||||
- `MG_DISABLE_MD5` disable MD5 support (used by HTTP auth)
|
||||
- `MG_DISABLE_SOCKETPAIR` disable `mg_broadcast()` API
|
||||
|
@ -2,9 +2,11 @@
|
||||
title: Enabling flags
|
||||
---
|
||||
|
||||
- `MG_ENABLE_SSL` Enable OpenSSL support
|
||||
- `MG_ENABLE_CGI` Enable CGI support
|
||||
- `MG_ENABLE_SSL` Enable SSL/TLS support (OpenSSL API)
|
||||
- `MG_ENABLE_IPV6` Enable IPV6 support
|
||||
- `MG_ENABLE_THREADS` enable `mg_start_thread()` API
|
||||
- `MG_ENABLE_MQTT` enable MQTT client
|
||||
- `MG_ENABLE_MQTT_BROKER` enable MQTT broker
|
||||
- `MG_ENABLE_DNS_SERVER` enable DNS server
|
||||
- `MG_ENABLE_COAP` enable CoAP protocol
|
||||
|
@ -1,4 +1,4 @@
|
||||
PROG = mqtt_client
|
||||
MODULE_CFLAGS = -DMG_ENABLE_MQTT_BROKER
|
||||
MODULE_CFLAGS = -DMG_ENABLE_MQTT
|
||||
SSL_LIB=openssl
|
||||
include ../examples.mk
|
||||
|
@ -109,7 +109,7 @@ struct ctl_msg {
|
||||
char message[MG_CTL_MSG_MESSAGE_SIZE];
|
||||
};
|
||||
|
||||
#if !MG_DISABLE_MQTT
|
||||
#if MG_ENABLE_MQTT
|
||||
struct mg_mqtt_message;
|
||||
MG_INTERNAL int parse_mqtt(struct mbuf *io, struct mg_mqtt_message *mm);
|
||||
#endif
|
||||
@ -7979,7 +7979,7 @@ int mg_match_prefix(const char *pattern, int pattern_len, const char *str) {
|
||||
* All rights reserved
|
||||
*/
|
||||
|
||||
#if !MG_DISABLE_MQTT
|
||||
#if MG_ENABLE_MQTT
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@ -8293,7 +8293,7 @@ void mg_mqtt_disconnect(struct mg_connection *nc) {
|
||||
mg_mqtt_prepend_header(nc, MG_MQTT_CMD_DISCONNECT, 0, 0);
|
||||
}
|
||||
|
||||
#endif /* MG_DISABLE_MQTT */
|
||||
#endif /* MG_ENABLE_MQTT */
|
||||
#ifdef MG_MODULE_LINES
|
||||
#line 1 "mongoose/src/mqtt_server.c"
|
||||
#endif
|
||||
|
14
mongoose.h
14
mongoose.h
@ -1219,10 +1219,6 @@ const char *c_strnstr(const char *s, const char *find, size_t slen);
|
||||
#define MG_DISABLE_DAV 0
|
||||
#endif
|
||||
|
||||
#ifndef MG_DISABLE_MQTT
|
||||
#define MG_DISABLE_MQTT 0
|
||||
#endif
|
||||
|
||||
#ifndef MG_DISABLE_PFS
|
||||
#define MG_DISABLE_PFS 0
|
||||
#endif
|
||||
@ -1287,6 +1283,10 @@ const char *c_strnstr(const char *s, const char *find, size_t slen);
|
||||
#define MG_ENABLE_JAVASCRIPT 0
|
||||
#endif
|
||||
|
||||
#ifndef MG_ENABLE_MQTT
|
||||
#define MG_ENABLE_MQTT 0
|
||||
#endif
|
||||
|
||||
#ifndef MG_ENABLE_MQTT_BROKER
|
||||
#define MG_ENABLE_MQTT_BROKER 0
|
||||
#endif
|
||||
@ -1322,6 +1322,12 @@ const char *c_strnstr(const char *s, const char *find, size_t slen);
|
||||
#define MG_DISABLE_SOCKETPAIR 1
|
||||
#endif /* MG_NO_BSD_SOCKETS */
|
||||
|
||||
/* MQTT broker requires MQTT */
|
||||
#if MG_ENABLE_MQTT_BROKER && !MG_ENABLE_MQTT
|
||||
#undef MG_ENABLE_MQTT
|
||||
#define MG_ENABLE_MQTT 1
|
||||
#endif
|
||||
|
||||
#endif /* CS_MONGOOSE_SRC_FEATURES_H_ */
|
||||
#ifdef MG_MODULE_LINES
|
||||
#line 1 "mongoose/src/net.h"
|
||||
|
Loading…
Reference in New Issue
Block a user