Skip to content

Commit

Permalink
Merge tag 'v1.5.4' into togs-conan
Browse files Browse the repository at this point in the history
Version 1.5.4.

* Fixes memory leak, GitHub eclipse#592
* Fixes TLS reconnects, GitHub eclipse#990

MAINE-140, MAINE-361
  • Loading branch information
matthias-stone committed Dec 13, 2018
2 parents 8e80854 + 8960b1f commit d66f57c
Show file tree
Hide file tree
Showing 58 changed files with 734 additions and 409 deletions.
26 changes: 25 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ project(mosquitto)
cmake_minimum_required(VERSION 2.8)
# Only for version 3 and up. cmake_policy(SET CMP0042 NEW)

set (VERSION 1.5.3)
set (VERSION 1.5.4)

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

Expand Down Expand Up @@ -73,6 +73,30 @@ endif (${WITH_SOCKS} STREQUAL ON)

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

option(WITH_THREADING "Include client library threading support?" ON)
if (${WITH_THREADING} STREQUAL ON)
add_definitions("-DWITH_THREADING")
if (WIN32)
if (CMAKE_CL_64)
set (PTHREAD_LIBRARIES C:\\pthreads\\Pre-built.2\\lib\\x64\\pthreadVC2.lib)
else (CMAKE_CL_64)
set (PTHREAD_LIBRARIES C:\\pthreads\\Pre-built.2\\lib\\x86\\pthreadVC2.lib)
endif (CMAKE_CL_64)
set (PTHREAD_INCLUDE_DIR C:\\pthreads\\Pre-built.2\\include)
else (WIN32)
find_library(LIBPTHREAD pthread)
if (LIBPTHREAD)
set (PTHREAD_LIBRARIES pthread)
else (LIBPTHREAD)
set (PTHREAD_LIBRARIES "")
endif()
set (PTHREAD_INCLUDE_DIR "")
endif (WIN32)
else (${WITH_THREADING} STREQUAL ON)
set (PTHREAD_LIBRARIES "")
set (PTHREAD_INCLUDE_DIR "")
endif (${WITH_THREADING} STREQUAL ON)

option(DOCUMENTATION "Build documentation?" ON)

