Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed May 3, 2018
2 parents e9d03c8 + 8452029 commit 5e60136
Show file tree
Hide file tree
Showing 377 changed files with 16,424 additions and 8,697 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ test/msgsps_sub
test/msgsps_pub.dat
test/msgsps_sub.dat
test/broker/c/auth_plugin.so
test/broker/c/*.test

lib/cpp/libmosquittopp.so*
lib/cpp/libmosquittopp.a
lib/libmosquitto.so*
lib/libmosquitto.a

Expand Down
37 changes: 25 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,9 @@ project(mosquitto)
cmake_minimum_required(VERSION 2.8)
# Only for version 3 and up. cmake_policy(SET CMP0042 NEW)

set (VERSION 1.4.15)
set (VERSION 1.5.0)

if (WIN32)
execute_process(COMMAND cmd /c echo %DATE% %TIME% OUTPUT_VARIABLE TIMESTAMP
OUTPUT_STRIP_TRAILING_WHITESPACE)
else (WIN32)
execute_process(COMMAND date "+%F %T%z" OUTPUT_VARIABLE TIMESTAMP
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif (WIN32)

add_definitions (-DCMAKE -DVERSION=\"${VERSION}\" -DTIMESTAMP=\"${TIMESTAMP}\")
add_definitions (-DCMAKE -DVERSION=\"${VERSION}\")

if (WIN32)
set (BINDIR .)
Expand All @@ -32,6 +24,7 @@ if (WIN32)
set (DATAROOTDIR share)
set (MANDIR man)
set (SHAREDEST .)
set (PKGCONFIGDIR "${LIBDIR}/pkgconfig")
add_definitions("-D_CRT_SECURE_NO_WARNINGS")
add_definitions("-D_CRT_NONSTDC_NO_DEPRECATE")
else (WIN32)
Expand All @@ -49,6 +42,7 @@ else (WIN32)
set (DATAROOTDIR share)
set (MANDIR "${DATAROOTDIR}/man")
set (SHAREDIR "${DATAROOTDIR}/mosquitto")
set (PKGCONFIGDIR "${LIBDIR}/pkgconfig")
endif (WIN32)

option(WITH_TLS
Expand Down Expand Up @@ -77,7 +71,9 @@ if (${WITH_SOCKS} STREQUAL ON)
add_definitions("-DWITH_SOCKS")
endif (${WITH_SOCKS} STREQUAL ON)

option(WITH_SRV "Include SRV lookup support?" ON)
option(WITH_SRV "Include SRV lookup support?" OFF)

option(DOCUMENTATION "Build documentation?" ON)

# ========================================
# Include projects
Expand All @@ -86,10 +82,27 @@ option(WITH_SRV "Include SRV lookup support?" ON)
add_subdirectory(lib)
add_subdirectory(client)
add_subdirectory(src)
add_subdirectory(man)
if (${DOCUMENTATION} STREQUAL ON)
add_subdirectory(man)
endif (${DOCUMENTATION} STREQUAL ON)

# ========================================
# Install config file
# ========================================

install(FILES mosquitto.conf aclfile.example pskfile.example pwfile.example DESTINATION "${SYSCONFDIR}")


# ========================================
# Install pkg-config files
# ========================================

configure_file(libmosquitto.pc.in libmosquitto.pc @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libmosquitto.pc" DESTINATION "${PKGCONFIGDIR}")
configure_file(libmosquittopp.pc.in libmosquittopp.pc @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libmosquittopp.pc" DESTINATION "${PKGCONFIGDIR}")

# ========================================
# Testing
# ========================================
add_custom_target(Tests COMMAND make -C ${mosquitto_SOURCE_DIR}/test test)
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Please read the [Eclipse Foundation policy on accepting contributions via Git](h
```develop``` or ```fixes``` branch as appropriate to request review and
merge of the commits in your pushed branch.


What happens next depends on the content of the patch. If it is 100% authored
by the contributor and is less than 1000 lines (and meets the needs of the
project), then it can be pulled into the main repository. If not, more steps
Expand All @@ -88,4 +89,4 @@ Create a new bug:
Be sure to search for existing bugs before you create another one. Remember
that contributions are always welcome!

- [Create new Paho bug](https://github.com/eclipse/mosquitto/issues)
- [Create new Mosquitto bug](https://github.com/eclipse/mosquitto/issues)
167 changes: 160 additions & 7 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,156 @@
1.5 - 20180502
==============

Security:
- Fix memory leak that could be caused by a malicious CONNECT packet. This
does not yet have a CVE assigned. Closes #533493 (on Eclipse bugtracker)

Broker features:
- Add per_listener_settings to allow authentication and access control to be
per listener.
- Add limited support for reloading listener settings. This allows settings
for an already defined listener to be reloaded, but port numbers must not be
changed.
- Add ability to deny access to SUBSCRIBE messages as well as the current
read/write accesses. Currently for auth plugins only.
- Reduce calls to malloc through the use of UHPA.
- Outgoing messages with QoS>1 are no longer retried after a timeout period.
Messages will be retried when a client reconnects. This change in behaviour
can be justified by considering when the timeout may have occurred.
* If a connection is unreliable and has dropped, but without one end
noticing, the messages will be retried on reconnection. Sending
additional PUBLISH or PUBREL would not have changed anything.
* If a client is overloaded/unable to respond/has a slow connection then
sending additional PUBLISH or PUBREL would not help the client catch
up. Once the backlog has cleared the client will respond. If it is not
able to catch up, sending additional duplicates would not help either.
- Add use_subject_as_username option for certificate based client
authentication to use the entire certificate subject as a username, rather
than just the CN. Closes #469467.
- Change sys tree printing output. This format shouldn't be relied upon and
may change at any time. Closes #470246.
- Minimum supported libwebsockets version is now 1.3.
- Add systemd startup notification and services. Closes #471053.
- Reduce unnecessary malloc and memcpy when receiving a message and storing
it. Closes #470258.
- Support for Windows XP has been dropped.
- Bridge connections now default to using MQTT v3.1.1.
- mosquitto_db_dump tool can now output some stats on clients.
- Perform utf-8 validation on incoming will, subscription and unsubscription
topics.
- new $SYS/broker/store/messages/count (deprecates $SYS/broker/messages/stored)
- new $SYS/broker/store/messages/bytes
- max_queued_bytes feature to limit queues by real size rather than
than just message count. Closes Eclipse #452919 or Github #100
- Add support for bridges to be configured to only send notifications to the
local broker.
- Add set_tcp_nodelay option to allow Nagle's algorithm to be disabled on
client sockets. Closes #433.
- The behaviour of allow_anonymous has changed. In the old behaviour, the
default if not set was to allow anonymous access. The new behaviour is to
default is to allow anonymous access unless another security option is set.
For example, if password_file is set and allow_anonymous is not set, then
anonymous access will be denied. It is still possible to allow anonymous
access by setting it explicitly.

Broker fixes:
- Fix UNSUBSCRIBE with no topic is accepted on MQTT 3.1.1. Closes #665.
- Produce an error if two bridges share the same local_clientid.
- Miscellaneous fixes on Windows.
- queue_qos0_messages was not observing max_queued_** limits
- When using the include_dir configuration option sort the files
alphabetically before loading them. Closes #17.
- IPv6 is no longer disabled for websockets listeners.
- Remove all build timestamp information including $SYS/broker/timestamp.
Close #651.
- Correctly handle incoming strings that contain a NULL byte. Closes #693.
- Use constant time memcmp for password comparisons.
- Fix incorrect PSK key being used if it had leading zeroes.
- Fix memory leak if a client provided a username/password for a listener with
use_identity_as_username configured.
- Fix use_identity_as_username not working on websockets clients.
- Don't crash if an auth plugin returns MOSQ_ERR_AUTH for a username check on
a websockets client. Closes #490.
- Fix 08-ssl-bridge.py test when using async dns lookups. Closes #507.
- Lines in the config file are no longer limited to 1024 characters long.
Closes #652.
- Fix $SYS counters of messages and bytes sent when message is sent over
a Websockets. Closes #250.
- Fix upgrade_outgoing_qos for retained message. Closes #534.
- Fix CONNACK message not being sent for unauthorised connect on websockets.
Closes #8.
- Maximum connections on Windows increased to 2048.
- When a client with an in-use client-id connects, if the old client has a
will, send the will message. Closes #26.
- Fix parsing of configuration options that end with a space. Closes #804.

Client library features:
- Outgoing messages with QoS>1 are no longer retried after a timeout period.
Messages will be retried when a client reconnects.
- DNS-SRV support is now disabled by default.
- Add mosquitto_subscribe_simple() This is a helper function to make
retrieving messages from a broker very straightforward. Examples of its use
are in examples/subscribe_simple.
- Add mosquitto_subscribe_callback() This is a helper function to make
processing messages from a broker very straightforward. An example of its use
is in examples/subscribe_simple.
- Connections now default to using MQTT v3.1.1.
- Add mosquitto_validate_utf8() to check whether a string is valid UTF-8
according to the UTF-8 spec and to the additional restrictions imposed by
the MQTT spec.
- Topic inputs are checked for UTF-8 validity.
- Add mosquitto_userdata function to allow retrieving the client userdata
member variable. Closes #111.
- Add mosquitto_pub_topic_check2(), mosquitto_sub_topic_check2(), and
mosquitto_topic_matches_sub2() which are identical to the similarly named
functions but also take length arguments.
- Add mosquitto_connect_with_flags_callback_set(), which allows a second
connect callback to be used which also exposes the connect flags parameter.
Closes #738 and #128.
- Add MOSQ_OPT_SSL_CTX option to allow a user specified SSL_CTX to be used
instead of the one generated by libmosquitto. This allows greater control
over what options can be set. Closes #715.
- Add MOSQ_OPT_SSL_CTX_WITH_DEFAULTS to work with MOSQ_OPT_SSL_CTX and have
the default libmosquitto SSL_CTX configuration applied to the user provided
SSL_CTX. Closes #567.

Client library fixes:
- Fix incorrect PSK key being used if it had leading zeroes.
- Initialise "result" variable as soon as possible in
mosquitto_topic_matches_sub. Closes #654.
- No need to close socket again if setting non-blocking failed. Closes #649.
- Fix mosquitto_topic_matches_sub() not correctly matching foo/bar against
foo/+/#. Closes #670.
- SNI host support added.

Client features:
- Add -F to mosquitto_sub to allow the user to choose the output format.
- Add -U to mosquitto_sub for unsubscribing from topics.
- Add -c (clean session) to mosquitto_pub.
- Add --retained-only to mosquitto_sub to exit after receiving all retained
messages.
- Add -W to allow mosquitto_sub to stop processing incoming messages after a
timeout.
- Connections now default to using MQTT v3.1.1.
- Default to using port 8883 when using TLS.
- mosquitto_sub doesn't continue to keep connecting if CONNACK tells it the
connection was refused.

Client fixes:
- Correctly handle empty files with "mosquitto_pub -l". Closes #676.

Build:
- Add WITH_STRIP option (defaulting to "no") that when set to "yes" will strip
executables and shared libraries when installing.
- Add WITH_STATIC_LIBRARIES (defaulting to "no") that when set to "yes" will
build and install static versions of the client libraries.
- Don't run TLS-PSK tests if TLS-PSK disabled at compile time. Closes #636.
- Support for openssl versions 1.0.0 and 1.0.1 has been removed as these are
no longer supported by openssl.

Documentation:
- Replace mentions of deprecated 'c_rehash' with 'openssl rehash'.

1.4.15 - 20180228
=================

Expand Down Expand Up @@ -581,7 +734,7 @@ Clients:
Broker:
- Don't always attempt to call read() for SSL clients, irrespective of whether
they were ready to read or not. Reduces syscalls significantly.
- Possible memory leak fixes.
- Possible memory leak fixes.
- Further fix for bug #1226040: multiple retained messages being delivered for
subscriptions ending in #.
- Fix bridge reconnections when using multiple bridge addresses.
Expand Down Expand Up @@ -1047,7 +1200,7 @@ Client library:
- C++ lib_init(), lib_version() and lib_cleanup() are now in the mosqpp
namespace directly, not mosquittopp class members.
- The Python library is now written in pure Python and so no longer depends on
libmosquitto.
libmosquitto.
- The Python library includes SSL/TLS support.
- The Python library should now be compatible with Python 3.

Expand Down Expand Up @@ -1183,7 +1336,7 @@ Other:
use a username/password.
- Add mosquitto_reconnect() to the client library.
- Add option for compiling with liberal protocol compliance support (enabled
by default).
by default).
- Fix problems with clients reconnecting and old messages remaining in the
message store.
- Display both ip and client id in the log message when a client connects.
Expand Down Expand Up @@ -1269,7 +1422,7 @@ Other:

- Implement support for the password_file option and accompanying
authentication requirements in the broker.
- Implement topic Access Control Lists.
- Implement topic Access Control Lists.
- mosquitto_will_set() and mosquitto_publish() now return
MOSQ_ERR_PAYLOAD_SIZE if the payload is too large (>268,435,455 bytes).
- Bridge support can now be disabled at compile time.
Expand Down Expand Up @@ -1344,7 +1497,7 @@ Other:
- Don't send client will if it is disconnected for exceeding its keepalive
timer.
- Fix client library unsubscribe function incorrectly sending a SUBSCRIBE
command when it should be UNSUBSCRIBE.
command when it should be UNSUBSCRIBE.
- Fix max_inflight_messages and max_queued_messages operation. These
parameters now apply only to QoS 1 and 2 messages and are used regardless of
the client connection state.
Expand Down Expand Up @@ -1487,7 +1640,7 @@ Other:
Fixes bug #529990.
- Treat subscriptions with a trailing slash correctly. This should fix bugs
#530369 and #530099.

0.5.1 - 20100227
================

Expand Down Expand Up @@ -1562,7 +1715,7 @@ Other:
- Set SO_REUSEADDR on the listening socket so restart is much quicker.
- Added support for tracking current heap memory usage - this is published on
the topic "$SYS/broker/heap/current size"
- Added code for logging to stderr, stdout, syslog and topics.
- Added code for logging to stderr, stdout, syslog and topics.
- Added logging to numerous places - still plenty of scope for more.

0.2 - 20091204
Expand Down
30 changes: 19 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ DIRS=lib client src
DOCDIRS=man
DISTDIRS=man

.PHONY : all mosquitto docs binary clean reallyclean test install uninstall dist sign copy
.PHONY : all mosquitto api docs binary clean reallyclean test install uninstall dist sign copy

all : $(MAKE_ALL)

api :
mkdir -p api p
naturaldocs -o HTML api -i lib -p p
rm -rf p

docs :
set -e; for d in ${DOCDIRS}; do $(MAKE) -C $${d}; done

Expand All @@ -31,6 +36,9 @@ reallyclean :
$(MAKE) -C test reallyclean
-rm -f *.orig

ptest : mosquitto
$(MAKE) -C test ptest

test : mosquitto
$(MAKE) -C test test

Expand All @@ -39,24 +47,24 @@ install : mosquitto
ifeq ($(WITH_DOCS),yes)
set -e; for d in ${DOCDIRS}; do $(MAKE) -C $${d} install; done
endif
$(INSTALL) -d ${DESTDIR}/etc/mosquitto
$(INSTALL) -m 644 mosquitto.conf ${DESTDIR}/etc/mosquitto/mosquitto.conf.example
$(INSTALL) -m 644 aclfile.example ${DESTDIR}/etc/mosquitto/aclfile.example
$(INSTALL) -m 644 pwfile.example ${DESTDIR}/etc/mosquitto/pwfile.example
$(INSTALL) -m 644 pskfile.example ${DESTDIR}/etc/mosquitto/pskfile.example
$(INSTALL) -d "${DESTDIR}/etc/mosquitto"
$(INSTALL) -m 644 mosquitto.conf "${DESTDIR}/etc/mosquitto/mosquitto.conf.example"
$(INSTALL) -m 644 aclfile.example "${DESTDIR}/etc/mosquitto/aclfile.example"
$(INSTALL) -m 644 pwfile.example "${DESTDIR}/etc/mosquitto/pwfile.example"
$(INSTALL) -m 644 pskfile.example "${DESTDIR}/etc/mosquitto/pskfile.example"

uninstall :
set -e; for d in ${DIRS}; do $(MAKE) -C $${d} uninstall; done
rm -f ${DESTDIR}/etc/mosquitto/mosquitto.conf
rm -f ${DESTDIR}/etc/mosquitto/aclfile.example
rm -f ${DESTDIR}/etc/mosquitto/pwfile.example
rm -f ${DESTDIR}/etc/mosquitto/pskfile.example
rm -f "${DESTDIR}/etc/mosquitto/mosquitto.conf.example"
rm -f "${DESTDIR}/etc/mosquitto/aclfile.example"
rm -f "${DESTDIR}/etc/mosquitto/pwfile.example"
rm -f "${DESTDIR}/etc/mosquitto/pskfile.example"

dist : reallyclean
set -e; for d in ${DISTDIRS}; do $(MAKE) -C $${d} dist; done

mkdir -p dist/mosquitto-${VERSION}
cp -r client examples installer lib logo man misc security service src test about.html aclfile.example ChangeLog.txt CMakeLists.txt compiling.txt config.h config.mk CONTRIBUTING.md edl-v10 epl-v10 LICENSE.txt Makefile mosquitto.conf notice.html pskfile.example pwfile.example readme.md readme-windows.txt dist/mosquitto-${VERSION}/
cp -r client examples installer lib logo man misc security service src test about.html aclfile.example ChangeLog.txt CMakeLists.txt compiling.txt config.h config.mk CONTRIBUTING.md edl-v10 epl-v10 libmosquitto.pc.in libmosquittopp.pc.in LICENSE.txt Makefile mosquitto.conf notice.html pskfile.example pwfile.example readme.md readme-windows.txt dist/mosquitto-${VERSION}/
cd dist; tar -zcf mosquitto-${VERSION}.tar.gz mosquitto-${VERSION}/
set -e; for m in man/*.xml; \
do \
Expand Down
1 change: 1 addition & 0 deletions THANKS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Dirk O. Kaar
Dominik Obermaier
Dominik Zajac
Ed Morris
Fabian Ruff
Fang Chong
Frank Hansen
Gary Koh
Expand Down
Loading

0 comments on commit 5e60136

Please sign in to comment.