MG_DISABLE_MQTT -> MG_ENABLE_MQTT

PUBLISHED_FROM=34e6028b68e286f81be7ba0f8ae73b760f144131
This commit is contained in:
Deomid Ryabkov 2016-10-13 21:48:45 +01:00 committed by Cesanta Bot
parent 75059d1bdc
commit b298d46a40
5 changed files with 17 additions and 10 deletions

View File

@ -4,7 +4,6 @@ title: Disabling flags
- `MG_DISABLE_HTTP_WEBSOCKET` disable HTTP + WebSocket protocol support - `MG_DISABLE_HTTP_WEBSOCKET` disable HTTP + WebSocket protocol support
- `MG_DISABLE_HTTP_DIGEST_AUTH` disable HTTP Digest (MD5) authorisation 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_SHA1` disable SHA1 support (used by WebSocket)
- `MG_DISABLE_MD5` disable MD5 support (used by HTTP auth) - `MG_DISABLE_MD5` disable MD5 support (used by HTTP auth)
- `MG_DISABLE_SOCKETPAIR` disable `mg_broadcast()` API - `MG_DISABLE_SOCKETPAIR` disable `mg_broadcast()` API

View File

@ -2,9 +2,11 @@
title: Enabling flags 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_IPV6` Enable IPV6 support
- `MG_ENABLE_THREADS` enable `mg_start_thread()` API - `MG_ENABLE_THREADS` enable `mg_start_thread()` API
- `MG_ENABLE_MQTT` enable MQTT client
- `MG_ENABLE_MQTT_BROKER` enable MQTT broker - `MG_ENABLE_MQTT_BROKER` enable MQTT broker
- `MG_ENABLE_DNS_SERVER` enable DNS server - `MG_ENABLE_DNS_SERVER` enable DNS server
- `MG_ENABLE_COAP` enable CoAP protocol - `MG_ENABLE_COAP` enable CoAP protocol

View File

@ -1,4 +1,4 @@
PROG = mqtt_client PROG = mqtt_client
MODULE_CFLAGS = -DMG_ENABLE_MQTT_BROKER MODULE_CFLAGS = -DMG_ENABLE_MQTT
SSL_LIB=openssl SSL_LIB=openssl
include ../examples.mk include ../examples.mk

View File

@ -109,7 +109,7 @@ struct ctl_msg {
char message[MG_CTL_MSG_MESSAGE_SIZE]; char message[MG_CTL_MSG_MESSAGE_SIZE];
}; };
#if !MG_DISABLE_MQTT #if MG_ENABLE_MQTT
struct mg_mqtt_message; struct mg_mqtt_message;
MG_INTERNAL int parse_mqtt(struct mbuf *io, struct mg_mqtt_message *mm); MG_INTERNAL int parse_mqtt(struct mbuf *io, struct mg_mqtt_message *mm);
#endif #endif
@ -7979,7 +7979,7 @@ int mg_match_prefix(const char *pattern, int pattern_len, const char *str) {
* All rights reserved * All rights reserved
*/ */
#if !MG_DISABLE_MQTT #if MG_ENABLE_MQTT
#include <string.h> #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); mg_mqtt_prepend_header(nc, MG_MQTT_CMD_DISCONNECT, 0, 0);
} }
#endif /* MG_DISABLE_MQTT */ #endif /* MG_ENABLE_MQTT */
#ifdef MG_MODULE_LINES #ifdef MG_MODULE_LINES
#line 1 "mongoose/src/mqtt_server.c" #line 1 "mongoose/src/mqtt_server.c"
#endif #endif

View File

@ -1219,10 +1219,6 @@ const char *c_strnstr(const char *s, const char *find, size_t slen);
#define MG_DISABLE_DAV 0 #define MG_DISABLE_DAV 0
#endif #endif
#ifndef MG_DISABLE_MQTT
#define MG_DISABLE_MQTT 0
#endif
#ifndef MG_DISABLE_PFS #ifndef MG_DISABLE_PFS
#define MG_DISABLE_PFS 0 #define MG_DISABLE_PFS 0
#endif #endif
@ -1287,6 +1283,10 @@ const char *c_strnstr(const char *s, const char *find, size_t slen);
#define MG_ENABLE_JAVASCRIPT 0 #define MG_ENABLE_JAVASCRIPT 0
#endif #endif
#ifndef MG_ENABLE_MQTT
#define MG_ENABLE_MQTT 0
#endif
#ifndef MG_ENABLE_MQTT_BROKER #ifndef MG_ENABLE_MQTT_BROKER
#define MG_ENABLE_MQTT_BROKER 0 #define MG_ENABLE_MQTT_BROKER 0
#endif #endif
@ -1322,6 +1322,12 @@ const char *c_strnstr(const char *s, const char *find, size_t slen);
#define MG_DISABLE_SOCKETPAIR 1 #define MG_DISABLE_SOCKETPAIR 1
#endif /* MG_NO_BSD_SOCKETS */ #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_ */ #endif /* CS_MONGOOSE_SRC_FEATURES_H_ */
#ifdef MG_MODULE_LINES #ifdef MG_MODULE_LINES
#line 1 "mongoose/src/net.h" #line 1 "mongoose/src/net.h"