mirror of
https://github.com/eclipse/mosquitto.git
synced 2025-05-09 01:01:11 +08:00
Merge branch 'fixes' of git://github.com/bk138/mosquitto into bk138-fixes
This commit is contained in:
commit
5434931dbc
@ -756,8 +756,9 @@ int client_config_line_proc(struct mosq_config *cfg, int pub_or_sub, int argc, c
|
|||||||
|
|
||||||
tmp = strchr(url, '@');
|
tmp = strchr(url, '@');
|
||||||
if(tmp) {
|
if(tmp) {
|
||||||
|
char *colon;
|
||||||
*tmp++ = 0;
|
*tmp++ = 0;
|
||||||
char *colon = strchr(url, ':');
|
colon = strchr(url, ':');
|
||||||
if(colon) {
|
if(colon) {
|
||||||
*colon = 0;
|
*colon = 0;
|
||||||
cfg->password = strdup(colon + 1);
|
cfg->password = strdup(colon + 1);
|
||||||
|
9
config.h
9
config.h
@ -33,6 +33,15 @@
|
|||||||
#if defined(_MSC_VER) && _MSC_VER < 1900
|
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||||
# define snprintf sprintf_s
|
# define snprintf sprintf_s
|
||||||
# define EPROTO ECONNABORTED
|
# define EPROTO ECONNABORTED
|
||||||
|
# ifndef ECONNABORTED
|
||||||
|
# define ECONNABORTED WSAECONNABORTED
|
||||||
|
# endif
|
||||||
|
# ifndef ENOTCONN
|
||||||
|
# define ENOTCONN WSAENOTCONN
|
||||||
|
# endif
|
||||||
|
# ifndef ECONNREFUSED
|
||||||
|
# define ECONNREFUSED WSAECONNREFUSED
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
@ -49,7 +49,7 @@ extern "C" {
|
|||||||
# define libmosq_EXPORT
|
# define libmosq_EXPORT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_MSC_VER) && _MSC_VER < 1900
|
#if defined(_MSC_VER) && _MSC_VER < 1900 && !defined(bool)
|
||||||
# ifndef __cplusplus
|
# ifndef __cplusplus
|
||||||
# define bool char
|
# define bool char
|
||||||
# define true 1
|
# define true 1
|
||||||
|
@ -57,6 +57,8 @@ FILE *mosquitto__fopen(const char *path, const char *mode, bool restrict_read)
|
|||||||
DWORD ulen = UNLEN;
|
DWORD ulen = UNLEN;
|
||||||
SECURITY_DESCRIPTOR sd;
|
SECURITY_DESCRIPTOR sd;
|
||||||
DWORD dwCreationDisposition;
|
DWORD dwCreationDisposition;
|
||||||
|
int fd;
|
||||||
|
FILE *fptr;
|
||||||
|
|
||||||
switch(mode[0]){
|
switch(mode[0]){
|
||||||
case 'a':
|
case 'a':
|
||||||
@ -97,12 +99,12 @@ FILE *mosquitto__fopen(const char *path, const char *mode, bool restrict_read)
|
|||||||
|
|
||||||
LocalFree(pacl);
|
LocalFree(pacl);
|
||||||
|
|
||||||
int fd = _open_osfhandle((intptr_t)hfile, 0);
|
fd = _open_osfhandle((intptr_t)hfile, 0);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
FILE *fptr = _fdopen(fd, mode);
|
fptr = _fdopen(fd, mode);
|
||||||
if (!fptr) {
|
if (!fptr) {
|
||||||
_close(fd);
|
_close(fd);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -36,6 +36,9 @@ typedef SSIZE_T ssize_t;
|
|||||||
# define COMPAT_ECONNRESET WSAECONNRESET
|
# define COMPAT_ECONNRESET WSAECONNRESET
|
||||||
# define COMPAT_EINTR WSAEINTR
|
# define COMPAT_EINTR WSAEINTR
|
||||||
# define COMPAT_EWOULDBLOCK WSAEWOULDBLOCK
|
# define COMPAT_EWOULDBLOCK WSAEWOULDBLOCK
|
||||||
|
# ifndef EINPROGRESS
|
||||||
|
# define EINPROGRESS WSAEINPROGRESS
|
||||||
|
# endif
|
||||||
#else
|
#else
|
||||||
# define COMPAT_CLOSE(a) close(a)
|
# define COMPAT_CLOSE(a) close(a)
|
||||||
# define COMPAT_ECONNRESET ECONNRESET
|
# define COMPAT_ECONNRESET ECONNRESET
|
||||||
|
@ -24,7 +24,9 @@ Contributors:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
#if !(defined(_MSC_VER) && _MSC_VER <= 1500)
|
||||||
# define _WIN32_WINNT _WIN32_WINNT_VISTA
|
# define _WIN32_WINNT _WIN32_WINNT_VISTA
|
||||||
|
#endif
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
#else
|
#else
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
|
@ -2028,15 +2028,16 @@ static int config__read_file_core(struct mosquitto__config *config, bool reload,
|
|||||||
#endif
|
#endif
|
||||||
}else if(!strcmp(token, "topic")){
|
}else if(!strcmp(token, "topic")){
|
||||||
#ifdef WITH_BRIDGE
|
#ifdef WITH_BRIDGE
|
||||||
|
char *topic = NULL;
|
||||||
|
enum mosquitto__bridge_direction direction = bd_out;
|
||||||
|
uint8_t qos = 0;
|
||||||
|
char *local_prefix = NULL, *remote_prefix = NULL;
|
||||||
|
|
||||||
if(reload) continue; /* FIXME */
|
if(reload) continue; /* FIXME */
|
||||||
if(!cur_bridge){
|
if(!cur_bridge){
|
||||||
log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration.");
|
log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration.");
|
||||||
return MOSQ_ERR_INVAL;
|
return MOSQ_ERR_INVAL;
|
||||||
}
|
}
|
||||||
char *topic = NULL;
|
|
||||||
enum mosquitto__bridge_direction direction = bd_out;
|
|
||||||
uint8_t qos = 0;
|
|
||||||
char *local_prefix = NULL, *remote_prefix = NULL;
|
|
||||||
|
|
||||||
token = strtok_r(NULL, " ", &saveptr);
|
token = strtok_r(NULL, " ", &saveptr);
|
||||||
if(token){
|
if(token){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user