Skip to content

Commit

Permalink
Merge branch 'master'
Browse files Browse the repository at this point in the history
Conflicts:
	CMakeLists.txt
	ChangeLog.txt
	client/Makefile
	config.mk
	installer/mosquitto.nsi
	installer/mosquitto64.nsi
	lib/mosquitto.h
	lib/mqtt3_protocol.h
	lib/util_mosq.c
	set-version.sh
	snap/snapcraft.yaml
	src/bridge.c
	src/database.c
	src/handle_connack.c
	src/loop.c
	src/persist.c
	test/broker/Makefile
  • Loading branch information
ralight committed Mar 16, 2019
2 parents a7d0660 + 2d360fd commit 320ddc1
Show file tree
Hide file tree
Showing 112 changed files with 1,881 additions and 163 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ if (WITH_TLS)
find_package(OpenSSL REQUIRED)
add_definitions("-DWITH_TLS")

if (${WITH_TLS_PSK} STREQUAL ON)
if (WITH_TLS_PSK)
add_definitions("-DWITH_TLS_PSK")
endif (${WITH_TLS_PSK} STREQUAL ON)
endif (WITH_TLS_PSK)

if (${WITH_EC} STREQUAL ON)
if (WITH_EC)
add_definitions("-DWITH_EC")
endif (${WITH_EC} STREQUAL ON)
endif (WITH_EC)
else (WITH_TLS)
set (OPENSSL_INCLUDE_DIR "")
endif (WITH_TLS)
Expand Down
27 changes: 26 additions & 1 deletion ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,28 @@ Client fixes:
QoS>0. This has been fixed.


1.5.7 - 201902xx
1.5.8 - 20190228
================

Broker:
- Fix clients being disconnected when ACLs are in use. This only affects the
case where a client connects using a username, and the anonymous ACL list is
defined but specific user ACLs are not defined. Closes #1162.
- Make error messages for missing config file clearer.
- Fix some Coverity Scan reported errors that could occur when the broker was
already failing to start.
- Fix broken mosquitto_passwd on FreeBSD. Closes #1032.
- Fix delayed bridge local subscriptions causing missing messages.
Closes #1174.

Library:
- Use higher resolution timer for random initialisation of client id
generation. Closes #1177.
- Fix some Coverity Scan reported errors that could occur when the library was
already quitting.


1.5.7 - 20190213
================

Broker:
Expand All @@ -51,6 +72,9 @@ Broker:
other security options. Closes #1149.
- Fix include_dir not sorting config files before loading. This was partially
fixed in 1.5 previously.
- Improve documentation around the `include_dir` option. Closes #1154.
- Fix case where old unreferenced msg_store messages were being saved to the
persistence file, bloating its size unnecessarily. Closes #389.

Library:
- Fix `mosquitto_topic_matches_sub()` not returning MOSQ_ERR_INVAL for
Expand All @@ -59,6 +83,7 @@ Library:

Build:
- Don't require C99 compiler.
- Add rewritten build test script and remove some build warnings.


1.5.6 - 20190206
Expand Down
59 changes: 59 additions & 0 deletions buildtest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/usr/bin/python3

build_variants = [
'WITH_ADNS',
'WITH_BRIDGE',
'WITH_DOCS',
'WITH_EC',
'WITH_EPOLL',
'WITH_MEMORY_TRACKING',
'WITH_PERSISTENCE',
'WITH_SHARED_LIBRARIES',
'WITH_SOCKS',
'WITH_SRV',
'WITH_STATIC_LIBRARIES',
'WITH_STRIP',
'WITH_SYSTEMD',
'WITH_SYS_TREE',
'WITH_THREADING',
'WITH_TLS',
'WITH_TLS_PSK',
'WITH_WEBSOCKETS',
'WITH_WRAP',
]

special_variants = [
'WITH_BUNDLED_DEPS',
'WITH_COVERAGE',
]


import random
import subprocess