# ========================================
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ Foundation IP policy.
Please read the [Eclipse Foundation policy on accepting contributions via Git](http:https://wiki.eclipse.org/Development_Resources/Contributing_via_Git).

1. Sign the [Eclipse ECA](http:https://www.eclipse.org/legal/ECA.php)
1. Register for an Eclipse Foundation User ID. You can register [here](https://dev.eclipse.org/site_login/createaccount.php).
2. Log into the [Projects Portal](https://projects.eclipse.org/), and click on the '[Eclipse ECA](https://projects.eclipse.org/user/sign/eca)' link.
2. Go to your [account settings](https://dev.eclipse.org/site_login/myaccount.php#open_tab_accountsettings) and add your GitHub username to your account.
1. Register for an Eclipse Foundation User ID. You can register [here](https://accounts.eclipse.org/user/register).
2. Log into the [Accounts Portal](https://accounts.eclipse.org/), and click on the '[Eclipse Contributor Agreement](https://accounts.eclipse.org/user/eca)' link.
2. Go to your [account settings](https://accounts.eclipse.org/user/edit) and add your GitHub username to your account.
3. Make sure that you _sign-off_ your Git commits in the following format:
``` Signed-off-by: John Smith <[email protected]> ``` This is usually at the bottom of the commit message. You can automate this by adding the '-s' flag when you make the commits. e.g. ```git commit -s -m "Adding a cool feature"```
4. Ensure that the email address that you make your commits with is the same one you used to sign up to the Eclipse Foundation website with.
Expand Down
38 changes: 38 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
1.5.4 - 20181108
================

Security:
- When using a TLS enabled websockets listener with "require_certificate"
enabled, the mosquitto broker does not correctly verify client certificates.
This is now fixed. All other security measures operate as expected, and in
particular non-websockets listeners are not affected by this. Closes #996.

Broker:
- Process all pending messages even when a client has disconnected. This means
a client that send a PUBLISH then DISCONNECT quickly, then disconnects will
have its DISCONNECT message processed properly and so no Will will be sent.
Closes #7.
- $SYS/broker/clients/disconnected should never be negative. Closes #287.
- Give better error message if a client sends a password without a username.
Closes #1015.
- Fix bridge not honoring restart_timeout. Closes #1019.
- Don't disconnect a client if an auth plugin denies access to SUBSCRIBE.
Closes #1016.

Library:
- Fix memory leak that occurred if mosquitto_reconnect() was used when TLS
errors were present. Closes #592.
- Fix TLS connections when using an external event loop with
mosquitto_loop_read() and mosquitto_write(). Closes #990.

Build:
- Fix clients not being compiled with threading support when using CMake.
Closes #983.
- Header fixes for FreeBSD. Closes #977.
- Use _GNU_SOURCE to fix build errors in websockets and getaddrinfo usage.
Closes #862 and #933.
- Fix builds on QNX 7.0.0. Closes #1018.


1.5.3 - 20180925
================

Expand All @@ -16,6 +52,8 @@ Broker:
removed. Closes #645.
- Fix Windows version not starting if include_dir did not contain any files.
Closes #566.
- When an authentication plugin denied access to a SUBSCRIBE, the client would
be disconnected incorrectly. This has been fixed. Closes #1016.

Build:
- Various fixes to ease building.
Expand Down
8 changes: 7 additions & 1 deletion client/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include_directories(${mosquitto_SOURCE_DIR} ${mosquitto_SOURCE_DIR}/lib
${STDBOOL_H_PATH} ${STDINT_H_PATH})
${STDBOOL_H_PATH} ${STDINT_H_PATH} ${PTHREAD_INCLUDE_DIR})
link_directories(${mosquitto_BINARY_DIR}/lib)

set(shared_src client_shared.c client_shared.h)
Expand All @@ -11,8 +11,14 @@ endif (${WITH_SRV} STREQUAL ON)
add_executable(mosquitto_pub pub_client.c ${shared_src})
add_executable(mosquitto_sub sub_client.c sub_client_output.c ${shared_src})


target_link_libraries(mosquitto_pub libmosquitto)
target_link_libraries(mosquitto_sub libmosquitto)

if (QNX)
target_link_libraries(mosquitto_pub socket)
target_link_libraries(mosquitto_sub socket)
endif()

install(TARGETS mosquitto_pub RUNTIME DESTINATION "${BINDIR}" LIBRARY DESTINATION "${LIBDIR}")
install(TARGETS mosquitto_sub RUNTIME DESTINATION "${BINDIR}" LIBRARY DESTINATION "${LIBDIR}")
20 changes: 16 additions & 4 deletions client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@ include ../config.mk

.PHONY: all install uninstall reallyclean clean static static_pub static_sub

all : mosquitto_pub mosquitto_sub
ifeq ($(WITH_SHARED_LIBRARIES),yes)
SHARED_DEP:=../lib/libmosquitto.so.${SOVERSION}
endif

ifeq ($(WITH_SHARED_LIBRARIES),yes)
ALL_DEPS:= mosquitto_pub mosquitto_sub
else
ifeq ($(WITH_STATIC_LIBRARIES),yes)
ALL_DEPS:= static_pub static_sub
endif
endif

all : ${ALL_DEPS}

static : static_pub static_sub
# This makes mosquitto_pub/sub versions that are statically linked with
Expand All @@ -20,13 +32,13 @@ mosquitto_pub : pub_client.o client_shared.o
mosquitto_sub : sub_client.o sub_client_output.o client_shared.o
${CROSS_COMPILE}${CC} $^ -o $@ ${CLIENT_LDFLAGS}

pub_client.o : pub_client.c ../lib/libmosquitto.so.${SOVERSION}
pub_client.o : pub_client.c ${SHARED_DEP}
${CROSS_COMPILE}${CC} -c $< -o $@ ${CLIENT_CFLAGS}

sub_client.o : sub_client.c ../lib/libmosquitto.so.${SOVERSION}
sub_client.o : sub_client.c ${SHARED_DEP}
${CROSS_COMPILE}${CC} -c $< -o $@ ${CLIENT_CFLAGS}

sub_client_output.o : sub_client_output.c ../lib/libmosquitto.so.${SOVERSION}
sub_client_output.o : sub_client_output.c ${SHARED_DEP}
${CROSS_COMPILE}${CC} -c $< -o $@ ${CLIENT_CFLAGS}

client_shared.o : client_shared.c client_shared.h
Expand Down
6 changes: 5 additions & 1 deletion client/client_shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,11 @@ int client_id_generate(struct mosq_config *cfg, const char *id_base)

int client_connect(struct mosquitto *mosq, struct mosq_config *cfg)
{
#ifndef WIN32
char *err;
#else
char err[1024];
#endif
int rc;
int port;

Expand Down Expand Up @@ -1008,7 +1012,7 @@ int client_connect(struct mosquitto *mosq, struct mosq_config *cfg)
if(!cfg->quiet){
if(rc == MOSQ_ERR_ERRNO){
#ifndef WIN32
strerror_r(errno, err, 1024);
err = strerror(errno);
#else
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, errno, 0, (LPTSTR)&err, 1024, NULL);
#endif
Expand Down
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class LibmosquittoConan(ConanFile):
name = "libmosquitto"
version = "1.5.3-togs1"
version = "1.5.4-togs1"
license = "EDL/EPL"
description = "Mosquitto MQTT client library"
url = "https://github.com/geotracsystems/mosquitto"
Expand Down
1 change: 1 addition & 0 deletions config.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# define _POSIX_C_SOURCE 200809L
#endif

#define _GNU_SOURCE

/* ============================================================
* Compatibility defines
Expand Down
10 changes: 8 additions & 2 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ WITH_STRIP:=no
# Build static libraries
WITH_STATIC_LIBRARIES:=no

# Build shared libraries
WITH_SHARED_LIBRARIES:=yes

# Build with async dns lookup support for bridges (temporary). Requires glibc.
#WITH_ADNS:=yes

Expand All @@ -102,7 +105,7 @@ WITH_BUNDLED_DEPS:=yes

# Also bump lib/mosquitto.h, CMakeLists.txt,
# installer/mosquitto.nsi, installer/mosquitto64.nsi
VERSION=1.5.3
VERSION=1.5.4

# Client library SO version. Bump if incompatible API/ABI changes are made.
SOVERSION=1
Expand Down Expand Up @@ -146,7 +149,10 @@ ifeq ($(UNAME),Linux)
LIB_LIBS:=$(LIB_LIBS) -lrt
endif

CLIENT_LDFLAGS:=$(LDFLAGS) -L../lib ../lib/libmosquitto.so.${SOVERSION}
CLIENT_LDFLAGS:=$(LDFLAGS) -L../lib
ifeq ($(WITH_SHARED_LIBRARIES),yes)
CLIENT_LDFLAGS:=${CLIENT_LDFLAGS} ../lib/libmosquitto.so.${SOVERSION}
endif

ifeq ($(UNAME),SunOS)
ifeq ($(CC),cc)
Expand Down
13 changes: 0 additions & 13 deletions docker/1.4.10/Dockerfile

This file was deleted.

49 changes: 0 additions & 49 deletions docker/1.4.10/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions docker/1.4.10/docker-entrypoint.sh

This file was deleted.

13 changes: 0 additions & 13 deletions docker/1.4.14/Dockerfile

This file was deleted.

13 changes: 0 additions & 13 deletions docker/1.4.4/Dockerfile

This file was deleted.

49 changes: 0 additions & 49 deletions docker/1.4.4/README.md

This file was deleted.

13 changes: 0 additions & 13 deletions docker/1.4.8/Dockerfile

This file was deleted.

0 comments on commit d66f57c

Please sign in to comment.