Skip to content

Commit

Permalink
Merge pull request #1 from marcel-behlau-elfin/bump_to_newest_mqtt_cpp
Browse files Browse the repository at this point in the history
Bump to newest mqtt cpp
  • Loading branch information
elfin-sbreuers authored Sep 19, 2019
2 parents cf385ad + c4bc289 commit 7db40bb
Show file tree
Hide file tree
Showing 123 changed files with 18,858 additions and 11,150 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "external/beast"]
path = external/beast
url = https://github.com/boostorg/beast.git
159 changes: 38 additions & 121 deletions .travis.yml

Large diffs are not rendered by default.

74 changes: 74 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,77 @@
## 6.0.4
* Fixed invalid subscribe qos comparison on receive. (#385)

## 6.0.3
* Fixed sync subscribe/unsubscribe with properties APIs dispatch to deprecated APIs problem. (#383)

## 6.0.2
* Fixed moved from object access problem. (#378)
* Fixed unexpected copy fallback of move operations. (#378)

## 6.0.1
* Fixed compile error of `acquired_async_publish_dup()`. (#376)

## 6.0.0
* Supressed warnings. (#367, #368, #369, #370, #371)
* Set `[[deprecated]]` attribute to derecated APIs. They will be removed on verion 7.0.0. (#364, #372)
* Added `mqtt::buffer` based APIs. (#364)
* Added user defined namespace support. User can define `MQTT_NS` (default `mqtt`). (#360)
* Improved test. (#357)
* Improved test broker. (#353)
* Added allocation fuction for `mqtt::buffer`. (#349)
* Supported old version of boost type_erasure. (#347)
* <<<< breaking change >>>> Adde zero copy receiving functionality. Callback handlers take `mqtt::buffer` parameter instead of `mqtt::string_view`. It can hold the lifetime. (#339, #358, #359, )
* Improved CI. (#333, #346)

## 5.0.1
* Improved CI. (#330)
* Fixed invalid std::any inclusion on mqtt::any. (#328)

## 5.0.0
* Fixed invalid pointer comparison. (#324)
* Fixed user_property value length. (#323)
* Added `store` type alias for each properties. (#319)
* Fixed `BOOST_MPL_LIMIT_LIST_SIZE` comparison. (#318)
* Removed `BOOST_ASSERT` from test code to improve exception message. (#315)
* Code refactoring. (#313)
* Added default parameter to `async_send_pubrel`'s `life_keeper`. (#312)
* Added async version of stored message sending after `CONNACK` received. (#311)
* <<<< breaking change >>>> Removed unnecessery callback invokation. (#309)
* Fixed moved from object access. (#308)
* <<<< breaking change >>>> Added properties and life_keeper parameter to pubrel and async_publrel. (#307)
* Added reuse_address flag to the test broker to avoid "address already in use" on travis-ci. (#306)
* <<<< breaking change >>>> Fixed TCP accepting process. After TCP accepting, do the next accepting process immediately. Due to the fix, Socket is updated to shared_ptr from unique_ptr. (#299)
* <<<< breaking change >>>> Added underlying connect timeout. It can treat well with TCP connected but TLS handshake not sending attack. (#296)
* Added stream output operator for properties. (#293)
* Replaced byte sequence creation macro with function. (#291)
* Fixed static boost support. (#290)
* <<<< breaking change >>>> Fixed property allocation management. (#288)
* Improved MSVC support for test. (#286)
* Added codecov for CI. (#285, #276, #275, #273)
* Added `MQTT_BUILD_EXAMPLES` flag to cmake to shorten CI time. (#284)
* Added non_ref/ref types conversion for properties. (#283)
* Added tests. (#278, #276)
* Improve travis-ci. (#274)
* Migrate from appveyor azure devops build pipelines that supports 10 parallel build. (#270)
* Fixed pingreq async/sync send. (#267)

## 4.0.0
* Added getting ssl keylog callback for debugging. (#256)
* Fixed re-listen logic for servers. Now we can re-listen after accept is failed. (#252, #254)
* Fixed restore lifetime management to avoid accessing memory after destroyed (#251)
* Removed BOOST_ASSERT checking in the case that actually happens if invalid message is received (#249, #250)
* Added MQTT v5 support (#226, #245, #257, #258, #259)
* Added connection overwrite behavior on `test_broker` (#210)
* Added `async_client` and `sync_client` to avoid misusing async and sync APIs. `client` is still remained that can use both sync and async APIs. (#208)
* Added concatenating `const_buffer` functionality on asynchronous packet sending (#207)
* Improved documents (#198, #214, #219, #229, #235)
* Added switching option between `std` and `boost` (#188, #209)
* Improved build mechanisim (#184, #201, #253)
* Code refactoring (#183, #189, #190, #193, #195, #197, #199, #202, #203, #211, #215, #216, #220, #227, #234, #236, #238, #239, #240, #242)
* Support configure time switches for using std::varient or std::optional instead of the boost versions (#182)
* Allow inheriting classes to construct mqtt::client (#181)
* <<<< Breaking change >> Replaced fixed_header type from `char` to `std::uint8_t`. Fixed `-Wconversion` warnings. See https://github.com/redboltz/mqtt_cpp/pull/180/files (#180)

## 3.1.0
* Fixed inefficient passed by value. (#174)
* Fixed unsugscribe message packet id position for continuours buffer. (#167)
Expand Down
40 changes: 21 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
CMAKE_MINIMUM_REQUIRED (VERSION 3.8.2)
PROJECT (mqtt_cpp)

OPTION(BUILD_EXAMPLES "Enable building example applications" ON)
OPTION(BUILD_TESTS "Enable building test applications" ON)
OPTION(MQTT_BUILD_EXAMPLES "Enable building example applications" ON)
OPTION(MQTT_BUILD_TESTS "Enable building test applications" ON)
OPTION(MQTT_USE_STATIC_BOOST "Statically link with boost libraries" OFF)
OPTION(MQTT_NO_TLS "Disable building TLS code" ON)
OPTION(MQTT_USE_WS "Enable building WebSockets code" OFF)
Expand All @@ -11,6 +11,7 @@ OPTION(MQTT_STD_VARIANT "Use std::variant from C++17 instead of boost::variant"
OPTION(MQTT_STD_OPTIONAL "Use std::optional from C++17 instead of boost::optional" OFF)
OPTION(MQTT_STD_STRING_VIEW "Use std::string_view from C++17 instead of boost::string_view" OFF)
OPTION(MQTT_STD_ANY "Use std::any from C++17 instead of boost::any" OFF)
OPTION(MQTT_STD_SHARED_PTR_ARRAY "Use std::shared_ptr<char[]> from C++17 instead of boost::shared_ptr<char[]>" OFF)

IF ((CMAKE_VERSION VERSION_GREATER 3.1) OR
(CMAKE_VERSION VERSION_EQUAL 3.1))
Expand Down Expand Up @@ -72,7 +73,7 @@ ELSE ()
MESSAGE (STATUS "Using boost::string_view instead of std::string_view")
ENDIF ()

IF (MQTT_STD_ANY_VIEW)
IF (MQTT_STD_ANY)
SET(CMAKE_CXX_STANDARD 17)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
MESSAGE (STATUS "Using std::any instead of boost::any. Enables C++17!!!")
Expand All @@ -81,31 +82,29 @@ ELSE ()
MESSAGE (STATUS "Using boost::any instead of std::any")
ENDIF ()

IF (MQTT_STD_SHARED_PTR_ARRAY)
SET(CMAKE_CXX_STANDARD 17)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
MESSAGE (STATUS "Using std::shared_ptr<char []> instead of boost::shared_ptr<char []>. Enables C++17!!!")
SET (CMAKE_CXX_FLAGS "-DMQTT_STD_SHARED_PTR_ARRAY ${CMAKE_CXX_FLAGS}")
ELSE ()
MESSAGE (STATUS "Using boost::shared_ptr<char []> instead of boost::shared_ptr<char []>")
ENDIF ()

IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
SET (CMAKE_CXX_FLAGS "/bigobj ${CMAKE_CXX_FLAGS}")
ENDIF ()

SET (Boost_USE_MULTITHREADED ON)
FIND_PACKAGE (Boost 1.59.0 REQUIRED COMPONENTS system)
FIND_PACKAGE (Boost 1.66.0 REQUIRED COMPONENTS system)
FIND_PACKAGE (Threads)

IF(BUILD_TESTS)
FIND_PACKAGE (Boost 1.59.0 REQUIRED COMPONENTS chrono timer test_exec_monitor unit_test_framework)
IF(MQTT_BUILD_TESTS)
FIND_PACKAGE (Boost 1.66.0 REQUIRED COMPONENTS chrono timer unit_test_framework)
ENDIF()

IF(!MQTT_NO_TLS)
FIND_PACKAGE (Boost 1.59.0 REQUIRED COMPONENTS ssl)
ENDIF()

IF (NOT MQTT_BEAST_INCLUDE_DIR)
IF (${Boost_VERSION} LESS 106600)
SET (MQTT_BEAST_INCLUDE_DIR "external/beast/include")
ENDIF ()
ENDIF ()

INCLUDE_DIRECTORIES (
${Boost_INCLUDE_DIR}
${MQTT_BEAST_INCLUDE_DIR}
include
)

Expand All @@ -118,16 +117,18 @@ ENDIF ()

ENABLE_TESTING ()

IF (BUILD_TESTS)
IF (MQTT_BUILD_TESTS)
MESSAGE(STATUS "Tests enabled")
ADD_SUBDIRECTORY (test)
ENDIF ()

IF (BUILD_EXAMPLES)
IF (MQTT_BUILD_EXAMPLES)
MESSAGE(STATUS "Examples enabled")
ADD_SUBDIRECTORY (example)
ENDIF ()

ADD_CUSTOM_TARGET(check_deps)

ADD_SUBDIRECTORY (include)

# Doxygen
Expand All @@ -140,6 +141,7 @@ IF (DOXYGEN_FOUND)
COMMAND ${CMAKE_COMMAND} -E echo "PROJECT_NAME = \"mqtt_cpp\"" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
COMMAND ${CMAKE_COMMAND} -E echo "EXTRACT_ALL = YES" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
COMMAND ${CMAKE_COMMAND} -E echo "RECURSIVE = YES" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
COMMAND ${CMAKE_COMMAND} -E echo "PREDEFINED = _DOXYGEN_" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
COMMAND ${CMAKE_COMMAND} -E echo "INPUT = ${CMAKE_CURRENT_SOURCE_DIR}/include" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
)
IF (DOXYGEN_DOT_FOUND)
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# MQTT client/server for C++14 based on Boost.Asio

Version 4.0.0 [![Build Status](https://travis-ci.org/redboltz/mqtt_cpp.svg?branch=master)](https://travis-ci.org/redboltz/mqtt_cpp) [![Build status](https://ci.appveyor.com/api/projects/status/21a267hd34s0kqu5/branch/master?svg=true)](https://ci.appveyor.com/project/redboltz/mqtt-client-cpp/branch/master)
Version 7.0.0 [![Build Status](https://travis-ci.org/redboltz/mqtt_cpp.svg?branch=master)](https://travis-ci.org/redboltz/mqtt_cpp)[![Build Status](https://dev.azure.com/redboltz/redboltz/_apis/build/status/redboltz.mqtt_cpp?branchName=master)](https://dev.azure.com/redboltz/redboltz/_build/latest?definitionId=6&branchName=master)[![codecov](https://codecov.io/gh/redboltz/mqtt_cpp/branch/master/graph/badge.svg)](https://codecov.io/gh/redboltz/mqtt_cpp)

Important note https://github.com/redboltz/mqtt_cpp/wiki/News.

[MQTT v5 is supported](https://github.com/redboltz/mqtt_cpp/wiki/MQTT-v5) since version 4.0.0.

## Overview

mqtt_cpp is a header only library. It requires C++14 and the Boost Libraries 1.57.0 or later (See [#33](https://github.com/redboltz/mqtt_cpp/issues/33)).
mqtt_cpp is a header only library. It requires C++14 and the Boost Libraries 1.66.0 or later.

Add mqtt_cpp/include to your include path. Then, include `mqtt_cpp.hpp` and/or `mqtt_server_cpp.hpp` as follows:

Expand Down
25 changes: 0 additions & 25 deletions appveyor.yml

This file was deleted.

131 changes: 131 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger:
- '*'
pr:
- '*'

pool:
vmImage: 'vs2017-win2016'

strategy:
matrix:
ExamplesTls:
MQTT_NO_TLS: OFF
MQTT_USE_WS: OFF
MQTT_USE_STR_CHECK: ON
MQTT_TEST_1: OFF
MQTT_TEST_2: OFF
MQTT_TEST_3: OFF
MQTT_TEST_4: OFF
MQTT_TEST_5: OFF
MQTT_TEST_6: OFF
MQTT_BUILD_EXAMPLES: ON
ExamplesWs:
MQTT_NO_TLS: ON
MQTT_USE_WS: ON
MQTT_USE_STR_CHECK: ON
MQTT_TEST_1: OFF
MQTT_TEST_2: OFF
MQTT_TEST_3: OFF
MQTT_TEST_4: OFF
MQTT_TEST_5: OFF
MQTT_TEST_6: OFF
MQTT_BUILD_EXAMPLES: ON
TestGroup1:
MQTT_NO_TLS: OFF
MQTT_USE_WS: OFF
MQTT_USE_STR_CHECK: OFF
MQTT_TEST_1: ON
MQTT_TEST_2: OFF
MQTT_TEST_3: OFF
MQTT_TEST_4: OFF
MQTT_TEST_5: OFF
MQTT_TEST_6: OFF
MQTT_BUILD_EXAMPLES: OFF
TestGroup2:
MQTT_NO_TLS: ON
MQTT_USE_WS: ON
MQTT_USE_STR_CHECK: ON
MQTT_TEST_1: OFF
MQTT_TEST_2: ON
MQTT_TEST_3: OFF
MQTT_TEST_4: OFF
MQTT_TEST_5: OFF
MQTT_TEST_6: OFF
MQTT_BUILD_EXAMPLES: OFF
TestGroup3:
MQTT_NO_TLS: OFF
MQTT_USE_WS: OFF
MQTT_USE_STR_CHECK: ON
MQTT_TEST_1: OFF
MQTT_TEST_2: OFF
MQTT_TEST_3: ON
MQTT_TEST_4: OFF
MQTT_TEST_5: OFF
MQTT_TEST_6: OFF
MQTT_BUILD_EXAMPLES: OFF
TestGroup4:
MQTT_NO_TLS: ON
MQTT_USE_WS: ON
MQTT_USE_STR_CHECK: ON
MQTT_TEST_1: OFF
MQTT_TEST_2: OFF
MQTT_TEST_3: OFF
MQTT_TEST_4: ON
MQTT_TEST_5: OFF
MQTT_TEST_6: OFF
MQTT_BUILD_EXAMPLES: OFF
TestGroup5:
MQTT_NO_TLS: ON
MQTT_USE_WS: ON
MQTT_USE_STR_CHECK: ON
MQTT_TEST_1: OFF
MQTT_TEST_2: OFF
MQTT_TEST_3: OFF
MQTT_TEST_4: OFF
MQTT_TEST_5: ON
MQTT_TEST_6: OFF
MQTT_BUILD_EXAMPLES: OFF
TestGroup6:
MQTT_NO_TLS: OFF
MQTT_USE_WS: OFF
MQTT_USE_STR_CHECK: ON
MQTT_TEST_1: OFF
MQTT_TEST_2: OFF
MQTT_TEST_3: OFF
MQTT_TEST_4: OFF
MQTT_TEST_5: OFF
MQTT_TEST_6: ON
MQTT_BUILD_EXAMPLES: OFF
TestGroup7:
MQTT_NO_TLS: ON
MQTT_USE_WS: ON
MQTT_USE_STR_CHECK: ON
MQTT_TEST_1: OFF
MQTT_TEST_2: OFF
MQTT_TEST_3: OFF
MQTT_TEST_4: OFF
MQTT_TEST_5: OFF
MQTT_TEST_6: ON
MQTT_BUILD_EXAMPLES: OFF

steps:
- script: |
git clone https://github.com/curl/curl.git -b curl-7_65_0
git clone https://github.com/openssl/openssl.git -b OpenSSL_1_1_1b
.\curl\projects\build-openssl.bat vc14.1 x86 debug .\openssl\ -perlpath C:\Strawberry
displayName: 'install openssl'

- script: |
git submodule update --init --recursive
mkdir build
cd build
cmake -DMQTT_NO_TLS=%MQTT_NO_TLS% -DMQTT_USE_WS=%MQTT_USE_WS% -DMQTT_USE_STR_CHECK=%MQTT_USE_STR_CHECK% -DMQTT_TEST_1=%MQTT_TEST_1% -DMQTT_TEST_2=%MQTT_TEST_2% -DMQTT_TEST_3=%MQTT_TEST_3% -DMQTT_TEST_4=%MQTT_TEST_4% -DMQTT_TEST_5=%MQTT_TEST_5% -DMQTT_TEST_6=%MQTT_TEST_6% -DMQTT_BUILD_EXAMPLES=%MQTT_BUILD_EXAMPLES% -DOPENSSL_ROOT_DIR="./openssl/" ..
cmake --build . --config Release
cd test
set PATH=%BOOST_ROOT%\lib;D:/a/1/s/openssl/;%PATH%
ctest -VV
displayName: 'cmake test'
31 changes: 31 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
codecov:
notify:
require_ci_to_pass: yes

coverage:
precision: 2
round: down
range: "70...100"

status:
project: yes
patch: yes
changes: no

parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no

comment:
layout: "header, diff"
behavior: default
require_changes: no

ignore:
- "test"
- "example"
- "external"
Loading

0 comments on commit 7db40bb

Please sign in to comment.