def run_test(msg, opts):
subprocess.run(["make", "clean"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
print("%s: %s" % (msg, str(opts)))
args = ["make", "-j"] + opts
proc = subprocess.run(args, stdout=subprocess.DEVNULL)
if proc.returncode != 0:
raise RuntimeError("BUILD FAILED: %s" % (' '.join(args)))

def simple_tests():
for bv in build_variants:
for enabled in ["yes", "no"]:
opts = "%s=%s" % (bv, enabled)
run_test("SIMPLE BUILD", [opts])

def random_tests(count=10):
for i in range(1, count):
opts = []
for bv in build_variants:
opts.append("%s=%s" % (bv, random.choice(["yes", "no"])))

run_test("RANDOM BUILD", opts)


if __name__ == "__main__":
simple_tests()
random_tests(100)
4 changes: 2 additions & 2 deletions client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ static : static_pub static_sub
# libmosquitto only.

static_pub : pub_client.o pub_shared.o client_props.o client_shared.o ../lib/libmosquitto.a
${CROSS_COMPILE}${CC} $^ -o mosquitto_pub ${CLIENT_LDFLAGS} -lssl -lcrypto -lpthread
${CROSS_COMPILE}${CC} $^ -o mosquitto_pub ${CLIENT_LDFLAGS} ${STATIC_LIB_DEPS}

static_sub : sub_client.o sub_client_output.o client_props.o client_shared.o ../lib/libmosquitto.a
${CROSS_COMPILE}${CC} $^ -o mosquitto_sub ${CLIENT_LDFLAGS} -lssl -lcrypto -lpthread
${CROSS_COMPILE}${CC} $^ -o mosquitto_sub ${CLIENT_LDFLAGS} ${STATIC_LIB_DEPS}

mosquitto_pub : pub_client.o pub_shared.o client_shared.o client_props.o
${CROSS_COMPILE}${CC} $^ -o $@ ${CLIENT_LDFLAGS}
Expand Down
2 changes: 1 addition & 1 deletion client/client_shared.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2014-2018 Roger Light <[email protected]>
Copyright (c) 2014-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
2 changes: 1 addition & 1 deletion client/client_shared.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2014-2018 Roger Light <[email protected]>
Copyright (c) 2014-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
2 changes: 1 addition & 1 deletion client/pub_client.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2009-2018 Roger Light <[email protected]>
Copyright (c) 2009-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
2 changes: 1 addition & 1 deletion client/sub_client.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2009-2018 Roger Light <[email protected]>
Copyright (c) 2009-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
2 changes: 1 addition & 1 deletion client/sub_client_output.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2009-2018 Roger Light <[email protected]>
Copyright (c) 2009-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
4 changes: 4 additions & 0 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ else
CFLAGS?=-Wall -ggdb -O2
endif

STATIC_LIB_DEPS:=
LIB_CFLAGS:=${CFLAGS} ${CPPFLAGS} -I. -I.. -I../lib
LIB_CXXFLAGS:=$(CFLAGS) ${CPPFLAGS} -I. -I.. -I../lib
LIB_LDFLAGS:=${LDFLAGS}
Expand Down Expand Up @@ -192,6 +193,7 @@ ifeq ($(WITH_TLS),yes)
LIB_CFLAGS:=$(LIB_CFLAGS) -DWITH_TLS
PASSWD_LIBS:=-lcrypto
CLIENT_CFLAGS:=$(CLIENT_CFLAGS) -DWITH_TLS
STATIC_LIB_DEPS:=$(STATIC_LIB_DEPS) -lssl -lcrypto

ifeq ($(WITH_TLS_PSK),yes)
BROKER_CFLAGS:=$(BROKER_CFLAGS) -DWITH_TLS_PSK
Expand All @@ -204,6 +206,7 @@ ifeq ($(WITH_THREADING),yes)
LIB_LIBS:=$(LIB_LIBS) -lpthread
LIB_CFLAGS:=$(LIB_CFLAGS) -DWITH_THREADING
CLIENT_CFLAGS:=$(CLIENT_CFLAGS) -DWITH_THREADING
STATIC_LIB_DEPS:=$(STATIC_LIB_DEPS) -lpthread
endif

ifeq ($(WITH_SOCKS),yes)
Expand Down Expand Up @@ -242,6 +245,7 @@ ifeq ($(WITH_SRV),yes)
LIB_CFLAGS:=$(LIB_CFLAGS) -DWITH_SRV
LIB_LIBS:=$(LIB_LIBS) -lcares
CLIENT_CFLAGS:=$(CLIENT_CFLAGS) -DWITH_SRV
STATIC_LIB_DEPS:=$(STATIC_LIB_DEPS) -lcares
endif

ifeq ($(UNAME),SunOS)
Expand Down
4 changes: 2 additions & 2 deletions docker/1.5/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ FROM alpine:3.8
LABEL maintainer="Roger Light <[email protected]>" \
description="Eclipse Mosquitto MQTT Broker"

ENV VERSION=1.5.6 \
DOWNLOAD_SHA256=d5bdc13cc668350026376d57fc14de10aaee029f6840707677637d15e0751a40 \
ENV VERSION=1.5.8 \
DOWNLOAD_SHA256=78d7e70c3794dc3a1d484b4f2f8d3addebe9c2da3f5a1cebe557f7d13beb0da4 \
GPG_KEYS=A0D6EEA1DCAE49A635A3B2F0779B22DFB3E717B7 \
LWS_VERSION=2.4.2

Expand Down
2 changes: 1 addition & 1 deletion lib/actions.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2010-2018 Roger Light <[email protected]>
Copyright (c) 2010-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
2 changes: 1 addition & 1 deletion lib/callbacks.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2010-2018 Roger Light <[email protected]>
Copyright (c) 2010-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
2 changes: 1 addition & 1 deletion lib/connect.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2010-2018 Roger Light <[email protected]>
Copyright (c) 2010-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
2 changes: 1 addition & 1 deletion lib/cpp/mosquittopp.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2010-2018 Roger Light <[email protected]>
Copyright (c) 2010-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
2 changes: 1 addition & 1 deletion lib/cpp/mosquittopp.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2010-2018 Roger Light <[email protected]>
Copyright (c) 2010-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
2 changes: 1 addition & 1 deletion lib/handle_connack.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2009-2018 Roger Light <[email protected]>
Copyright (c) 2009-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
2 changes: 1 addition & 1 deletion lib/handle_ping.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2009-2018 Roger Light <[email protected]>
Copyright (c) 2009-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
2 changes: 1 addition & 1 deletion lib/handle_pubackcomp.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2009-2018 Roger Light <[email protected]>
Copyright (c) 2009-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
2 changes: 1 addition & 1 deletion lib/handle_publish.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2009-2018 Roger Light <[email protected]>
Copyright (c) 2009-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
2 changes: 1 addition & 1 deletion lib/handle_pubrec.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2009-2018 Roger Light <[email protected]>
Copyright (c) 2009-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
2 changes: 1 addition & 1 deletion lib/handle_pubrel.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2009-2018 Roger Light <[email protected]>
Copyright (c) 2009-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
2 changes: 1 addition & 1 deletion lib/handle_suback.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2009-2018 Roger Light <[email protected]>
Copyright (c) 2009-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
2 changes: 1 addition & 1 deletion lib/handle_unsuback.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2009-2018 Roger Light <[email protected]>
Copyright (c) 2009-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
2 changes: 1 addition & 1 deletion lib/helpers.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2016-2018 Roger Light <[email protected]>
Copyright (c) 2016-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
2 changes: 1 addition & 1 deletion lib/logging_mosq.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2009-2018 Roger Light <[email protected]>
Copyright (c) 2009-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
2 changes: 1 addition & 1 deletion lib/logging_mosq.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2009-2018 Roger Light <[email protected]>
Copyright (c) 2009-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
2 changes: 1 addition & 1 deletion lib/loop.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2010-2018 Roger Light <[email protected]>
Copyright (c) 2010-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
2 changes: 1 addition & 1 deletion lib/memory_mosq.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2009-2018 Roger Light <[email protected]>
Copyright (c) 2009-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
2 changes: 1 addition & 1 deletion lib/memory_mosq.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2010-2018 Roger Light <[email protected]>
Copyright (c) 2010-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
2 changes: 1 addition & 1 deletion lib/messages_mosq.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2010-2018 Roger Light <[email protected]>
Copyright (c) 2010-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
2 changes: 1 addition & 1 deletion lib/messages_mosq.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2010-2018 Roger Light <[email protected]>
Copyright (c) 2010-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
12 changes: 11 additions & 1 deletion lib/mosquitto.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2010-2018 Roger Light <[email protected]>
Copyright (c) 2010-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down Expand Up @@ -47,6 +47,16 @@ int mosquitto_lib_init(void)
{
#ifdef WIN32
srand(GetTickCount64());
#elif _POSIX_TIMERS>0 && defined(_POSIX_MONOTONIC_CLOCK)
struct timespec tp;

clock_gettime(CLOCK_MONOTONIC, &tp);
srand(tp.tv_nsec);
#elif defined(__APPLE__)
uint64_t ticks;

ticks = mach_absolute_time();
srand((unsigned int)ticks);
#else
struct timeval tv;

Expand Down
2 changes: 1 addition & 1 deletion lib/mosquitto.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2010-2018 Roger Light <[email protected]>
Copyright (c) 2010-2019 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand Down
Loading

0 comments on commit 320ddc1

Please sign in to comment.