diff -Nru librabbitmq-0.10.0/appveyor.yml librabbitmq-0.11.0/appveyor.yml --- librabbitmq-0.10.0/appveyor.yml 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/appveyor.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -# appveyor configuration -version: '{build}' - -# Limit history cloned. This matches what travis-CI currently does. -clone_depth: 50 - -environment: - matrix: - - GENERATOR: Visual Studio 12 Win64 - BITS: 64 - - GENERATOR: Visual Studio 12 - BITS: 32 -configuration: - - Debug - - Release - -cache: - - c:\deps -> appveyor.yml - -# borrowed from https://github.com/FreeTDS/freetds -install: - # xidel (xpath command line tool) - - appveyor DownloadFile "https://downloads.sourceforge.net/project/videlibri/Xidel/Xidel 0.9.6/xidel-0.9.6.win32.zip" - - 7z x xidel-0.9.6.win32.zip xidel.exe - # detect version of Windows OpenSSL binaries published by the Shining Light Productions crew - - xidel https://slproweb.com/products/Win32OpenSSL.html --extract "(//td/a[starts-with(@href, '/download') and starts-with(text(), 'Win32 OpenSSL') and ends-with(text(), 'Light')])[1]/translate(substring-before(substring-after(text(), 'Win32 OpenSSL v'), ' Light'), '.', '_')" > openssl_ver.txt - - set /P OPENSSL_VER=< openssl_ver.txt - # OpenSSL - - appveyor DownloadFile https://slproweb.com/download/Win%BITS%OpenSSL-%OPENSSL_VER%.exe - - "Win%BITS%OpenSSL-%OPENSSL_VER%.exe /SP- /SILENT /SUPPRESSMSGBOXES /NORESTART" - -before_build: - - cmake -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_TESTS=ON -DENABLE_SSL_SUPPORT=True -G"%GENERATOR%" . - -build: - project: ALL_BUILD.vcxproj - verbosity: normal - -artifacts: - - path: librabbitmq\%CONFIGURATION% - name: LibRabbit-%BITS%-%OPENSSL_VER%-%CONFIGURATION%.zip - type: zip diff -Nru librabbitmq-0.10.0/ChangeLog.md librabbitmq-0.11.0/ChangeLog.md --- librabbitmq-0.10.0/ChangeLog.md 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/ChangeLog.md 2021-04-01 03:22:03.000000000 +0000 @@ -1,4 +1,25 @@ # Change Log +## v0.11.0 - 2021-03-31 +## Added: +- rabbitmq-c-config.cmake is now generated (#611) +- rabbitmq-c can be compiled on Win32 using pthreads (#613) +- Add amqp_set_ssl_engine API to allow setting OpenSSL engine (#618) +- Add amqp_ssl_socket_set_key_engine API to allow setting OpenSSL engine (#618) +- Add support use of password-protected SSL keys (#661) + +## Changed +- Update OpenSSL library initialization to current best practices (#603) +- Updates to OpenSSL to support v3.0.0 (#654, 627) + +## Fixed: +- OpenSSL symbol clash when compiling on Win32 (#583) +- Restore correct non-blocking behavior using OpenSSL v1.1.1 (#586) +- Disable harmless secure CRT compile warnings on Win32 (#588) +- Fix unused parameter warnings on Win32 (#591) +- Fix invalid format in generated pkg-config file (#599) +- Fix invalid AMQP_STATUS_HEARTBEAT_TIMEOUT (#557) +- Fix incorrect port when using --server flag in CLI tools + ## v0.10.0 - 2019-12-01 ## Added: - amqp_ssl_socket_get_context can be used to get the current OpenSSL CTX* diff -Nru librabbitmq-0.10.0/cmake/rabbitmq-c-config.cmake.in librabbitmq-0.11.0/cmake/rabbitmq-c-config.cmake.in --- librabbitmq-0.10.0/cmake/rabbitmq-c-config.cmake.in 1970-01-01 00:00:00.000000000 +0000 +++ librabbitmq-0.11.0/cmake/rabbitmq-c-config.cmake.in 2021-04-01 03:22:03.000000000 +0000 @@ -0,0 +1,4 @@ +@PACKAGE_INIT@ + +include(${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake) +check_required_components(rabbitmq-c) diff -Nru librabbitmq-0.10.0/CMakeLists.txt librabbitmq-0.11.0/CMakeLists.txt --- librabbitmq-0.10.0/CMakeLists.txt 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/CMakeLists.txt 2021-04-01 03:22:03.000000000 +0000 @@ -16,9 +16,9 @@ # 3. If any interfaces have been added since the last public release, then increment age. # 4. If any interfaces have been removed since the last public release, then set age to 0. -set(RMQ_SOVERSION_CURRENT 8) +set(RMQ_SOVERSION_CURRENT 9) set(RMQ_SOVERSION_REVISION 0) -set(RMQ_SOVERSION_AGE 4) +set(RMQ_SOVERSION_AGE 5) math(EXPR RMQ_SOVERSION_MAJOR "${RMQ_SOVERSION_CURRENT} - ${RMQ_SOVERSION_AGE}") math(EXPR RMQ_SOVERSION_MINOR "${RMQ_SOVERSION_AGE}") @@ -266,11 +266,14 @@ option(BUILD_TOOLS_DOCS "Build man pages for Tools (requires xmlto)" ${DO_DOCS}) option(BUILD_TESTS "Build tests (run tests with make test)" ON) option(BUILD_API_DOCS "Build Doxygen API docs" ${DOXYGEN_FOUND}) +option(RUN_SYSTEM_TESTS "Run system tests (i.e. tests requiring an accessible RabbitMQ server instance on localhost)" OFF) if (NOT BUILD_SHARED_LIBS AND NOT BUILD_STATIC_LIBS) message(FATAL_ERROR "One or both of BUILD_SHARED_LIBS or BUILD_STATIC_LIBS must be set to ON to build") endif() +set(targets_export_name rabbitmq-targets) + add_subdirectory(librabbitmq) if (BUILD_EXAMPLES) @@ -311,10 +314,13 @@ ) endif () -set(libs_private ${SOCKET_LIBRARIES} ${LIBRT}) +foreach (lib ${SOCKET_LIBRARIES}) + set(libs_private "${libs_private} -l${lib}") +endforeach(lib) +set(libs_private "${libs_private} -l${LIBRT}") if (ENABLE_SSL_SUPPORT) set(requires_private "openssl") - set(libs_private ${libs_private} ${CMAKE_THREAD_LIBS_INIT}) + set(libs_private "${libs_private} ${CMAKE_THREAD_LIBS_INIT}") endif() set(prefix ${CMAKE_INSTALL_PREFIX}) @@ -325,6 +331,43 @@ configure_file(cmake/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/librabbitmq/config.h) configure_file(librabbitmq.pc.in ${CMAKE_CURRENT_BINARY_DIR}/librabbitmq.pc @ONLY) + +include(CMakePackageConfigHelpers) +set(RMQ_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/rabbitmq-c) +set(project_config "${CMAKE_CURRENT_BINARY_DIR}/rabbitmq-c-config.cmake") +set(version_config "${CMAKE_CURRENT_BINARY_DIR}/rabbitmq-c-config-version.cmake") + +write_basic_package_version_file( + "${version_config}" + VERSION ${RMQ_VERSION} + COMPATIBILITY AnyNewerVersion) + +configure_package_config_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/rabbitmq-c-config.cmake.in" + "${project_config}" + INSTALL_DESTINATION "${RMQ_CMAKE_DIR}") + + +if(BUILD_SHARED_LIBS) + list(APPEND INSTALL_TARGETS rabbitmq) +endif() +if(BUILD_STATIC_LIBS) + list(APPEND INSTALL_TARGETS rabbitmq-static) +endif() + +export(TARGETS ${INSTALL_TARGETS} + NAMESPACE rabbitmq:: + FILE ${PROJECT_BINARY_DIR}/${targets_export_name}.cmake) + +install(FILES ${project_config} ${version_config} + DESTINATION ${RMQ_CMAKE_DIR} + ) + +install(EXPORT ${targets_export_name} + DESTINATION ${RMQ_CMAKE_DIR} + NAMESPACE rabbitmq:: + ) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/librabbitmq.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig diff -Nru librabbitmq-0.10.0/debian/changelog librabbitmq-0.11.0/debian/changelog --- librabbitmq-0.10.0/debian/changelog 2022-02-03 20:30:36.000000000 +0000 +++ librabbitmq-0.11.0/debian/changelog 2022-02-21 22:42:45.000000000 +0000 @@ -1,23 +1,21 @@ -librabbitmq (0.10.0-1ubuntu2) jammy; urgency=medium +librabbitmq (0.11.0-1) unstable; urgency=low - * d/p/server-flag-deprecation.patch: - add patch to fix issue parsing hostname in --server flag. - (LP: #1888313) + * New upstream release (Closes: #1004590, #1006244). + * Add debian/gbp.conf. + * Update d/watch to work with github again. + * Bump debhelper version to 13. + * Bump Standards-Version to 4.6.0.1. + * Update year in d/copyright. + * Install cmake files in librabbitmq-dev. + * Update symbols for librabbitmq4. + * Refresh patches and re-export with gbp numbering. + * Add patch to fix typo in amqp-publish.1 manpage. + * Install examples in librabbitmq-dev. + * Add d/upstream/metadata. + * Use uscan version 4. + * Enable upstream testsuite for autopkgtests. - -- Jess Jang Thu, 03 Feb 2022 14:30:36 -0600 - -librabbitmq (0.10.0-1ubuntu1) jammy; urgency=medium - - * d/p/ssl-remove-reference-to-FIPS_set_mode.patch: backported - to fix the build against OpenSSL 3.0 (LP: #1945812) - - -- Simon Chopin Wed, 17 Nov 2021 14:22:23 +0100 - -librabbitmq (0.10.0-1build1) impish; urgency=medium - - * No-change rebuild to build packages with zstd compression. - - -- Matthias Klose Thu, 07 Oct 2021 12:17:49 +0200 + -- Michael Fladischer Mon, 21 Feb 2022 22:42:45 +0000 librabbitmq (0.10.0-1) unstable; urgency=high diff -Nru librabbitmq-0.10.0/debian/control librabbitmq-0.11.0/debian/control --- librabbitmq-0.10.0/debian/control 2022-02-03 20:30:36.000000000 +0000 +++ librabbitmq-0.11.0/debian/control 2022-02-21 22:42:45.000000000 +0000 @@ -1,18 +1,17 @@ Source: librabbitmq Priority: optional Section: libs -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Michael Fladischer +Maintainer: Michael Fladischer Uploaders: Brian May , Build-Depends: cmake, - debhelper-compat (= 12), + debhelper-compat (= 13), docbook-to-man, libpopt-dev, libssl-dev, libtool, -Standards-Version: 4.4.1 +Standards-Version: 4.6.0.1 Homepage: https://github.com/alanxz/rabbitmq-c Vcs-Git: https://salsa.debian.org/debian/librabbitmq.git Vcs-Browser: https://salsa.debian.org/debian/librabbitmq diff -Nru librabbitmq-0.10.0/debian/copyright librabbitmq-0.11.0/debian/copyright --- librabbitmq-0.10.0/debian/copyright 2022-02-03 20:30:36.000000000 +0000 +++ librabbitmq-0.11.0/debian/copyright 2022-02-21 22:42:45.000000000 +0000 @@ -10,7 +10,7 @@ Files: debian/* Copyright: 2010, Monty Taylor - 2013-2015, Michael Fladischer + 2013-2022, Michael Fladischer License: Expat Files: librabbitmq/win32/msinttypes/stdint.h diff -Nru librabbitmq-0.10.0/debian/gbp.conf librabbitmq-0.11.0/debian/gbp.conf --- librabbitmq-0.10.0/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000 +++ librabbitmq-0.11.0/debian/gbp.conf 2022-02-21 22:42:45.000000000 +0000 @@ -0,0 +1,3 @@ +[DEFAULT] +debian-branch=debian/master +pristine-tar=true diff -Nru librabbitmq-0.10.0/debian/librabbitmq4.symbols librabbitmq-0.11.0/debian/librabbitmq4.symbols --- librabbitmq-0.10.0/debian/librabbitmq4.symbols 2022-02-03 20:30:36.000000000 +0000 +++ librabbitmq-0.11.0/debian/librabbitmq4.symbols 2022-02-21 22:42:45.000000000 +0000 @@ -80,6 +80,7 @@ amqp_set_initialize_ssl_library@Base 0.6.0 amqp_set_rpc_timeout@Base 0.9.0 amqp_set_sockfd@Base 0.6.0 + amqp_set_ssl_engine@Base 0.11.0 amqp_simple_rpc@Base 0.6.0 amqp_simple_rpc_decoded@Base 0.6.0 amqp_simple_wait_frame@Base 0.6.0 @@ -93,6 +94,8 @@ amqp_ssl_socket_set_cacert@Base 0.6.0 amqp_ssl_socket_set_key@Base 0.6.0 amqp_ssl_socket_set_key_buffer@Base 0.6.0 + amqp_ssl_socket_set_key_engine@Base 0.11.0 + amqp_ssl_socket_set_key_passwd@Base 0.11.0 amqp_ssl_socket_set_ssl_versions@Base 0.8.0 amqp_ssl_socket_set_verify@Base 0.6.0 amqp_ssl_socket_set_verify_hostname@Base 0.8.0 diff -Nru librabbitmq-0.10.0/debian/librabbitmq-dev.examples librabbitmq-0.11.0/debian/librabbitmq-dev.examples --- librabbitmq-0.10.0/debian/librabbitmq-dev.examples 1970-01-01 00:00:00.000000000 +0000 +++ librabbitmq-0.11.0/debian/librabbitmq-dev.examples 2022-02-21 22:42:45.000000000 +0000 @@ -0,0 +1 @@ +examples/* diff -Nru librabbitmq-0.10.0/debian/librabbitmq-dev.install librabbitmq-0.11.0/debian/librabbitmq-dev.install --- librabbitmq-0.10.0/debian/librabbitmq-dev.install 2022-02-03 20:30:36.000000000 +0000 +++ librabbitmq-0.11.0/debian/librabbitmq-dev.install 2022-02-21 22:42:45.000000000 +0000 @@ -2,3 +2,4 @@ usr/lib/*/lib*.a usr/lib/*/lib*.so usr/lib/*/pkgconfig/librabbitmq.pc +usr/lib/*/cmake/rabbitmq-c/*.cmake diff -Nru librabbitmq-0.10.0/debian/patches/0001-cmake_with_ssl.patch librabbitmq-0.11.0/debian/patches/0001-cmake_with_ssl.patch --- librabbitmq-0.10.0/debian/patches/0001-cmake_with_ssl.patch 1970-01-01 00:00:00.000000000 +0000 +++ librabbitmq-0.11.0/debian/patches/0001-cmake_with_ssl.patch 2022-02-21 22:42:45.000000000 +0000 @@ -0,0 +1,28 @@ +From: Michael Fladischer +Date: Mon, 1 Oct 2018 12:38:04 +0000 +Subject: Enable SSL support for tools. + +Add WITH_SSL preprocessor macro it SSL support is enabled. Otherwise tools +would abort it they see an SSL URL. +Last-Update: 2014-10-17 +Bug-Debian: https://bugs.debian.org/764080 +Forwarded: https://github.com/alanxz/rabbitmq-c/pull/220 +--- + tools/CMakeLists.txt | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt +index 1b09975..1867684 100644 +--- a/tools/CMakeLists.txt ++++ b/tools/CMakeLists.txt +@@ -76,6 +76,10 @@ if (ENABLE_SSL_SUPPORT) + add_definitions(-DWITH_SSL=1) + endif() + ++if (ENABLE_SSL_SUPPORT) ++ add_definitions(-DWITH_SSL=1) ++endif() ++ + install(TARGETS amqp-publish amqp-get amqp-consume amqp-declare-queue amqp-delete-queue + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib diff -Nru librabbitmq-0.10.0/debian/patches/0002-use_cmake_package.patch librabbitmq-0.11.0/debian/patches/0002-use_cmake_package.patch --- librabbitmq-0.10.0/debian/patches/0002-use_cmake_package.patch 1970-01-01 00:00:00.000000000 +0000 +++ librabbitmq-0.11.0/debian/patches/0002-use_cmake_package.patch 2022-02-21 22:42:45.000000000 +0000 @@ -0,0 +1,338 @@ +From: Michael Fladischer +Date: Mon, 1 Oct 2018 12:38:04 +0000 +Subject: Remove files already included in cmake distribution + +The project builds fine without these files as they are already provided by cmake +upstream. This also fixes a problem with multiarch library paths in Debian +kFreeBSD and HURD, because the included GNUInstallDirs.cmake did not check for +these systems. +Last-Update: 2014-09-16 +Forwarded: https://github.com/alanxz/rabbitmq-c/pull/214 +Bug-Debian: https://bugs.debian.org/760227 +--- + cmake/CMakePushCheckState.cmake | 103 -------------------- + cmake/GNUInstallDirs.cmake | 205 ---------------------------------------- + 2 files changed, 308 deletions(-) + delete mode 100644 cmake/CMakePushCheckState.cmake + delete mode 100644 cmake/GNUInstallDirs.cmake + +diff --git a/cmake/CMakePushCheckState.cmake b/cmake/CMakePushCheckState.cmake +deleted file mode 100644 +index 038319b..0000000 +--- a/cmake/CMakePushCheckState.cmake ++++ /dev/null +@@ -1,103 +0,0 @@ +-# This module defines two macros: +-# CMAKE_PUSH_CHECK_STATE() +-# and +-# CMAKE_POP_CHECK_STATE() +-# These two macros can be used to save and restore the state of the variables +-# CMAKE_REQUIRED_FLAGS, CMAKE_REQUIRED_DEFINITIONS, CMAKE_REQUIRED_LIBRARIES +-# and CMAKE_REQUIRED_INCLUDES used by the various Check-files coming with CMake, +-# like e.g. check_function_exists() etc. +-# The variable contents are pushed on a stack, pushing multiple times is supported. +-# This is useful e.g. when executing such tests in a Find-module, where they have to be set, +-# but after the Find-module has been executed they should have the same value +-# as they had before. +-# +-# Usage: +-# cmake_push_check_state() +-# set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -DSOME_MORE_DEF) +-# check_function_exists(...) +-# cmake_pop_check_state() +- +-#============================================================================= +-# Copyright 2006-2011 Alexander Neundorf, +-# +-# Redistribution and use in source and binary forms, with or without +-# modification, are permitted provided that the following conditions +-# are met: +-# +-# * Redistributions of source code must retain the above copyright +-# notice, this list of conditions and the following disclaimer. +-# +-# * Redistributions in binary form must reproduce the above copyright +-# notice, this list of conditions and the following disclaimer in the +-# documentation and/or other materials provided with the distribution. +-# +-# * Neither the names of Kitware, Inc., the Insight Software Consortium, +-# nor the names of their contributors may be used to endorse or promote +-# products derived from this software without specific prior written +-# permission. +-# +-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +-# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-# +-# ------------------------------------------------------------------------------ +-# +-# The above copyright and license notice applies to distributions of +-# CMake in source and binary form. Some source files contain additional +-# notices of original copyright by their contributors; see each source +-# for details. Third-party software packages supplied with CMake under +-# compatible licenses provide their own copyright notices documented in +-# corresponding subdirectories. +-# +-# ------------------------------------------------------------------------------ +-# +-# CMake was initially developed by Kitware with the following sponsorship: +-# +-# * National Library of Medicine at the National Institutes of Health +-# as part of the Insight Segmentation and Registration Toolkit (ITK). +-# +-# * US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel +-# Visualization Initiative. +-# +-# * National Alliance for Medical Image Computing (NAMIC) is funded by the +-# National Institutes of Health through the NIH Roadmap for Medical Research, +-# Grant U54 EB005149. +-# +-# * Kitware, Inc. +- +-macro(CMAKE_PUSH_CHECK_STATE) +- +- if(NOT DEFINED _CMAKE_PUSH_CHECK_STATE_COUNTER) +- set(_CMAKE_PUSH_CHECK_STATE_COUNTER 0) +- endif() +- +- math(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}+1") +- +- set(_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_INCLUDES}) +- set(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS}) +- set(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LIBRARIES}) +- set(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS}) +-endmacro() +- +-macro(CMAKE_POP_CHECK_STATE) +- +-# don't pop more than we pushed +- if("${_CMAKE_PUSH_CHECK_STATE_COUNTER}" GREATER "0") +- +- set(CMAKE_REQUIRED_INCLUDES ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) +- set(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) +- set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) +- set(CMAKE_REQUIRED_FLAGS ${_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) +- +- math(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}-1") +- endif() +- +-endmacro() +diff --git a/cmake/GNUInstallDirs.cmake b/cmake/GNUInstallDirs.cmake +deleted file mode 100644 +index c8d77c6..0000000 +--- a/cmake/GNUInstallDirs.cmake ++++ /dev/null +@@ -1,205 +0,0 @@ +-#.rst: +-# GNUInstallDirs +-# -------------- +-# +-# Define GNU standard installation directories +-# +-# Provides install directory variables as defined for GNU software: +-# +-# :: +-# +-# http://www.gnu.org/prep/standards/html_node/Directory-Variables.html +-# +-# Inclusion of this module defines the following variables: +-# +-# :: +-# +-# CMAKE_INSTALL_ - destination for files of a given type +-# CMAKE_INSTALL_FULL_ - corresponding absolute path +-# +-# where is one of: +-# +-# :: +-# +-# BINDIR - user executables (bin) +-# SBINDIR - system admin executables (sbin) +-# LIBEXECDIR - program executables (libexec) +-# SYSCONFDIR - read-only single-machine data (etc) +-# SHAREDSTATEDIR - modifiable architecture-independent data (com) +-# LOCALSTATEDIR - modifiable single-machine data (var) +-# LIBDIR - object code libraries (lib or lib64 or lib/ on Debian) +-# INCLUDEDIR - C header files (include) +-# OLDINCLUDEDIR - C header files for non-gcc (/usr/include) +-# DATAROOTDIR - read-only architecture-independent data root (share) +-# DATADIR - read-only architecture-independent data (DATAROOTDIR) +-# INFODIR - info documentation (DATAROOTDIR/info) +-# LOCALEDIR - locale-dependent data (DATAROOTDIR/locale) +-# MANDIR - man documentation (DATAROOTDIR/man) +-# DOCDIR - documentation root (DATAROOTDIR/doc/PROJECT_NAME) +-# +-# Each CMAKE_INSTALL_ value may be passed to the DESTINATION +-# options of install() commands for the corresponding file type. If the +-# includer does not define a value the above-shown default will be used +-# and the value will appear in the cache for editing by the user. Each +-# CMAKE_INSTALL_FULL_ value contains an absolute path constructed +-# from the corresponding destination by prepending (if necessary) the +-# value of CMAKE_INSTALL_PREFIX. +- +-#============================================================================= +-# Copyright 2011 Nikita Krupen'ko +-# Copyright 2011 Kitware, Inc. +-# +-# Distributed under the OSI-approved BSD License (the "License"); +-# see accompanying file Copyright.txt for details. +-# +-# This software is distributed WITHOUT ANY WARRANTY; without even the +-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +-# See the License for more information. +-#============================================================================= +-# (To distribute this file outside of CMake, substitute the full +-# License text for the above reference.) +- +-# Installation directories +-# +-if(NOT DEFINED CMAKE_INSTALL_BINDIR) +- set(CMAKE_INSTALL_BINDIR "bin" CACHE PATH "user executables (bin)") +-endif() +- +-if(NOT DEFINED CMAKE_INSTALL_SBINDIR) +- set(CMAKE_INSTALL_SBINDIR "sbin" CACHE PATH "system admin executables (sbin)") +-endif() +- +-if(NOT DEFINED CMAKE_INSTALL_LIBEXECDIR) +- set(CMAKE_INSTALL_LIBEXECDIR "libexec" CACHE PATH "program executables (libexec)") +-endif() +- +-if(NOT DEFINED CMAKE_INSTALL_SYSCONFDIR) +- set(CMAKE_INSTALL_SYSCONFDIR "etc" CACHE PATH "read-only single-machine data (etc)") +-endif() +- +-if(NOT DEFINED CMAKE_INSTALL_SHAREDSTATEDIR) +- set(CMAKE_INSTALL_SHAREDSTATEDIR "com" CACHE PATH "modifiable architecture-independent data (com)") +-endif() +- +-if(NOT DEFINED CMAKE_INSTALL_LOCALSTATEDIR) +- set(CMAKE_INSTALL_LOCALSTATEDIR "var" CACHE PATH "modifiable single-machine data (var)") +-endif() +- +-if(NOT DEFINED CMAKE_INSTALL_LIBDIR) +- set(_LIBDIR_DEFAULT "lib") +- # Override this default 'lib' with 'lib64' iff: +- # - we are on Linux system but NOT cross-compiling +- # - we are NOT on debian +- # - we are on a 64 bits system +- # reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf +- # For Debian with multiarch, use 'lib/${CMAKE_LIBRARY_ARCHITECTURE}' if +- # CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu" +- # See http://wiki.debian.org/Multiarch +- if(CMAKE_SYSTEM_NAME MATCHES "Linux" +- AND NOT CMAKE_CROSSCOMPILING) +- if (EXISTS "/etc/debian_version") # is this a debian system ? +- if(CMAKE_LIBRARY_ARCHITECTURE) +- set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}") +- endif() +- else() # not debian, rely on CMAKE_SIZEOF_VOID_P: +- if(NOT DEFINED CMAKE_SIZEOF_VOID_P) +- message(AUTHOR_WARNING +- "Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. " +- "Please enable at least one language before including GNUInstallDirs.") +- else() +- if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") +- set(_LIBDIR_DEFAULT "lib64") +- endif() +- endif() +- endif() +- endif() +- set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "object code libraries (${_LIBDIR_DEFAULT})") +-endif() +- +-if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR) +- set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE PATH "C header files (include)") +-endif() +- +-if(NOT DEFINED CMAKE_INSTALL_OLDINCLUDEDIR) +- set(CMAKE_INSTALL_OLDINCLUDEDIR "/usr/include" CACHE PATH "C header files for non-gcc (/usr/include)") +-endif() +- +-if(NOT DEFINED CMAKE_INSTALL_DATAROOTDIR) +- set(CMAKE_INSTALL_DATAROOTDIR "share" CACHE PATH "read-only architecture-independent data root (share)") +-endif() +- +-#----------------------------------------------------------------------------- +-# Values whose defaults are relative to DATAROOTDIR. Store empty values in +-# the cache and store the defaults in local variables if the cache values are +-# not set explicitly. This auto-updates the defaults as DATAROOTDIR changes. +- +-if(NOT CMAKE_INSTALL_DATADIR) +- set(CMAKE_INSTALL_DATADIR "" CACHE PATH "read-only architecture-independent data (DATAROOTDIR)") +- set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}") +-endif() +- +-if(NOT CMAKE_INSTALL_INFODIR) +- set(CMAKE_INSTALL_INFODIR "" CACHE PATH "info documentation (DATAROOTDIR/info)") +- set(CMAKE_INSTALL_INFODIR "${CMAKE_INSTALL_DATAROOTDIR}/info") +-endif() +- +-if(NOT CMAKE_INSTALL_LOCALEDIR) +- set(CMAKE_INSTALL_LOCALEDIR "" CACHE PATH "locale-dependent data (DATAROOTDIR/locale)") +- set(CMAKE_INSTALL_LOCALEDIR "${CMAKE_INSTALL_DATAROOTDIR}/locale") +-endif() +- +-if(NOT CMAKE_INSTALL_MANDIR) +- set(CMAKE_INSTALL_MANDIR "" CACHE PATH "man documentation (DATAROOTDIR/man)") +- set(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man") +-endif() +- +-if(NOT CMAKE_INSTALL_DOCDIR) +- set(CMAKE_INSTALL_DOCDIR "" CACHE PATH "documentation root (DATAROOTDIR/doc/PROJECT_NAME)") +- set(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}") +-endif() +- +-#----------------------------------------------------------------------------- +- +-mark_as_advanced( +- CMAKE_INSTALL_BINDIR +- CMAKE_INSTALL_SBINDIR +- CMAKE_INSTALL_LIBEXECDIR +- CMAKE_INSTALL_SYSCONFDIR +- CMAKE_INSTALL_SHAREDSTATEDIR +- CMAKE_INSTALL_LOCALSTATEDIR +- CMAKE_INSTALL_LIBDIR +- CMAKE_INSTALL_INCLUDEDIR +- CMAKE_INSTALL_OLDINCLUDEDIR +- CMAKE_INSTALL_DATAROOTDIR +- CMAKE_INSTALL_DATADIR +- CMAKE_INSTALL_INFODIR +- CMAKE_INSTALL_LOCALEDIR +- CMAKE_INSTALL_MANDIR +- CMAKE_INSTALL_DOCDIR +- ) +- +-# Result directories +-# +-foreach(dir +- BINDIR +- SBINDIR +- LIBEXECDIR +- SYSCONFDIR +- SHAREDSTATEDIR +- LOCALSTATEDIR +- LIBDIR +- INCLUDEDIR +- OLDINCLUDEDIR +- DATAROOTDIR +- DATADIR +- INFODIR +- LOCALEDIR +- MANDIR +- DOCDIR +- ) +- if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_${dir}}) +- set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}") +- else() +- set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}") +- endif() +-endforeach() diff -Nru librabbitmq-0.10.0/debian/patches/0003-disable-test-basic.patch librabbitmq-0.11.0/debian/patches/0003-disable-test-basic.patch --- librabbitmq-0.10.0/debian/patches/0003-disable-test-basic.patch 1970-01-01 00:00:00.000000000 +0000 +++ librabbitmq-0.11.0/debian/patches/0003-disable-test-basic.patch 2022-02-21 22:42:45.000000000 +0000 @@ -0,0 +1,25 @@ +From: Gianfranco Costamagna +Date: Tue, 7 Jan 2020 09:08:34 +0100 +Subject: This test seems to require an active AMQP instance, + +Bug-Debian: https://bugs.debian.org/911693 +Last-Update: 2018-12-17 + +something not possible during build process. Disable it for now. +--- + tests/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +index 320a73d..e5cc89b 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -35,7 +35,7 @@ target_link_libraries(test_basic rabbitmq-static) + + if (RUN_SYSTEM_TESTS) + if (NOT APPLE) +- add_test(basic test_basic) ++ #add_test(basic test_basic) + endif() + endif(RUN_SYSTEM_TESTS) + diff -Nru librabbitmq-0.10.0/debian/patches/0004-Fix-typo-in-amqp-publish.1-manpage.patch librabbitmq-0.11.0/debian/patches/0004-Fix-typo-in-amqp-publish.1-manpage.patch --- librabbitmq-0.10.0/debian/patches/0004-Fix-typo-in-amqp-publish.1-manpage.patch 1970-01-01 00:00:00.000000000 +0000 +++ librabbitmq-0.11.0/debian/patches/0004-Fix-typo-in-amqp-publish.1-manpage.patch 2022-02-21 22:42:45.000000000 +0000 @@ -0,0 +1,21 @@ +From: Michael Fladischer +Date: Mon, 21 Feb 2022 22:10:32 +0000 +Subject: Fix typo in amqp-publish.1 manpage. + +--- + tools/doc/amqp-publish.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/doc/amqp-publish.xml b/tools/doc/amqp-publish.xml +index aae07f4..54c5439 100644 +--- a/tools/doc/amqp-publish.xml ++++ b/tools/doc/amqp-publish.xml +@@ -70,7 +70,7 @@ + The routing key to publish with. If omitted, + an empty routing key is assumed. A routing + key must be specified when publishing to the +- default exchange; in that case, accoding to ++ default exchange; in that case, according to + the AMQP specification, the routing key + corresponds to a queue name. + diff -Nru librabbitmq-0.10.0/debian/patches/cmake_with_ssl.patch librabbitmq-0.11.0/debian/patches/cmake_with_ssl.patch --- librabbitmq-0.10.0/debian/patches/cmake_with_ssl.patch 2022-02-03 20:30:36.000000000 +0000 +++ librabbitmq-0.11.0/debian/patches/cmake_with_ssl.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -From: Michael Fladischer -Date: Mon, 1 Oct 2018 12:38:04 +0000 -Subject: Enable SSL support for tools. - -Add WITH_SSL preprocessor macro it SSL support is enabled. Otherwise tools -would abort it they see an SSL URL. -Last-Update: 2014-10-17 -Bug-Debian: https://bugs.debian.org/764080 -Forwarded: https://github.com/alanxz/rabbitmq-c/pull/220 ---- - tools/CMakeLists.txt | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt -index 7609cd3..0b896fd 100644 ---- a/tools/CMakeLists.txt -+++ b/tools/CMakeLists.txt -@@ -75,6 +75,10 @@ if (ENABLE_SSL_SUPPORT) - add_definitions(-DWITH_SSL=1) - endif() - -+if (ENABLE_SSL_SUPPORT) -+ add_definitions(-DWITH_SSL=1) -+endif() -+ - install(TARGETS amqp-publish amqp-get amqp-consume amqp-declare-queue amqp-delete-queue - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib diff -Nru librabbitmq-0.10.0/debian/patches/disable-test-basic.patch librabbitmq-0.11.0/debian/patches/disable-test-basic.patch --- librabbitmq-0.10.0/debian/patches/disable-test-basic.patch 2022-02-03 20:30:36.000000000 +0000 +++ librabbitmq-0.11.0/debian/patches/disable-test-basic.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -From: Gianfranco Costamagna -Date: Tue, 7 Jan 2020 09:08:34 +0100 -Subject: This test seems to require an active AMQP instance, - -Bug-Debian: https://bugs.debian.org/911693 -Last-Update: 2018-12-17 - -something not possible during build process. Disable it for now. ---- - tests/CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt -index cf042b0..0f622cd 100644 ---- a/tests/CMakeLists.txt -+++ b/tests/CMakeLists.txt -@@ -34,7 +34,7 @@ add_executable(test_basic - target_link_libraries(test_basic rabbitmq-static) - - if (NOT APPLE) -- add_test(basic test_basic) -+ #add_test(basic test_basic) - endif() - - add_executable(test_sasl_mechanism test_sasl_mechanism.c) diff -Nru librabbitmq-0.10.0/debian/patches/series librabbitmq-0.11.0/debian/patches/series --- librabbitmq-0.10.0/debian/patches/series 2022-02-03 20:30:36.000000000 +0000 +++ librabbitmq-0.11.0/debian/patches/series 2022-02-21 22:42:45.000000000 +0000 @@ -1,5 +1,4 @@ -cmake_with_ssl.patch -use_cmake_package.patch -disable-test-basic.patch -ssl-remove-reference-to-FIPS_set_mode.patch -server_flag_deprecation.patch +0001-cmake_with_ssl.patch +0002-use_cmake_package.patch +0003-disable-test-basic.patch +0004-Fix-typo-in-amqp-publish.1-manpage.patch diff -Nru librabbitmq-0.10.0/debian/patches/server_flag_deprecation.patch librabbitmq-0.11.0/debian/patches/server_flag_deprecation.patch --- librabbitmq-0.10.0/debian/patches/server_flag_deprecation.patch 2022-02-03 20:30:36.000000000 +0000 +++ librabbitmq-0.11.0/debian/patches/server_flag_deprecation.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -From 637f0275ffcc2bfb58c94f0bf6e290aa40c1695a Mon Sep 17 00:00:00 2001 -From: Alan Antonuk -Date: Fri, 7 Aug 2020 05:07:50 +0000 -Subject: [PATCH] tool: set port when not specified in --server flag - -Set the port to 5672 and 5671 in SSL mode in the tools when the --server -flag is used, but does not specify a port. - -From 54d00bee5cc4603dc96af5f86c899210689dfeeb Mon Sep 17 00:00:00 2001 -From: Alan Antonuk -Date: Sun, 9 Aug 2020 06:44:28 +0000 -Subject: [PATCH] tool: fix issue parsing hostname in --server flag - -Set both the host and port when a ':' isn't found in in the --server -flag. The attempted fix in #622 was not complete as the host was not -properly set. - -Fixes: #621 - -Origin: upstream; - https://github.com/alanxz/rabbitmq-c/commit/637f0275ffcc2bfb58c94f0bf6e290aa40c1695a - https://github.com/alanxz/rabbitmq-c/commit/4d03c849868231dc217785c6f0e78eab9cd79fd5 -Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/librabbitmq/+bug/1888313 -Last-Updated: 2022-01-19 - ---- a/tools/common.c -+++ b/tools/common.c -@@ -240,6 +240,14 @@ - if (ci->port < 0 || ci->port > 65535 || port_end == colon + 1 || - *port_end != 0) - die("bad server port number in '%s'", amqp_server); -+ } else { -+ ci->host = amqp_server; -+ ci->port = 5672; -+#if WITH_SSL -+ if (amqp_ssl) { -+ ci->port = 5671; -+ } -+#endif - } - - #if WITH_SSL diff -Nru librabbitmq-0.10.0/debian/patches/ssl-remove-reference-to-FIPS_set_mode.patch librabbitmq-0.11.0/debian/patches/ssl-remove-reference-to-FIPS_set_mode.patch --- librabbitmq-0.10.0/debian/patches/ssl-remove-reference-to-FIPS_set_mode.patch 2022-02-03 20:30:36.000000000 +0000 +++ librabbitmq-0.11.0/debian/patches/ssl-remove-reference-to-FIPS_set_mode.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -From 23856b8cce06d0ed0a4e65f46bde27df409fe9f6 Mon Sep 17 00:00:00 2001 -From: Alan Antonuk -Date: Fri, 5 Mar 2021 06:44:15 +0000 -Subject: [PATCH] ssl: remove reference to FIPS_set_mode -Origin: https://github.com/alanxz/rabbitmq-c/pull/657 - -This was cargo-culted from the OpenSSL wiki for uninitializing OpenSSL. -This API has been removed v3.x and newer of OpenSSL, additionally -rabbitmq-c doesn't use FIPS mode, so this is likely a no-op even using -older OpenSSL. - -Fixes #654 -Fixes #627 - -Signed-off-by: GitHub ---- - librabbitmq/amqp_openssl.c | 4 ---- - 1 file changed, 4 deletions(-) - -diff --git a/librabbitmq/amqp_openssl.c b/librabbitmq/amqp_openssl.c -index 0a37fe0..3cebd58 100644 ---- a/librabbitmq/amqp_openssl.c -+++ b/librabbitmq/amqp_openssl.c -@@ -753,10 +753,6 @@ int amqp_uninitialize_ssl_library(void) { - ERR_remove_state(0); - #endif - --#ifndef LIBRESSL_VERSION_NUMBER -- FIPS_mode_set(0); --#endif -- - CRYPTO_set_locking_callback(NULL); - CRYPTO_set_id_callback(NULL); - { --- -2.32.0 - diff -Nru librabbitmq-0.10.0/debian/patches/use_cmake_package.patch librabbitmq-0.11.0/debian/patches/use_cmake_package.patch --- librabbitmq-0.10.0/debian/patches/use_cmake_package.patch 2022-02-03 20:30:36.000000000 +0000 +++ librabbitmq-0.11.0/debian/patches/use_cmake_package.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,338 +0,0 @@ -From: Michael Fladischer -Date: Mon, 1 Oct 2018 12:38:04 +0000 -Subject: Remove files already included in cmake distribution - -The project builds fine without these files as they are already provided by cmake -upstream. This also fixes a problem with multiarch library paths in Debian -kFreeBSD and HURD, because the included GNUInstallDirs.cmake did not check for -these systems. -Last-Update: 2014-09-16 -Forwarded: https://github.com/alanxz/rabbitmq-c/pull/214 -Bug-Debian: https://bugs.debian.org/760227 ---- - cmake/CMakePushCheckState.cmake | 103 -------------------- - cmake/GNUInstallDirs.cmake | 205 ---------------------------------------- - 2 files changed, 308 deletions(-) - delete mode 100644 cmake/CMakePushCheckState.cmake - delete mode 100644 cmake/GNUInstallDirs.cmake - -diff --git a/cmake/CMakePushCheckState.cmake b/cmake/CMakePushCheckState.cmake -deleted file mode 100644 -index 038319b..0000000 ---- a/cmake/CMakePushCheckState.cmake -+++ /dev/null -@@ -1,103 +0,0 @@ --# This module defines two macros: --# CMAKE_PUSH_CHECK_STATE() --# and --# CMAKE_POP_CHECK_STATE() --# These two macros can be used to save and restore the state of the variables --# CMAKE_REQUIRED_FLAGS, CMAKE_REQUIRED_DEFINITIONS, CMAKE_REQUIRED_LIBRARIES --# and CMAKE_REQUIRED_INCLUDES used by the various Check-files coming with CMake, --# like e.g. check_function_exists() etc. --# The variable contents are pushed on a stack, pushing multiple times is supported. --# This is useful e.g. when executing such tests in a Find-module, where they have to be set, --# but after the Find-module has been executed they should have the same value --# as they had before. --# --# Usage: --# cmake_push_check_state() --# set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -DSOME_MORE_DEF) --# check_function_exists(...) --# cmake_pop_check_state() -- --#============================================================================= --# Copyright 2006-2011 Alexander Neundorf, --# --# Redistribution and use in source and binary forms, with or without --# modification, are permitted provided that the following conditions --# are met: --# --# * Redistributions of source code must retain the above copyright --# notice, this list of conditions and the following disclaimer. --# --# * Redistributions in binary form must reproduce the above copyright --# notice, this list of conditions and the following disclaimer in the --# documentation and/or other materials provided with the distribution. --# --# * Neither the names of Kitware, Inc., the Insight Software Consortium, --# nor the names of their contributors may be used to endorse or promote --# products derived from this software without specific prior written --# permission. --# --# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --# --# ------------------------------------------------------------------------------ --# --# The above copyright and license notice applies to distributions of --# CMake in source and binary form. Some source files contain additional --# notices of original copyright by their contributors; see each source --# for details. Third-party software packages supplied with CMake under --# compatible licenses provide their own copyright notices documented in --# corresponding subdirectories. --# --# ------------------------------------------------------------------------------ --# --# CMake was initially developed by Kitware with the following sponsorship: --# --# * National Library of Medicine at the National Institutes of Health --# as part of the Insight Segmentation and Registration Toolkit (ITK). --# --# * US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel --# Visualization Initiative. --# --# * National Alliance for Medical Image Computing (NAMIC) is funded by the --# National Institutes of Health through the NIH Roadmap for Medical Research, --# Grant U54 EB005149. --# --# * Kitware, Inc. -- --macro(CMAKE_PUSH_CHECK_STATE) -- -- if(NOT DEFINED _CMAKE_PUSH_CHECK_STATE_COUNTER) -- set(_CMAKE_PUSH_CHECK_STATE_COUNTER 0) -- endif() -- -- math(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}+1") -- -- set(_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_INCLUDES}) -- set(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS}) -- set(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LIBRARIES}) -- set(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS}) --endmacro() -- --macro(CMAKE_POP_CHECK_STATE) -- --# don't pop more than we pushed -- if("${_CMAKE_PUSH_CHECK_STATE_COUNTER}" GREATER "0") -- -- set(CMAKE_REQUIRED_INCLUDES ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) -- set(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) -- set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) -- set(CMAKE_REQUIRED_FLAGS ${_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) -- -- math(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}-1") -- endif() -- --endmacro() -diff --git a/cmake/GNUInstallDirs.cmake b/cmake/GNUInstallDirs.cmake -deleted file mode 100644 -index c8d77c6..0000000 ---- a/cmake/GNUInstallDirs.cmake -+++ /dev/null -@@ -1,205 +0,0 @@ --#.rst: --# GNUInstallDirs --# -------------- --# --# Define GNU standard installation directories --# --# Provides install directory variables as defined for GNU software: --# --# :: --# --# http://www.gnu.org/prep/standards/html_node/Directory-Variables.html --# --# Inclusion of this module defines the following variables: --# --# :: --# --# CMAKE_INSTALL_ - destination for files of a given type --# CMAKE_INSTALL_FULL_ - corresponding absolute path --# --# where is one of: --# --# :: --# --# BINDIR - user executables (bin) --# SBINDIR - system admin executables (sbin) --# LIBEXECDIR - program executables (libexec) --# SYSCONFDIR - read-only single-machine data (etc) --# SHAREDSTATEDIR - modifiable architecture-independent data (com) --# LOCALSTATEDIR - modifiable single-machine data (var) --# LIBDIR - object code libraries (lib or lib64 or lib/ on Debian) --# INCLUDEDIR - C header files (include) --# OLDINCLUDEDIR - C header files for non-gcc (/usr/include) --# DATAROOTDIR - read-only architecture-independent data root (share) --# DATADIR - read-only architecture-independent data (DATAROOTDIR) --# INFODIR - info documentation (DATAROOTDIR/info) --# LOCALEDIR - locale-dependent data (DATAROOTDIR/locale) --# MANDIR - man documentation (DATAROOTDIR/man) --# DOCDIR - documentation root (DATAROOTDIR/doc/PROJECT_NAME) --# --# Each CMAKE_INSTALL_ value may be passed to the DESTINATION --# options of install() commands for the corresponding file type. If the --# includer does not define a value the above-shown default will be used --# and the value will appear in the cache for editing by the user. Each --# CMAKE_INSTALL_FULL_ value contains an absolute path constructed --# from the corresponding destination by prepending (if necessary) the --# value of CMAKE_INSTALL_PREFIX. -- --#============================================================================= --# Copyright 2011 Nikita Krupen'ko --# Copyright 2011 Kitware, Inc. --# --# Distributed under the OSI-approved BSD License (the "License"); --# see accompanying file Copyright.txt for details. --# --# This software is distributed WITHOUT ANY WARRANTY; without even the --# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --# See the License for more information. --#============================================================================= --# (To distribute this file outside of CMake, substitute the full --# License text for the above reference.) -- --# Installation directories --# --if(NOT DEFINED CMAKE_INSTALL_BINDIR) -- set(CMAKE_INSTALL_BINDIR "bin" CACHE PATH "user executables (bin)") --endif() -- --if(NOT DEFINED CMAKE_INSTALL_SBINDIR) -- set(CMAKE_INSTALL_SBINDIR "sbin" CACHE PATH "system admin executables (sbin)") --endif() -- --if(NOT DEFINED CMAKE_INSTALL_LIBEXECDIR) -- set(CMAKE_INSTALL_LIBEXECDIR "libexec" CACHE PATH "program executables (libexec)") --endif() -- --if(NOT DEFINED CMAKE_INSTALL_SYSCONFDIR) -- set(CMAKE_INSTALL_SYSCONFDIR "etc" CACHE PATH "read-only single-machine data (etc)") --endif() -- --if(NOT DEFINED CMAKE_INSTALL_SHAREDSTATEDIR) -- set(CMAKE_INSTALL_SHAREDSTATEDIR "com" CACHE PATH "modifiable architecture-independent data (com)") --endif() -- --if(NOT DEFINED CMAKE_INSTALL_LOCALSTATEDIR) -- set(CMAKE_INSTALL_LOCALSTATEDIR "var" CACHE PATH "modifiable single-machine data (var)") --endif() -- --if(NOT DEFINED CMAKE_INSTALL_LIBDIR) -- set(_LIBDIR_DEFAULT "lib") -- # Override this default 'lib' with 'lib64' iff: -- # - we are on Linux system but NOT cross-compiling -- # - we are NOT on debian -- # - we are on a 64 bits system -- # reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf -- # For Debian with multiarch, use 'lib/${CMAKE_LIBRARY_ARCHITECTURE}' if -- # CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu" -- # See http://wiki.debian.org/Multiarch -- if(CMAKE_SYSTEM_NAME MATCHES "Linux" -- AND NOT CMAKE_CROSSCOMPILING) -- if (EXISTS "/etc/debian_version") # is this a debian system ? -- if(CMAKE_LIBRARY_ARCHITECTURE) -- set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}") -- endif() -- else() # not debian, rely on CMAKE_SIZEOF_VOID_P: -- if(NOT DEFINED CMAKE_SIZEOF_VOID_P) -- message(AUTHOR_WARNING -- "Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. " -- "Please enable at least one language before including GNUInstallDirs.") -- else() -- if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") -- set(_LIBDIR_DEFAULT "lib64") -- endif() -- endif() -- endif() -- endif() -- set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "object code libraries (${_LIBDIR_DEFAULT})") --endif() -- --if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR) -- set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE PATH "C header files (include)") --endif() -- --if(NOT DEFINED CMAKE_INSTALL_OLDINCLUDEDIR) -- set(CMAKE_INSTALL_OLDINCLUDEDIR "/usr/include" CACHE PATH "C header files for non-gcc (/usr/include)") --endif() -- --if(NOT DEFINED CMAKE_INSTALL_DATAROOTDIR) -- set(CMAKE_INSTALL_DATAROOTDIR "share" CACHE PATH "read-only architecture-independent data root (share)") --endif() -- --#----------------------------------------------------------------------------- --# Values whose defaults are relative to DATAROOTDIR. Store empty values in --# the cache and store the defaults in local variables if the cache values are --# not set explicitly. This auto-updates the defaults as DATAROOTDIR changes. -- --if(NOT CMAKE_INSTALL_DATADIR) -- set(CMAKE_INSTALL_DATADIR "" CACHE PATH "read-only architecture-independent data (DATAROOTDIR)") -- set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}") --endif() -- --if(NOT CMAKE_INSTALL_INFODIR) -- set(CMAKE_INSTALL_INFODIR "" CACHE PATH "info documentation (DATAROOTDIR/info)") -- set(CMAKE_INSTALL_INFODIR "${CMAKE_INSTALL_DATAROOTDIR}/info") --endif() -- --if(NOT CMAKE_INSTALL_LOCALEDIR) -- set(CMAKE_INSTALL_LOCALEDIR "" CACHE PATH "locale-dependent data (DATAROOTDIR/locale)") -- set(CMAKE_INSTALL_LOCALEDIR "${CMAKE_INSTALL_DATAROOTDIR}/locale") --endif() -- --if(NOT CMAKE_INSTALL_MANDIR) -- set(CMAKE_INSTALL_MANDIR "" CACHE PATH "man documentation (DATAROOTDIR/man)") -- set(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man") --endif() -- --if(NOT CMAKE_INSTALL_DOCDIR) -- set(CMAKE_INSTALL_DOCDIR "" CACHE PATH "documentation root (DATAROOTDIR/doc/PROJECT_NAME)") -- set(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}") --endif() -- --#----------------------------------------------------------------------------- -- --mark_as_advanced( -- CMAKE_INSTALL_BINDIR -- CMAKE_INSTALL_SBINDIR -- CMAKE_INSTALL_LIBEXECDIR -- CMAKE_INSTALL_SYSCONFDIR -- CMAKE_INSTALL_SHAREDSTATEDIR -- CMAKE_INSTALL_LOCALSTATEDIR -- CMAKE_INSTALL_LIBDIR -- CMAKE_INSTALL_INCLUDEDIR -- CMAKE_INSTALL_OLDINCLUDEDIR -- CMAKE_INSTALL_DATAROOTDIR -- CMAKE_INSTALL_DATADIR -- CMAKE_INSTALL_INFODIR -- CMAKE_INSTALL_LOCALEDIR -- CMAKE_INSTALL_MANDIR -- CMAKE_INSTALL_DOCDIR -- ) -- --# Result directories --# --foreach(dir -- BINDIR -- SBINDIR -- LIBEXECDIR -- SYSCONFDIR -- SHAREDSTATEDIR -- LOCALSTATEDIR -- LIBDIR -- INCLUDEDIR -- OLDINCLUDEDIR -- DATAROOTDIR -- DATADIR -- INFODIR -- LOCALEDIR -- MANDIR -- DOCDIR -- ) -- if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_${dir}}) -- set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}") -- else() -- set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}") -- endif() --endforeach() diff -Nru librabbitmq-0.10.0/debian/tests/control librabbitmq-0.11.0/debian/tests/control --- librabbitmq-0.10.0/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 +++ librabbitmq-0.11.0/debian/tests/control 2022-02-21 22:42:45.000000000 +0000 @@ -0,0 +1,5 @@ +Tests: upstream +Depends: + @, + @builddeps@, +Restrictions: allow-stderr diff -Nru librabbitmq-0.10.0/debian/tests/upstream librabbitmq-0.11.0/debian/tests/upstream --- librabbitmq-0.10.0/debian/tests/upstream 1970-01-01 00:00:00.000000000 +0000 +++ librabbitmq-0.11.0/debian/tests/upstream 2022-02-21 22:42:45.000000000 +0000 @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +SRC=$(pwd) +cd ${AUTOPKGTEST_TMP} +cmake ${SRC} +make all test diff -Nru librabbitmq-0.10.0/debian/upstream/metadata librabbitmq-0.11.0/debian/upstream/metadata --- librabbitmq-0.10.0/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ librabbitmq-0.11.0/debian/upstream/metadata 2022-02-21 22:42:45.000000000 +0000 @@ -0,0 +1,4 @@ +Bug-Database: https://github.com/alanxz/rabbitmq-c/issues +Bug-Submit: https://github.com/alanxz/rabbitmq-c/issues/new +Repository: https://github.com/alanxz/rabbitmq-c.git +Repository-Browse: https://github.com/alanxz/rabbitmq-c diff -Nru librabbitmq-0.10.0/debian/watch librabbitmq-0.11.0/debian/watch --- librabbitmq-0.10.0/debian/watch 2022-02-03 20:30:36.000000000 +0000 +++ librabbitmq-0.11.0/debian/watch 2022-02-21 22:42:45.000000000 +0000 @@ -1,4 +1,4 @@ -version=3 +version=4 opts=uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha)\d*)$/$1~$2/,filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/librabbitmq-c-$1.tar.gz/ \ https://github.com/alanxz/rabbitmq-c/releases \ -/alanxz/rabbitmq-c/archive/v([\d\.]+)\.tar\.gz +/alanxz/rabbitmq-c/archive/refs/tags/v([\d\.]+)\.tar\.gz diff -Nru librabbitmq-0.10.0/examples/amqp_consumer.c librabbitmq-0.11.0/examples/amqp_consumer.c --- librabbitmq-0.10.0/examples/amqp_consumer.c 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/examples/amqp_consumer.c 2021-04-01 03:22:03.000000000 +0000 @@ -205,6 +205,8 @@ run(conn); + amqp_bytes_free(queuename); + die_on_amqp_error(amqp_channel_close(conn, 1, AMQP_REPLY_SUCCESS), "Closing channel"); die_on_amqp_error(amqp_connection_close(conn, AMQP_REPLY_SUCCESS), diff -Nru librabbitmq-0.10.0/examples/amqp_listen.c librabbitmq-0.11.0/examples/amqp_listen.c --- librabbitmq-0.10.0/examples/amqp_listen.c 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/examples/amqp_listen.c 2021-04-01 03:22:03.000000000 +0000 @@ -133,6 +133,8 @@ } } + amqp_bytes_free(queuename); + die_on_amqp_error(amqp_channel_close(conn, 1, AMQP_REPLY_SUCCESS), "Closing channel"); die_on_amqp_error(amqp_connection_close(conn, AMQP_REPLY_SUCCESS), diff -Nru librabbitmq-0.10.0/examples/amqp_ssl_connect.c librabbitmq-0.11.0/examples/amqp_ssl_connect.c --- librabbitmq-0.10.0/examples/amqp_ssl_connect.c 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/examples/amqp_ssl_connect.c 2021-04-01 03:22:03.000000000 +0000 @@ -71,8 +71,9 @@ if (argc < 3) { fprintf(stderr, - "Usage: amqps_connect_timeout host port timeout_sec " - "[cacert.pem [verifypeer] [verifyhostname] [key.pem cert.pem]]\n"); + "Usage: amqp_ssl_connect host port timeout_sec " + "[cacert.pem [engine engine_ID] [verifypeer] [verifyhostname] " + "[key.pem cert.pem]]\n"); return 1; } @@ -103,6 +104,10 @@ int nextarg = 5; die_on_error(amqp_ssl_socket_set_cacert(socket, argv[4]), "setting CA certificate"); + if (argc > nextarg && !strcmp("engine", argv[nextarg])) { + amqp_set_ssl_engine(argv[++nextarg]); + nextarg++; + } if (argc > nextarg && !strcmp("verifypeer", argv[nextarg])) { amqp_ssl_socket_set_verify_peer(socket, 1); nextarg++; diff -Nru librabbitmq-0.10.0/.github/workflows/ci.yml librabbitmq-0.11.0/.github/workflows/ci.yml --- librabbitmq-0.10.0/.github/workflows/ci.yml 1970-01-01 00:00:00.000000000 +0000 +++ librabbitmq-0.11.0/.github/workflows/ci.yml 2021-04-01 03:22:03.000000000 +0000 @@ -0,0 +1,74 @@ +name: CI + +on: + # Run the jobs on either push or a pull_request, but not both. + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build-linux: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - compiler: gcc + config: cmake + - compiler: clang + config: cmake + - compiler: clang + config: asan + - compiler: clang + config: tsan + - compiler: clang + config: format + - compiler: clang + config: scan-build + + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - name: Configure Build & Test + shell: bash + env: + CC: ${{ matrix.compiler }} + run: ./travis.sh ${{ matrix.config }} + + build-macox: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - name: Configure Build & Test + shell: bash + run: ./travis.sh macos + + build-win32: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - uses: actions/cache@v2 + with: + path: c:\Users\runneradmin\AppData\Local\Temp\chocolatey + # This caches the cache, no need to make sure that this is invalidated + # chocolatey will do that for us. + key: chocolatey-cache + - name: Install Prerequisites + run: choco install openssl + - name: Configure Build & Test + shell: bash + run: | + cmake -E make_directory build/ + cmake -S . -B build/ + cmake --build build/ --config Debug --target INSTALL + ctest -V ./build/ diff -Nru librabbitmq-0.10.0/.gitignore librabbitmq-0.11.0/.gitignore --- librabbitmq-0.10.0/.gitignore 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/.gitignore 2021-04-01 03:22:03.000000000 +0000 @@ -71,3 +71,4 @@ *.sw? .#* \#*# +.venv/ diff -Nru librabbitmq-0.10.0/librabbitmq/amqp_api.c librabbitmq-0.11.0/librabbitmq/amqp_api.c --- librabbitmq-0.10.0/librabbitmq/amqp_api.c 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/librabbitmq/amqp_api.c 2021-04-01 03:22:03.000000000 +0000 @@ -108,14 +108,16 @@ "socket library initialization failed"}; static const char *ssl_error_strings[] = { - /* AMQP_STATUS_SSL_ERRO R -0x0200 */ + /* AMQP_STATUS_SSL_ERROR -0x0200 */ "a SSL error occurred", /* AMQP_STATUS_SSL_HOSTNAME_VERIFY_FAILED -0x0201 */ "SSL hostname verification failed", /* AMQP_STATUS_SSL_PEER_VERIFY_FAILED -0x0202 */ "SSL peer cert verification failed", /* AMQP_STATUS_SSL_CONNECTION_FAILED -0x0203 */ - "SSL handshake failed"}; + "SSL handshake failed", + /* AMQP_STATUS_SSL_SET_ENGINE_FAILED -0x0204 */ + "SSL setting engine failed"}; static const char *unknown_error_string = "(unknown error)"; @@ -361,7 +363,7 @@ } int amqp_set_handshake_timeout(amqp_connection_state_t state, - struct timeval *timeout) { + const struct timeval *timeout) { if (timeout) { if (timeout->tv_sec < 0 || timeout->tv_usec < 0) { return AMQP_STATUS_INVALID_PARAMETER; @@ -380,7 +382,7 @@ } int amqp_set_rpc_timeout(amqp_connection_state_t state, - struct timeval *timeout) { + const struct timeval *timeout) { if (timeout) { if (timeout->tv_sec < 0 || timeout->tv_usec < 0) { return AMQP_STATUS_INVALID_PARAMETER; diff -Nru librabbitmq-0.10.0/librabbitmq/amqp_connection.c librabbitmq-0.11.0/librabbitmq/amqp_connection.c --- librabbitmq-0.10.0/librabbitmq/amqp_connection.c 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/librabbitmq/amqp_connection.c 2021-04-01 03:22:03.000000000 +0000 @@ -281,8 +281,8 @@ return (int)bytes_consumed; } - /* it's not a protocol header; fall through to process it as a - regular frame header */ + /* it's not a protocol header; fall through to process it as a + regular frame header */ case CONNECTION_STATE_HEADER: { amqp_channel_t channel; @@ -329,7 +329,7 @@ return (int)bytes_consumed; } } - /* fall through to process body */ + /* fall through to process body */ case CONNECTION_STATE_BODY: { amqp_bytes_t encoded; diff -Nru librabbitmq-0.10.0/librabbitmq/amqp_consumer.c librabbitmq-0.11.0/librabbitmq/amqp_consumer.c --- librabbitmq-0.10.0/librabbitmq/amqp_consumer.c 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/librabbitmq/amqp_consumer.c 2021-04-01 03:22:03.000000000 +0000 @@ -134,7 +134,7 @@ amqp_rpc_reply_t amqp_consume_message(amqp_connection_state_t state, amqp_envelope_t *envelope, - struct timeval *timeout, + const struct timeval *timeout, AMQP_UNUSED int flags) { int res; amqp_frame_t frame; diff -Nru librabbitmq-0.10.0/librabbitmq/amqp_framing.h librabbitmq-0.11.0/librabbitmq/amqp_framing.h --- librabbitmq-0.10.0/librabbitmq/amqp_framing.h 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/librabbitmq/amqp_framing.h 2021-04-01 03:22:03.000000000 +0000 @@ -46,7 +46,7 @@ #define AMQP_PROTOCOL_VERSION_MINOR 9 /**< AMQP protocol version minor */ #define AMQP_PROTOCOL_VERSION_REVISION \ 1 /**< AMQP protocol version revision \ - */ + */ #define AMQP_PROTOCOL_PORT 5672 /**< Default AMQP Port */ #define AMQP_FRAME_METHOD 1 /**< Constant: FRAME-METHOD */ #define AMQP_FRAME_HEADER 2 /**< Constant: FRAME-HEADER */ @@ -794,7 +794,7 @@ /* Class property records. */ #define AMQP_CONNECTION_CLASS \ (0x000A) /**< connection class id @internal 10 \ - */ + */ /** connection class properties */ typedef struct amqp_connection_properties_t_ { amqp_flags_t _flags; /**< bit-mask of set fields */ diff -Nru librabbitmq-0.10.0/librabbitmq/amqp.h librabbitmq-0.11.0/librabbitmq/amqp.h --- librabbitmq-0.10.0/librabbitmq/amqp.h 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/librabbitmq/amqp.h 2021-04-01 03:22:03.000000000 +0000 @@ -219,7 +219,7 @@ */ #define AMQP_VERSION_MAJOR 0 -#define AMQP_VERSION_MINOR 10 +#define AMQP_VERSION_MINOR 11 #define AMQP_VERSION_PATCH 0 #define AMQP_VERSION_IS_RELEASE 1 @@ -575,8 +575,8 @@ * own block in the large_blocks block list */ amqp_pool_blocklist_t pages; /**< blocks that are the size of pagesize */ - amqp_pool_blocklist_t - large_blocks; /**< allocations larger than the pagesize */ + amqp_pool_blocklist_t large_blocks; /**< allocations larger than the pagesize + */ int next_page; /**< an index to the next unused page block */ char *alloc_block; /**< pointer to the current allocation block */ @@ -608,8 +608,8 @@ */ amqp_channel_t channel; /**< the channel the frame was received on */ union { - amqp_method_t - method; /**< a method, use if frame_type == AMQP_FRAME_METHOD */ + amqp_method_t method; /**< a method, use if frame_type == AMQP_FRAME_METHOD + */ struct { uint16_t class_id; /**< the class for the properties */ uint64_t body_size; /**< size of the body in bytes */ @@ -770,7 +770,8 @@ AMQP_STATUS_SSL_PEER_VERIFY_FAILED = -0x0202, /**< SSL validation of peer certificate failed. */ AMQP_STATUS_SSL_CONNECTION_FAILED = -0x0203, /**< SSL handshake failed. */ - _AMQP_STATUS_SSL_NEXT_VALUE = -0x0204 /**< Internal value */ + AMQP_STATUS_SSL_SET_ENGINE_FAILED = -0x0204, /**< SSL setting engine failed */ + _AMQP_STATUS_SSL_NEXT_VALUE = -0x0205 /**< Internal value */ } amqp_status_enum; /** @@ -1044,7 +1045,7 @@ * of the socket outside of the library will lead to undefined behavior. * Additionally rabbitmq-c may use the socket differently version-to-version, * what may work in one version, may break in the next version. Be sure to - * throughly test any applications that use the socket returned by this + * thoroughly test any applications that use the socket returned by this * function especially when using a newer version of rabbitmq-c * * \param [in] state the connection object @@ -1510,7 +1511,7 @@ * amqp_data_in_buffer() function. * * \note This function does not return heartbeat frames. When enabled, - * heartbeating is handed internally internally by the library. + * heartbeating is handled internally by the library. * * \param [in,out] state the connection object * \param [out] decoded_frame the frame @@ -1548,7 +1549,7 @@ AMQP_PUBLIC_FUNCTION int AMQP_CALL amqp_simple_wait_frame_noblock(amqp_connection_state_t state, amqp_frame_t *decoded_frame, - struct timeval *tv); + const struct timeval *tv); /** * Waits for a specific method from the broker @@ -2200,16 +2201,16 @@ * \since v0.4.0 */ typedef struct amqp_envelope_t_ { - amqp_channel_t channel; /**< channel message was delivered on */ - amqp_bytes_t - consumer_tag; /**< the consumer tag the message was delivered to */ - uint64_t delivery_tag; /**< the messages delivery tag */ + amqp_channel_t channel; /**< channel message was delivered on */ + amqp_bytes_t consumer_tag; /**< the consumer tag the message was delivered to + */ + uint64_t delivery_tag; /**< the messages delivery tag */ amqp_boolean_t redelivered; /**< flag indicating whether this message is being redelivered */ amqp_bytes_t exchange; /**< exchange this message was published to */ - amqp_bytes_t - routing_key; /**< the routing key this message was published with */ - amqp_message_t message; /**< the message */ + amqp_bytes_t routing_key; /**< the routing key this message was published with + */ + amqp_message_t message; /**< the message */ } amqp_envelope_t; /** @@ -2245,7 +2246,7 @@ AMQP_PUBLIC_FUNCTION amqp_rpc_reply_t AMQP_CALL amqp_consume_message(amqp_connection_state_t state, amqp_envelope_t *envelope, - struct timeval *timeout, + const struct timeval *timeout, int flags); /** @@ -2365,7 +2366,7 @@ */ AMQP_PUBLIC_FUNCTION int AMQP_CALL amqp_socket_open_noblock(amqp_socket_t *self, const char *host, - int port, struct timeval *timeout); + int port, const struct timeval *timeout); /** * Get the socket descriptor in use by a socket object. @@ -2473,7 +2474,7 @@ */ AMQP_PUBLIC_FUNCTION int AMQP_CALL amqp_set_handshake_timeout(amqp_connection_state_t state, - struct timeval *timeout); + const struct timeval *timeout); /** * Get the RPC timeout @@ -2531,7 +2532,7 @@ */ AMQP_PUBLIC_FUNCTION int AMQP_CALL amqp_set_rpc_timeout(amqp_connection_state_t state, - struct timeval *timeout); + const struct timeval *timeout); AMQP_END_DECLS diff -Nru librabbitmq-0.10.0/librabbitmq/amqp_openssl.c librabbitmq-0.11.0/librabbitmq/amqp_openssl.c --- librabbitmq-0.10.0/librabbitmq/amqp_openssl.c 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/librabbitmq/amqp_openssl.c 2021-04-01 03:22:03.000000000 +0000 @@ -28,6 +28,10 @@ #include "config.h" #endif +#ifdef _MSC_VER +#define _CRT_SECURE_NO_WARNINGS +#endif + #include "amqp_openssl_bio.h" #include "amqp_openssl_hostname_validation.h" #include "amqp_private.h" @@ -59,6 +63,7 @@ static amqp_boolean_t openssl_initialized = 0; static amqp_boolean_t openssl_bio_initialized = 0; static int openssl_connections = 0; +static ENGINE *openssl_engine = NULL; #define CHECK_SUCCESS(condition) \ do { \ @@ -164,7 +169,7 @@ } static int amqp_ssl_socket_open(void *base, const char *host, int port, - struct timeval *timeout) { + const struct timeval *timeout) { struct amqp_ssl_socket_t *self = (struct amqp_ssl_socket_t *)base; long result; int status; @@ -355,6 +360,11 @@ /* Disable SSLv2 and SSLv3 */ SSL_CTX_set_options(self->ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3); + SSL_CTX_set_mode(self->ctx, SSL_MODE_ENABLE_PARTIAL_WRITE); + /* OpenSSL v1.1.1 turns this on by default, which makes the non-blocking + * logic not behave as expected, so turn this back off */ + SSL_CTX_clear_mode(self->ctx, SSL_MODE_AUTO_RETRY); + amqp_set_socket(state, (amqp_socket_t *)self); return (amqp_socket_t *)self; @@ -403,6 +413,34 @@ return AMQP_STATUS_OK; } +int amqp_ssl_socket_set_key_engine(amqp_socket_t *base, const char *cert, + const char *key) { + int status; + struct amqp_ssl_socket_t *self; + EVP_PKEY *pkey = NULL; + if (base->klass != &amqp_ssl_socket_class) { + amqp_abort("<%p> is not of type amqp_ssl_socket_t", base); + } + self = (struct amqp_ssl_socket_t *)base; + status = SSL_CTX_use_certificate_chain_file(self->ctx, cert); + if (1 != status) { + return AMQP_STATUS_SSL_ERROR; + } + + pkey = ENGINE_load_private_key(openssl_engine, key, NULL, NULL); + if (pkey == NULL) { + return AMQP_STATUS_SSL_ERROR; + } + + status = SSL_CTX_use_PrivateKey(self->ctx, pkey); + EVP_PKEY_free(pkey); + + if (1 != status) { + return AMQP_STATUS_SSL_ERROR; + } + return AMQP_STATUS_OK; +} + static int password_cb(AMQP_UNUSED char *buffer, AMQP_UNUSED int length, AMQP_UNUSED int rwflag, AMQP_UNUSED void *user_data) { amqp_abort("rabbitmq-c does not support password protected keys"); @@ -460,6 +498,15 @@ return AMQP_STATUS_OK; } +void amqp_ssl_socket_set_key_passwd(amqp_socket_t *base, const char *passwd) { + struct amqp_ssl_socket_t *self; + if (base->klass != &amqp_ssl_socket_class) { + amqp_abort("<%p> is not of type amqp_ssl_socket_t", base); + } + self = (struct amqp_ssl_socket_t *)base; + SSL_CTX_set_default_passwd_cb_userdata(self->ctx, (void *)passwd); +} + void amqp_ssl_socket_set_verify(amqp_socket_t *base, amqp_boolean_t verify) { amqp_ssl_socket_set_verify_peer(base, verify); amqp_ssl_socket_set_verify_hostname(base, verify); @@ -591,9 +638,7 @@ CRYPTO_set_locking_callback(ssl_locking_callback); #ifdef AMQP_OPENSSL_V110 - if (CONF_modules_load_file( - NULL, "rabbitmq-c", - CONF_MFLAGS_DEFAULT_SECTION | CONF_MFLAGS_IGNORE_MISSING_FILE) <= 0) { + if (OPENSSL_init_ssl(0, NULL) <= 0) { status = AMQP_STATUS_SSL_ERROR; goto out; } @@ -626,6 +671,43 @@ return status; } +int amqp_set_ssl_engine(const char *engine) { + int status = AMQP_STATUS_OK; + CHECK_SUCCESS(pthread_mutex_lock(&openssl_init_mutex)); + + if (!openssl_initialized) { + status = AMQP_STATUS_SSL_ERROR; + goto out; + } + + if (openssl_engine != NULL) { + ENGINE_free(openssl_engine); + openssl_engine = NULL; + } + + if (engine == NULL) { + goto out; + } + + ENGINE_load_builtin_engines(); + openssl_engine = ENGINE_by_id(engine); + if (openssl_engine == NULL) { + status = AMQP_STATUS_SSL_SET_ENGINE_FAILED; + goto out; + } + + if (ENGINE_set_default(openssl_engine, ENGINE_METHOD_ALL) == 0) { + ENGINE_free(openssl_engine); + openssl_engine = NULL; + status = AMQP_STATUS_SSL_SET_ENGINE_FAILED; + goto out; + } + +out: + CHECK_SUCCESS(pthread_mutex_unlock(&openssl_init_mutex)); + return status; +} + static int initialize_ssl_and_increment_connections() { int status; CHECK_SUCCESS(pthread_mutex_lock(&openssl_init_mutex)); @@ -680,10 +762,6 @@ ERR_remove_state(0); #endif -#ifndef LIBRESSL_VERSION_NUMBER - FIPS_mode_set(0); -#endif - CRYPTO_set_locking_callback(NULL); CRYPTO_set_id_callback(NULL); { @@ -694,6 +772,11 @@ free(amqp_openssl_lockarray); } + if (openssl_engine != NULL) { + ENGINE_free(openssl_engine); + openssl_engine = NULL; + } + ENGINE_cleanup(); CONF_modules_free(); EVP_cleanup(); diff -Nru librabbitmq-0.10.0/librabbitmq/amqp_openssl_hostname_validation.c librabbitmq-0.11.0/librabbitmq/amqp_openssl_hostname_validation.c --- librabbitmq-0.10.0/librabbitmq/amqp_openssl_hostname_validation.c 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/librabbitmq/amqp_openssl_hostname_validation.c 2021-04-01 03:22:03.000000000 +0000 @@ -27,6 +27,10 @@ * https://wiki.openssl.org/index.php/Hostname_validation */ +#if defined(_WIN32) +#define WIN32_LEAN_AND_MEAN +#endif + #include #include diff -Nru librabbitmq-0.10.0/librabbitmq/amqp_openssl_hostname_validation.h librabbitmq-0.11.0/librabbitmq/amqp_openssl_hostname_validation.h --- librabbitmq-0.10.0/librabbitmq/amqp_openssl_hostname_validation.h 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/librabbitmq/amqp_openssl_hostname_validation.h 2021-04-01 03:22:03.000000000 +0000 @@ -30,7 +30,7 @@ * https://wiki.openssl.org/index.php/Hostname_validation */ -#include +#include typedef enum { AMQP_HVR_MATCH_FOUND, @@ -41,17 +41,17 @@ } amqp_hostname_validation_result; /** -* Validates the server's identity by looking for the expected hostname in the -* server's certificate. As described in RFC 6125, it first tries to find a match -* in the Subject Alternative Name extension. If the extension is not present in -* the certificate, it checks the Common Name instead. -* -* Returns AMQP_HVR_MATCH_FOUND if a match was found. -* Returns AMQP_HVR_MATCH_NOT_FOUND if no matches were found. -* Returns AMQP_HVR_MALFORMED_CERTIFICATE if any of the hostnames had a NUL -* character embedded in it. -* Returns AMQP_HVR_ERROR if there was an error. -*/ + * Validates the server's identity by looking for the expected hostname in the + * server's certificate. As described in RFC 6125, it first tries to find a + * match in the Subject Alternative Name extension. If the extension is not + * present in the certificate, it checks the Common Name instead. + * + * Returns AMQP_HVR_MATCH_FOUND if a match was found. + * Returns AMQP_HVR_MATCH_NOT_FOUND if no matches were found. + * Returns AMQP_HVR_MALFORMED_CERTIFICATE if any of the hostnames had a NUL + * character embedded in it. + * Returns AMQP_HVR_ERROR if there was an error. + */ amqp_hostname_validation_result amqp_ssl_validate_hostname( const char *hostname, const X509 *server_cert); diff -Nru librabbitmq-0.10.0/librabbitmq/amqp_private.h librabbitmq-0.11.0/librabbitmq/amqp_private.h --- librabbitmq-0.10.0/librabbitmq/amqp_private.h 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/librabbitmq/amqp_private.h 2021-04-01 03:22:03.000000000 +0000 @@ -71,7 +71,7 @@ #define AMQP_UNUSED __attribute__((__unused__)) #elif defined(_MSC_VER) #define AMQP_NORETURN __declspec(noreturn) -#define AMQP_UNUSED +#define AMQP_UNUSED __pragma(warning(suppress : 4100)) #else #define AMQP_NORETURN #define AMQP_UNUSED diff -Nru librabbitmq-0.10.0/librabbitmq/amqp_socket.c librabbitmq-0.11.0/librabbitmq/amqp_socket.c --- librabbitmq-0.10.0/librabbitmq/amqp_socket.c 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/librabbitmq/amqp_socket.c 2021-04-01 03:22:03.000000000 +0000 @@ -139,7 +139,7 @@ } int amqp_socket_open_noblock(amqp_socket_t *self, const char *host, int port, - struct timeval *timeout) { + const struct timeval *timeout) { assert(self); assert(self->klass->open); return self->klass->open(self, host, port, timeout); @@ -312,7 +312,7 @@ } int amqp_open_socket_noblock(char const *hostname, int portnumber, - struct timeval *timeout) { + const struct timeval *timeout) { amqp_time_t deadline; int res = amqp_time_from_now(&deadline, timeout); if (AMQP_STATUS_OK != res) { @@ -760,7 +760,10 @@ state->last_queued_frame = link; } } - timeout = amqp_time_immediate(); + int res = amqp_time_s_from_now(&timeout, 0); + if (AMQP_STATUS_OK != res) { + return res; + } return recv_with_timeout(state, timeout); } @@ -938,7 +941,7 @@ int amqp_simple_wait_frame_noblock(amqp_connection_state_t state, amqp_frame_t *decoded_frame, - struct timeval *timeout) { + const struct timeval *timeout) { amqp_time_t deadline; int res = amqp_time_from_now(&deadline, timeout); @@ -1226,10 +1229,13 @@ return res; } -static amqp_rpc_reply_t amqp_login_inner( - amqp_connection_state_t state, char const *vhost, int channel_max, - int frame_max, int heartbeat, const amqp_table_t *client_properties, - struct timeval *timeout, amqp_sasl_method_enum sasl_method, va_list vl) { +static amqp_rpc_reply_t amqp_login_inner(amqp_connection_state_t state, + char const *vhost, int channel_max, + int frame_max, int heartbeat, + const amqp_table_t *client_properties, + const struct timeval *timeout, + amqp_sasl_method_enum sasl_method, + va_list vl) { int res; amqp_method_t method; diff -Nru librabbitmq-0.10.0/librabbitmq/amqp_socket.h librabbitmq-0.11.0/librabbitmq/amqp_socket.h --- librabbitmq-0.10.0/librabbitmq/amqp_socket.h 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/librabbitmq/amqp_socket.h 2021-04-01 03:22:03.000000000 +0000 @@ -53,7 +53,8 @@ /* Socket callbacks. */ typedef ssize_t (*amqp_socket_send_fn)(void *, const void *, size_t, int); typedef ssize_t (*amqp_socket_recv_fn)(void *, void *, size_t, int); -typedef int (*amqp_socket_open_fn)(void *, const char *, int, struct timeval *); +typedef int (*amqp_socket_open_fn)(void *, const char *, int, + const struct timeval *); typedef int (*amqp_socket_close_fn)(void *, amqp_socket_close_enum); typedef int (*amqp_socket_get_sockfd_fn)(void *); typedef void (*amqp_socket_delete_fn)(void *); @@ -157,7 +158,7 @@ * \return File descriptor upon success, non-zero negative error code otherwise. */ int amqp_open_socket_noblock(char const *hostname, int portnumber, - struct timeval *timeout); + const struct timeval *timeout); int amqp_open_socket_inner(char const *hostname, int portnumber, amqp_time_t deadline); diff -Nru librabbitmq-0.10.0/librabbitmq/amqp_ssl_socket.h librabbitmq-0.11.0/librabbitmq/amqp_ssl_socket.h --- librabbitmq-0.10.0/librabbitmq/amqp_ssl_socket.h 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/librabbitmq/amqp_ssl_socket.h 2021-04-01 03:22:03.000000000 +0000 @@ -86,6 +86,18 @@ const char *cacert); /** + * Set the password of key in PEM format. + * + * \param [in,out] self An SSL/TLS socket object. + * \param [in] passwd The password of key in PEM format. + * + * \since v0.11.0 + */ +AMQP_PUBLIC_FUNCTION +void AMQP_CALL amqp_ssl_socket_set_key_passwd(amqp_socket_t *self, + const char *passwd); + +/** * Set the client key. * * \param [in,out] self An SSL/TLS socket object. @@ -102,6 +114,24 @@ const char *key); /** + * Set the client key use the engine. + * + * This function requires amqp_set_ssl_engine() has been called. + * + * \param [in,out] self An SSL/TLS socket object. + * \param [in] cert Path to the client certificate in PEM foramt. + * \param [in] the key ID. + * + * \return \ref AMQP_STATUS_OK on success an \ref amqp_status_enum value on + * failure. + * + * \since v0.11.0 + */ +AMQP_PUBLIC_FUNCTION +int AMQP_CALL amqp_ssl_socket_set_key_engine(amqp_socket_t *self, + const char *cert, const char *key); + +/** * Set the client key from a buffer. * * \param [in,out] self An SSL/TLS socket object. @@ -238,6 +268,22 @@ int AMQP_CALL amqp_initialize_ssl_library(void); /** + * Set the engine for underlying SSL/TLS library. + * + * This function is thread-safe, and may be called more than once. + * + * This function requires amqp_initialize_ssl_library() or amqp_ssl_socket_new() + * has been called. + * + * \param [in] engine the engine ID + * \return AMQP_STATUS_OK on success. + * + * \since v0.11.0 + */ +AMQP_PUBLIC_FUNCTION +int amqp_set_ssl_engine(const char *engine); + +/** * Uninitialize the underlying SSL/TLS library. * * \return AMQP_STATUS_OK on success. diff -Nru librabbitmq-0.10.0/librabbitmq/amqp_table.c librabbitmq-0.11.0/librabbitmq/amqp_table.c --- librabbitmq-0.10.0/librabbitmq/amqp_table.c 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/librabbitmq/amqp_table.c 2021-04-01 03:22:03.000000000 +0000 @@ -247,11 +247,11 @@ case AMQP_FIELD_KIND_F32: TRIVIAL_FIELD_DECODER(32); - /* and by punning, f32 magically gets the right value...! */ + /* and by punning, f32 magically gets the right value...! */ case AMQP_FIELD_KIND_F64: TRIVIAL_FIELD_DECODER(64); - /* and by punning, f64 magically gets the right value...! */ + /* and by punning, f64 magically gets the right value...! */ case AMQP_FIELD_KIND_DECIMAL: if (!amqp_decode_8(encoded, offset, &entry->value.decimal.decimals) || diff -Nru librabbitmq-0.10.0/librabbitmq/amqp_tcp_socket.c librabbitmq-0.11.0/librabbitmq/amqp_tcp_socket.c --- librabbitmq-0.10.0/librabbitmq/amqp_tcp_socket.c 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/librabbitmq/amqp_tcp_socket.c 2021-04-01 03:22:03.000000000 +0000 @@ -163,7 +163,7 @@ } static int amqp_tcp_socket_open(void *base, const char *host, int port, - struct timeval *timeout) { + const struct timeval *timeout) { struct amqp_tcp_socket_t *self = (struct amqp_tcp_socket_t *)base; if (-1 != self->sockfd) { return AMQP_STATUS_SOCKET_INUSE; diff -Nru librabbitmq-0.10.0/librabbitmq/amqp_time.c librabbitmq-0.11.0/librabbitmq/amqp_time.c --- librabbitmq-0.10.0/librabbitmq/amqp_time.c 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/librabbitmq/amqp_time.c 2021-04-01 03:22:03.000000000 +0000 @@ -101,7 +101,7 @@ } #endif /* AMQP_POSIX_TIMER_API */ -int amqp_time_from_now(amqp_time_t *time, struct timeval *timeout) { +int amqp_time_from_now(amqp_time_t *time, const struct timeval *timeout) { uint64_t now_ns; uint64_t delta_ns; @@ -111,10 +111,6 @@ *time = amqp_time_infinite(); return AMQP_STATUS_OK; } - if (0 == timeout->tv_sec && 0 == timeout->tv_usec) { - *time = amqp_time_immediate(); - return AMQP_STATUS_OK; - } if (timeout->tv_sec < 0 || timeout->tv_usec < 0) { return AMQP_STATUS_INVALID_PARAMETER; @@ -160,12 +156,6 @@ return AMQP_STATUS_OK; } -amqp_time_t amqp_time_immediate(void) { - amqp_time_t time; - time.time_point_ns = 0; - return time; -} - amqp_time_t amqp_time_infinite(void) { amqp_time_t time; time.time_point_ns = UINT64_MAX; diff -Nru librabbitmq-0.10.0/librabbitmq/amqp_time.h librabbitmq-0.11.0/librabbitmq/amqp_time.h --- librabbitmq-0.10.0/librabbitmq/amqp_time.h 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/librabbitmq/amqp_time.h 2021-04-01 03:22:03.000000000 +0000 @@ -53,7 +53,9 @@ * - UINT64_MAX: means 'at infinity', its mean for polls with an infinite * timeout */ -typedef struct amqp_time_t_ { uint64_t time_point_ns; } amqp_time_t; +typedef struct amqp_time_t_ { + uint64_t time_point_ns; +} amqp_time_t; /* Gets a monotonic timestamp. This will return 0 if the underlying call to the * system fails. @@ -62,14 +64,13 @@ /* Get a amqp_time_t that is timeout from now. * If timeout is NULL, an amqp_time_infinite() is created. - * If timeout = {0, 0}, an amqp_time_immediate() is created. * * Returns AMQP_STATUS_OK on success. * AMQP_STATUS_INVALID_PARAMETER if timeout is invalid * AMQP_STATUS_TIMER_FAILURE if the underlying call to get the current timestamp * fails. */ -int amqp_time_from_now(amqp_time_t *time, struct timeval *timeout); +int amqp_time_from_now(amqp_time_t *time, const struct timeval *timeout); /* Get a amqp_time_t that is seconds from now. * If seconds <= 0, then amqp_time_infinite() is created. @@ -80,9 +81,6 @@ */ int amqp_time_s_from_now(amqp_time_t *time, int seconds); -/* Create an immediate amqp_time_t */ -amqp_time_t amqp_time_immediate(void); - /* Create an infinite amqp_time_t */ amqp_time_t amqp_time_infinite(void); diff -Nru librabbitmq-0.10.0/librabbitmq/amqp_url.c librabbitmq-0.11.0/librabbitmq/amqp_url.c --- librabbitmq-0.10.0/librabbitmq/amqp_url.c 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/librabbitmq/amqp_url.c 2021-04-01 03:22:03.000000000 +0000 @@ -213,7 +213,7 @@ res = AMQP_STATUS_OK; } -/* Any other delimiter is bad, and we will return AMQP_STATUS_BAD_AMQP_URL. */ + /* Any other delimiter is bad, and we will return AMQP_STATUS_BAD_AMQP_URL. */ out: return res; diff -Nru librabbitmq-0.10.0/librabbitmq/CMakeLists.txt librabbitmq-0.11.0/librabbitmq/CMakeLists.txt --- librabbitmq-0.10.0/librabbitmq/CMakeLists.txt 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/librabbitmq/CMakeLists.txt 2021-04-01 03:22:03.000000000 +0000 @@ -45,12 +45,6 @@ set(AMQP_FRAMING_C_PATH ${CMAKE_CURRENT_SOURCE_DIR}/amqp_framing.c) endif (REGENERATE_AMQP_FRAMING) -if(WIN32) - set(SOCKET_IMPL "win32") -else(WIN32) - set(SOCKET_IMPL "unix") -endif(WIN32) - if(MSVC) if(MSVC_VERSION LESS 1600) set(MSINTTYPES_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/win32/msinttypes") @@ -63,7 +57,6 @@ set(LIBRABBITMQ_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} - ${SOCKET_IMPL} ${MSINTTYPES_INCLUDE} ) @@ -96,10 +89,12 @@ PROPERTIES COMPILE_FLAGS -Wno-deprecated-declarations) endif() - if (WIN32) + if (WIN32 AND NOT CMAKE_USE_PTHREADS_INIT) set(AMQP_SSL_SRCS ${AMQP_SSL_SRCS} win32/threads.h win32/threads.c) + include_directories(win32) else() set(AMQP_SSL_SRCS ${AMQP_SSL_SRCS} unix/threads.h) + include_directories(unix) endif() endif() @@ -119,9 +114,6 @@ if (BUILD_SHARED_LIBS) add_library(rabbitmq SHARED ${RABBITMQ_SOURCES}) - if (THREADS_HAVE_PTHREAD_ARG) - target_compile_options(rabbitmq PUBLIC "-pthread") - endif() target_link_libraries(rabbitmq ${RMQ_LIBRARIES}) @@ -131,7 +123,7 @@ set_target_properties(rabbitmq PROPERTIES VERSION ${RMQ_VERSION} SOVERSION ${RMQ_SOVERSION}) endif (WIN32) - install(TARGETS rabbitmq + install(TARGETS rabbitmq EXPORT "${targets_export_name}" RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} @@ -142,9 +134,6 @@ if (BUILD_STATIC_LIBS) add_library(rabbitmq-static STATIC ${RABBITMQ_SOURCES}) - if (THREADS_HAVE_PTHREAD_ARG) - target_compile_options(rabbitmq-static PUBLIC "-pthread") - endif() target_link_libraries(rabbitmq-static ${RMQ_LIBRARIES}) @@ -165,7 +154,7 @@ set_target_properties(rabbitmq-static PROPERTIES VERSION ${RMQ_VERSION} SOVERSION ${RMQ_SOVERSION} OUTPUT_NAME rabbitmq) endif (WIN32) - install(TARGETS rabbitmq-static + install(TARGETS rabbitmq-static EXPORT "${targets_export_name}" ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) diff -Nru librabbitmq-0.10.0/README.md librabbitmq-0.11.0/README.md --- librabbitmq-0.10.0/README.md 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/README.md 2021-04-01 03:22:03.000000000 +0000 @@ -84,6 +84,23 @@ default this is ON if the OpenSSL headers and library can be found. * `BUILD_API_DOCS=ON/OFF` - toggles building the Doxygen API documentation, by default this is OFF +* `RUN_SYSTEM_TESTS=ON/OFF` toggles building the system tests (i.e. tests requiring + an accessible RabbitMQ server instance on localhost), by default this is OFF + +## Building RabbitMQ - Using vcpkg + +You can download and install RabbitMQ using the [vcpkg](https://github.com/Microsoft/vcpkg) +dependency manager: + + git clone https://github.com/Microsoft/vcpkg.git + cd vcpkg + ./bootstrap-vcpkg.sh + ./vcpkg integrate install + ./vcpkg install librabbitmq + +The RabbitMQ port in vcpkg is kept up to date by Microsoft team members and +community contributors. If the version is out of date, +please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. ## Running the examples diff -Nru librabbitmq-0.10.0/tests/CMakeLists.txt librabbitmq-0.11.0/tests/CMakeLists.txt --- librabbitmq-0.10.0/tests/CMakeLists.txt 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/tests/CMakeLists.txt 2021-04-01 03:22:03.000000000 +0000 @@ -33,9 +33,11 @@ test_basic.c) target_link_libraries(test_basic rabbitmq-static) -if (NOT APPLE) - add_test(basic test_basic) -endif() +if (RUN_SYSTEM_TESTS) + if (NOT APPLE) + add_test(basic test_basic) + endif() +endif(RUN_SYSTEM_TESTS) add_executable(test_sasl_mechanism test_sasl_mechanism.c) target_link_libraries(test_sasl_mechanism rabbitmq-static) diff -Nru librabbitmq-0.10.0/tools/CMakeLists.txt librabbitmq-0.11.0/tools/CMakeLists.txt --- librabbitmq-0.10.0/tools/CMakeLists.txt 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/tools/CMakeLists.txt 2021-04-01 03:22:03.000000000 +0000 @@ -45,9 +45,10 @@ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc) set(XMLTO_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/doc/man-date.ent) + STRING(TIMESTAMP BUILD_DATE "%Y-%m-%d" UTC) add_custom_command( OUTPUT ${XMLTO_DEPENDS} - COMMAND date +'%Y-%m-%d' > ${XMLTO_DEPENDS} + COMMAND echo ${BUILD_DATE} > ${XMLTO_DEPENDS} VERBATIM ) diff -Nru librabbitmq-0.10.0/tools/common.c librabbitmq-0.11.0/tools/common.c --- librabbitmq-0.10.0/tools/common.c 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/tools/common.c 2021-04-01 03:22:03.000000000 +0000 @@ -240,6 +240,14 @@ if (ci->port < 0 || ci->port > 65535 || port_end == colon + 1 || *port_end != 0) die("bad server port number in '%s'", amqp_server); + } else { + ci->host = amqp_server; + ci->port = 5672; +#if WITH_SSL + if (amqp_ssl) { + ci->port = 5671; + } +#endif } #if WITH_SSL diff -Nru librabbitmq-0.10.0/travis/clang-format.sh librabbitmq-0.11.0/travis/clang-format.sh --- librabbitmq-0.10.0/travis/clang-format.sh 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/travis/clang-format.sh 2021-04-01 03:22:03.000000000 +0000 @@ -2,4 +2,4 @@ set -e -exec clang-format-3.9 -style=file $@ +exec clang-format -style=file $@ diff -Nru librabbitmq-0.10.0/travis.sh librabbitmq-0.11.0/travis.sh --- librabbitmq-0.10.0/travis.sh 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/travis.sh 2021-04-01 03:22:03.000000000 +0000 @@ -2,13 +2,21 @@ build_cmake() { mkdir $PWD/_build && cd $PWD/_build + cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/../_install -DCMAKE_C_FLAGS="-Werror -Wno-implicit-fallthrough" + cmake --build . --target install + ctest -V . +} + +build_macos() { + mkdir $PWD/_build && cd $PWD/_build cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/../_install -DCMAKE_C_FLAGS="-Werror" \ - ${_CMAKE_OPENSSL_FLAG} + -DOPENSSL_ROOT_DIR="/usr/local/opt/openssl@1.1" cmake --build . --target install ctest -V . } build_format() { + sudo apt-get install -y clang-format ./travis/run-clang-format/run-clang-format.py \ --clang-format-executable="${PWD}/travis/clang-format.sh" \ --recursive examples librabbitmq tests tools @@ -17,8 +25,7 @@ build_coverage() { mkdir $PWD/_build && cd $PWD/_build cmake .. -DCMAKE_BUILD_TYPE=Coverage -DCMAKE_INSTALL_PREFIX=$PWD/../_install \ - -DCMAKE_C_FLAGS="-Werror -fprofile-arcs -ftest-coverage" \ - ${_CMAKE_OPENSSL_FLAG} + -DCMAKE_C_FLAGS="-Werror -fprofile-arcs -ftest-coverage" cmake --build . --target install ctest -V . @@ -43,29 +50,21 @@ } build_scan-build() { + sudo apt-get install -y clang-tools mkdir $PWD/_build && cd $PWD/_build - scan-build-3.9 cmake .. -DCMAKE_BUILD_TYPE=Debug \ + scan-build cmake .. -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_C_COMPILER=clang \ -DCMAKE_INSTALL_PREFIX=$PWD/../_install \ -DCMAKE_C_FLAGS="-Werror" - scan-build-3.9 make install + scan-build make install } if [ "$#" -ne 1 ]; then - echo "Usage: $0 {cmake|asan|tsan|scan-build}" + echo "Usage: $0 {cmake|macos|format|coverage|asan|tsan|scan-build}" exit 1 fi set -e # exit on error. set -x # echo commands. -case $TRAVIS_OS_NAME in -osx) - # This prints out a long list of updated packages, which isn't useful. - brew update > /dev/null - brew install popt - brew outdated openssl || brew install openssl - export _CMAKE_OPENSSL_FLAG="-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl" - ;; -esac - eval "build_$1" diff -Nru librabbitmq-0.10.0/.travis.yml librabbitmq-0.11.0/.travis.yml --- librabbitmq-0.10.0/.travis.yml 2019-12-02 04:37:33.000000000 +0000 +++ librabbitmq-0.11.0/.travis.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,89 +0,0 @@ -# Travis-CI Build for rabbitmq-c -# see travis-ci.org for details - -language: c - -dist: xenial -# Currently libpopt-dev is not on the list of whitelisted apt-packages. -sudo: true - -addons: - apt: - packages: &default_packages - - rabbitmq-server - - clang-3.9 - - clang-format-3.9 - - libpopt-dev - coverity_scan: - project: - name: "alanxz/rabbitmq-c" - description: "C AMQP client for RabbitMQ" - notification_email: alan.antonuk@gmail.com - build_command_prepend: mkdir build && pushd build && cmake .. && popd - build_command: cmake --build ./build - branch_pattern: coverity_scan - -env: - global: - # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created - # via the "travis encrypt" command using the project repo's public key - - secure: "gDwqo3jHj+HHGzFKnxL/nwZhbVeh2pItw0TbeaHcLtWubUZaf85ViEQRaXPyfnbG7l0OEQq+PjyhKAfvViVq2NP0lGeeu4VM5uMZJhsCLN594BJr39Y4XzOapg0O8mEMhQ0DU2u1Zo4LMgEcRz67aosVQOj6QV30tOzp9fnxn9U=" - -matrix: - include: - # Note that the first compiler in the matrix must be gcc, so that the - # coverity_scan branch hack below works correctly. - - compiler: gcc - os: linux - env: CONFIG=cmake - - compiler: gcc - os: linux - env: CONFIG=format - - compiler: gcc - os: linux - env: CONFIG=coverage - - compiler: clang - os: linux - env: CONFIG=cmake - - compiler: clang - os: linux - env: CONFIG=asan - - compiler: clang - os: linux - env: CONFIG=tsan - - compiler: clang - os: linux - env: CONFIG=scan-build - - compiler: clang - os: osx - env: CONFIG=cmake - - compiler: gcc - os: linux - env: NAME="openssl-1.1.0" CONFIG=cmake - addons: - apt: - sources: - - sourceline: 'ppa:ondrej/nginx-mainline' - packages: - - *default_packages - - libssl1.1 - - openssl - - libssl-dev - - allow_failures: - - compiler: clang - os: linux - env: CONFIG=tsan - -before_install: - # ugly hack; if running a coverity scan abort all except the 1st build - # see note re gcc compiler above needing to be 1st - # also note that branch_pattern & the TRAVIS_BRANCH check must match - # unfortunately COVERITY_SCAN_BRANCH isn't defined until later in the - # build process - - if ([[ "${TRAVIS_JOB_NUMBER##*.}" != "1" ]] && [[ "${TRAVIS_BRANCH}" == "coverity_scan" ]]); then false ; fi - - -script: - # Don't bother building if this is being done in the coverity_scan branch. - - if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then ./travis.sh $CONFIG ; fi