From b1c9e3f81d4b359f18e5af53fb5bb4a1086a642b Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Tue, 27 Jan 2015 02:12:55 +0100 Subject: [PATCH 01/55] Rebuild for boost 1.57.0 --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 234a33e..539d61c 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.4.0 -Release: 2%{?dist} +Release: 3%{?dist} License: BSD Url: http://www.zaphoyd.com/websocketpp @@ -61,6 +61,9 @@ make install/fast DESTDIR=%{buildroot} -C %{_target_platform} %changelog +* Tue Jan 27 2015 Petr Machata - 0.4.0-3 +- Rebuild for boost 1.57.0 + * Thu Nov 13 2014 Rex Dieter 0.4.0-2 - use (upstreamable) cmake_noarch.patch instead of manually moving files around From 1929902849b0ae3772c8816011bfffde1ff93405 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 19 Jun 2015 02:20:04 +0000 Subject: [PATCH 02/55] - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 539d61c..d3b40eb 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.4.0 -Release: 3%{?dist} +Release: 4%{?dist} License: BSD Url: http://www.zaphoyd.com/websocketpp @@ -61,6 +61,9 @@ make install/fast DESTDIR=%{buildroot} -C %{_target_platform} %changelog +* Fri Jun 19 2015 Fedora Release Engineering - 0.4.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + * Tue Jan 27 2015 Petr Machata - 0.4.0-3 - Rebuild for boost 1.57.0 From 20033e8e8cdb117dce71a563b5c9d21ea1da06a8 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Wed, 22 Jul 2015 22:36:47 +0200 Subject: [PATCH 03/55] rebuild for Boost 1.58 --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index d3b40eb..2c4f1e2 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.4.0 -Release: 4%{?dist} +Release: 5%{?dist} License: BSD Url: http://www.zaphoyd.com/websocketpp @@ -61,6 +61,9 @@ make install/fast DESTDIR=%{buildroot} -C %{_target_platform} %changelog +* Wed Jul 22 2015 David Tardon - 0.4.0-5 +- rebuild for Boost 1.58 + * Fri Jun 19 2015 Fedora Release Engineering - 0.4.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild From a315274fe21b7d697e29fd9ea43881967712549c Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 29 Jul 2015 13:34:37 -0500 Subject: [PATCH 04/55] - Rebuilt for https://fedoraproject.org/wiki/Changes/F23Boost159 --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 2c4f1e2..792a278 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.4.0 -Release: 5%{?dist} +Release: 6%{?dist} License: BSD Url: http://www.zaphoyd.com/websocketpp @@ -61,6 +61,9 @@ make install/fast DESTDIR=%{buildroot} -C %{_target_platform} %changelog +* Wed Jul 29 2015 Fedora Release Engineering - 0.4.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Changes/F23Boost159 + * Wed Jul 22 2015 David Tardon - 0.4.0-5 - rebuild for Boost 1.58 From 85e55653961b3101b6ae9c07518e33e6f19633e8 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Thu, 27 Aug 2015 18:06:54 +0100 Subject: [PATCH 05/55] Rebuilt for Boost 1.59 --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 792a278..42d53e6 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.4.0 -Release: 6%{?dist} +Release: 7%{?dist} License: BSD Url: http://www.zaphoyd.com/websocketpp @@ -61,6 +61,9 @@ make install/fast DESTDIR=%{buildroot} -C %{_target_platform} %changelog +* Thu Aug 27 2015 Jonathan Wakely - 0.4.0-7 +- Rebuilt for Boost 1.59 + * Wed Jul 29 2015 Fedora Release Engineering - 0.4.0-6 - Rebuilt for https://fedoraproject.org/wiki/Changes/F23Boost159 From d391e1becdff073b67944df4602d52553bc1c08b Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Sat, 16 Jan 2016 02:28:35 +0000 Subject: [PATCH 06/55] Rebuilt for Boost 1.60 --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 42d53e6..1e001c7 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.4.0 -Release: 7%{?dist} +Release: 8%{?dist} License: BSD Url: http://www.zaphoyd.com/websocketpp @@ -61,6 +61,9 @@ make install/fast DESTDIR=%{buildroot} -C %{_target_platform} %changelog +* Sat Jan 16 2016 Jonathan Wakely - 0.4.0-8 +- Rebuilt for Boost 1.60 + * Thu Aug 27 2015 Jonathan Wakely - 0.4.0-7 - Rebuilt for Boost 1.59 From b9ac7a5ffbdfc8193296d701975999c7189c6f59 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 5 Feb 2016 02:58:03 +0000 Subject: [PATCH 07/55] - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 1e001c7..ab0f218 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.4.0 -Release: 8%{?dist} +Release: 9%{?dist} License: BSD Url: http://www.zaphoyd.com/websocketpp @@ -61,6 +61,9 @@ make install/fast DESTDIR=%{buildroot} -C %{_target_platform} %changelog +* Fri Feb 05 2016 Fedora Release Engineering - 0.4.0-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + * Sat Jan 16 2016 Jonathan Wakely - 0.4.0-8 - Rebuilt for Boost 1.60 From b047accdcccff823402b643763b91e9202b725dc Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Thu, 15 Sep 2016 13:32:46 -0500 Subject: [PATCH 08/55] websocketpp-0.7.0 (#1375610) --- .gitignore | 2 +- sources | 2 +- websocketpp-0.4.0-cmake_noarch.patch | 12 ------------ websocketpp-0.7.0-cmake_noarch.patch | 12 ++++++++++++ websocketpp.pc | 2 +- websocketpp.spec | 14 +++++++++----- 6 files changed, 24 insertions(+), 20 deletions(-) delete mode 100644 websocketpp-0.4.0-cmake_noarch.patch create mode 100644 websocketpp-0.7.0-cmake_noarch.patch diff --git a/.gitignore b/.gitignore index 708df3b..c92e440 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/0.4.0.tar.gz +/websocketpp-0.7.0.tar.gz diff --git a/sources b/sources index 33b55a3..ea9d6ad 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -21ed2beaaf2fe3f76783e4b3bbaa8206 0.4.0.tar.gz +5027c20cde76fdaef83a74acfcf98e23 websocketpp-0.7.0.tar.gz diff --git a/websocketpp-0.4.0-cmake_noarch.patch b/websocketpp-0.4.0-cmake_noarch.patch deleted file mode 100644 index 31e3356..0000000 --- a/websocketpp-0.4.0-cmake_noarch.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up websocketpp-0.4.0/CMakeLists.txt.noarch websocketpp-0.4.0/CMakeLists.txt ---- websocketpp-0.4.0/CMakeLists.txt.noarch 2014-11-04 06:35:10.000000000 -0600 -+++ websocketpp-0.4.0/CMakeLists.txt 2014-11-13 14:23:02.306865323 -0600 -@@ -17,7 +17,7 @@ set(INSTALL_INCLUDE_DIR include CACHE PA - if (WIN32 AND NOT CYGWIN) - set (DEF_INSTALL_CMAKE_DIR cmake) - else () -- set (DEF_INSTALL_CMAKE_DIR lib/cmake/websocketpp) -+ set (DEF_INSTALL_CMAKE_DIR share/cmake/websocketpp) - endif () - set (INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files") - diff --git a/websocketpp-0.7.0-cmake_noarch.patch b/websocketpp-0.7.0-cmake_noarch.patch new file mode 100644 index 0000000..0a85d82 --- /dev/null +++ b/websocketpp-0.7.0-cmake_noarch.patch @@ -0,0 +1,12 @@ +diff -up websocketpp-0.7.0/CMakeLists.txt.cmake_noarch websocketpp-0.7.0/CMakeLists.txt +--- websocketpp-0.7.0/CMakeLists.txt.cmake_noarch 2016-02-22 07:30:10.000000000 -0600 ++++ websocketpp-0.7.0/CMakeLists.txt 2016-09-15 13:05:59.012179625 -0500 +@@ -19,7 +19,7 @@ set(INSTALL_INCLUDE_DIR include CACHE PA + if (WIN32 AND NOT CYGWIN) + set (DEF_INSTALL_CMAKE_DIR cmake) + else () +- set (DEF_INSTALL_CMAKE_DIR lib/cmake/websocketpp) ++ set (DEF_INSTALL_CMAKE_DIR share/cmake/websocketpp) + endif () + set (INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files") + diff --git a/websocketpp.pc b/websocketpp.pc index 6575df6..086557b 100644 --- a/websocketpp.pc +++ b/websocketpp.pc @@ -4,6 +4,6 @@ includedir=${prefix}/include Name: websocketpp Description: WebSocket API -Version: 0.4.0 +Version: 0.7.0 URL: http://www.zaphoyd.com/websocketpp/ Cflags: -I${includedir}/ diff --git a/websocketpp.spec b/websocketpp.spec index ab0f218..8ab7abc 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -1,17 +1,17 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library -Version: 0.4.0 -Release: 9%{?dist} +Version: 0.7.0 +Release: 0.1%{?dist} License: BSD Url: http://www.zaphoyd.com/websocketpp -Source0: https://github.com/zaphoyd/websocketpp/archive/%{version}.tar.gz +Source0: https://github.com/zaphoyd/websocketpp/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: websocketpp.pc BuildArch: noarch # put cmake files in share/cmake instead of lib/cmake -Patch1: websocketpp-0.4.0-cmake_noarch.patch +Patch1: websocketpp-0.7.0-cmake_noarch.patch BuildRequires: boost-devel BuildRequires: cmake @@ -34,8 +34,9 @@ WebSocket client and server functionality into C++ programs. It uses interchangeable network transport modules including one based on C++ iostreams and one based on Boost Asio. + %prep -%setup -q -n %{name}-%{version} +%autosetup %patch1 -p1 -b .cmake_noarch @@ -61,6 +62,9 @@ make install/fast DESTDIR=%{buildroot} -C %{_target_platform} %changelog +* Thu Sep 15 2016 Rex Dieter - 0.7.0-0.1 +- websocketpp-0.7.0 (#1375610) + * Fri Feb 05 2016 Fedora Release Engineering - 0.4.0-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild From 5b3808de898de58c96bc5b18c8ce25264a1f5709 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Fri, 16 Sep 2016 10:08:52 -0500 Subject: [PATCH 09/55] fix release, patches --- websocketpp.spec | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/websocketpp.spec b/websocketpp.spec index 8ab7abc..6ff82c5 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.7.0 -Release: 0.1%{?dist} +Release: 1%{?dist} License: BSD Url: http://www.zaphoyd.com/websocketpp @@ -36,9 +36,7 @@ iostreams and one based on Boost Asio. %prep -%autosetup - -%patch1 -p1 -b .cmake_noarch +%autosetup -p1 %build @@ -62,7 +60,7 @@ make install/fast DESTDIR=%{buildroot} -C %{_target_platform} %changelog -* Thu Sep 15 2016 Rex Dieter - 0.7.0-0.1 +* Thu Sep 15 2016 Rex Dieter - 0.7.0-1 - websocketpp-0.7.0 (#1375610) * Fri Feb 05 2016 Fedora Release Engineering - 0.4.0-9 From f590743eaafe93c6260acd3baf7b71b44fd2aeae Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 27 Jan 2017 09:14:46 +0000 Subject: [PATCH 10/55] Rebuilt for Boost 1.63 --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 6ff82c5..4a7db5a 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.7.0 -Release: 1%{?dist} +Release: 2%{?dist} License: BSD Url: http://www.zaphoyd.com/websocketpp @@ -60,6 +60,9 @@ make install/fast DESTDIR=%{buildroot} -C %{_target_platform} %changelog +* Fri Jan 27 2017 Jonathan Wakely - 0.7.0-2 +- Rebuilt for Boost 1.63 + * Thu Sep 15 2016 Rex Dieter - 0.7.0-1 - websocketpp-0.7.0 (#1375610) From ce4eb59a46c9187085e9a2d83c358570d18226fd Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 11 Feb 2017 17:19:17 +0000 Subject: [PATCH 11/55] - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 4a7db5a..1630ec1 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.7.0 -Release: 2%{?dist} +Release: 3%{?dist} License: BSD Url: http://www.zaphoyd.com/websocketpp @@ -60,6 +60,9 @@ make install/fast DESTDIR=%{buildroot} -C %{_target_platform} %changelog +* Sat Feb 11 2017 Fedora Release Engineering - 0.7.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + * Fri Jan 27 2017 Jonathan Wakely - 0.7.0-2 - Rebuilt for Boost 1.63 From 1f4b76d10b6869700e7fc03b64eb85897dc4d77f Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Wed, 17 May 2017 12:25:16 -0500 Subject: [PATCH 12/55] tls.hpp, SSL_R_SHORT_READ undefined in openssl-1.1 (#1449163) enable tests --- websocketpp-0.7.0-openssl11.patch | 17 +++++++++++++++++ websocketpp.spec | 23 ++++++++++++++++++++--- 2 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 websocketpp-0.7.0-openssl11.patch diff --git a/websocketpp-0.7.0-openssl11.patch b/websocketpp-0.7.0-openssl11.patch new file mode 100644 index 0000000..6513b80 --- /dev/null +++ b/websocketpp-0.7.0-openssl11.patch @@ -0,0 +1,17 @@ +diff -up websocketpp-0.7.0/websocketpp/transport/asio/security/tls.hpp.openssl11 websocketpp-0.7.0/websocketpp/transport/asio/security/tls.hpp +--- websocketpp-0.7.0/websocketpp/transport/asio/security/tls.hpp.openssl11 2016-02-22 07:30:10.000000000 -0600 ++++ websocketpp-0.7.0/websocketpp/transport/asio/security/tls.hpp 2017-05-17 12:19:55.418658051 -0500 +@@ -355,8 +355,13 @@ protected: + template + lib::error_code translate_ec(ErrorCodeType ec) { + if (ec.category() == lib::asio::error::get_ssl_category()) { ++#if defined SSL_R_SHORT_READ + if (ERR_GET_REASON(ec.value()) == SSL_R_SHORT_READ) { + return make_error_code(transport::error::tls_short_read); ++#else ++ if (ERR_GET_REASON(ec.value()) == boost::asio::ssl::error::stream_truncated) { ++ return make_error_code(boost::asio::ssl::error::stream_truncated); ++#endif + } else { + // We know it is a TLS related error, but otherwise don't know + // more. Pass through as TLS generic. diff --git a/websocketpp.spec b/websocketpp.spec index 1630ec1..0d593fb 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.7.0 -Release: 3%{?dist} +Release: 4%{?dist} License: BSD Url: http://www.zaphoyd.com/websocketpp @@ -13,6 +13,10 @@ BuildArch: noarch # put cmake files in share/cmake instead of lib/cmake Patch1: websocketpp-0.7.0-cmake_noarch.patch +# make compatible with openssl-1.1.x +# https://github.com/zaphoyd/websocketpp/issues/599 +Patch2: websocketpp-0.7.0-openssl11.patch + BuildRequires: boost-devel BuildRequires: cmake BuildRequires: pkgconfig @@ -42,7 +46,8 @@ iostreams and one based on Boost Asio. %build mkdir %{_target_platform} pushd %{_target_platform} -%cmake .. +%cmake .. \ + -DBUILD_TESTS:BOOL=ON make %{?_smp_mflags} popd @@ -51,15 +56,27 @@ popd %install make install/fast DESTDIR=%{buildroot} -C %{_target_platform} +## unpackaged files +rm -rfv %{buildroot}%{_includedir}/test_connection/ + + +%check +make test -C %{_target_platform} + %files devel -%doc COPYING changelog.md readme.md roadmap.md +%doc changelog.md readme.md roadmap.md +%license COPYING %{_includedir}/websocketpp/ %dir %{_datadir}/cmake/ %{_datadir}/cmake/websocketpp/ %changelog +* Wed May 17 2017 Rex Dieter - 0.7.0-4 +- tls.hpp, SSL_R_SHORT_READ undefined in openssl-1.1 (#1449163) +- enable tests + * Sat Feb 11 2017 Fedora Release Engineering - 0.7.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild From 415db96ff3f8d70cef6ecdd75e3242b0d9d54b83 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Mon, 22 May 2017 09:55:38 -0500 Subject: [PATCH 13/55] adjust openssl patch BR: openssl-devel zlib-devel (for tests mostly) --- websocketpp-0.7.0-openssl11.patch | 18 +++++++++++------- websocketpp.spec | 10 ++++++++-- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/websocketpp-0.7.0-openssl11.patch b/websocketpp-0.7.0-openssl11.patch index 6513b80..60bc1a4 100644 --- a/websocketpp-0.7.0-openssl11.patch +++ b/websocketpp-0.7.0-openssl11.patch @@ -1,17 +1,21 @@ diff -up websocketpp-0.7.0/websocketpp/transport/asio/security/tls.hpp.openssl11 websocketpp-0.7.0/websocketpp/transport/asio/security/tls.hpp --- websocketpp-0.7.0/websocketpp/transport/asio/security/tls.hpp.openssl11 2016-02-22 07:30:10.000000000 -0600 -+++ websocketpp-0.7.0/websocketpp/transport/asio/security/tls.hpp 2017-05-17 12:19:55.418658051 -0500 -@@ -355,8 +355,13 @@ protected: ++++ websocketpp-0.7.0/websocketpp/transport/asio/security/tls.hpp 2017-05-22 09:49:43.613622484 -0500 +@@ -355,13 +355,17 @@ protected: template lib::error_code translate_ec(ErrorCodeType ec) { if (ec.category() == lib::asio::error::get_ssl_category()) { -+#if defined SSL_R_SHORT_READ ++#ifdef SSL_R_SHORT_READ if (ERR_GET_REASON(ec.value()) == SSL_R_SHORT_READ) { return make_error_code(transport::error::tls_short_read); -+#else -+ if (ERR_GET_REASON(ec.value()) == boost::asio::ssl::error::stream_truncated) { -+ return make_error_code(boost::asio::ssl::error::stream_truncated); -+#endif } else { ++#endif // We know it is a TLS related error, but otherwise don't know // more. Pass through as TLS generic. + return make_error_code(transport::error::tls_error); ++#ifdef SSL_R_SHORT_READ + } ++#endif + } else { + // We don't know any more information about this error so pass + // through diff --git a/websocketpp.spec b/websocketpp.spec index 0d593fb..cc6b15f 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.7.0 -Release: 4%{?dist} +Release: 5%{?dist} License: BSD Url: http://www.zaphoyd.com/websocketpp @@ -19,7 +19,9 @@ Patch2: websocketpp-0.7.0-openssl11.patch BuildRequires: boost-devel BuildRequires: cmake -BuildRequires: pkgconfig +# needed for tests mostly +BuildRequires: pkgconfig(openssl) +BuildRequires: zlib-devel %description WebSocket++ is an open source (BSD license) header only C++ library @@ -73,6 +75,10 @@ make test -C %{_target_platform} %changelog +* Mon May 22 2017 Rex Dieter - 0.7.0-5 +- adjust openssl patch +- BR: openssl-devel zlib-devel (for tests mostly) + * Wed May 17 2017 Rex Dieter - 0.7.0-4 - tls.hpp, SSL_R_SHORT_READ undefined in openssl-1.1 (#1449163) - enable tests From 82734c302bb99c8abe206814a4d0c17aa0b697fd Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Mon, 22 May 2017 12:19:36 -0500 Subject: [PATCH 14/55] make tests non-fatal (for now) --- websocketpp.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index cc6b15f..f904783 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -63,7 +63,8 @@ rm -rfv %{buildroot}%{_includedir}/test_connection/ %check -make test -C %{_target_platform} +# tests non-fatal (for now) +make test -C %{_target_platform} ||: %files devel From 19b12bfdf1d8c43022d437c8ea691fe3b281748a Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Fri, 26 May 2017 09:13:42 -0500 Subject: [PATCH 15/55] explicitly use openssl-devel (instead of generic 'pkgconfig(openssl)' --- websocketpp.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/websocketpp.spec b/websocketpp.spec index f904783..48f8e4a 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.7.0 -Release: 5%{?dist} +Release: 6%{?dist} License: BSD Url: http://www.zaphoyd.com/websocketpp @@ -20,7 +20,7 @@ Patch2: websocketpp-0.7.0-openssl11.patch BuildRequires: boost-devel BuildRequires: cmake # needed for tests mostly -BuildRequires: pkgconfig(openssl) +BuildRequires: openssl-devel BuildRequires: zlib-devel %description @@ -76,6 +76,9 @@ make test -C %{_target_platform} ||: %changelog +* Fri May 26 2017 Rex Dieter - 0.7.0-6 +- explicitly use openssl-devel (instead of generic 'pkgconfig(openssl)' + * Mon May 22 2017 Rex Dieter - 0.7.0-5 - adjust openssl patch - BR: openssl-devel zlib-devel (for tests mostly) From 44ef4da11807da4f7416d9442046296ef5e15311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= Date: Tue, 27 Jun 2017 09:36:49 +0200 Subject: [PATCH 16/55] Fix failing tests of websocketpp 0.7.0-6 (#1461069) - Add patches to fix zlib test failure (test_permessage_deflate) - Disable tests test_transport, test_transport_asio_timers Fix build and test failures with zlib 1.2.11. Fixes test_permessage_deflate zaphoyd/websocketpp#653 Upstream patches, backported to websocketpp-0.7.0 zaphoyd/websocketpp@9ddb300 websocketpp-0.7.0-zlib-permessage-deflate.patch zaphoyd/websocketpp@4cab5e5 websocketpp-0.7.0-minor-adjustments-to-recent-extension- negotiation.patch --- ...transport-test_transport_asio_timers.patch | 46 ++ ...ents-to-recent-extension-negotiation.patch | 146 +++++ ...cketpp-0.7.0-zlib-permessage-deflate.patch | 566 ++++++++++++++++++ websocketpp.spec | 20 +- 4 files changed, 775 insertions(+), 3 deletions(-) create mode 100644 websocketpp-0.7.0-disable-test_transport-test_transport_asio_timers.patch create mode 100644 websocketpp-0.7.0-minor-adjustments-to-recent-extension-negotiation.patch create mode 100644 websocketpp-0.7.0-zlib-permessage-deflate.patch diff --git a/websocketpp-0.7.0-disable-test_transport-test_transport_asio_timers.patch b/websocketpp-0.7.0-disable-test_transport-test_transport_asio_timers.patch new file mode 100644 index 0000000..8d6c93f --- /dev/null +++ b/websocketpp-0.7.0-disable-test_transport-test_transport_asio_timers.patch @@ -0,0 +1,46 @@ +--- a/test/transport/CMakeLists.txt ++++ b/test/transport/CMakeLists.txt +@@ -1,24 +1,24 @@ + if (OPENSSL_FOUND) + +-# Test transport integration +-file (GLOB SOURCE integration.cpp) +- +-init_target (test_transport) +-build_test (${TARGET_NAME} ${SOURCE}) +-link_boost () +-link_openssl() +-final_target () +-set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "test") +- +-# Test transport asio timers +-file (GLOB SOURCE asio/timers.cpp) +- +-init_target (test_transport_asio_timers) +-build_test (${TARGET_NAME} ${SOURCE}) +-link_boost () +-link_openssl() +-final_target () +-set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "test") ++## Test transport integration ++#file (GLOB SOURCE integration.cpp) ++# ++#init_target (test_transport) ++#build_test (${TARGET_NAME} ${SOURCE}) ++#link_boost () ++#link_openssl() ++#final_target () ++#set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "test") ++# ++## Test transport asio timers ++#file (GLOB SOURCE asio/timers.cpp) ++# ++#init_target (test_transport_asio_timers) ++#build_test (${TARGET_NAME} ${SOURCE}) ++#link_boost () ++#link_openssl() ++#final_target () ++#set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "test") + + # Test transport asio security + file (GLOB SOURCE asio/security.cpp) diff --git a/websocketpp-0.7.0-minor-adjustments-to-recent-extension-negotiation.patch b/websocketpp-0.7.0-minor-adjustments-to-recent-extension-negotiation.patch new file mode 100644 index 0000000..319b601 --- /dev/null +++ b/websocketpp-0.7.0-minor-adjustments-to-recent-extension-negotiation.patch @@ -0,0 +1,146 @@ +diff --git a/websocketpp/impl/connection_impl.hpp b/websocketpp/impl/connection_impl.hpp +index 93a5a16..bf88c95 100644 +--- a/websocketpp/impl/connection_impl.hpp ++++ b/websocketpp/impl/connection_impl.hpp +@@ -1222,17 +1222,17 @@ lib::error_code connection::process_handshake_request() { + std::pair neg_results; + neg_results = m_processor->negotiate_extensions(m_request); + +- if (neg_results.first == error::make_error_code(error::extension_parse_error)) { ++ if (neg_results.first == processor::error::make_error_code(processor::error::extension_parse_error)) { + // There was a fatal error in extension parsing that should result in + // a failed connection attempt. +- m_alog.write(log::alevel::info, "Bad request: " + neg_results.first.message()); ++ m_elog.write(log::elevel::info, "Bad request: " + neg_results.first.message()); + m_response.set_status(http::status_code::bad_request); + return neg_results.first; + } else if (neg_results.first) { + // There was a fatal error in extension processing that is probably our + // fault. Consider extension negotiation to have failed and continue as + // if extensions were not supported +- m_alog.write(log::alevel::info, ++ m_elog.write(log::elevel::info, + "Extension negotiation failed: " + neg_results.first.message()); + } else { + // extension negotiation succeeded, set response header accordingly +diff --git a/websocketpp/processors/hybi13.hpp b/websocketpp/processors/hybi13.hpp +index a95bc64..ca12439 100644 +--- a/websocketpp/processors/hybi13.hpp ++++ b/websocketpp/processors/hybi13.hpp +@@ -97,11 +97,6 @@ public: + /** + * This exists mostly because the code for requests and responses is + * identical and I can't have virtual template methods. +- * +- * NOTE: this method makes assumptions that the permessage-deflate +- * extension is the only one supported. If additional extensions are +- * ever supported it should be reviewed carefully. Most cases where +- * that assumption is made are explicitly noted. + */ + template + err_str_pair negotiate_extensions_helper(header_type const & header) { +@@ -130,55 +125,60 @@ public: + + http::parameter_list::const_iterator it; + ++ // look through the list of extension requests to find the first ++ // one that we can accept. + if (m_permessage_deflate.is_implemented()) { + err_str_pair neg_ret; + for (it = p.begin(); it != p.end(); ++it) { +- // look through each extension, if the key is permessage-deflate +- if (it->first == "permessage-deflate") { +- // if we have already successfully negotiated this extension +- // then skip any other requests to negotiate the same one +- // with different parameters +- if (m_permessage_deflate.is_enabled()) { +- continue; +- } +- +- +- neg_ret = m_permessage_deflate.negotiate(it->second); +- +- if (neg_ret.first) { +- // Figure out if this is an error that should halt all +- // extension negotiations or simply cause negotiation of +- // this specific extension to fail. +- //std::cout << "permessage-compress negotiation failed: " +- // << neg_ret.first.message() << std::endl; +- } else { +- // Note: this list will need commas if WebSocket++ ever +- // supports more than one extension +- +- // Actually try to initialize the extension before we +- // deem negotiation complete +- ret.first = m_permessage_deflate.init(base::m_server); +- if (!ret.first) { +- +- // TODO: support multiple extensions. +- // right now, because there is only one extension +- // supported, it failing to negotiate means we are +- // done with all negotiating. In the future if more +- // extensions are supported a better solution will +- // be needed here. +- break; +- } else { +- ret.second += neg_ret.second; ++ // not a permessage-deflate extension request, ignore ++ if (it->first != "permessage-deflate") { ++ continue; ++ } + +- // continue looking for more extensions +- continue; +- } +- +- } ++ // if we have already successfully negotiated this extension ++ // then skip any other requests to negotiate the same one ++ // with different parameters ++ if (m_permessage_deflate.is_enabled()) { ++ continue; ++ } ++ ++ // attempt to negotiate this offer ++ neg_ret = m_permessage_deflate.negotiate(it->second); ++ ++ if (neg_ret.first) { ++ // negotiation offer failed. Do nothing. We will continue ++ // searching for a permessage-deflate config that succeeds ++ continue; ++ } ++ ++ // Negotiation tentatively succeeded ++ ++ // Actually try to initialize the extension before we ++ // deem negotiation complete ++ lib::error_code ec = m_permessage_deflate.init(base::m_server); ++ ++ if (ec) { ++ // Negotiation succeeded but initialization failed this is ++ // an error that should stop negotiation of permessage ++ // deflate. Return the reason for the init failure ++ ++ ret.first = ec; ++ break; ++ } else { ++ // Successfully initialized, push the negotiated response into ++ // the reply and stop looking for additional permessage-deflate ++ // extensions ++ ret.second += neg_ret.second; ++ break; + } + } + } + ++ // support for future extensions would go here. Should check the value of ++ // ret.first before continuing. Might need to consider whether failure of ++ // negotiation of an earlier extension should stop negotiation of subsequent ++ // ones ++ + return ret; + } + +-- +2.13.0 + diff --git a/websocketpp-0.7.0-zlib-permessage-deflate.patch b/websocketpp-0.7.0-zlib-permessage-deflate.patch new file mode 100644 index 0000000..7d74221 --- /dev/null +++ b/websocketpp-0.7.0-zlib-permessage-deflate.patch @@ -0,0 +1,566 @@ +diff --git a/test/extension/permessage_deflate.cpp b/test/extension/permessage_deflate.cpp +index 4cd3e7b..805afcc 100644 +--- a/test/extension/permessage_deflate.cpp ++++ b/test/extension/permessage_deflate.cpp +@@ -186,15 +186,22 @@ BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_invalid ) { + + BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_valid ) { + ext_vars v; ++ ++ // confirm that a request for a value of 8 is interpreted as 9 + v.attr["server_max_window_bits"] = "8"; ++ v.esp = v.exts.negotiate(v.attr); ++ BOOST_CHECK( v.exts.is_enabled() ); ++ BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); ++ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; server_max_window_bits=9"); + ++ v.attr["server_max_window_bits"] = "9"; + v.esp = v.exts.negotiate(v.attr); + BOOST_CHECK( v.exts.is_enabled() ); + BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); +- BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; server_max_window_bits=8"); ++ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; server_max_window_bits=9"); + +- v.attr["server_max_window_bits"] = "15"; + ++ v.attr["server_max_window_bits"] = "15"; + v.esp = v.exts.negotiate(v.attr); + BOOST_CHECK( v.exts.is_enabled() ); + BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); +@@ -213,7 +220,7 @@ BOOST_AUTO_TEST_CASE( invalid_set_server_max_window_bits ) { + + BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_decline ) { + ext_vars v; +- v.attr["server_max_window_bits"] = "8"; ++ v.attr["server_max_window_bits"] = "9"; + + v.ec = v.exts.set_server_max_window_bits(15,pmd_mode::decline); + v.esp = v.exts.negotiate(v.attr); +@@ -223,7 +230,7 @@ BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_decline ) { + BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate"); + } + +-BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_accept ) { ++BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_accept_8 ) { + ext_vars v; + v.attr["server_max_window_bits"] = "8"; + +@@ -232,10 +239,22 @@ BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_accept ) { + BOOST_CHECK( v.exts.is_enabled() ); + BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); + BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); +- BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; server_max_window_bits=8"); ++ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; server_max_window_bits=9"); + } + +-BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_largest ) { ++BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_accept ) { ++ ext_vars v; ++ v.attr["server_max_window_bits"] = "9"; ++ ++ v.ec = v.exts.set_server_max_window_bits(15,pmd_mode::accept); ++ v.esp = v.exts.negotiate(v.attr); ++ BOOST_CHECK( v.exts.is_enabled() ); ++ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); ++ BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); ++ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; server_max_window_bits=9"); ++} ++ ++BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_largest_8 ) { + ext_vars v; + v.attr["server_max_window_bits"] = "8"; + +@@ -244,10 +263,22 @@ BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_largest ) { + BOOST_CHECK( v.exts.is_enabled() ); + BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); + BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); +- BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; server_max_window_bits=8"); ++ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; server_max_window_bits=9"); + } + +-BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_smallest ) { ++BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_largest ) { ++ ext_vars v; ++ v.attr["server_max_window_bits"] = "9"; ++ ++ v.ec = v.exts.set_server_max_window_bits(15,pmd_mode::largest); ++ v.esp = v.exts.negotiate(v.attr); ++ BOOST_CHECK( v.exts.is_enabled() ); ++ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); ++ BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); ++ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; server_max_window_bits=9"); ++} ++ ++BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_smallest_8 ) { + ext_vars v; + v.attr["server_max_window_bits"] = "8"; + +@@ -256,7 +287,19 @@ BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_smallest ) { + BOOST_CHECK( v.exts.is_enabled() ); + BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); + BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); +- BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; server_max_window_bits=8"); ++ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; server_max_window_bits=9"); ++} ++ ++BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_smallest ) { ++ ext_vars v; ++ v.attr["server_max_window_bits"] = "9"; ++ ++ v.ec = v.exts.set_server_max_window_bits(15,pmd_mode::smallest); ++ v.esp = v.exts.negotiate(v.attr); ++ BOOST_CHECK( v.exts.is_enabled() ); ++ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); ++ BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); ++ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; server_max_window_bits=9"); + } + + // Negotiate server_max_window_bits +@@ -292,7 +335,13 @@ BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_valid ) { + v.esp = v.exts.negotiate(v.attr); + BOOST_CHECK( v.exts.is_enabled() ); + BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); +- BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; client_max_window_bits=8"); ++ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; client_max_window_bits=9"); ++ ++ v.attr["client_max_window_bits"] = "9"; ++ v.esp = v.exts.negotiate(v.attr); ++ BOOST_CHECK( v.exts.is_enabled() ); ++ BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); ++ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; client_max_window_bits=9"); + + v.attr["client_max_window_bits"] = "15"; + v.esp = v.exts.negotiate(v.attr); +@@ -311,7 +360,7 @@ BOOST_AUTO_TEST_CASE( invalid_set_client_max_window_bits ) { + BOOST_CHECK_EQUAL(v.ec,pmde::make_error_code(pmde::invalid_max_window_bits)); + } + +-BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_decline ) { ++BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_decline_8 ) { + ext_vars v; + v.attr["client_max_window_bits"] = "8"; + +@@ -323,7 +372,19 @@ BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_decline ) { + BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate"); + } + +-BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_accept ) { ++BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_decline ) { ++ ext_vars v; ++ v.attr["client_max_window_bits"] = "9"; ++ ++ v.ec = v.exts.set_client_max_window_bits(9,pmd_mode::decline); ++ v.esp = v.exts.negotiate(v.attr); ++ BOOST_CHECK( v.exts.is_enabled() ); ++ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); ++ BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); ++ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate"); ++} ++ ++BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_accept_8 ) { + ext_vars v; + v.attr["client_max_window_bits"] = "8"; + +@@ -332,10 +393,22 @@ BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_accept ) { + BOOST_CHECK( v.exts.is_enabled() ); + BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); + BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); +- BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; client_max_window_bits=8"); ++ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; client_max_window_bits=9"); + } + +-BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_largest ) { ++BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_accept ) { ++ ext_vars v; ++ v.attr["client_max_window_bits"] = "9"; ++ ++ v.ec = v.exts.set_client_max_window_bits(15,pmd_mode::accept); ++ v.esp = v.exts.negotiate(v.attr); ++ BOOST_CHECK( v.exts.is_enabled() ); ++ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); ++ BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); ++ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; client_max_window_bits=9"); ++} ++ ++BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_largest_8 ) { + ext_vars v; + v.attr["client_max_window_bits"] = "8"; + +@@ -344,10 +417,22 @@ BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_largest ) { + BOOST_CHECK( v.exts.is_enabled() ); + BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); + BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); +- BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; client_max_window_bits=8"); ++ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; client_max_window_bits=9"); + } + +-BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_smallest ) { ++BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_largest ) { ++ ext_vars v; ++ v.attr["client_max_window_bits"] = "9"; ++ ++ v.ec = v.exts.set_client_max_window_bits(15,pmd_mode::largest); ++ v.esp = v.exts.negotiate(v.attr); ++ BOOST_CHECK( v.exts.is_enabled() ); ++ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); ++ BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); ++ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; client_max_window_bits=9"); ++} ++ ++BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_smallest_8 ) { + ext_vars v; + v.attr["client_max_window_bits"] = "8"; + +@@ -356,7 +441,19 @@ BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_smallest ) { + BOOST_CHECK( v.exts.is_enabled() ); + BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); + BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); +- BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; client_max_window_bits=8"); ++ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; client_max_window_bits=9"); ++} ++ ++BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_smallest ) { ++ ext_vars v; ++ v.attr["client_max_window_bits"] = "9"; ++ ++ v.ec = v.exts.set_client_max_window_bits(15,pmd_mode::smallest); ++ v.esp = v.exts.negotiate(v.attr); ++ BOOST_CHECK( v.exts.is_enabled() ); ++ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); ++ BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); ++ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; client_max_window_bits=9"); + } + + +@@ -507,7 +604,8 @@ BOOST_AUTO_TEST_CASE( compress_data ) { + std::string compress_out; + std::string decompress_out; + +- v.exts.init(true); ++ v.ec = v.exts.init(true); ++ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); + + v.ec = v.exts.compress(compress_in,compress_out); + BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); +@@ -520,7 +618,8 @@ BOOST_AUTO_TEST_CASE( compress_data ) { + BOOST_AUTO_TEST_CASE( compress_data_multiple ) { + ext_vars v; + +- v.exts.init(true); ++ v.ec = v.exts.init(true); ++ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); + + for (int i = 0; i < 2; i++) { + std::string compress_in = "Hello"; +@@ -545,11 +644,12 @@ BOOST_AUTO_TEST_CASE( compress_data_large ) { + + websocketpp::http::attribute_list alist; + +- alist["server_max_window_bits"] = "8"; +- v.exts.set_server_max_window_bits(8,websocketpp::extensions::permessage_deflate::mode::smallest); ++ alist["server_max_window_bits"] = "9"; ++ v.exts.set_server_max_window_bits(9,websocketpp::extensions::permessage_deflate::mode::smallest); + + v.exts.negotiate(alist); +- v.exts.init(true); ++ v.ec = v.exts.init(true); ++ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); + + v.ec = v.exts.compress(compress_in,compress_out); + BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); +@@ -573,7 +673,8 @@ BOOST_AUTO_TEST_CASE( compress_data_no_context_takeover ) { + v.exts.enable_server_no_context_takeover(); + + v.exts.negotiate(alist); +- v.exts.init(true); ++ v.ec = v.exts.init(true); ++ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); + + v.ec = v.exts.compress(compress_in,compress_out1); + BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); +@@ -609,7 +710,8 @@ BOOST_AUTO_TEST_CASE( compress_empty ) { + std::string compress_out; + std::string decompress_out; + +- v.exts.init(true); ++ v.ec = v.exts.init(true); ++ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); + + v.ec = v.exts.compress(compress_in,compress_out); + BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); +@@ -640,7 +742,8 @@ BOOST_AUTO_TEST_CASE( decompress_data ) { + std::string out; + std::string reference = "Hello"; + +- v.exts.init(true); ++ v.ec = v.exts.init(true); ++ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); + + v.ec = v.exts.decompress(in,11,out); + +diff --git a/websocketpp/extensions/permessage_deflate/enabled.hpp b/websocketpp/extensions/permessage_deflate/enabled.hpp +index 1581f14..f20a1b1 100644 +--- a/websocketpp/extensions/permessage_deflate/enabled.hpp ++++ b/websocketpp/extensions/permessage_deflate/enabled.hpp +@@ -46,7 +46,7 @@ + namespace websocketpp { + namespace extensions { + +-/// Implementation of the draft permessage-deflate WebSocket extension ++/// Implementation of RFC 7692, the permessage-deflate WebSocket extension + /** + * ### permessage-deflate interface + * +@@ -174,18 +174,30 @@ namespace websocketpp { + namespace extensions { + namespace permessage_deflate { + +-/// Default value for server_max_window_bits as defined by draft 17 ++/// Default value for server_max_window_bits as defined by RFC 7692 + static uint8_t const default_server_max_window_bits = 15; +-/// Minimum value for server_max_window_bits as defined by draft 17 ++/// Minimum value for server_max_window_bits as defined by RFC 7692 ++/** ++ * NOTE: A value of 8 is not actually supported by zlib, the deflate ++ * library that WebSocket++ uses. To preserve backwards compatibility ++ * with RFC 7692 and previous versions of the library a value of 8 ++ * is accepted by the library but will always be negotiated as 9. ++ */ + static uint8_t const min_server_max_window_bits = 8; +-/// Maximum value for server_max_window_bits as defined by draft 17 ++/// Maximum value for server_max_window_bits as defined by RFC 7692 + static uint8_t const max_server_max_window_bits = 15; + +-/// Default value for client_max_window_bits as defined by draft 17 ++/// Default value for client_max_window_bits as defined by RFC 7692 + static uint8_t const default_client_max_window_bits = 15; +-/// Minimum value for client_max_window_bits as defined by draft 17 ++/// Minimum value for client_max_window_bits as defined by RFC 7692 ++/** ++ * NOTE: A value of 8 is not actually supported by zlib, the deflate ++ * library that WebSocket++ uses. To preserve backwards compatibility ++ * with RFC 7692 and previous versions of the library a value of 8 ++ * is accepted by the library but will always be negotiated as 9. ++ */ + static uint8_t const min_client_max_window_bits = 8; +-/// Maximum value for client_max_window_bits as defined by draft 17 ++/// Maximum value for client_max_window_bits as defined by RFC 7692 + static uint8_t const max_client_max_window_bits = 15; + + namespace mode { +@@ -372,7 +384,7 @@ public: + /** + * The bits setting is the base 2 logarithm of the maximum window size that + * the server must use to compress outgoing messages. The permitted range +- * is 8 to 15 inclusive. 8 represents a 256 byte window and 15 a 32KiB ++ * is 9 to 15 inclusive. 9 represents a 512 byte window and 15 a 32KiB + * window. The default setting is 15. + * + * Mode Options: +@@ -386,6 +398,14 @@ public: + * adjusted by the server. A server may unilaterally set this value without + * client support. + * ++ * NOTE: The permessage-deflate spec specifies that a value of 8 is allowed. ++ * Prior to version 0.8.0 a value of 8 was also allowed by this library. ++ * zlib, the deflate compression library that WebSocket++ uses has always ++ * silently adjusted a value of 8 to 9. In recent versions of zlib (1.2.9 ++ * and greater) a value of 8 is now explicitly rejected. WebSocket++ 0.8.0 ++ * continues to perform the 8->9 conversion for backwards compatibility ++ * purposes but this should be considered deprecated functionality. ++ * + * @param bits The size to request for the outgoing window size + * @param mode The mode to use for negotiating this parameter + * @return A status code +@@ -394,6 +414,12 @@ public: + if (bits < min_server_max_window_bits || bits > max_server_max_window_bits) { + return error::make_error_code(error::invalid_max_window_bits); + } ++ ++ // See note in doc comment above about what is happening here ++ if (bits == 8) { ++ bits = 9; ++ } ++ + m_server_max_window_bits = bits; + m_server_max_window_bits_mode = mode; + +@@ -403,8 +429,8 @@ public: + /// Limit client LZ77 sliding window size + /** + * The bits setting is the base 2 logarithm of the window size that the +- * client must use to compress outgoing messages. The permitted range is 8 +- * to 15 inclusive. 8 represents a 256 byte window and 15 a 32KiB window. ++ * client must use to compress outgoing messages. The permitted range is 9 ++ * to 15 inclusive. 9 represents a 512 byte window and 15 a 32KiB window. + * The default setting is 15. + * + * Mode Options: +@@ -417,6 +443,14 @@ public: + * outgoing window size unilaterally. A server may only limit the client's + * window size if the remote client supports that feature. + * ++ * NOTE: The permessage-deflate spec specifies that a value of 8 is allowed. ++ * Prior to version 0.8.0 a value of 8 was also allowed by this library. ++ * zlib, the deflate compression library that WebSocket++ uses has always ++ * silently adjusted a value of 8 to 9. In recent versions of zlib (1.2.9 ++ * and greater) a value of 8 is now explicitly rejected. WebSocket++ 0.8.0 ++ * continues to perform the 8->9 conversion for backwards compatibility ++ * purposes but this should be considered deprecated functionality. ++ * + * @param bits The size to request for the outgoing window size + * @param mode The mode to use for negotiating this parameter + * @return A status code +@@ -425,6 +459,12 @@ public: + if (bits < min_client_max_window_bits || bits > max_client_max_window_bits) { + return error::make_error_code(error::invalid_max_window_bits); + } ++ ++ // See note in doc comment above about what is happening here ++ if (bits == 8) { ++ bits = 9; ++ } ++ + m_client_max_window_bits = bits; + m_client_max_window_bits_mode = mode; + +@@ -642,11 +682,17 @@ private: + * client requested that we use. + * + * options: +- * - decline (refuse to use the attribute) +- * - accept (use whatever the client says) +- * - largest (use largest possible value) ++ * - decline (ignore value, offer our default instead) ++ * - accept (use the value requested by the client) ++ * - largest (use largest value acceptable to both) + * - smallest (use smallest possible value) + * ++ * NOTE: As a value of 8 is no longer explicitly supported by zlib but might ++ * be requested for negotiation by an older client/server, if the result of ++ * the negotiation would be to send a value of 8, a value of 9 is offered ++ * instead. This ensures that WebSocket++ will only ever negotiate connections ++ * with compression settings explicitly supported by zlib. ++ * + * @param [in] value The value of the attribute from the offer + * @param [out] ec A reference to the error code to return errors via + */ +@@ -678,6 +724,11 @@ private: + ec = make_error_code(error::invalid_mode); + m_server_max_window_bits = default_server_max_window_bits; + } ++ ++ // See note in doc comment ++ if (m_server_max_window_bits == 8) { ++ m_server_max_window_bits = 9; ++ } + } + + /// Negotiate client_max_window_bits attribute +@@ -687,11 +738,17 @@ private: + * negotiation mode. + * + * options: +- * - decline (refuse to use the attribute) +- * - accept (use whatever the client says) +- * - largest (use largest possible value) ++ * - decline (ignore value, offer our default instead) ++ * - accept (use the value requested by the client) ++ * - largest (use largest value acceptable to both) + * - smallest (use smallest possible value) + * ++ * NOTE: As a value of 8 is no longer explicitly supported by zlib but might ++ * be requested for negotiation by an older client/server, if the result of ++ * the negotiation would be to send a value of 8, a value of 9 is offered ++ * instead. This ensures that WebSocket++ will only ever negotiate connections ++ * with compression settings explicitly supported by zlib. ++ * + * @param [in] value The value of the attribute from the offer + * @param [out] ec A reference to the error code to return errors via + */ +@@ -727,6 +784,11 @@ private: + ec = make_error_code(error::invalid_mode); + m_client_max_window_bits = default_client_max_window_bits; + } ++ ++ // See note in doc comment ++ if (m_client_max_window_bits == 8) { ++ m_client_max_window_bits = 9; ++ } + } + + bool m_enabled; +diff --git a/websocketpp/impl/connection_impl.hpp b/websocketpp/impl/connection_impl.hpp +index 105911d..ae55c33 100644 +--- a/websocketpp/impl/connection_impl.hpp ++++ b/websocketpp/impl/connection_impl.hpp +@@ -1222,12 +1222,18 @@ lib::error_code connection::process_handshake_request() { + std::pair neg_results; + neg_results = m_processor->negotiate_extensions(m_request); + +- if (neg_results.first) { ++ if (neg_results.first == error::make_error_code(error::extension_parse_error)) { + // There was a fatal error in extension parsing that should result in + // a failed connection attempt. +- m_alog.write(log::alevel::devel, "Bad request: " + neg_results.first.message()); ++ m_alog.write(log::alevel::info, "Bad request: " + neg_results.first.message()); + m_response.set_status(http::status_code::bad_request); + return neg_results.first; ++ } else if (neg_results.first) { ++ // There was a fatal error in extension processing that is probably our ++ // fault. Consider extension negotiation to have failed and continue as ++ // if extensions were not supported ++ m_alog.write(log::alevel::info, ++ "Extension negotiation failed: " + neg_results.first.message()); + } else { + // extension negotiation succeeded, set response header accordingly + // we don't send an empty extensions header because it breaks many +diff --git a/websocketpp/processors/hybi13.hpp b/websocketpp/processors/hybi13.hpp +index 7948665..a95bc64 100644 +--- a/websocketpp/processors/hybi13.hpp ++++ b/websocketpp/processors/hybi13.hpp +@@ -97,6 +97,11 @@ public: + /** + * This exists mostly because the code for requests and responses is + * identical and I can't have virtual template methods. ++ * ++ * NOTE: this method makes assumptions that the permessage-deflate ++ * extension is the only one supported. If additional extensions are ++ * ever supported it should be reviewed carefully. Most cases where ++ * that assumption is made are explicitly noted. + */ + template + err_str_pair negotiate_extensions_helper(header_type const & header) { +@@ -149,9 +154,26 @@ public: + } else { + // Note: this list will need commas if WebSocket++ ever + // supports more than one extension +- ret.second += neg_ret.second; +- m_permessage_deflate.init(base::m_server); +- continue; ++ ++ // Actually try to initialize the extension before we ++ // deem negotiation complete ++ ret.first = m_permessage_deflate.init(base::m_server); ++ if (!ret.first) { ++ ++ // TODO: support multiple extensions. ++ // right now, because there is only one extension ++ // supported, it failing to negotiate means we are ++ // done with all negotiating. In the future if more ++ // extensions are supported a better solution will ++ // be needed here. ++ break; ++ } else { ++ ret.second += neg_ret.second; ++ ++ // continue looking for more extensions ++ continue; ++ } ++ + } + } + } +-- +2.13.0 + diff --git a/websocketpp.spec b/websocketpp.spec index 48f8e4a..133e973 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.7.0 -Release: 6%{?dist} +Release: 7%{?dist} License: BSD Url: http://www.zaphoyd.com/websocketpp @@ -17,6 +17,17 @@ Patch1: websocketpp-0.7.0-cmake_noarch.patch # https://github.com/zaphoyd/websocketpp/issues/599 Patch2: websocketpp-0.7.0-openssl11.patch +# Fix build and test failures with zlib 1.2.11. Fixes test_permessage_deflate +# https://github.com/zaphoyd/websocketpp/issues/653 +# Upstream patches, backported to websocketpp-0.7.0 +# https://github.com/zaphoyd/websocketpp/commit/9ddb300d874a30db35e3ad58f188944bef0bf31b +Patch3: websocketpp-0.7.0-zlib-permessage-deflate.patch +# https://github.com/zaphoyd/websocketpp/commit/4cab5e5c0c5f19fcee7d37b4a38b156d63a150d4 +Patch4: websocketpp-0.7.0-minor-adjustments-to-recent-extension-negotiation.patch + +# Disable the following tests, which fail occasionally: test_transport, test_transport_asio_timers +Patch5: websocketpp-0.7.0-disable-test_transport-test_transport_asio_timers.patch + BuildRequires: boost-devel BuildRequires: cmake # needed for tests mostly @@ -63,8 +74,7 @@ rm -rfv %{buildroot}%{_includedir}/test_connection/ %check -# tests non-fatal (for now) -make test -C %{_target_platform} ||: +make test -C %{_target_platform} %files devel @@ -76,6 +86,10 @@ make test -C %{_target_platform} ||: %changelog +* Tue Jun 13 2017 Wolfgang Stöggl - 0.7.0-7 +- Add patches to fix zlib test failure (test_permessage_deflate) +- Disable tests test_transport, test_transport_asio_timers + * Fri May 26 2017 Rex Dieter - 0.7.0-6 - explicitly use openssl-devel (instead of generic 'pkgconfig(openssl)' From 897150634f14e1fb6fc7cab89da55f6e241da64b Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Tue, 4 Jul 2017 13:32:00 +0100 Subject: [PATCH 17/55] Rebuilt for Boost 1.64 --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 133e973..816b2a3 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.7.0 -Release: 7%{?dist} +Release: 8%{?dist} License: BSD Url: http://www.zaphoyd.com/websocketpp @@ -86,6 +86,9 @@ make test -C %{_target_platform} %changelog +* Tue Jul 04 2017 Jonathan Wakely - 0.7.0-8 +- Rebuilt for Boost 1.64 + * Tue Jun 13 2017 Wolfgang Stöggl - 0.7.0-7 - Add patches to fix zlib test failure (test_permessage_deflate) - Disable tests test_transport, test_transport_asio_timers From 1ae9acf38f48b8d94e1f5abb38b85467479454e2 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Wed, 19 Jul 2017 19:07:47 +0100 Subject: [PATCH 18/55] Rebuilt for s390x binutils bug --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 816b2a3..61394f7 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.7.0 -Release: 8%{?dist} +Release: 9%{?dist} License: BSD Url: http://www.zaphoyd.com/websocketpp @@ -86,6 +86,9 @@ make test -C %{_target_platform} %changelog +* Wed Jul 19 2017 Jonathan Wakely - 0.7.0-9 +- Rebuilt for s390x binutils bug + * Tue Jul 04 2017 Jonathan Wakely - 0.7.0-8 - Rebuilt for Boost 1.64 From 68605505419dfa6a64c287a9be4ab7fd3501e28a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 27 Jul 2017 21:33:15 +0000 Subject: [PATCH 19/55] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 61394f7..acd8a1d 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.7.0 -Release: 9%{?dist} +Release: 10%{?dist} License: BSD Url: http://www.zaphoyd.com/websocketpp @@ -86,6 +86,9 @@ make test -C %{_target_platform} %changelog +* Thu Jul 27 2017 Fedora Release Engineering - 0.7.0-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + * Wed Jul 19 2017 Jonathan Wakely - 0.7.0-9 - Rebuilt for s390x binutils bug From 736e3dd4b980a321be0bd473a9cd815c7375c529 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 9 Feb 2018 20:50:47 +0000 Subject: [PATCH 20/55] - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index acd8a1d..f9c769b 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.7.0 -Release: 10%{?dist} +Release: 11%{?dist} License: BSD Url: http://www.zaphoyd.com/websocketpp @@ -86,6 +86,9 @@ make test -C %{_target_platform} %changelog +* Fri Feb 09 2018 Fedora Release Engineering - 0.7.0-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + * Thu Jul 27 2017 Fedora Release Engineering - 0.7.0-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild From 2b7863c36d4ebb6d77687bd86a01b02b1bb3b13f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= Date: Sun, 11 Feb 2018 21:03:33 +0100 Subject: [PATCH 21/55] Rebuilt for Boost 1.66 --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index f9c769b..34dec47 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.7.0 -Release: 11%{?dist} +Release: 12%{?dist} License: BSD Url: http://www.zaphoyd.com/websocketpp @@ -86,6 +86,9 @@ make test -C %{_target_platform} %changelog +* Sun Feb 11 2018 Wolfgang Stöggl - 0.7.0-12 +- Rebuilt for Boost 1.66 + * Fri Feb 09 2018 Fedora Release Engineering - 0.7.0-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild From 1dec616685498b53fff4f6dd7965949a3102b0b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= Date: Fri, 16 Feb 2018 17:56:54 +0100 Subject: [PATCH 22/55] Add BuildRequires: gcc-c++ --- websocketpp.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 34dec47..9f9e840 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.7.0 -Release: 12%{?dist} +Release: 13%{?dist} License: BSD Url: http://www.zaphoyd.com/websocketpp @@ -30,6 +30,7 @@ Patch5: websocketpp-0.7.0-disable-test_transport-test_transport_asio_timers.patc BuildRequires: boost-devel BuildRequires: cmake +BuildRequires: gcc-c++ # needed for tests mostly BuildRequires: openssl-devel BuildRequires: zlib-devel @@ -86,6 +87,9 @@ make test -C %{_target_platform} %changelog +* Fri Feb 16 2018 Wolfgang Stöggl - 0.7.0-13 +- Add BuildRequires: gcc-c++ + * Sun Feb 11 2018 Wolfgang Stöggl - 0.7.0-12 - Rebuilt for Boost 1.66 From d4791a5d31789a7114b4bb533e8943dc65c39914 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 14 Jul 2018 08:47:00 +0000 Subject: [PATCH 23/55] - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 9f9e840..832e35d 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.7.0 -Release: 13%{?dist} +Release: 14%{?dist} License: BSD Url: http://www.zaphoyd.com/websocketpp @@ -87,6 +87,9 @@ make test -C %{_target_platform} %changelog +* Sat Jul 14 2018 Fedora Release Engineering - 0.7.0-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Fri Feb 16 2018 Wolfgang Stöggl - 0.7.0-13 - Add BuildRequires: gcc-c++ From bacc9021ff5e39f4184dc971fa217fe9960f7d47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= Date: Thu, 26 Jul 2018 21:29:50 +0200 Subject: [PATCH 24/55] New upstream version 0.8.1 --- .gitignore | 1 + sources | 2 +- ...ents-to-recent-extension-negotiation.patch | 146 ----- websocketpp-0.7.0-openssl11.patch | 21 - ...cketpp-0.7.0-zlib-permessage-deflate.patch | 566 ------------------ ...ersion-compatibility-anynewerversion.patch | 11 + websocketpp.pc | 4 +- websocketpp.spec | 40 +- 8 files changed, 37 insertions(+), 754 deletions(-) delete mode 100644 websocketpp-0.7.0-minor-adjustments-to-recent-extension-negotiation.patch delete mode 100644 websocketpp-0.7.0-openssl11.patch delete mode 100644 websocketpp-0.7.0-zlib-permessage-deflate.patch create mode 100644 websocketpp-0.8.1-cmake-configversion-compatibility-anynewerversion.patch diff --git a/.gitignore b/.gitignore index c92e440..ca0a2d9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /websocketpp-0.7.0.tar.gz +/websocketpp-0.8.1.tar.gz diff --git a/sources b/sources index ea9d6ad..6af2eff 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -5027c20cde76fdaef83a74acfcf98e23 websocketpp-0.7.0.tar.gz +SHA512 (websocketpp-0.8.1.tar.gz) = 35e0261ed0285acf77d300768819bd380197de8acdf68223e2d7598481b9bfd69cb1653b435139771b1db6c16530c8d8cf9a887a8a6bba3fea126d0da4dbc13c diff --git a/websocketpp-0.7.0-minor-adjustments-to-recent-extension-negotiation.patch b/websocketpp-0.7.0-minor-adjustments-to-recent-extension-negotiation.patch deleted file mode 100644 index 319b601..0000000 --- a/websocketpp-0.7.0-minor-adjustments-to-recent-extension-negotiation.patch +++ /dev/null @@ -1,146 +0,0 @@ -diff --git a/websocketpp/impl/connection_impl.hpp b/websocketpp/impl/connection_impl.hpp -index 93a5a16..bf88c95 100644 ---- a/websocketpp/impl/connection_impl.hpp -+++ b/websocketpp/impl/connection_impl.hpp -@@ -1222,17 +1222,17 @@ lib::error_code connection::process_handshake_request() { - std::pair neg_results; - neg_results = m_processor->negotiate_extensions(m_request); - -- if (neg_results.first == error::make_error_code(error::extension_parse_error)) { -+ if (neg_results.first == processor::error::make_error_code(processor::error::extension_parse_error)) { - // There was a fatal error in extension parsing that should result in - // a failed connection attempt. -- m_alog.write(log::alevel::info, "Bad request: " + neg_results.first.message()); -+ m_elog.write(log::elevel::info, "Bad request: " + neg_results.first.message()); - m_response.set_status(http::status_code::bad_request); - return neg_results.first; - } else if (neg_results.first) { - // There was a fatal error in extension processing that is probably our - // fault. Consider extension negotiation to have failed and continue as - // if extensions were not supported -- m_alog.write(log::alevel::info, -+ m_elog.write(log::elevel::info, - "Extension negotiation failed: " + neg_results.first.message()); - } else { - // extension negotiation succeeded, set response header accordingly -diff --git a/websocketpp/processors/hybi13.hpp b/websocketpp/processors/hybi13.hpp -index a95bc64..ca12439 100644 ---- a/websocketpp/processors/hybi13.hpp -+++ b/websocketpp/processors/hybi13.hpp -@@ -97,11 +97,6 @@ public: - /** - * This exists mostly because the code for requests and responses is - * identical and I can't have virtual template methods. -- * -- * NOTE: this method makes assumptions that the permessage-deflate -- * extension is the only one supported. If additional extensions are -- * ever supported it should be reviewed carefully. Most cases where -- * that assumption is made are explicitly noted. - */ - template - err_str_pair negotiate_extensions_helper(header_type const & header) { -@@ -130,55 +125,60 @@ public: - - http::parameter_list::const_iterator it; - -+ // look through the list of extension requests to find the first -+ // one that we can accept. - if (m_permessage_deflate.is_implemented()) { - err_str_pair neg_ret; - for (it = p.begin(); it != p.end(); ++it) { -- // look through each extension, if the key is permessage-deflate -- if (it->first == "permessage-deflate") { -- // if we have already successfully negotiated this extension -- // then skip any other requests to negotiate the same one -- // with different parameters -- if (m_permessage_deflate.is_enabled()) { -- continue; -- } -- -- -- neg_ret = m_permessage_deflate.negotiate(it->second); -- -- if (neg_ret.first) { -- // Figure out if this is an error that should halt all -- // extension negotiations or simply cause negotiation of -- // this specific extension to fail. -- //std::cout << "permessage-compress negotiation failed: " -- // << neg_ret.first.message() << std::endl; -- } else { -- // Note: this list will need commas if WebSocket++ ever -- // supports more than one extension -- -- // Actually try to initialize the extension before we -- // deem negotiation complete -- ret.first = m_permessage_deflate.init(base::m_server); -- if (!ret.first) { -- -- // TODO: support multiple extensions. -- // right now, because there is only one extension -- // supported, it failing to negotiate means we are -- // done with all negotiating. In the future if more -- // extensions are supported a better solution will -- // be needed here. -- break; -- } else { -- ret.second += neg_ret.second; -+ // not a permessage-deflate extension request, ignore -+ if (it->first != "permessage-deflate") { -+ continue; -+ } - -- // continue looking for more extensions -- continue; -- } -- -- } -+ // if we have already successfully negotiated this extension -+ // then skip any other requests to negotiate the same one -+ // with different parameters -+ if (m_permessage_deflate.is_enabled()) { -+ continue; -+ } -+ -+ // attempt to negotiate this offer -+ neg_ret = m_permessage_deflate.negotiate(it->second); -+ -+ if (neg_ret.first) { -+ // negotiation offer failed. Do nothing. We will continue -+ // searching for a permessage-deflate config that succeeds -+ continue; -+ } -+ -+ // Negotiation tentatively succeeded -+ -+ // Actually try to initialize the extension before we -+ // deem negotiation complete -+ lib::error_code ec = m_permessage_deflate.init(base::m_server); -+ -+ if (ec) { -+ // Negotiation succeeded but initialization failed this is -+ // an error that should stop negotiation of permessage -+ // deflate. Return the reason for the init failure -+ -+ ret.first = ec; -+ break; -+ } else { -+ // Successfully initialized, push the negotiated response into -+ // the reply and stop looking for additional permessage-deflate -+ // extensions -+ ret.second += neg_ret.second; -+ break; - } - } - } - -+ // support for future extensions would go here. Should check the value of -+ // ret.first before continuing. Might need to consider whether failure of -+ // negotiation of an earlier extension should stop negotiation of subsequent -+ // ones -+ - return ret; - } - --- -2.13.0 - diff --git a/websocketpp-0.7.0-openssl11.patch b/websocketpp-0.7.0-openssl11.patch deleted file mode 100644 index 60bc1a4..0000000 --- a/websocketpp-0.7.0-openssl11.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up websocketpp-0.7.0/websocketpp/transport/asio/security/tls.hpp.openssl11 websocketpp-0.7.0/websocketpp/transport/asio/security/tls.hpp ---- websocketpp-0.7.0/websocketpp/transport/asio/security/tls.hpp.openssl11 2016-02-22 07:30:10.000000000 -0600 -+++ websocketpp-0.7.0/websocketpp/transport/asio/security/tls.hpp 2017-05-22 09:49:43.613622484 -0500 -@@ -355,13 +355,17 @@ protected: - template - lib::error_code translate_ec(ErrorCodeType ec) { - if (ec.category() == lib::asio::error::get_ssl_category()) { -+#ifdef SSL_R_SHORT_READ - if (ERR_GET_REASON(ec.value()) == SSL_R_SHORT_READ) { - return make_error_code(transport::error::tls_short_read); - } else { -+#endif - // We know it is a TLS related error, but otherwise don't know - // more. Pass through as TLS generic. - return make_error_code(transport::error::tls_error); -+#ifdef SSL_R_SHORT_READ - } -+#endif - } else { - // We don't know any more information about this error so pass - // through diff --git a/websocketpp-0.7.0-zlib-permessage-deflate.patch b/websocketpp-0.7.0-zlib-permessage-deflate.patch deleted file mode 100644 index 7d74221..0000000 --- a/websocketpp-0.7.0-zlib-permessage-deflate.patch +++ /dev/null @@ -1,566 +0,0 @@ -diff --git a/test/extension/permessage_deflate.cpp b/test/extension/permessage_deflate.cpp -index 4cd3e7b..805afcc 100644 ---- a/test/extension/permessage_deflate.cpp -+++ b/test/extension/permessage_deflate.cpp -@@ -186,15 +186,22 @@ BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_invalid ) { - - BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_valid ) { - ext_vars v; -+ -+ // confirm that a request for a value of 8 is interpreted as 9 - v.attr["server_max_window_bits"] = "8"; -+ v.esp = v.exts.negotiate(v.attr); -+ BOOST_CHECK( v.exts.is_enabled() ); -+ BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); -+ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; server_max_window_bits=9"); - -+ v.attr["server_max_window_bits"] = "9"; - v.esp = v.exts.negotiate(v.attr); - BOOST_CHECK( v.exts.is_enabled() ); - BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); -- BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; server_max_window_bits=8"); -+ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; server_max_window_bits=9"); - -- v.attr["server_max_window_bits"] = "15"; - -+ v.attr["server_max_window_bits"] = "15"; - v.esp = v.exts.negotiate(v.attr); - BOOST_CHECK( v.exts.is_enabled() ); - BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); -@@ -213,7 +220,7 @@ BOOST_AUTO_TEST_CASE( invalid_set_server_max_window_bits ) { - - BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_decline ) { - ext_vars v; -- v.attr["server_max_window_bits"] = "8"; -+ v.attr["server_max_window_bits"] = "9"; - - v.ec = v.exts.set_server_max_window_bits(15,pmd_mode::decline); - v.esp = v.exts.negotiate(v.attr); -@@ -223,7 +230,7 @@ BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_decline ) { - BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate"); - } - --BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_accept ) { -+BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_accept_8 ) { - ext_vars v; - v.attr["server_max_window_bits"] = "8"; - -@@ -232,10 +239,22 @@ BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_accept ) { - BOOST_CHECK( v.exts.is_enabled() ); - BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); - BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); -- BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; server_max_window_bits=8"); -+ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; server_max_window_bits=9"); - } - --BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_largest ) { -+BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_accept ) { -+ ext_vars v; -+ v.attr["server_max_window_bits"] = "9"; -+ -+ v.ec = v.exts.set_server_max_window_bits(15,pmd_mode::accept); -+ v.esp = v.exts.negotiate(v.attr); -+ BOOST_CHECK( v.exts.is_enabled() ); -+ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); -+ BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); -+ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; server_max_window_bits=9"); -+} -+ -+BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_largest_8 ) { - ext_vars v; - v.attr["server_max_window_bits"] = "8"; - -@@ -244,10 +263,22 @@ BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_largest ) { - BOOST_CHECK( v.exts.is_enabled() ); - BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); - BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); -- BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; server_max_window_bits=8"); -+ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; server_max_window_bits=9"); - } - --BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_smallest ) { -+BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_largest ) { -+ ext_vars v; -+ v.attr["server_max_window_bits"] = "9"; -+ -+ v.ec = v.exts.set_server_max_window_bits(15,pmd_mode::largest); -+ v.esp = v.exts.negotiate(v.attr); -+ BOOST_CHECK( v.exts.is_enabled() ); -+ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); -+ BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); -+ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; server_max_window_bits=9"); -+} -+ -+BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_smallest_8 ) { - ext_vars v; - v.attr["server_max_window_bits"] = "8"; - -@@ -256,7 +287,19 @@ BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_smallest ) { - BOOST_CHECK( v.exts.is_enabled() ); - BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); - BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); -- BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; server_max_window_bits=8"); -+ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; server_max_window_bits=9"); -+} -+ -+BOOST_AUTO_TEST_CASE( negotiate_server_max_window_bits_smallest ) { -+ ext_vars v; -+ v.attr["server_max_window_bits"] = "9"; -+ -+ v.ec = v.exts.set_server_max_window_bits(15,pmd_mode::smallest); -+ v.esp = v.exts.negotiate(v.attr); -+ BOOST_CHECK( v.exts.is_enabled() ); -+ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); -+ BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); -+ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; server_max_window_bits=9"); - } - - // Negotiate server_max_window_bits -@@ -292,7 +335,13 @@ BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_valid ) { - v.esp = v.exts.negotiate(v.attr); - BOOST_CHECK( v.exts.is_enabled() ); - BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); -- BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; client_max_window_bits=8"); -+ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; client_max_window_bits=9"); -+ -+ v.attr["client_max_window_bits"] = "9"; -+ v.esp = v.exts.negotiate(v.attr); -+ BOOST_CHECK( v.exts.is_enabled() ); -+ BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); -+ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; client_max_window_bits=9"); - - v.attr["client_max_window_bits"] = "15"; - v.esp = v.exts.negotiate(v.attr); -@@ -311,7 +360,7 @@ BOOST_AUTO_TEST_CASE( invalid_set_client_max_window_bits ) { - BOOST_CHECK_EQUAL(v.ec,pmde::make_error_code(pmde::invalid_max_window_bits)); - } - --BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_decline ) { -+BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_decline_8 ) { - ext_vars v; - v.attr["client_max_window_bits"] = "8"; - -@@ -323,7 +372,19 @@ BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_decline ) { - BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate"); - } - --BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_accept ) { -+BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_decline ) { -+ ext_vars v; -+ v.attr["client_max_window_bits"] = "9"; -+ -+ v.ec = v.exts.set_client_max_window_bits(9,pmd_mode::decline); -+ v.esp = v.exts.negotiate(v.attr); -+ BOOST_CHECK( v.exts.is_enabled() ); -+ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); -+ BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); -+ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate"); -+} -+ -+BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_accept_8 ) { - ext_vars v; - v.attr["client_max_window_bits"] = "8"; - -@@ -332,10 +393,22 @@ BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_accept ) { - BOOST_CHECK( v.exts.is_enabled() ); - BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); - BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); -- BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; client_max_window_bits=8"); -+ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; client_max_window_bits=9"); - } - --BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_largest ) { -+BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_accept ) { -+ ext_vars v; -+ v.attr["client_max_window_bits"] = "9"; -+ -+ v.ec = v.exts.set_client_max_window_bits(15,pmd_mode::accept); -+ v.esp = v.exts.negotiate(v.attr); -+ BOOST_CHECK( v.exts.is_enabled() ); -+ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); -+ BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); -+ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; client_max_window_bits=9"); -+} -+ -+BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_largest_8 ) { - ext_vars v; - v.attr["client_max_window_bits"] = "8"; - -@@ -344,10 +417,22 @@ BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_largest ) { - BOOST_CHECK( v.exts.is_enabled() ); - BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); - BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); -- BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; client_max_window_bits=8"); -+ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; client_max_window_bits=9"); - } - --BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_smallest ) { -+BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_largest ) { -+ ext_vars v; -+ v.attr["client_max_window_bits"] = "9"; -+ -+ v.ec = v.exts.set_client_max_window_bits(15,pmd_mode::largest); -+ v.esp = v.exts.negotiate(v.attr); -+ BOOST_CHECK( v.exts.is_enabled() ); -+ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); -+ BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); -+ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; client_max_window_bits=9"); -+} -+ -+BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_smallest_8 ) { - ext_vars v; - v.attr["client_max_window_bits"] = "8"; - -@@ -356,7 +441,19 @@ BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_smallest ) { - BOOST_CHECK( v.exts.is_enabled() ); - BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); - BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); -- BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; client_max_window_bits=8"); -+ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; client_max_window_bits=9"); -+} -+ -+BOOST_AUTO_TEST_CASE( negotiate_client_max_window_bits_smallest ) { -+ ext_vars v; -+ v.attr["client_max_window_bits"] = "9"; -+ -+ v.ec = v.exts.set_client_max_window_bits(15,pmd_mode::smallest); -+ v.esp = v.exts.negotiate(v.attr); -+ BOOST_CHECK( v.exts.is_enabled() ); -+ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); -+ BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() ); -+ BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; client_max_window_bits=9"); - } - - -@@ -507,7 +604,8 @@ BOOST_AUTO_TEST_CASE( compress_data ) { - std::string compress_out; - std::string decompress_out; - -- v.exts.init(true); -+ v.ec = v.exts.init(true); -+ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); - - v.ec = v.exts.compress(compress_in,compress_out); - BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); -@@ -520,7 +618,8 @@ BOOST_AUTO_TEST_CASE( compress_data ) { - BOOST_AUTO_TEST_CASE( compress_data_multiple ) { - ext_vars v; - -- v.exts.init(true); -+ v.ec = v.exts.init(true); -+ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); - - for (int i = 0; i < 2; i++) { - std::string compress_in = "Hello"; -@@ -545,11 +644,12 @@ BOOST_AUTO_TEST_CASE( compress_data_large ) { - - websocketpp::http::attribute_list alist; - -- alist["server_max_window_bits"] = "8"; -- v.exts.set_server_max_window_bits(8,websocketpp::extensions::permessage_deflate::mode::smallest); -+ alist["server_max_window_bits"] = "9"; -+ v.exts.set_server_max_window_bits(9,websocketpp::extensions::permessage_deflate::mode::smallest); - - v.exts.negotiate(alist); -- v.exts.init(true); -+ v.ec = v.exts.init(true); -+ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); - - v.ec = v.exts.compress(compress_in,compress_out); - BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); -@@ -573,7 +673,8 @@ BOOST_AUTO_TEST_CASE( compress_data_no_context_takeover ) { - v.exts.enable_server_no_context_takeover(); - - v.exts.negotiate(alist); -- v.exts.init(true); -+ v.ec = v.exts.init(true); -+ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); - - v.ec = v.exts.compress(compress_in,compress_out1); - BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); -@@ -609,7 +710,8 @@ BOOST_AUTO_TEST_CASE( compress_empty ) { - std::string compress_out; - std::string decompress_out; - -- v.exts.init(true); -+ v.ec = v.exts.init(true); -+ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); - - v.ec = v.exts.compress(compress_in,compress_out); - BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); -@@ -640,7 +742,8 @@ BOOST_AUTO_TEST_CASE( decompress_data ) { - std::string out; - std::string reference = "Hello"; - -- v.exts.init(true); -+ v.ec = v.exts.init(true); -+ BOOST_CHECK_EQUAL( v.ec, websocketpp::lib::error_code() ); - - v.ec = v.exts.decompress(in,11,out); - -diff --git a/websocketpp/extensions/permessage_deflate/enabled.hpp b/websocketpp/extensions/permessage_deflate/enabled.hpp -index 1581f14..f20a1b1 100644 ---- a/websocketpp/extensions/permessage_deflate/enabled.hpp -+++ b/websocketpp/extensions/permessage_deflate/enabled.hpp -@@ -46,7 +46,7 @@ - namespace websocketpp { - namespace extensions { - --/// Implementation of the draft permessage-deflate WebSocket extension -+/// Implementation of RFC 7692, the permessage-deflate WebSocket extension - /** - * ### permessage-deflate interface - * -@@ -174,18 +174,30 @@ namespace websocketpp { - namespace extensions { - namespace permessage_deflate { - --/// Default value for server_max_window_bits as defined by draft 17 -+/// Default value for server_max_window_bits as defined by RFC 7692 - static uint8_t const default_server_max_window_bits = 15; --/// Minimum value for server_max_window_bits as defined by draft 17 -+/// Minimum value for server_max_window_bits as defined by RFC 7692 -+/** -+ * NOTE: A value of 8 is not actually supported by zlib, the deflate -+ * library that WebSocket++ uses. To preserve backwards compatibility -+ * with RFC 7692 and previous versions of the library a value of 8 -+ * is accepted by the library but will always be negotiated as 9. -+ */ - static uint8_t const min_server_max_window_bits = 8; --/// Maximum value for server_max_window_bits as defined by draft 17 -+/// Maximum value for server_max_window_bits as defined by RFC 7692 - static uint8_t const max_server_max_window_bits = 15; - --/// Default value for client_max_window_bits as defined by draft 17 -+/// Default value for client_max_window_bits as defined by RFC 7692 - static uint8_t const default_client_max_window_bits = 15; --/// Minimum value for client_max_window_bits as defined by draft 17 -+/// Minimum value for client_max_window_bits as defined by RFC 7692 -+/** -+ * NOTE: A value of 8 is not actually supported by zlib, the deflate -+ * library that WebSocket++ uses. To preserve backwards compatibility -+ * with RFC 7692 and previous versions of the library a value of 8 -+ * is accepted by the library but will always be negotiated as 9. -+ */ - static uint8_t const min_client_max_window_bits = 8; --/// Maximum value for client_max_window_bits as defined by draft 17 -+/// Maximum value for client_max_window_bits as defined by RFC 7692 - static uint8_t const max_client_max_window_bits = 15; - - namespace mode { -@@ -372,7 +384,7 @@ public: - /** - * The bits setting is the base 2 logarithm of the maximum window size that - * the server must use to compress outgoing messages. The permitted range -- * is 8 to 15 inclusive. 8 represents a 256 byte window and 15 a 32KiB -+ * is 9 to 15 inclusive. 9 represents a 512 byte window and 15 a 32KiB - * window. The default setting is 15. - * - * Mode Options: -@@ -386,6 +398,14 @@ public: - * adjusted by the server. A server may unilaterally set this value without - * client support. - * -+ * NOTE: The permessage-deflate spec specifies that a value of 8 is allowed. -+ * Prior to version 0.8.0 a value of 8 was also allowed by this library. -+ * zlib, the deflate compression library that WebSocket++ uses has always -+ * silently adjusted a value of 8 to 9. In recent versions of zlib (1.2.9 -+ * and greater) a value of 8 is now explicitly rejected. WebSocket++ 0.8.0 -+ * continues to perform the 8->9 conversion for backwards compatibility -+ * purposes but this should be considered deprecated functionality. -+ * - * @param bits The size to request for the outgoing window size - * @param mode The mode to use for negotiating this parameter - * @return A status code -@@ -394,6 +414,12 @@ public: - if (bits < min_server_max_window_bits || bits > max_server_max_window_bits) { - return error::make_error_code(error::invalid_max_window_bits); - } -+ -+ // See note in doc comment above about what is happening here -+ if (bits == 8) { -+ bits = 9; -+ } -+ - m_server_max_window_bits = bits; - m_server_max_window_bits_mode = mode; - -@@ -403,8 +429,8 @@ public: - /// Limit client LZ77 sliding window size - /** - * The bits setting is the base 2 logarithm of the window size that the -- * client must use to compress outgoing messages. The permitted range is 8 -- * to 15 inclusive. 8 represents a 256 byte window and 15 a 32KiB window. -+ * client must use to compress outgoing messages. The permitted range is 9 -+ * to 15 inclusive. 9 represents a 512 byte window and 15 a 32KiB window. - * The default setting is 15. - * - * Mode Options: -@@ -417,6 +443,14 @@ public: - * outgoing window size unilaterally. A server may only limit the client's - * window size if the remote client supports that feature. - * -+ * NOTE: The permessage-deflate spec specifies that a value of 8 is allowed. -+ * Prior to version 0.8.0 a value of 8 was also allowed by this library. -+ * zlib, the deflate compression library that WebSocket++ uses has always -+ * silently adjusted a value of 8 to 9. In recent versions of zlib (1.2.9 -+ * and greater) a value of 8 is now explicitly rejected. WebSocket++ 0.8.0 -+ * continues to perform the 8->9 conversion for backwards compatibility -+ * purposes but this should be considered deprecated functionality. -+ * - * @param bits The size to request for the outgoing window size - * @param mode The mode to use for negotiating this parameter - * @return A status code -@@ -425,6 +459,12 @@ public: - if (bits < min_client_max_window_bits || bits > max_client_max_window_bits) { - return error::make_error_code(error::invalid_max_window_bits); - } -+ -+ // See note in doc comment above about what is happening here -+ if (bits == 8) { -+ bits = 9; -+ } -+ - m_client_max_window_bits = bits; - m_client_max_window_bits_mode = mode; - -@@ -642,11 +682,17 @@ private: - * client requested that we use. - * - * options: -- * - decline (refuse to use the attribute) -- * - accept (use whatever the client says) -- * - largest (use largest possible value) -+ * - decline (ignore value, offer our default instead) -+ * - accept (use the value requested by the client) -+ * - largest (use largest value acceptable to both) - * - smallest (use smallest possible value) - * -+ * NOTE: As a value of 8 is no longer explicitly supported by zlib but might -+ * be requested for negotiation by an older client/server, if the result of -+ * the negotiation would be to send a value of 8, a value of 9 is offered -+ * instead. This ensures that WebSocket++ will only ever negotiate connections -+ * with compression settings explicitly supported by zlib. -+ * - * @param [in] value The value of the attribute from the offer - * @param [out] ec A reference to the error code to return errors via - */ -@@ -678,6 +724,11 @@ private: - ec = make_error_code(error::invalid_mode); - m_server_max_window_bits = default_server_max_window_bits; - } -+ -+ // See note in doc comment -+ if (m_server_max_window_bits == 8) { -+ m_server_max_window_bits = 9; -+ } - } - - /// Negotiate client_max_window_bits attribute -@@ -687,11 +738,17 @@ private: - * negotiation mode. - * - * options: -- * - decline (refuse to use the attribute) -- * - accept (use whatever the client says) -- * - largest (use largest possible value) -+ * - decline (ignore value, offer our default instead) -+ * - accept (use the value requested by the client) -+ * - largest (use largest value acceptable to both) - * - smallest (use smallest possible value) - * -+ * NOTE: As a value of 8 is no longer explicitly supported by zlib but might -+ * be requested for negotiation by an older client/server, if the result of -+ * the negotiation would be to send a value of 8, a value of 9 is offered -+ * instead. This ensures that WebSocket++ will only ever negotiate connections -+ * with compression settings explicitly supported by zlib. -+ * - * @param [in] value The value of the attribute from the offer - * @param [out] ec A reference to the error code to return errors via - */ -@@ -727,6 +784,11 @@ private: - ec = make_error_code(error::invalid_mode); - m_client_max_window_bits = default_client_max_window_bits; - } -+ -+ // See note in doc comment -+ if (m_client_max_window_bits == 8) { -+ m_client_max_window_bits = 9; -+ } - } - - bool m_enabled; -diff --git a/websocketpp/impl/connection_impl.hpp b/websocketpp/impl/connection_impl.hpp -index 105911d..ae55c33 100644 ---- a/websocketpp/impl/connection_impl.hpp -+++ b/websocketpp/impl/connection_impl.hpp -@@ -1222,12 +1222,18 @@ lib::error_code connection::process_handshake_request() { - std::pair neg_results; - neg_results = m_processor->negotiate_extensions(m_request); - -- if (neg_results.first) { -+ if (neg_results.first == error::make_error_code(error::extension_parse_error)) { - // There was a fatal error in extension parsing that should result in - // a failed connection attempt. -- m_alog.write(log::alevel::devel, "Bad request: " + neg_results.first.message()); -+ m_alog.write(log::alevel::info, "Bad request: " + neg_results.first.message()); - m_response.set_status(http::status_code::bad_request); - return neg_results.first; -+ } else if (neg_results.first) { -+ // There was a fatal error in extension processing that is probably our -+ // fault. Consider extension negotiation to have failed and continue as -+ // if extensions were not supported -+ m_alog.write(log::alevel::info, -+ "Extension negotiation failed: " + neg_results.first.message()); - } else { - // extension negotiation succeeded, set response header accordingly - // we don't send an empty extensions header because it breaks many -diff --git a/websocketpp/processors/hybi13.hpp b/websocketpp/processors/hybi13.hpp -index 7948665..a95bc64 100644 ---- a/websocketpp/processors/hybi13.hpp -+++ b/websocketpp/processors/hybi13.hpp -@@ -97,6 +97,11 @@ public: - /** - * This exists mostly because the code for requests and responses is - * identical and I can't have virtual template methods. -+ * -+ * NOTE: this method makes assumptions that the permessage-deflate -+ * extension is the only one supported. If additional extensions are -+ * ever supported it should be reviewed carefully. Most cases where -+ * that assumption is made are explicitly noted. - */ - template - err_str_pair negotiate_extensions_helper(header_type const & header) { -@@ -149,9 +154,26 @@ public: - } else { - // Note: this list will need commas if WebSocket++ ever - // supports more than one extension -- ret.second += neg_ret.second; -- m_permessage_deflate.init(base::m_server); -- continue; -+ -+ // Actually try to initialize the extension before we -+ // deem negotiation complete -+ ret.first = m_permessage_deflate.init(base::m_server); -+ if (!ret.first) { -+ -+ // TODO: support multiple extensions. -+ // right now, because there is only one extension -+ // supported, it failing to negotiate means we are -+ // done with all negotiating. In the future if more -+ // extensions are supported a better solution will -+ // be needed here. -+ break; -+ } else { -+ ret.second += neg_ret.second; -+ -+ // continue looking for more extensions -+ continue; -+ } -+ - } - } - } --- -2.13.0 - diff --git a/websocketpp-0.8.1-cmake-configversion-compatibility-anynewerversion.patch b/websocketpp-0.8.1-cmake-configversion-compatibility-anynewerversion.patch new file mode 100644 index 0000000..1ddc05c --- /dev/null +++ b/websocketpp-0.8.1-cmake-configversion-compatibility-anynewerversion.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt 2018-07-16 14:40:53.000000000 +0200 ++++ b/CMakeLists.txt 2018-07-26 16:41:28.356321007 +0200 +@@ -268,7 +268,7 @@ + ) + write_basic_package_version_file("${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/websocketpp-configVersion.cmake" + VERSION ${WEBSOCKETPP_VERSION} +- COMPATIBILITY ExactVersion) ++ COMPATIBILITY AnyNewerVersion) + + # Install the websocketpp-config.cmake and websocketpp-configVersion.cmake + install (FILES diff --git a/websocketpp.pc b/websocketpp.pc index 086557b..58f7548 100644 --- a/websocketpp.pc +++ b/websocketpp.pc @@ -4,6 +4,6 @@ includedir=${prefix}/include Name: websocketpp Description: WebSocket API -Version: 0.7.0 -URL: http://www.zaphoyd.com/websocketpp/ +Version: 0.8.1 +URL: https://www.zaphoyd.com/websocketpp/ Cflags: -I${includedir}/ diff --git a/websocketpp.spec b/websocketpp.spec index 832e35d..da7f5bf 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -1,11 +1,11 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library -Version: 0.7.0 -Release: 14%{?dist} +Version: 0.8.1 +Release: 1%{?dist} License: BSD -Url: http://www.zaphoyd.com/websocketpp +Url: https://www.zaphoyd.com/websocketpp Source0: https://github.com/zaphoyd/websocketpp/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: websocketpp.pc BuildArch: noarch @@ -13,31 +13,25 @@ BuildArch: noarch # put cmake files in share/cmake instead of lib/cmake Patch1: websocketpp-0.7.0-cmake_noarch.patch -# make compatible with openssl-1.1.x -# https://github.com/zaphoyd/websocketpp/issues/599 -Patch2: websocketpp-0.7.0-openssl11.patch - -# Fix build and test failures with zlib 1.2.11. Fixes test_permessage_deflate -# https://github.com/zaphoyd/websocketpp/issues/653 -# Upstream patches, backported to websocketpp-0.7.0 -# https://github.com/zaphoyd/websocketpp/commit/9ddb300d874a30db35e3ad58f188944bef0bf31b -Patch3: websocketpp-0.7.0-zlib-permessage-deflate.patch -# https://github.com/zaphoyd/websocketpp/commit/4cab5e5c0c5f19fcee7d37b4a38b156d63a150d4 -Patch4: websocketpp-0.7.0-minor-adjustments-to-recent-extension-negotiation.patch +# Switch from ExactVersion to AnyNewerVersion to improve compatibility +# https://cmake.org/cmake/help/v3.0/module/CMakePackageConfigHelpers.html +# Fixes build failure of tomahawk, which uses "find_package(websocketpp 0.2.99 REQUIRED)" +# PR submitted upstream: https://github.com/zaphoyd/websocketpp/pull/740 +Patch2: websocketpp-0.8.1-cmake-configversion-compatibility-anynewerversion.patch # Disable the following tests, which fail occasionally: test_transport, test_transport_asio_timers -Patch5: websocketpp-0.7.0-disable-test_transport-test_transport_asio_timers.patch +Patch3: websocketpp-0.7.0-disable-test_transport-test_transport_asio_timers.patch BuildRequires: boost-devel BuildRequires: cmake BuildRequires: gcc-c++ # needed for tests mostly -BuildRequires: openssl-devel +BuildRequires: pkgconfig(openssl) BuildRequires: zlib-devel %description WebSocket++ is an open source (BSD license) header only C++ library -that impliments RFC6455 The WebSocket Protocol. It allows integrating +that implements RFC6455 The WebSocket Protocol. It allows integrating WebSocket client and server functionality into C++ programs. It uses interchangeable network transport modules including one based on C++ iostreams and one based on Boost Asio. @@ -47,7 +41,7 @@ Summary: C++ WebSocket Protocol Library Requires: boost-devel %description devel WebSocket++ is an open source (BSD license) header only C++ library -that impliments RFC6455 The WebSocket Protocol. It allows integrating +that implements RFC6455 The WebSocket Protocol. It allows integrating WebSocket client and server functionality into C++ programs. It uses interchangeable network transport modules including one based on C++ iostreams and one based on Boost Asio. @@ -87,6 +81,16 @@ make test -C %{_target_platform} %changelog +* Thu Jul 26 2018 Wolfgang Stöggl - 0.8.1-1 +- New upstream version +- Added websocketpp-0.8.1-cmake-configversion-compatibility-anynewerversion.patch +- The following patches are not needed any more and have been removed: + websocketpp-0.7.0-openssl11.patch + websocketpp-0.7.0-zlib-permessage-deflate.patch + websocketpp-0.7.0-minor-adjustments-to-recent-extension-negotiation.patch +- Switch to pkgconfig(openssl) again +- Update version and URL in websocketpp.pc + * Sat Jul 14 2018 Fedora Release Engineering - 0.7.0-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild From 1e1bda980234632aacbbb31d8aee36bd74fc75f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= Date: Wed, 31 Oct 2018 15:12:55 +0100 Subject: [PATCH 25/55] Disable check for same 32/64bit-ness in websocketpp-configVersion.cmake --- ...e-configversion-compatibility-anynewerversion.patch | 10 +++++++--- websocketpp.spec | 8 +++++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/websocketpp-0.8.1-cmake-configversion-compatibility-anynewerversion.patch b/websocketpp-0.8.1-cmake-configversion-compatibility-anynewerversion.patch index 1ddc05c..983b73d 100644 --- a/websocketpp-0.8.1-cmake-configversion-compatibility-anynewerversion.patch +++ b/websocketpp-0.8.1-cmake-configversion-compatibility-anynewerversion.patch @@ -1,7 +1,11 @@ ---- a/CMakeLists.txt 2018-07-16 14:40:53.000000000 +0200 -+++ b/CMakeLists.txt 2018-07-26 16:41:28.356321007 +0200 -@@ -268,7 +268,7 @@ +--- a/CMakeLists.txt 2018-10-31 13:58:03.000000000 +0100 ++++ b/CMakeLists.txt 2018-10-31 14:21:06.251424022 +0100 +@@ -266,9 +266,11 @@ + INSTALL_DESTINATION "${INSTALL_CMAKE_DIR}" + NO_CHECK_REQUIRED_COMPONENTS_MACRO ) ++# disable check for same 32/64bit-ness in websocketpp-configVersion.cmake by setting CMAKE_SIZEOF_VOID_P ++set (CMAKE_SIZEOF_VOID_P "") write_basic_package_version_file("${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/websocketpp-configVersion.cmake" VERSION ${WEBSOCKETPP_VERSION} - COMPATIBILITY ExactVersion) diff --git a/websocketpp.spec b/websocketpp.spec index da7f5bf..4963033 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.1 -Release: 1%{?dist} +Release: 2%{?dist} License: BSD Url: https://www.zaphoyd.com/websocketpp @@ -17,11 +17,13 @@ Patch1: websocketpp-0.7.0-cmake_noarch.patch # https://cmake.org/cmake/help/v3.0/module/CMakePackageConfigHelpers.html # Fixes build failure of tomahawk, which uses "find_package(websocketpp 0.2.99 REQUIRED)" # PR submitted upstream: https://github.com/zaphoyd/websocketpp/pull/740 +# Disable check for same 32/64bit-ness in websocketpp-configVersion.cmake by setting CMAKE_SIZEOF_VOID_P Patch2: websocketpp-0.8.1-cmake-configversion-compatibility-anynewerversion.patch # Disable the following tests, which fail occasionally: test_transport, test_transport_asio_timers Patch3: websocketpp-0.7.0-disable-test_transport-test_transport_asio_timers.patch + BuildRequires: boost-devel BuildRequires: cmake BuildRequires: gcc-c++ @@ -81,6 +83,10 @@ make test -C %{_target_platform} %changelog +* Wed Oct 31 2018 Wolfgang Stöggl - 0.8.1-2 +- Update websocketpp-0.8.1-cmake-configversion-compatibility-anynewerversion.patch + Disable check for same 32/64bit-ness in websocketpp-configVersion.cmake + * Thu Jul 26 2018 Wolfgang Stöggl - 0.8.1-1 - New upstream version - Added websocketpp-0.8.1-cmake-configversion-compatibility-anynewerversion.patch From 5b5d20d00a9eac053191fc4b0a4f69b7f2ebe220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= Date: Wed, 7 Nov 2018 09:56:20 +0100 Subject: [PATCH 26/55] Add websocketpp.pc to files --- websocketpp.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 4963033..ec91d0e 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.1 -Release: 2%{?dist} +Release: 3%{?dist} License: BSD Url: https://www.zaphoyd.com/websocketpp @@ -18,6 +18,7 @@ Patch1: websocketpp-0.7.0-cmake_noarch.patch # Fixes build failure of tomahawk, which uses "find_package(websocketpp 0.2.99 REQUIRED)" # PR submitted upstream: https://github.com/zaphoyd/websocketpp/pull/740 # Disable check for same 32/64bit-ness in websocketpp-configVersion.cmake by setting CMAKE_SIZEOF_VOID_P +# PR submitted upstream: https://github.com/zaphoyd/websocketpp/pull/770 Patch2: websocketpp-0.8.1-cmake-configversion-compatibility-anynewerversion.patch # Disable the following tests, which fail occasionally: test_transport, test_transport_asio_timers @@ -65,6 +66,8 @@ popd %install make install/fast DESTDIR=%{buildroot} -C %{_target_platform} +mkdir -p %{buildroot}%{_datadir}/pkgconfig +install -m 644 %{SOURCE1} %{buildroot}%{_datadir}/pkgconfig/websocketpp.pc ## unpackaged files rm -rfv %{buildroot}%{_includedir}/test_connection/ @@ -80,9 +83,13 @@ make test -C %{_target_platform} %{_includedir}/websocketpp/ %dir %{_datadir}/cmake/ %{_datadir}/cmake/websocketpp/ +%{_datadir}/pkgconfig/websocketpp.pc %changelog +* Wed Nov 07 2018 Wolfgang Stöggl - 0.8.1-3 +- Add websocketpp.pc to files + * Wed Oct 31 2018 Wolfgang Stöggl - 0.8.1-2 - Update websocketpp-0.8.1-cmake-configversion-compatibility-anynewerversion.patch Disable check for same 32/64bit-ness in websocketpp-configVersion.cmake From 634f53f5930144337d1f84e9863c0888ff2d4ce7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= Date: Wed, 7 Nov 2018 13:50:42 +0100 Subject: [PATCH 27/55] Update version number in CMakeLists.txt to 0.8.1 - Add websocketpp-0.8.1-fix_CMakeLists.txt_version_number.patch --- ....1-fix_CMakeLists.txt_version_number.patch | 22 +++++++++++++++++++ websocketpp.spec | 11 ++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 websocketpp-0.8.1-fix_CMakeLists.txt_version_number.patch diff --git a/websocketpp-0.8.1-fix_CMakeLists.txt_version_number.patch b/websocketpp-0.8.1-fix_CMakeLists.txt_version_number.patch new file mode 100644 index 0000000..bc65efb --- /dev/null +++ b/websocketpp-0.8.1-fix_CMakeLists.txt_version_number.patch @@ -0,0 +1,22 @@ +From 4bccfb04a264704ec9b80ba332ee1cf113ce7f1b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= +Date: Thu, 1 Nov 2018 20:58:10 +0100 +Subject: [PATCH] Update version number in CMakeLists.txt to 0.8.1 + +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2786aba9..2d13117b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -24,7 +24,7 @@ endif () + ############ Project name and version + set (WEBSOCKETPP_MAJOR_VERSION 0) + set (WEBSOCKETPP_MINOR_VERSION 8) +-set (WEBSOCKETPP_PATCH_VERSION 0) ++set (WEBSOCKETPP_PATCH_VERSION 1) + set (WEBSOCKETPP_VERSION ${WEBSOCKETPP_MAJOR_VERSION}.${WEBSOCKETPP_MINOR_VERSION}.${WEBSOCKETPP_PATCH_VERSION}) + + if(POLICY CMP0048) diff --git a/websocketpp.spec b/websocketpp.spec index ec91d0e..c06d663 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.1 -Release: 3%{?dist} +Release: 4%{?dist} License: BSD Url: https://www.zaphoyd.com/websocketpp @@ -24,6 +24,10 @@ Patch2: websocketpp-0.8.1-cmake-configversion-compatibility-anynewerversion.patc # Disable the following tests, which fail occasionally: test_transport, test_transport_asio_timers Patch3: websocketpp-0.7.0-disable-test_transport-test_transport_asio_timers.patch +# Update version number in CMakeLists.txt to 0.8.1 +# Upstream commit: https://github.com/zaphoyd/websocketpp/commit/72e2760 +Patch4: websocketpp-0.8.1-fix_CMakeLists.txt_version_number.patch + BuildRequires: boost-devel BuildRequires: cmake @@ -67,7 +71,7 @@ popd %install make install/fast DESTDIR=%{buildroot} -C %{_target_platform} mkdir -p %{buildroot}%{_datadir}/pkgconfig -install -m 644 %{SOURCE1} %{buildroot}%{_datadir}/pkgconfig/websocketpp.pc +install -p -m 644 %{SOURCE1} %{buildroot}%{_datadir}/pkgconfig/websocketpp.pc ## unpackaged files rm -rfv %{buildroot}%{_includedir}/test_connection/ @@ -87,6 +91,9 @@ make test -C %{_target_platform} %changelog +* Wed Nov 07 2018 Wolfgang Stöggl - 0.8.1-4 +- Add websocketpp-0.8.1-fix_CMakeLists.txt_version_number.patch + * Wed Nov 07 2018 Wolfgang Stöggl - 0.8.1-3 - Add websocketpp.pc to files From ec12af4c1b069ae8ec5294dd700edae2b9cd3e58 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 3 Feb 2019 11:37:38 +0000 Subject: [PATCH 28/55] - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index c06d663..b5bebbc 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.1 -Release: 4%{?dist} +Release: 5%{?dist} License: BSD Url: https://www.zaphoyd.com/websocketpp @@ -91,6 +91,9 @@ make test -C %{_target_platform} %changelog +* Sun Feb 03 2019 Fedora Release Engineering - 0.8.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Wed Nov 07 2018 Wolfgang Stöggl - 0.8.1-4 - Add websocketpp-0.8.1-fix_CMakeLists.txt_version_number.patch From 3a8dd70fc74d6ebcf95446255b90dc8a77a37687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= Date: Mon, 8 Jul 2019 05:50:06 +0200 Subject: [PATCH 29/55] Prepare for Boost 1.70 - Add websocketpp-0.8.1-boost_1.70.patch --- websocketpp-0.8.1-boost_1.70.patch | 139 +++++++++++++++++++++++++++++ websocketpp.spec | 9 +- 2 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 websocketpp-0.8.1-boost_1.70.patch diff --git a/websocketpp-0.8.1-boost_1.70.patch b/websocketpp-0.8.1-boost_1.70.patch new file mode 100644 index 0000000..40ae155 --- /dev/null +++ b/websocketpp-0.8.1-boost_1.70.patch @@ -0,0 +1,139 @@ +From c769c9238ad62178f506038178714a1c35aa2769 Mon Sep 17 00:00:00 2001 +From: Stefan Floeren <42731906+stefan-floeren@users.noreply.github.com> +Date: Tue, 16 Apr 2019 08:38:01 +0200 +Subject: [PATCH 1/2] Replace make_shared with new in some cases + +Replace make_shared for asio types that take a lib::ref as a parameter. +This should fix the ASIO change (boostorg/asio@59066d8) for 1.70, +while keeping it backwards compatible to older boost versions. +--- + websocketpp/transport/asio/connection.hpp | 7 ++++--- + websocketpp/transport/asio/endpoint.hpp | 3 +-- + websocketpp/transport/asio/security/none.hpp | 3 +-- + websocketpp/transport/asio/security/tls.hpp | 3 +-- + 4 files changed, 7 insertions(+), 9 deletions(-) + +diff --git a/websocketpp/transport/asio/connection.hpp b/websocketpp/transport/asio/connection.hpp +index 60f88a79..1ccda8f3 100644 +--- a/websocketpp/transport/asio/connection.hpp ++++ b/websocketpp/transport/asio/connection.hpp +@@ -311,9 +311,10 @@ class connection : public config::socket_type::socket_con_type { + * needed. + */ + timer_ptr set_timer(long duration, timer_handler callback) { +- timer_ptr new_timer = lib::make_shared( +- lib::ref(*m_io_service), +- lib::asio::milliseconds(duration) ++ timer_ptr new_timer( ++ new lib::asio::steady_timer( ++ *m_io_service, ++ lib::asio::milliseconds(duration)) + ); + + if (config::enable_multithreading) { +diff --git a/websocketpp/transport/asio/endpoint.hpp b/websocketpp/transport/asio/endpoint.hpp +index ddab2c74..4b719a97 100644 +--- a/websocketpp/transport/asio/endpoint.hpp ++++ b/websocketpp/transport/asio/endpoint.hpp +@@ -195,8 +195,7 @@ class endpoint : public config::socket_type { + + m_io_service = ptr; + m_external_io_service = true; +- m_acceptor = lib::make_shared( +- lib::ref(*m_io_service)); ++ m_acceptor.reset(new lib::asio::ip::tcp::acceptor(*m_io_service)); + + m_state = READY; + ec = lib::error_code(); +diff --git a/websocketpp/transport/asio/security/none.hpp b/websocketpp/transport/asio/security/none.hpp +index 5c8293db..6c7d3524 100644 +--- a/websocketpp/transport/asio/security/none.hpp ++++ b/websocketpp/transport/asio/security/none.hpp +@@ -168,8 +168,7 @@ class connection : public lib::enable_shared_from_this { + return socket::make_error_code(socket::error::invalid_state); + } + +- m_socket = lib::make_shared( +- lib::ref(*service)); ++ m_socket.reset(new lib::asio::ip::tcp::socket(*service)); + + if (m_socket_init_handler) { + m_socket_init_handler(m_hdl, *m_socket); +diff --git a/websocketpp/transport/asio/security/tls.hpp b/websocketpp/transport/asio/security/tls.hpp +index c76fd9aa..04ac3790 100644 +--- a/websocketpp/transport/asio/security/tls.hpp ++++ b/websocketpp/transport/asio/security/tls.hpp +@@ -193,8 +193,7 @@ class connection : public lib::enable_shared_from_this { + if (!m_context) { + return socket::make_error_code(socket::error::invalid_tls_context); + } +- m_socket = lib::make_shared( +- _WEBSOCKETPP_REF(*service),lib::ref(*m_context)); ++ m_socket.reset(new socket_type(*service, *m_context)); + + if (m_socket_init_handler) { + m_socket_init_handler(m_hdl, get_socket()); + +From f810ca2e800e9b55be41c5911cf1d1185fcd516b Mon Sep 17 00:00:00 2001 +From: Stefan Floeren <42731906+stefan-floeren@users.noreply.github.com> +Date: Wed, 17 Apr 2019 10:06:18 +0000 +Subject: [PATCH 2/2] Fix missed entries; fix testing + +--- + CMakeLists.txt | 2 +- + websocketpp/transport/asio/connection.hpp | 3 +-- + websocketpp/transport/asio/endpoint.hpp | 7 ++----- + 3 files changed, 4 insertions(+), 8 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2786aba9..951de975 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -202,7 +202,7 @@ if (BUILD_TESTS OR BUILD_EXAMPLES) + endif () + + if (NOT Boost_USE_STATIC_LIBS) +- add_definitions (/DBOOST_TEST_DYN_LINK) ++ add_definitions (-DBOOST_TEST_DYN_LINK) + endif () + + set (Boost_FIND_REQUIRED TRUE) +diff --git a/websocketpp/transport/asio/connection.hpp b/websocketpp/transport/asio/connection.hpp +index 1ccda8f3..57dda74a 100644 +--- a/websocketpp/transport/asio/connection.hpp ++++ b/websocketpp/transport/asio/connection.hpp +@@ -462,8 +462,7 @@ class connection : public config::socket_type::socket_con_type { + m_io_service = io_service; + + if (config::enable_multithreading) { +- m_strand = lib::make_shared( +- lib::ref(*io_service)); ++ m_strand.reset(new lib::asio::io_service::strand(*io_service)); + } + + lib::error_code ec = socket_con_type::init_asio(io_service, m_strand, +diff --git a/websocketpp/transport/asio/endpoint.hpp b/websocketpp/transport/asio/endpoint.hpp +index 4b719a97..94509adb 100644 +--- a/websocketpp/transport/asio/endpoint.hpp ++++ b/websocketpp/transport/asio/endpoint.hpp +@@ -687,9 +687,7 @@ class endpoint : public config::socket_type { + * @since 0.3.0 + */ + void start_perpetual() { +- m_work = lib::make_shared( +- lib::ref(*m_io_service) +- ); ++ m_work.reset(new lib::asio::io_service::work(*m_io_service)); + } + + /// Clears the endpoint's perpetual flag, allowing it to exit when empty +@@ -853,8 +851,7 @@ class endpoint : public config::socket_type { + + // Create a resolver + if (!m_resolver) { +- m_resolver = lib::make_shared( +- lib::ref(*m_io_service)); ++ m_resolver.reset(new lib::asio::ip::tcp::resolver(*m_io_service)); + } + + tcon->set_uri(u); diff --git a/websocketpp.spec b/websocketpp.spec index b5bebbc..72958a3 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.1 -Release: 5%{?dist} +Release: 6%{?dist} License: BSD Url: https://www.zaphoyd.com/websocketpp @@ -28,6 +28,9 @@ Patch3: websocketpp-0.7.0-disable-test_transport-test_transport_asio_timers.patc # Upstream commit: https://github.com/zaphoyd/websocketpp/commit/72e2760 Patch4: websocketpp-0.8.1-fix_CMakeLists.txt_version_number.patch +# Upstream PR: https://github.com/zaphoyd/websocketpp/pull/814 +Patch5: websocketpp-0.8.1-boost_1.70.patch + BuildRequires: boost-devel BuildRequires: cmake @@ -91,6 +94,10 @@ make test -C %{_target_platform} %changelog +* Mon Jul 08 2019 Wolfgang Stöggl - 0.8.1-6 +- Prepare for Boost 1.70: + Add websocketpp-0.8.1-boost_1.70.patch + * Sun Feb 03 2019 Fedora Release Engineering - 0.8.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild From 09322b4c2aab7a95a65b8b30d2872618462ecb81 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 27 Jul 2019 03:22:31 +0000 Subject: [PATCH 30/55] - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 72958a3..c673a78 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.1 -Release: 6%{?dist} +Release: 7%{?dist} License: BSD Url: https://www.zaphoyd.com/websocketpp @@ -94,6 +94,9 @@ make test -C %{_target_platform} %changelog +* Sat Jul 27 2019 Fedora Release Engineering - 0.8.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Mon Jul 08 2019 Wolfgang Stöggl - 0.8.1-6 - Prepare for Boost 1.70: Add websocketpp-0.8.1-boost_1.70.patch From 11d8eea513cc4cecf4919b6301ab1775c9bc16d1 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 31 Jan 2020 03:36:03 +0000 Subject: [PATCH 31/55] - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index c673a78..fd2bf77 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.1 -Release: 7%{?dist} +Release: 8%{?dist} License: BSD Url: https://www.zaphoyd.com/websocketpp @@ -94,6 +94,9 @@ make test -C %{_target_platform} %changelog +* Fri Jan 31 2020 Fedora Release Engineering - 0.8.1-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + * Sat Jul 27 2019 Fedora Release Engineering - 0.8.1-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild From 493ba886244daa4a0ee3d0ee2566df42fa2c9f18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= Date: Mon, 20 Apr 2020 21:39:43 +0200 Subject: [PATCH 32/55] New upstream version 0.8.2 - Drop patches (fixed upstream): websocketpp-0.8.1-boost_1.70.patch websocketpp-0.8.1-fix_CMakeLists.txt_version_number.patch --- .gitignore | 1 + sources | 2 +- websocketpp-0.8.1-boost_1.70.patch | 139 ------------------ ....1-fix_CMakeLists.txt_version_number.patch | 22 --- websocketpp.pc | 2 +- websocketpp.spec | 17 +-- 6 files changed, 11 insertions(+), 172 deletions(-) delete mode 100644 websocketpp-0.8.1-boost_1.70.patch delete mode 100644 websocketpp-0.8.1-fix_CMakeLists.txt_version_number.patch diff --git a/.gitignore b/.gitignore index ca0a2d9..8b6b169 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /websocketpp-0.7.0.tar.gz /websocketpp-0.8.1.tar.gz +/websocketpp-0.8.2.tar.gz diff --git a/sources b/sources index 6af2eff..77d9040 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (websocketpp-0.8.1.tar.gz) = 35e0261ed0285acf77d300768819bd380197de8acdf68223e2d7598481b9bfd69cb1653b435139771b1db6c16530c8d8cf9a887a8a6bba3fea126d0da4dbc13c +SHA512 (websocketpp-0.8.2.tar.gz) = b2afc63edb69ce81a3a6c06b3d857b3e8820f0e22300ac32bb20ab30ff07bd58bd5ada3e526ed8ab52de934e0e3a26cad2118b0e68ecf3e5e9e8d7101348fd06 diff --git a/websocketpp-0.8.1-boost_1.70.patch b/websocketpp-0.8.1-boost_1.70.patch deleted file mode 100644 index 40ae155..0000000 --- a/websocketpp-0.8.1-boost_1.70.patch +++ /dev/null @@ -1,139 +0,0 @@ -From c769c9238ad62178f506038178714a1c35aa2769 Mon Sep 17 00:00:00 2001 -From: Stefan Floeren <42731906+stefan-floeren@users.noreply.github.com> -Date: Tue, 16 Apr 2019 08:38:01 +0200 -Subject: [PATCH 1/2] Replace make_shared with new in some cases - -Replace make_shared for asio types that take a lib::ref as a parameter. -This should fix the ASIO change (boostorg/asio@59066d8) for 1.70, -while keeping it backwards compatible to older boost versions. ---- - websocketpp/transport/asio/connection.hpp | 7 ++++--- - websocketpp/transport/asio/endpoint.hpp | 3 +-- - websocketpp/transport/asio/security/none.hpp | 3 +-- - websocketpp/transport/asio/security/tls.hpp | 3 +-- - 4 files changed, 7 insertions(+), 9 deletions(-) - -diff --git a/websocketpp/transport/asio/connection.hpp b/websocketpp/transport/asio/connection.hpp -index 60f88a79..1ccda8f3 100644 ---- a/websocketpp/transport/asio/connection.hpp -+++ b/websocketpp/transport/asio/connection.hpp -@@ -311,9 +311,10 @@ class connection : public config::socket_type::socket_con_type { - * needed. - */ - timer_ptr set_timer(long duration, timer_handler callback) { -- timer_ptr new_timer = lib::make_shared( -- lib::ref(*m_io_service), -- lib::asio::milliseconds(duration) -+ timer_ptr new_timer( -+ new lib::asio::steady_timer( -+ *m_io_service, -+ lib::asio::milliseconds(duration)) - ); - - if (config::enable_multithreading) { -diff --git a/websocketpp/transport/asio/endpoint.hpp b/websocketpp/transport/asio/endpoint.hpp -index ddab2c74..4b719a97 100644 ---- a/websocketpp/transport/asio/endpoint.hpp -+++ b/websocketpp/transport/asio/endpoint.hpp -@@ -195,8 +195,7 @@ class endpoint : public config::socket_type { - - m_io_service = ptr; - m_external_io_service = true; -- m_acceptor = lib::make_shared( -- lib::ref(*m_io_service)); -+ m_acceptor.reset(new lib::asio::ip::tcp::acceptor(*m_io_service)); - - m_state = READY; - ec = lib::error_code(); -diff --git a/websocketpp/transport/asio/security/none.hpp b/websocketpp/transport/asio/security/none.hpp -index 5c8293db..6c7d3524 100644 ---- a/websocketpp/transport/asio/security/none.hpp -+++ b/websocketpp/transport/asio/security/none.hpp -@@ -168,8 +168,7 @@ class connection : public lib::enable_shared_from_this { - return socket::make_error_code(socket::error::invalid_state); - } - -- m_socket = lib::make_shared( -- lib::ref(*service)); -+ m_socket.reset(new lib::asio::ip::tcp::socket(*service)); - - if (m_socket_init_handler) { - m_socket_init_handler(m_hdl, *m_socket); -diff --git a/websocketpp/transport/asio/security/tls.hpp b/websocketpp/transport/asio/security/tls.hpp -index c76fd9aa..04ac3790 100644 ---- a/websocketpp/transport/asio/security/tls.hpp -+++ b/websocketpp/transport/asio/security/tls.hpp -@@ -193,8 +193,7 @@ class connection : public lib::enable_shared_from_this { - if (!m_context) { - return socket::make_error_code(socket::error::invalid_tls_context); - } -- m_socket = lib::make_shared( -- _WEBSOCKETPP_REF(*service),lib::ref(*m_context)); -+ m_socket.reset(new socket_type(*service, *m_context)); - - if (m_socket_init_handler) { - m_socket_init_handler(m_hdl, get_socket()); - -From f810ca2e800e9b55be41c5911cf1d1185fcd516b Mon Sep 17 00:00:00 2001 -From: Stefan Floeren <42731906+stefan-floeren@users.noreply.github.com> -Date: Wed, 17 Apr 2019 10:06:18 +0000 -Subject: [PATCH 2/2] Fix missed entries; fix testing - ---- - CMakeLists.txt | 2 +- - websocketpp/transport/asio/connection.hpp | 3 +-- - websocketpp/transport/asio/endpoint.hpp | 7 ++----- - 3 files changed, 4 insertions(+), 8 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2786aba9..951de975 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -202,7 +202,7 @@ if (BUILD_TESTS OR BUILD_EXAMPLES) - endif () - - if (NOT Boost_USE_STATIC_LIBS) -- add_definitions (/DBOOST_TEST_DYN_LINK) -+ add_definitions (-DBOOST_TEST_DYN_LINK) - endif () - - set (Boost_FIND_REQUIRED TRUE) -diff --git a/websocketpp/transport/asio/connection.hpp b/websocketpp/transport/asio/connection.hpp -index 1ccda8f3..57dda74a 100644 ---- a/websocketpp/transport/asio/connection.hpp -+++ b/websocketpp/transport/asio/connection.hpp -@@ -462,8 +462,7 @@ class connection : public config::socket_type::socket_con_type { - m_io_service = io_service; - - if (config::enable_multithreading) { -- m_strand = lib::make_shared( -- lib::ref(*io_service)); -+ m_strand.reset(new lib::asio::io_service::strand(*io_service)); - } - - lib::error_code ec = socket_con_type::init_asio(io_service, m_strand, -diff --git a/websocketpp/transport/asio/endpoint.hpp b/websocketpp/transport/asio/endpoint.hpp -index 4b719a97..94509adb 100644 ---- a/websocketpp/transport/asio/endpoint.hpp -+++ b/websocketpp/transport/asio/endpoint.hpp -@@ -687,9 +687,7 @@ class endpoint : public config::socket_type { - * @since 0.3.0 - */ - void start_perpetual() { -- m_work = lib::make_shared( -- lib::ref(*m_io_service) -- ); -+ m_work.reset(new lib::asio::io_service::work(*m_io_service)); - } - - /// Clears the endpoint's perpetual flag, allowing it to exit when empty -@@ -853,8 +851,7 @@ class endpoint : public config::socket_type { - - // Create a resolver - if (!m_resolver) { -- m_resolver = lib::make_shared( -- lib::ref(*m_io_service)); -+ m_resolver.reset(new lib::asio::ip::tcp::resolver(*m_io_service)); - } - - tcon->set_uri(u); diff --git a/websocketpp-0.8.1-fix_CMakeLists.txt_version_number.patch b/websocketpp-0.8.1-fix_CMakeLists.txt_version_number.patch deleted file mode 100644 index bc65efb..0000000 --- a/websocketpp-0.8.1-fix_CMakeLists.txt_version_number.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 4bccfb04a264704ec9b80ba332ee1cf113ce7f1b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= -Date: Thu, 1 Nov 2018 20:58:10 +0100 -Subject: [PATCH] Update version number in CMakeLists.txt to 0.8.1 - ---- - CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2786aba9..2d13117b 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -24,7 +24,7 @@ endif () - ############ Project name and version - set (WEBSOCKETPP_MAJOR_VERSION 0) - set (WEBSOCKETPP_MINOR_VERSION 8) --set (WEBSOCKETPP_PATCH_VERSION 0) -+set (WEBSOCKETPP_PATCH_VERSION 1) - set (WEBSOCKETPP_VERSION ${WEBSOCKETPP_MAJOR_VERSION}.${WEBSOCKETPP_MINOR_VERSION}.${WEBSOCKETPP_PATCH_VERSION}) - - if(POLICY CMP0048) diff --git a/websocketpp.pc b/websocketpp.pc index 58f7548..6af5aeb 100644 --- a/websocketpp.pc +++ b/websocketpp.pc @@ -4,6 +4,6 @@ includedir=${prefix}/include Name: websocketpp Description: WebSocket API -Version: 0.8.1 +Version: 0.8.2 URL: https://www.zaphoyd.com/websocketpp/ Cflags: -I${includedir}/ diff --git a/websocketpp.spec b/websocketpp.spec index fd2bf77..4332982 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -1,8 +1,8 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library -Version: 0.8.1 -Release: 8%{?dist} +Version: 0.8.2 +Release: 1%{?dist} License: BSD Url: https://www.zaphoyd.com/websocketpp @@ -24,13 +24,6 @@ Patch2: websocketpp-0.8.1-cmake-configversion-compatibility-anynewerversion.patc # Disable the following tests, which fail occasionally: test_transport, test_transport_asio_timers Patch3: websocketpp-0.7.0-disable-test_transport-test_transport_asio_timers.patch -# Update version number in CMakeLists.txt to 0.8.1 -# Upstream commit: https://github.com/zaphoyd/websocketpp/commit/72e2760 -Patch4: websocketpp-0.8.1-fix_CMakeLists.txt_version_number.patch - -# Upstream PR: https://github.com/zaphoyd/websocketpp/pull/814 -Patch5: websocketpp-0.8.1-boost_1.70.patch - BuildRequires: boost-devel BuildRequires: cmake @@ -94,6 +87,12 @@ make test -C %{_target_platform} %changelog +* Mon Apr 20 2020 Wolfgang Stöggl - 0.8.2-1 +- New upstream version +- Drop patches (fixed upstream): + websocketpp-0.8.1-boost_1.70.patch + websocketpp-0.8.1-fix_CMakeLists.txt_version_number.patch + * Fri Jan 31 2020 Fedora Release Engineering - 0.8.1-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild From ae2f2aec6d1529f710169413577d5eb1725b3d0a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 29 Jul 2020 14:03:37 +0000 Subject: [PATCH 33/55] - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 4332982..2291a56 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.2 -Release: 1%{?dist} +Release: 2%{?dist} License: BSD Url: https://www.zaphoyd.com/websocketpp @@ -87,6 +87,9 @@ make test -C %{_target_platform} %changelog +* Wed Jul 29 2020 Fedora Release Engineering - 0.8.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Mon Apr 20 2020 Wolfgang Stöggl - 0.8.2-1 - New upstream version - Drop patches (fixed upstream): From df654078fc54e6601bf243d6b9afaa08cfe953f3 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 1 Aug 2020 09:38:45 +0000 Subject: [PATCH 34/55] - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- websocketpp.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 2291a56..40c8a29 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.2 -Release: 2%{?dist} +Release: 3%{?dist} License: BSD Url: https://www.zaphoyd.com/websocketpp @@ -87,6 +87,10 @@ make test -C %{_target_platform} %changelog +* Sat Aug 01 2020 Fedora Release Engineering - 0.8.2-3 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Wed Jul 29 2020 Fedora Release Engineering - 0.8.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild From 0d9d25ee517f6dc1a81472582b7aaf8ed4cda935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= Date: Mon, 3 Aug 2020 23:23:40 +0200 Subject: [PATCH 35/55] Fix FTBFS - Use %%cmake_build and %%cmake_install macros to fix FTBFS --- websocketpp.spec | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/websocketpp.spec b/websocketpp.spec index 40c8a29..78c6892 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.2 -Release: 3%{?dist} +Release: 4%{?dist} License: BSD Url: https://www.zaphoyd.com/websocketpp @@ -55,17 +55,12 @@ iostreams and one based on Boost Asio. %build -mkdir %{_target_platform} -pushd %{_target_platform} -%cmake .. \ - -DBUILD_TESTS:BOOL=ON - -make %{?_smp_mflags} -popd +%cmake -DBUILD_TESTS:BOOL=ON +%cmake_build %install -make install/fast DESTDIR=%{buildroot} -C %{_target_platform} +%cmake_install mkdir -p %{buildroot}%{_datadir}/pkgconfig install -p -m 644 %{SOURCE1} %{buildroot}%{_datadir}/pkgconfig/websocketpp.pc @@ -74,7 +69,7 @@ rm -rfv %{buildroot}%{_includedir}/test_connection/ %check -make test -C %{_target_platform} +%ctest %files devel @@ -87,6 +82,9 @@ make test -C %{_target_platform} %changelog +* Mon Aug 03 2020 Wolfgang Stöggl - 0.8.2-4 +- Use %%cmake_build and %%cmake_install macros to fix FTBFS + * Sat Aug 01 2020 Fedora Release Engineering - 0.8.2-3 - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild From 98fea54609832bbc5d610cca41a1199003de6dbf Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 27 Jan 2021 23:25:05 +0000 Subject: [PATCH 36/55] - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 78c6892..723eba2 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.2 -Release: 4%{?dist} +Release: 5%{?dist} License: BSD Url: https://www.zaphoyd.com/websocketpp @@ -82,6 +82,9 @@ rm -rfv %{buildroot}%{_includedir}/test_connection/ %changelog +* Wed Jan 27 2021 Fedora Release Engineering - 0.8.2-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + * Mon Aug 03 2020 Wolfgang Stöggl - 0.8.2-4 - Use %%cmake_build and %%cmake_install macros to fix FTBFS From c359bbe93216aebb353646d11e4fc37e97bbf838 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 23 Jul 2021 20:51:33 +0000 Subject: [PATCH 37/55] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 723eba2..4a846f4 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.2 -Release: 5%{?dist} +Release: 6%{?dist} License: BSD Url: https://www.zaphoyd.com/websocketpp @@ -82,6 +82,9 @@ rm -rfv %{buildroot}%{_includedir}/test_connection/ %changelog +* Fri Jul 23 2021 Fedora Release Engineering - 0.8.2-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Wed Jan 27 2021 Fedora Release Engineering - 0.8.2-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From e72a5da2ea5faf5171c2cc133391168fd4dd90a0 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 22 Jan 2022 04:22:40 +0000 Subject: [PATCH 38/55] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 4a846f4..11423e5 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.2 -Release: 6%{?dist} +Release: 7%{?dist} License: BSD Url: https://www.zaphoyd.com/websocketpp @@ -82,6 +82,9 @@ rm -rfv %{buildroot}%{_includedir}/test_connection/ %changelog +* Sat Jan 22 2022 Fedora Release Engineering - 0.8.2-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Fri Jul 23 2021 Fedora Release Engineering - 0.8.2-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From c5df1fb152e2c5a8da27caf63461a7ee473d5c3d Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 23 Jul 2022 12:19:24 +0000 Subject: [PATCH 39/55] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 11423e5..eaff536 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.2 -Release: 7%{?dist} +Release: 8%{?dist} License: BSD Url: https://www.zaphoyd.com/websocketpp @@ -82,6 +82,9 @@ rm -rfv %{buildroot}%{_includedir}/test_connection/ %changelog +* Sat Jul 23 2022 Fedora Release Engineering - 0.8.2-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Sat Jan 22 2022 Fedora Release Engineering - 0.8.2-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From 5422f128f4fa6a1f3d745eef781737d27c216f46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= Date: Tue, 26 Jul 2022 18:09:13 +0200 Subject: [PATCH 40/55] Fix cmake find boost error - Add patch: websocketpp-0.8.2-fix-cmake-find-boost.patch --- websocketpp-0.8.2-fix-cmake-find-boost.patch | 23 ++++++++++++++++++++ websocketpp.spec | 9 +++++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 websocketpp-0.8.2-fix-cmake-find-boost.patch diff --git a/websocketpp-0.8.2-fix-cmake-find-boost.patch b/websocketpp-0.8.2-fix-cmake-find-boost.patch new file mode 100644 index 0000000..d941e0b --- /dev/null +++ b/websocketpp-0.8.2-fix-cmake-find-boost.patch @@ -0,0 +1,23 @@ +From 3590d77bb9753fbbf076028e2395182ced6466ba Mon Sep 17 00:00:00 2001 +From: Gianfranco Costamagna +Date: Wed, 8 Jan 2020 17:59:48 +0100 +Subject: [PATCH] Fix cmake find boost with version >= 1.71 + +For some reasons "system;thread;random;unit_test_framework" was seen as a single module, because of the quotes. +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2d13117ba..9a46bc10c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -211,7 +211,7 @@ if (BUILD_TESTS OR BUILD_EXAMPLES) + set (Boost_USE_MULTITHREADED TRUE) + set (Boost_ADDITIONAL_VERSIONS "1.39.0" "1.40.0" "1.41.0" "1.42.0" "1.43.0" "1.44.0" "1.46.1") # todo: someone who knows better spesify these! + +- find_package (Boost 1.39.0 COMPONENTS "${WEBSOCKETPP_BOOST_LIBS}") ++ find_package (Boost 1.39.0 COMPONENTS ${WEBSOCKETPP_BOOST_LIBS}) + + if (Boost_FOUND) + # Boost is a project wide global dependency. diff --git a/websocketpp.spec b/websocketpp.spec index eaff536..30ba401 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.2 -Release: 8%{?dist} +Release: 9%{?dist} License: BSD Url: https://www.zaphoyd.com/websocketpp @@ -24,6 +24,10 @@ Patch2: websocketpp-0.8.1-cmake-configversion-compatibility-anynewerversion.patc # Disable the following tests, which fail occasionally: test_transport, test_transport_asio_timers Patch3: websocketpp-0.7.0-disable-test_transport-test_transport_asio_timers.patch +# Fix cmake find boost +# https://github.com/zaphoyd/websocketpp/pull/855 +# https://github.com/zaphoyd/websocketpp/commit/3590d77 +Patch4: websocketpp-0.8.2-fix-cmake-find-boost.patch BuildRequires: boost-devel BuildRequires: cmake @@ -82,6 +86,9 @@ rm -rfv %{buildroot}%{_includedir}/test_connection/ %changelog +* Tue Jul 26 2022 Wolfgang Stöggl - 0.8.2-9 +- Add patch: websocketpp-0.8.2-fix-cmake-find-boost.patch + * Sat Jul 23 2022 Fedora Release Engineering - 0.8.2-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From 487a18e21ff6bde13289f5917f5aa4c9ba89876b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 21 Jan 2023 06:43:25 +0000 Subject: [PATCH 41/55] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 30ba401..10831e4 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.2 -Release: 9%{?dist} +Release: 10%{?dist} License: BSD Url: https://www.zaphoyd.com/websocketpp @@ -86,6 +86,9 @@ rm -rfv %{buildroot}%{_includedir}/test_connection/ %changelog +* Sat Jan 21 2023 Fedora Release Engineering - 0.8.2-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Tue Jul 26 2022 Wolfgang Stöggl - 0.8.2-9 - Add patch: websocketpp-0.8.2-fix-cmake-find-boost.patch From 0ca8b0a8b486c776f6e9843b531762beee1f38ef Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 22 Jul 2023 18:06:12 +0000 Subject: [PATCH 42/55] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 10831e4..ec6bd8d 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.2 -Release: 10%{?dist} +Release: 11%{?dist} License: BSD Url: https://www.zaphoyd.com/websocketpp @@ -86,6 +86,9 @@ rm -rfv %{buildroot}%{_includedir}/test_connection/ %changelog +* Sat Jul 22 2023 Fedora Release Engineering - 0.8.2-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Sat Jan 21 2023 Fedora Release Engineering - 0.8.2-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild From bb984cec36d561a09bc4724aa985c9ac6cd94fe6 Mon Sep 17 00:00:00 2001 From: Christian Birk Date: Sun, 27 Aug 2023 17:11:05 +0200 Subject: [PATCH 43/55] add patch to fix cpp20 compile errors --- websocketpp-0.8.2-cpp20-fixes.patch | 106 ++++++++++++++++++++++++++++ websocketpp.spec | 10 ++- 2 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 websocketpp-0.8.2-cpp20-fixes.patch diff --git a/websocketpp-0.8.2-cpp20-fixes.patch b/websocketpp-0.8.2-cpp20-fixes.patch new file mode 100644 index 0000000..65c2fb8 --- /dev/null +++ b/websocketpp-0.8.2-cpp20-fixes.patch @@ -0,0 +1,106 @@ +From 3197a520eb4c1e4754860441918a5930160373eb Mon Sep 17 00:00:00 2001 +From: Peter Thorson +Date: Tue, 29 Jun 2021 09:13:12 -0500 +Subject: [PATCH] [core] Remove the use of simple template ids as they have + been removed in c++20. + https://timsong-cpp.github.io/cppwp/n4861/diff.cpp17.class#2 references #991 + +--- + websocketpp/endpoint.hpp | 2 +- + websocketpp/logger/basic.hpp | 14 +++++++------- + websocketpp/roles/server_endpoint.hpp | 6 +++--- + 3 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/websocketpp/endpoint.hpp b/websocketpp/endpoint.hpp +index 825eaa46d..10f525689 100644 +--- a/websocketpp/endpoint.hpp ++++ b/websocketpp/endpoint.hpp +@@ -111,7 +111,7 @@ class endpoint : public config::transport_type, public config::endpoint_base { + + + /// Destructor +- ~endpoint() {} ++ ~endpoint() {} + + #ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_ + // no copy constructor because endpoints are not copyable +diff --git a/websocketpp/logger/basic.hpp b/websocketpp/logger/basic.hpp +index 84514130e..4c9d83649 100644 +--- a/websocketpp/logger/basic.hpp ++++ b/websocketpp/logger/basic.hpp +@@ -58,33 +58,33 @@ namespace log { + template + class basic { + public: +- basic(channel_type_hint::value h = ++ basic(channel_type_hint::value h = + channel_type_hint::access) + : m_static_channels(0xffffffff) + , m_dynamic_channels(0) + , m_out(h == channel_type_hint::error ? &std::cerr : &std::cout) {} + +- basic(std::ostream * out) ++ basic(std::ostream * out) + : m_static_channels(0xffffffff) + , m_dynamic_channels(0) + , m_out(out) {} + +- basic(level c, channel_type_hint::value h = ++ basic(level c, channel_type_hint::value h = + channel_type_hint::access) + : m_static_channels(c) + , m_dynamic_channels(0) + , m_out(h == channel_type_hint::error ? &std::cerr : &std::cout) {} + +- basic(level c, std::ostream * out) ++ basic(level c, std::ostream * out) + : m_static_channels(c) + , m_dynamic_channels(0) + , m_out(out) {} + + /// Destructor +- ~basic() {} ++ ~basic() {} + + /// Copy constructor +- basic(basic const & other) ++ basic(basic const & other) + : m_static_channels(other.m_static_channels) + , m_dynamic_channels(other.m_dynamic_channels) + , m_out(other.m_out) +@@ -97,7 +97,7 @@ class basic { + + #ifdef _WEBSOCKETPP_MOVE_SEMANTICS_ + /// Move constructor +- basic(basic && other) ++ basic(basic && other) + : m_static_channels(other.m_static_channels) + , m_dynamic_channels(other.m_dynamic_channels) + , m_out(other.m_out) +diff --git a/websocketpp/roles/server_endpoint.hpp b/websocketpp/roles/server_endpoint.hpp +index 4a5865eff..04fee18f9 100644 +--- a/websocketpp/roles/server_endpoint.hpp ++++ b/websocketpp/roles/server_endpoint.hpp +@@ -75,11 +75,11 @@ class server : public endpoint,config> { + } + + /// Destructor +- ~server() {} ++ ~server() {} + + #ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_ + // no copy constructor because endpoints are not copyable +- server(server &) = delete; ++ server(server &) = delete; + + // no copy assignment operator because endpoints are not copyable + server & operator=(server const &) = delete; +@@ -87,7 +87,7 @@ class server : public endpoint,config> { + + #ifdef _WEBSOCKETPP_MOVE_SEMANTICS_ + /// Move constructor +- server(server && o) : endpoint,config>(std::move(o)) {} ++ server(server && o) : endpoint,config>(std::move(o)) {} + + #ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_ + // no move assignment operator because of const member variables diff --git a/websocketpp.spec b/websocketpp.spec index ec6bd8d..fe1134d 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.2 -Release: 11%{?dist} +Release: 12%{?dist} License: BSD Url: https://www.zaphoyd.com/websocketpp @@ -29,6 +29,11 @@ Patch3: websocketpp-0.7.0-disable-test_transport-test_transport_asio_timers.patc # https://github.com/zaphoyd/websocketpp/commit/3590d77 Patch4: websocketpp-0.8.2-fix-cmake-find-boost.patch +# fix c++20 build error +# https://github.com/zaphoyd/websocketpp/issues/991 +# https://github.com/zaphoyd/websocketpp/commit/3197a520eb4c1e4754860441918a5930160373eb +Patch5: websocketpp-0.8.2-cpp20-fixes.patch + BuildRequires: boost-devel BuildRequires: cmake BuildRequires: gcc-c++ @@ -86,6 +91,9 @@ rm -rfv %{buildroot}%{_includedir}/test_connection/ %changelog +* Sun Aug 27 2023 Christian Birk - 0.8.2-12 +- add patch to fix c++20 compile errors + * Sat Jul 22 2023 Fedora Release Engineering - 0.8.2-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From d708c1d34f31e440d12fde110993352605300279 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 27 Jan 2024 08:35:07 +0000 Subject: [PATCH 44/55] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index fe1134d..7d1bda6 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.2 -Release: 12%{?dist} +Release: 13%{?dist} License: BSD Url: https://www.zaphoyd.com/websocketpp @@ -91,6 +91,9 @@ rm -rfv %{buildroot}%{_includedir}/test_connection/ %changelog +* Sat Jan 27 2024 Fedora Release Engineering - 0.8.2-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Sun Aug 27 2023 Christian Birk - 0.8.2-12 - add patch to fix c++20 compile errors From 1d2e0cf31b9db5ea1faa0d995580ca1bf4b0df7a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 20 Jul 2024 09:14:22 +0000 Subject: [PATCH 45/55] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 7d1bda6..6c5ef56 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.2 -Release: 13%{?dist} +Release: 14%{?dist} License: BSD Url: https://www.zaphoyd.com/websocketpp @@ -91,6 +91,9 @@ rm -rfv %{buildroot}%{_includedir}/test_connection/ %changelog +* Sat Jul 20 2024 Fedora Release Engineering - 0.8.2-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Sat Jan 27 2024 Fedora Release Engineering - 0.8.2-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 908de352bf066ea4d64aa2d09ac0c0fd2c6ae0c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= Date: Wed, 24 Jul 2024 20:53:03 +0200 Subject: [PATCH 46/55] Add dependency on openssl-devel-engine - Add BuildRequires: openssl-devel-engine - Background info: https://fedoraproject.org/wiki/Changes/OpensslDeprecateEngine --- websocketpp.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 6c5ef56..1a32e06 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.2 -Release: 14%{?dist} +Release: 15%{?dist} License: BSD Url: https://www.zaphoyd.com/websocketpp @@ -39,6 +39,7 @@ BuildRequires: cmake BuildRequires: gcc-c++ # needed for tests mostly BuildRequires: pkgconfig(openssl) +BuildRequires: openssl-devel-engine BuildRequires: zlib-devel %description @@ -91,6 +92,9 @@ rm -rfv %{buildroot}%{_includedir}/test_connection/ %changelog +* Wed Jul 24 2024 Wolfgang Stöggl - 0.8.2-15 +- Add dependency on openssl-devel-engine + * Sat Jul 20 2024 Fedora Release Engineering - 0.8.2-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From 19be0bb63661fffc6573d42cee5f703d3b5f3f6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Wed, 4 Sep 2024 22:46:27 +0200 Subject: [PATCH 47/55] convert license to SPDX This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_4 --- websocketpp.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/websocketpp.spec b/websocketpp.spec index 1a32e06..0945129 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,9 +2,10 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.2 -Release: 15%{?dist} +Release: 16%{?dist} -License: BSD +# Automatically converted from old format: BSD - review is highly recommended. +License: LicenseRef-Callaway-BSD Url: https://www.zaphoyd.com/websocketpp Source0: https://github.com/zaphoyd/websocketpp/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: websocketpp.pc @@ -92,6 +93,9 @@ rm -rfv %{buildroot}%{_includedir}/test_connection/ %changelog +* Wed Sep 04 2024 Miroslav Suchý - 0.8.2-16 +- convert license to SPDX + * Wed Jul 24 2024 Wolfgang Stöggl - 0.8.2-15 - Add dependency on openssl-devel-engine From 3240d754139a0cb3a8fc5c512f07c9f0b724c3de Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 19 Jan 2025 14:53:36 +0000 Subject: [PATCH 48/55] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 0945129..ddbd805 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.2 -Release: 16%{?dist} +Release: 17%{?dist} # Automatically converted from old format: BSD - review is highly recommended. License: LicenseRef-Callaway-BSD @@ -93,6 +93,9 @@ rm -rfv %{buildroot}%{_includedir}/test_connection/ %changelog +* Sun Jan 19 2025 Fedora Release Engineering - 0.8.2-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Wed Sep 04 2024 Miroslav Suchý - 0.8.2-16 - convert license to SPDX From e56e25ceb064462bbed823974406743eaf4f2278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= Date: Fri, 18 Jul 2025 19:01:28 +0200 Subject: [PATCH 49/55] Fix CMake 4.0 FTBFS (#2381633) - Add patch: websocketpp-0.8.2-cmake40.patch --- websocketpp-0.8.2-cmake40.patch | 23 +++++++++++++++++++++++ websocketpp.spec | 10 +++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 websocketpp-0.8.2-cmake40.patch diff --git a/websocketpp-0.8.2-cmake40.patch b/websocketpp-0.8.2-cmake40.patch new file mode 100644 index 0000000..9badaeb --- /dev/null +++ b/websocketpp-0.8.2-cmake40.patch @@ -0,0 +1,23 @@ +From deb0a334471362608958ce59a6b0bcd3e5b73c24 Mon Sep 17 00:00:00 2001 +From: Alexander Bock +Date: Mon, 31 Mar 2025 22:04:07 +0200 +Subject: [PATCH] Update minimum required CMake version to comply with CMake + 4.0 + +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4f93e243a..92990c7dc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,7 +2,7 @@ + ############ Setup project and cmake + # Minimum cmake requirement. We should require a quite recent + # cmake for the dependency find macros etc. to be up to date. +-cmake_minimum_required (VERSION 2.8.8) ++cmake_minimum_required (VERSION 3.10) + + ############ Paths + diff --git a/websocketpp.spec b/websocketpp.spec index ddbd805..f6ba80f 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.2 -Release: 17%{?dist} +Release: 18%{?dist} # Automatically converted from old format: BSD - review is highly recommended. License: LicenseRef-Callaway-BSD @@ -35,6 +35,10 @@ Patch4: websocketpp-0.8.2-fix-cmake-find-boost.patch # https://github.com/zaphoyd/websocketpp/commit/3197a520eb4c1e4754860441918a5930160373eb Patch5: websocketpp-0.8.2-cpp20-fixes.patch +# Update minimum required CMake version to comply with CMake 4.0 +# https://github.com/zaphoyd/websocketpp/commit/deb0a334471362608958ce59a6b0bcd3e5b73c24 +Patch6: websocketpp-0.8.2-cmake40.patch + BuildRequires: boost-devel BuildRequires: cmake BuildRequires: gcc-c++ @@ -93,6 +97,10 @@ rm -rfv %{buildroot}%{_includedir}/test_connection/ %changelog +* Fri Jul 18 2025 Wolfgang Stöggl - 0.8.2-18 +- Add patch: websocketpp-0.8.2-cmake40.patch +- Fix CMake 4.0 FTBFS #2381633 + * Sun Jan 19 2025 Fedora Release Engineering - 0.8.2-17 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From 162b4de1fab6cfcb41179207790ae2325a5e2fed Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 20:21:33 +0000 Subject: [PATCH 50/55] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index f6ba80f..4311a15 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.2 -Release: 18%{?dist} +Release: 19%{?dist} # Automatically converted from old format: BSD - review is highly recommended. License: LicenseRef-Callaway-BSD @@ -97,6 +97,9 @@ rm -rfv %{buildroot}%{_includedir}/test_connection/ %changelog +* Fri Jul 25 2025 Fedora Release Engineering - 0.8.2-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Fri Jul 18 2025 Wolfgang Stöggl - 0.8.2-18 - Add patch: websocketpp-0.8.2-cmake40.patch - Fix CMake 4.0 FTBFS #2381633 From 0d7451f3134e69dff537f2e8f4eaa051ea5ea054 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 17 Jan 2026 20:10:55 +0000 Subject: [PATCH 51/55] Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 4311a15..2378d2e 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -2,7 +2,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: 0.8.2 -Release: 19%{?dist} +Release: 20%{?dist} # Automatically converted from old format: BSD - review is highly recommended. License: LicenseRef-Callaway-BSD @@ -97,6 +97,9 @@ rm -rfv %{buildroot}%{_includedir}/test_connection/ %changelog +* Sat Jan 17 2026 Fedora Release Engineering - 0.8.2-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild + * Fri Jul 25 2025 Fedora Release Engineering - 0.8.2-19 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From eef43b4393b37474e8247ee7b613b3680625b716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= Date: Tue, 27 Jan 2026 19:25:34 +0100 Subject: [PATCH 52/55] Update to post-release git snapshot on 0.8.2 Use commit b9aeec6 from websocketpp develop branch, in order to allow building with Boost 1.90 using an upstream patch from PR https://github.com/zaphoyd/websocketpp/pull/1164 - Add patch: websocketpp-0.8.2-compatibility_fixes_for_boost_1.87.patch, which fixes FTBFS with Boost 1.90 - Update cmake_noarch patch - Drop patches: websocketpp-0.8.2-fix-cmake-find-boost.patch websocketpp-0.8.2-cpp20-fixes.patch websocketpp-0.8.2-cmake40.patch --- .gitignore | 1 + sources | 2 +- websocketpp-0.7.0-cmake_noarch.patch | 12 - websocketpp-0.8.2-cmake40.patch | 23 - ...2-compatibility_fixes_for_boost_1.87.patch | 2610 +++++++++++++++++ websocketpp-0.8.2-cpp20-fixes.patch | 106 - websocketpp-0.8.2-fix-cmake-find-boost.patch | 23 - websocketpp-0.8.3-cmake_noarch.patch | 11 + websocketpp.spec | 46 +- 9 files changed, 2653 insertions(+), 181 deletions(-) delete mode 100644 websocketpp-0.7.0-cmake_noarch.patch delete mode 100644 websocketpp-0.8.2-cmake40.patch create mode 100644 websocketpp-0.8.2-compatibility_fixes_for_boost_1.87.patch delete mode 100644 websocketpp-0.8.2-cpp20-fixes.patch delete mode 100644 websocketpp-0.8.2-fix-cmake-find-boost.patch create mode 100644 websocketpp-0.8.3-cmake_noarch.patch diff --git a/.gitignore b/.gitignore index 8b6b169..f7d1703 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /websocketpp-0.7.0.tar.gz /websocketpp-0.8.1.tar.gz /websocketpp-0.8.2.tar.gz +/websocketpp-b9aeec6eaf3d5610503439b4fae3581d9aff08e8.tar.gz diff --git a/sources b/sources index 77d9040..e01aaab 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (websocketpp-0.8.2.tar.gz) = b2afc63edb69ce81a3a6c06b3d857b3e8820f0e22300ac32bb20ab30ff07bd58bd5ada3e526ed8ab52de934e0e3a26cad2118b0e68ecf3e5e9e8d7101348fd06 +SHA512 (websocketpp-b9aeec6eaf3d5610503439b4fae3581d9aff08e8.tar.gz) = 5449a10086c1b80d0d2865bac90539f64613156050816e97a2da1a2bc1f6710ac72305747e839a13e49b2ce1b25610480c110743aef60d7d148f2c39339289c4 diff --git a/websocketpp-0.7.0-cmake_noarch.patch b/websocketpp-0.7.0-cmake_noarch.patch deleted file mode 100644 index 0a85d82..0000000 --- a/websocketpp-0.7.0-cmake_noarch.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up websocketpp-0.7.0/CMakeLists.txt.cmake_noarch websocketpp-0.7.0/CMakeLists.txt ---- websocketpp-0.7.0/CMakeLists.txt.cmake_noarch 2016-02-22 07:30:10.000000000 -0600 -+++ websocketpp-0.7.0/CMakeLists.txt 2016-09-15 13:05:59.012179625 -0500 -@@ -19,7 +19,7 @@ set(INSTALL_INCLUDE_DIR include CACHE PA - if (WIN32 AND NOT CYGWIN) - set (DEF_INSTALL_CMAKE_DIR cmake) - else () -- set (DEF_INSTALL_CMAKE_DIR lib/cmake/websocketpp) -+ set (DEF_INSTALL_CMAKE_DIR share/cmake/websocketpp) - endif () - set (INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files") - diff --git a/websocketpp-0.8.2-cmake40.patch b/websocketpp-0.8.2-cmake40.patch deleted file mode 100644 index 9badaeb..0000000 --- a/websocketpp-0.8.2-cmake40.patch +++ /dev/null @@ -1,23 +0,0 @@ -From deb0a334471362608958ce59a6b0bcd3e5b73c24 Mon Sep 17 00:00:00 2001 -From: Alexander Bock -Date: Mon, 31 Mar 2025 22:04:07 +0200 -Subject: [PATCH] Update minimum required CMake version to comply with CMake - 4.0 - ---- - CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4f93e243a..92990c7dc 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -2,7 +2,7 @@ - ############ Setup project and cmake - # Minimum cmake requirement. We should require a quite recent - # cmake for the dependency find macros etc. to be up to date. --cmake_minimum_required (VERSION 2.8.8) -+cmake_minimum_required (VERSION 3.10) - - ############ Paths - diff --git a/websocketpp-0.8.2-compatibility_fixes_for_boost_1.87.patch b/websocketpp-0.8.2-compatibility_fixes_for_boost_1.87.patch new file mode 100644 index 0000000..d53f067 --- /dev/null +++ b/websocketpp-0.8.2-compatibility_fixes_for_boost_1.87.patch @@ -0,0 +1,2610 @@ +From 146925c2404655dbb61b9a18e57692bfc18eb6c6 Mon Sep 17 00:00:00 2001 +From: Amini Allight +Date: Wed, 12 Feb 2025 03:53:35 +0000 +Subject: [PATCH 1/8] fixed incompatibility with Boost 1.87 due to use of + previously-deprecated now-removed functionality + +--- + SConstruct | 4 +- + docs/faq.dox | 12 +- + .../broadcast_server/broadcast_server.cpp | 2 +- + examples/debug_client/debug_client.cpp | 2 +- + examples/debug_server/debug_server.cpp | 2 +- + examples/echo_client/echo_client.cpp | 2 +- + examples/echo_server/echo_server.cpp | 2 +- + .../echo_server_both/echo_server_both.cpp | 8 +- + examples/echo_server_tls/echo_server_tls.cpp | 2 +- + .../CMakeLists.txt | 2 +- + .../SConscript | 4 +- + .../external_io_context.cpp} | 14 +- + .../tcp_echo_server.hpp | 12 +- + examples/print_client/print_client.cpp | 2 +- + .../print_client_tls/print_client_tls.cpp | 2 +- + examples/scratch_server/scratch_server.cpp | 2 +- + examples/sip_client/sip_client.cpp | 2 +- + .../telemetry_client/telemetry_client.cpp | 4 +- + .../telemetry_server/telemetry_server.cpp | 2 +- + examples/testee_client/testee_client.cpp | 2 +- + examples/testee_server/testee_server.cpp | 2 +- + test/endpoint/endpoint.cpp | 6 +- + test/transport/asio/timers.cpp | 8 +- + test/transport/integration.cpp | 27 ++- + tutorials/utility_server/step1.cpp | 2 +- + tutorials/utility_server/step2.cpp | 2 +- + tutorials/utility_server/utility_server.md | 8 +- + websocketpp/roles/server_endpoint.hpp | 4 +- + websocketpp/transport/asio/base.hpp | 2 +- + websocketpp/transport/asio/connection.hpp | 44 ++--- + websocketpp/transport/asio/endpoint.hpp | 186 +++++++++--------- + websocketpp/transport/asio/security/none.hpp | 16 +- + websocketpp/transport/asio/security/tls.hpp | 20 +- + websocketpp/transport/debug/endpoint.hpp | 2 +- + websocketpp/transport/iostream/endpoint.hpp | 2 +- + websocketpp/transport/stub/endpoint.hpp | 2 +- + 36 files changed, 207 insertions(+), 210 deletions(-) + rename examples/{external_io_service => external_io_context}/CMakeLists.txt (87%) + rename examples/{external_io_service => external_io_context}/SConscript (72%) + rename examples/{external_io_service/external_io_service.cpp => external_io_context/external_io_context.cpp} (93%) + rename examples/{external_io_service => external_io_context}/tcp_echo_server.hpp (92%) + +diff --git a/SConstruct b/SConstruct +index c5ae19369..f87e4e8b9 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -273,8 +273,8 @@ subprotocol_server = SConscript('#/examples/subprotocol_server/SConscript',varia + # telemetry_server + telemetry_server = SConscript('#/examples/telemetry_server/SConscript',variant_dir = builddir + 'telemetry_server',duplicate = 0) + +-# external_io_service +-external_io_service = SConscript('#/examples/external_io_service/SConscript',variant_dir = builddir + 'external_io_service',duplicate = 0) ++# external_io_context ++external_io_context = SConscript('#/examples/external_io_context/SConscript',variant_dir = builddir + 'external_io_context',duplicate = 0) + + if not env['PLATFORM'].startswith('win'): + # iostream_server +diff --git a/docs/faq.dox b/docs/faq.dox +index 9f417ec41..c89e85b61 100644 +--- a/docs/faq.dox ++++ b/docs/faq.dox +@@ -29,19 +29,19 @@ Note: some browsers will allow the connection to continue if they requested a su + + ### How do I cleanly exit an Asio transport based program + +-The Asio transport based clients and servers use the Asio library's underlying `io_service` to handle asyncronous networking operations. The standard behavior of the io_service is to run until there are no async operations left and then return. WebSocket++, when using the Asio transport, behaves like a standard Asio application. If you want your WebSocket++/Asio based program to stop network operations and cleanly close all sockets you will want to do the following: ++The Asio transport based clients and servers use the Asio library's underlying `io_context` to handle asyncronous networking operations. The standard behavior of the io_context is to run until there are no async operations left and then return. WebSocket++, when using the Asio transport, behaves like a standard Asio application. If you want your WebSocket++/Asio based program to stop network operations and cleanly close all sockets you will want to do the following: + + - For servers, call `websocketpp::transport::asio::endpoint::stop_listening` to initiate the closing of the server listening socket. + - For clients, if you have engaged perpetual mode with `websocketpp::transport::asio::endpoint::start_perpetual`, disable it with `websocketpp::transport::asio::endpoint::stop_perpetual`. + - For both, run `websocketpp::endpoint::close` or `websocketpp::connection::close` on all currently outstanding connections. This will initiate the WebSocket closing handshake for these connections +-- Wait. Asio is asyncronous. When the calls to the above methods (stop_listening, close, etc) complete the server *will still be listening*, the connections *will still be active* until the io_service gets around to asyncronously processing the socket and WebSocket protocol closing handshakes. The `io_service::run` method will exit cleanly and automatically when all operations are complete. ++- Wait. Asio is asyncronous. When the calls to the above methods (stop_listening, close, etc) complete the server *will still be listening*, the connections *will still be active* until the io_context gets around to asyncronously processing the socket and WebSocket protocol closing handshakes. The `io_context::run` method will exit cleanly and automatically when all operations are complete. + +-__WARNING__: Asio's `io_service` has a method called `stop`. WebSocket++ wraps this method as `websocketpp::transport::asio::endpoint::stop`. While this operation has a benign sounding name, it is a powerful and destructive operation that should only be used in special cases. If you are using `io_service::stop` or `endpoint::stop` without a very good reason your program is likely broken and may exhibit erratic behavior. Specifically, `io_service::stop` stops the processing of events entirely. This does not give current operations (such as socket closing handshakes) the opportunity to finish. It will leave your sockets in a dangling state that may invoke operating system level timeouts or other errors. ++__WARNING__: Asio's `io_context` has a method called `stop`. WebSocket++ wraps this method as `websocketpp::transport::asio::endpoint::stop`. While this operation has a benign sounding name, it is a powerful and destructive operation that should only be used in special cases. If you are using `io_context::stop` or `endpoint::stop` without a very good reason your program is likely broken and may exhibit erratic behavior. Specifically, `io_context::stop` stops the processing of events entirely. This does not give current operations (such as socket closing handshakes) the opportunity to finish. It will leave your sockets in a dangling state that may invoke operating system level timeouts or other errors. + + __Special cases__: +-- If your client uses the `start_perpetual` method it will prevent the io_service from exiting even if it has nothing to do. This is useful if you want a client endpoint to idle in the background to allow new connections to be formed on demand rather than generating a new endpoint for each. +-- If you are using an external io_service and/or are placing non-WebSocket++ operations on the `io_service` those operations may keep the `io_service` open even after all WebSocket++ operations have completed. +-- If you are using `poll`/`poll_one`/`run_one` or otherwise manually driving the `io_service` event loop you may need to adjust usage to make sure you are correctly recognizing the "done with work" and "not done but idling / `io_service::work`" cases. ++- If your client uses the `start_perpetual` method it will prevent the io_context from exiting even if it has nothing to do. This is useful if you want a client endpoint to idle in the background to allow new connections to be formed on demand rather than generating a new endpoint for each. ++- If you are using an external io_context and/or are placing non-WebSocket++ operations on the `io_context` those operations may keep the `io_context` open even after all WebSocket++ operations have completed. ++- If you are using `poll`/`poll_one`/`run_one` or otherwise manually driving the `io_context` event loop you may need to adjust usage to make sure you are correctly recognizing the "done with work" and "not done but idling / `io_context::work`" cases. + + ### Is there a way to check the validity of a `connection_hdl`? + +diff --git a/examples/broadcast_server/broadcast_server.cpp b/examples/broadcast_server/broadcast_server.cpp +index 35976d35a..efdd4edd4 100644 +--- a/examples/broadcast_server/broadcast_server.cpp ++++ b/examples/broadcast_server/broadcast_server.cpp +@@ -75,7 +75,7 @@ class broadcast_server { + return; + } + +- // Start the ASIO io_service run loop ++ // Start the ASIO io_context run loop + //try { + m_server.run(); + //} catch (const std::exception & e) { +diff --git a/examples/debug_client/debug_client.cpp b/examples/debug_client/debug_client.cpp +index 457c24934..81c595b99 100644 +--- a/examples/debug_client/debug_client.cpp ++++ b/examples/debug_client/debug_client.cpp +@@ -82,7 +82,7 @@ class perftest { + + m_endpoint.connect(con); + +- // Start the ASIO io_service run loop ++ // Start the ASIO io_context run loop + m_start = std::chrono::high_resolution_clock::now(); + m_endpoint.run(); + } +diff --git a/examples/debug_server/debug_server.cpp b/examples/debug_server/debug_server.cpp +index 8d1ff0ee6..3748800b5 100644 +--- a/examples/debug_server/debug_server.cpp ++++ b/examples/debug_server/debug_server.cpp +@@ -162,7 +162,7 @@ int main() { + // Start the server accept loop + echo_server.start_accept(); + +- // Start the ASIO io_service run loop ++ // Start the ASIO io_context run loop + echo_server.run(); + } catch (websocketpp::exception const & e) { + std::cout << e.what() << std::endl; +diff --git a/examples/echo_client/echo_client.cpp b/examples/echo_client/echo_client.cpp +index 59af6614f..88171d9fc 100644 +--- a/examples/echo_client/echo_client.cpp ++++ b/examples/echo_client/echo_client.cpp +@@ -87,7 +87,7 @@ int main(int argc, char* argv[]) { + // exchanged until the event loop starts running in the next line. + c.connect(con); + +- // Start the ASIO io_service run loop ++ // Start the ASIO io_context run loop + // this will cause a single connection to be made to the server. c.run() + // will exit when this connection is closed. + c.run(); +diff --git a/examples/echo_server/echo_server.cpp b/examples/echo_server/echo_server.cpp +index aca3f6a9a..2eb3634d8 100644 +--- a/examples/echo_server/echo_server.cpp ++++ b/examples/echo_server/echo_server.cpp +@@ -62,7 +62,7 @@ int main() { + // Start the server accept loop + echo_server.start_accept(&on_end_accept); + +- // Start the ASIO io_service run loop ++ // Start the ASIO io_context run loop + echo_server.run(); + } catch (websocketpp::exception const & e) { + std::cout << e.what() << std::endl; +diff --git a/examples/echo_server_both/echo_server_both.cpp b/examples/echo_server_both/echo_server_both.cpp +index 06b50514a..a7e020401 100644 +--- a/examples/echo_server_both/echo_server_both.cpp ++++ b/examples/echo_server_both/echo_server_both.cpp +@@ -65,13 +65,13 @@ context_ptr on_tls_init(websocketpp::connection_hdl hdl) { + } + + int main() { +- // set up an external io_service to run both endpoints on. This is not ++ // set up an external io_context to run both endpoints on. This is not + // strictly necessary, but simplifies thread management a bit. +- boost::asio::io_service ios; ++ boost::asio::io_context ios; + + // set up plain endpoint + server_plain endpoint_plain; +- // initialize asio with our external io_service rather than an internal one ++ // initialize asio with our external io_context rather than an internal one + endpoint_plain.init_asio(&ios); + endpoint_plain.set_message_handler( + bind(&on_message,&endpoint_plain,::_1,::_2)); +@@ -89,6 +89,6 @@ int main() { + endpoint_tls.listen(443); + endpoint_tls.start_accept(&on_end_accept); + +- // Start the ASIO io_service run loop running both endpoints ++ // Start the ASIO io_context run loop running both endpoints + ios.run(); + } +diff --git a/examples/echo_server_tls/echo_server_tls.cpp b/examples/echo_server_tls/echo_server_tls.cpp +index ef14a4a22..e05680505 100644 +--- a/examples/echo_server_tls/echo_server_tls.cpp ++++ b/examples/echo_server_tls/echo_server_tls.cpp +@@ -155,7 +155,7 @@ int main() { + // Start the server accept loop + echo_server.start_accept(&on_end_accept); + +- // Start the ASIO io_service run loop ++ // Start the ASIO io_context run loop + echo_server.run(); + + } +diff --git a/examples/external_io_service/CMakeLists.txt b/examples/external_io_context/CMakeLists.txt +similarity index 87% +rename from examples/external_io_service/CMakeLists.txt +rename to examples/external_io_context/CMakeLists.txt +index 5223da1be..a0e89ec96 100644 +--- a/examples/external_io_service/CMakeLists.txt ++++ b/examples/external_io_context/CMakeLists.txt +@@ -2,7 +2,7 @@ + file (GLOB SOURCE_FILES *.cpp) + file (GLOB HEADER_FILES *.hpp) + +-init_target (external_io_service) ++init_target (external_io_context) + + build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) + +diff --git a/examples/external_io_service/SConscript b/examples/external_io_context/SConscript +similarity index 72% +rename from examples/external_io_service/SConscript +rename to examples/external_io_context/SConscript +index 0abf3e175..c6cd9740d 100644 +--- a/examples/external_io_service/SConscript ++++ b/examples/external_io_context/SConscript +@@ -15,9 +15,9 @@ prgs = [] + # if a C++11 environment is available build using that, otherwise use boost + if 'WSPP_CPP11_ENABLED' in env_cpp11: + ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] +- prgs += env_cpp11.Program('external_io_service', ["external_io_service.cpp"], LIBS = ALL_LIBS) ++ prgs += env_cpp11.Program('external_io_context', ["external_io_context.cpp"], LIBS = ALL_LIBS) + else: + ALL_LIBS = boostlibs(['system'],env) + [platform_libs] + [polyfill_libs] +- prgs += env.Program('external_io_service', ["external_io_service.cpp"], LIBS = ALL_LIBS) ++ prgs += env.Program('external_io_context', ["external_io_context.cpp"], LIBS = ALL_LIBS) + + Return('prgs') +diff --git a/examples/external_io_service/external_io_service.cpp b/examples/external_io_context/external_io_context.cpp +similarity index 93% +rename from examples/external_io_service/external_io_service.cpp +rename to examples/external_io_context/external_io_context.cpp +index 6aa23985e..08ca8e9f8 100644 +--- a/examples/external_io_service/external_io_service.cpp ++++ b/examples/external_io_context/external_io_context.cpp +@@ -66,10 +66,10 @@ void on_end_accept(error_code lib_ec, error_code trans_ec) { + } + + int main() { +- asio::io_service service; ++ asio::io_context context; + + // Add a TCP echo server on port 9003 +- tcp_echo_server custom_http_server(service, 9003); ++ tcp_echo_server custom_http_server(context, 9003); + + // Add a WebSocket echo server on port 9002 + ws_echo_server ws_server; +@@ -77,8 +77,8 @@ int main() { + ws_server.clear_access_channels(websocketpp::log::alevel::frame_payload); + + // The only difference in this code between an internal and external +- // io_service is the different constructor to init_asio +- ws_server.init_asio(&service); ++ // io_context is the different constructor to init_asio ++ ws_server.init_asio(&context); + + // Register our message handler + ws_server.set_message_handler(bind(&on_message,&ws_server,::_1,::_2)); +@@ -87,6 +87,6 @@ int main() { + + // TODO: add a timer? + +- // Start the Asio io_service run loop for all +- service.run(); +-} +\ No newline at end of file ++ // Start the Asio io_context run loop for all ++ context.run(); ++} +diff --git a/examples/external_io_service/tcp_echo_server.hpp b/examples/external_io_context/tcp_echo_server.hpp +similarity index 92% +rename from examples/external_io_service/tcp_echo_server.hpp +rename to examples/external_io_context/tcp_echo_server.hpp +index ef4ce1855..2e14703f5 100644 +--- a/examples/external_io_service/tcp_echo_server.hpp ++++ b/examples/external_io_context/tcp_echo_server.hpp +@@ -44,7 +44,7 @@ namespace asio = websocketpp::lib::asio; + struct tcp_echo_session : websocketpp::lib::enable_shared_from_this { + typedef websocketpp::lib::shared_ptr ptr; + +- tcp_echo_session(asio::io_service & service) : m_socket(service) {} ++ tcp_echo_session(asio::io_context & context) : m_socket(context) {} + + void start() { + m_socket.async_read_some(asio::buffer(m_buffer, sizeof(m_buffer)), +@@ -72,15 +72,15 @@ struct tcp_echo_session : websocketpp::lib::enable_shared_from_thisstart_accept(); + } + + void start_accept() { +- tcp_echo_session::ptr new_session(new tcp_echo_session(m_service)); ++ tcp_echo_session::ptr new_session(new tcp_echo_session(m_context)); + m_acceptor.async_accept(new_session->m_socket, + bind(&tcp_echo_server::handle_accept, this, new_session, _1)); + } +@@ -92,6 +92,6 @@ struct tcp_echo_server { + start_accept(); + } + +- asio::io_service & m_service; ++ asio::io_context & m_context; + asio::ip::tcp::acceptor m_acceptor; + }; +diff --git a/examples/print_client/print_client.cpp b/examples/print_client/print_client.cpp +index 7ba6e5fc9..20a2bd3e8 100644 +--- a/examples/print_client/print_client.cpp ++++ b/examples/print_client/print_client.cpp +@@ -68,7 +68,7 @@ int main(int argc, char* argv[]) { + // exchanged until the event loop starts running in the next line. + c.connect(con); + +- // Start the ASIO io_service run loop ++ // Start the ASIO io_context run loop + // this will cause a single connection to be made to the server. c.run() + // will exit when this connection is closed. + c.run(); +diff --git a/examples/print_client_tls/print_client_tls.cpp b/examples/print_client_tls/print_client_tls.cpp +index 469d9c61e..43164eaf7 100644 +--- a/examples/print_client_tls/print_client_tls.cpp ++++ b/examples/print_client_tls/print_client_tls.cpp +@@ -239,7 +239,7 @@ int main(int argc, char* argv[]) { + + c.get_alog().write(websocketpp::log::alevel::app, "Connecting to " + uri); + +- // Start the ASIO io_service run loop ++ // Start the ASIO io_context run loop + // this will cause a single connection to be made to the server. c.run() + // will exit when this connection is closed. + c.run(); +diff --git a/examples/scratch_server/scratch_server.cpp b/examples/scratch_server/scratch_server.cpp +index 901ae8e5d..dab20b90d 100644 +--- a/examples/scratch_server/scratch_server.cpp ++++ b/examples/scratch_server/scratch_server.cpp +@@ -94,7 +94,7 @@ int main(int argc, char * argv[]) { + // Start the server accept loop + echo_server.start_accept(); + +- // Start the ASIO io_service run loop ++ // Start the ASIO io_context run loop + echo_server.run(); + } catch (websocketpp::exception const & e) { + std::cout << e.what() << std::endl; +diff --git a/examples/sip_client/sip_client.cpp b/examples/sip_client/sip_client.cpp +index 66fa85784..c9f33e771 100644 +--- a/examples/sip_client/sip_client.cpp ++++ b/examples/sip_client/sip_client.cpp +@@ -69,7 +69,7 @@ int main(int argc, char* argv[]) { + + sip_client.connect(con); + +- // Start the ASIO io_service run loop ++ // Start the ASIO io_context run loop + sip_client.run(); + + while(!received) { +diff --git a/examples/telemetry_client/telemetry_client.cpp b/examples/telemetry_client/telemetry_client.cpp +index f0f7fae72..12390b821 100644 +--- a/examples/telemetry_client/telemetry_client.cpp ++++ b/examples/telemetry_client/telemetry_client.cpp +@@ -62,10 +62,10 @@ class telemetry_client { + m_hdl = con->get_handle(); + + // Queue the connection. No DNS queries or network connections will be +- // made until the io_service event loop is run. ++ // made until the io_context event loop is run. + m_client.connect(con); + +- // Create a thread to run the ASIO io_service event loop ++ // Create a thread to run the ASIO io_context event loop + websocketpp::lib::thread asio_thread(&client::run, &m_client); + + // Create a thread to run the telemetry loop +diff --git a/examples/telemetry_server/telemetry_server.cpp b/examples/telemetry_server/telemetry_server.cpp +index 22c155edf..9c576421a 100644 +--- a/examples/telemetry_server/telemetry_server.cpp ++++ b/examples/telemetry_server/telemetry_server.cpp +@@ -69,7 +69,7 @@ class telemetry_server { + // Set the initial timer to start telemetry + set_timer(); + +- // Start the ASIO io_service run loop ++ // Start the ASIO io_context run loop + try { + m_endpoint.run(); + } catch (websocketpp::exception const & e) { +diff --git a/examples/testee_client/testee_client.cpp b/examples/testee_client/testee_client.cpp +index b66e63353..12583e559 100644 +--- a/examples/testee_client/testee_client.cpp ++++ b/examples/testee_client/testee_client.cpp +@@ -117,7 +117,7 @@ int main(int argc, char* argv[]) { + client::connection_ptr con = c.get_connection(uri+"/getCaseCount", ec); + c.connect(con); + +- // Start the ASIO io_service run loop ++ // Start the ASIO io_context run loop + c.run(); + + std::cout << "case count: " << case_count << std::endl; +diff --git a/examples/testee_server/testee_server.cpp b/examples/testee_server/testee_server.cpp +index cf876f7e1..7ff1b050f 100644 +--- a/examples/testee_server/testee_server.cpp ++++ b/examples/testee_server/testee_server.cpp +@@ -131,7 +131,7 @@ int main(int argc, char * argv[]) { + // Start the server accept loop + testee_server.start_accept(&on_end_accept); + +- // Start the ASIO io_service run loop ++ // Start the ASIO io_context run loop + if (num_threads == 1) { + testee_server.run(); + } else { +diff --git a/test/endpoint/endpoint.cpp b/test/endpoint/endpoint.cpp +index b4c429ebc..fa58e6678 100644 +--- a/test/endpoint/endpoint.cpp ++++ b/test/endpoint/endpoint.cpp +@@ -53,7 +53,7 @@ BOOST_AUTO_TEST_CASE( initialize_server_asio ) { + + BOOST_AUTO_TEST_CASE( initialize_server_asio_external ) { + websocketpp::server s; +- boost::asio::io_service ios; ++ boost::asio::io_context ios; + s.init_asio(&ios); + } + +@@ -141,8 +141,8 @@ BOOST_AUTO_TEST_CASE( listen_after_listen_failure ) { + server1.init_asio(); + server2.init_asio(); + +- boost::asio::ip::tcp::endpoint ep1(boost::asio::ip::address::from_string("127.0.0.1"), 12345); +- boost::asio::ip::tcp::endpoint ep2(boost::asio::ip::address::from_string("127.0.0.1"), 23456); ++ boost::asio::ip::tcp::endpoint ep1(boost::asio::ip::make_address("127.0.0.1"), 12345); ++ boost::asio::ip::tcp::endpoint ep2(boost::asio::ip::make_address("127.0.0.1"), 23456); + + server1.listen(ep1, ec); + BOOST_CHECK(!ec); +diff --git a/test/transport/asio/timers.cpp b/test/transport/asio/timers.cpp +index aa03d6189..391b755ff 100644 +--- a/test/transport/asio/timers.cpp ++++ b/test/transport/asio/timers.cpp +@@ -54,9 +54,9 @@ void run_dummy_server(int port) { + using boost::asio::ip::tcp; + + try { +- boost::asio::io_service io_service; +- tcp::acceptor acceptor(io_service, tcp::endpoint(tcp::v6(), port)); +- tcp::socket socket(io_service); ++ boost::asio::io_context io_context; ++ tcp::acceptor acceptor(io_context, tcp::endpoint(tcp::v6(), port)); ++ tcp::socket socket(io_context); + + acceptor.accept(socket); + for (;;) { +@@ -79,7 +79,7 @@ void run_dummy_server(int port) { + + // Wait for the specified time period then fail the test + void run_test_timer(long value) { +- boost::asio::io_service ios; ++ boost::asio::io_context ios; + boost::asio::deadline_timer t(ios,boost::posix_time::milliseconds(value)); + boost::system::error_code ec; + t.wait(ec); +diff --git a/test/transport/integration.cpp b/test/transport/integration.cpp +index c083cfd01..ab82b1ab6 100644 +--- a/test/transport/integration.cpp ++++ b/test/transport/integration.cpp +@@ -221,9 +221,9 @@ void run_dummy_server(int port) { + using boost::asio::ip::tcp; + + try { +- boost::asio::io_service io_service; +- tcp::acceptor acceptor(io_service, tcp::endpoint(tcp::v6(), port)); +- tcp::socket socket(io_service); ++ boost::asio::io_context io_context; ++ tcp::acceptor acceptor(io_context, tcp::endpoint(tcp::v6(), port)); ++ tcp::socket socket(io_context); + + acceptor.accept(socket); + for (;;) { +@@ -248,13 +248,12 @@ void run_dummy_client(std::string port) { + using boost::asio::ip::tcp; + + try { +- boost::asio::io_service io_service; +- tcp::resolver resolver(io_service); +- tcp::resolver::query query("localhost", port); +- tcp::resolver::iterator iterator = resolver.resolve(query); +- tcp::socket socket(io_service); ++ boost::asio::io_context io_context; ++ tcp::resolver resolver(io_context); ++ tcp::resolver::results_type endpoints = resolver.resolve("localhost", port); ++ tcp::socket socket(io_context); + +- boost::asio::connect(socket, iterator); ++ boost::asio::connect(socket, endpoints); + for (;;) { + char data[512]; + boost::system::error_code ec; +@@ -358,11 +357,11 @@ class test_deadline_timer + { + public: + test_deadline_timer(int seconds) +- : m_timer(m_io_service, boost::posix_time::seconds(seconds)) ++ : m_timer(m_io_context, boost::posix_time::seconds(seconds)) + { + m_timer.async_wait(bind(&test_deadline_timer::expired, this, ::_1)); +- std::size_t (boost::asio::io_service::*run)() = &boost::asio::io_service::run; +- m_timer_thread = websocketpp::lib::thread(websocketpp::lib::bind(run, &m_io_service)); ++ std::size_t (boost::asio::io_context::*run)() = &boost::asio::io_context::run; ++ m_timer_thread = websocketpp::lib::thread(websocketpp::lib::bind(run, &m_io_context)); + } + ~test_deadline_timer() + { +@@ -379,7 +378,7 @@ class test_deadline_timer + BOOST_FAIL("Test timed out"); + } + +- boost::asio::io_service m_io_service; ++ boost::asio::io_context m_io_context; + boost::asio::deadline_timer m_timer; + websocketpp::lib::thread m_timer_thread; + }; +@@ -541,7 +540,7 @@ BOOST_AUTO_TEST_CASE( client_runs_out_of_work ) { + + c.run(); + +- // This test checks that an io_service with no work ends immediately. ++ // This test checks that an io_context with no work ends immediately. + BOOST_CHECK(true); + } + +diff --git a/tutorials/utility_server/step1.cpp b/tutorials/utility_server/step1.cpp +index c0e464382..dae4a2ab9 100644 +--- a/tutorials/utility_server/step1.cpp ++++ b/tutorials/utility_server/step1.cpp +@@ -57,7 +57,7 @@ class utility_server { + // Queues a connection accept operation + m_endpoint.start_accept(); + +- // Start the Asio io_service run loop ++ // Start the Asio io_context run loop + m_endpoint.run(); + } + private: +diff --git a/tutorials/utility_server/step2.cpp b/tutorials/utility_server/step2.cpp +index a2815bbb9..c4fe486c1 100644 +--- a/tutorials/utility_server/step2.cpp ++++ b/tutorials/utility_server/step2.cpp +@@ -68,7 +68,7 @@ class utility_server { + // Queues a connection accept operation + m_endpoint.start_accept(); + +- // Start the Asio io_service run loop ++ // Start the Asio io_context run loop + m_endpoint.run(); + } + private: +diff --git a/tutorials/utility_server/utility_server.md b/tutorials/utility_server/utility_server.md +index 1c7ee3fc1..461eed071 100644 +--- a/tutorials/utility_server/utility_server.md ++++ b/tutorials/utility_server/utility_server.md +@@ -56,7 +56,7 @@ m_endpoint.set_access_channels(websocketpp::log::alevel::all ^ websocketpp::log: + + Next, we initialize the transport system underlying the endpoint. This method is specific to the Asio transport not WebSocket++ core. It will not be necessary or present in endpoints that use a non-asio config. + +-> **Note:** This example uses an internal Asio `io_service` that is managed by the endpoint itself. This is a simple arrangement suitable for programs where WebSocket++ is the only code using Asio. If you have an existing program that already manages an `io_service` object or want to build a new program where WebSocket++ handlers share an io_service with other handlers you can pass the `io_service` you want WebSocket++ to register its handlers on to the `init_asio()` method and it will use it instead of generating and managing its own. [TODO: FAQ link instead?] ++> **Note:** This example uses an internal Asio `io_context` that is managed by the endpoint itself. This is a simple arrangement suitable for programs where WebSocket++ is the only code using Asio. If you have an existing program that already manages an `io_context` object or want to build a new program where WebSocket++ handlers share an io_context with other handlers you can pass the `io_context` you want WebSocket++ to register its handlers on to the `init_asio()` method and it will use it instead of generating and managing its own. [TODO: FAQ link instead?] + + ~~~{.cpp} + m_endpoint.init_asio(); +@@ -64,7 +64,7 @@ m_endpoint.init_asio(); + + #### `utility_server::run` method + +-In addition to the constructor, we also add a run method that sets up the listening socket, begins accepting connections, starts the Asio io_service event loop. ++In addition to the constructor, we also add a run method that sets up the listening socket, begins accepting connections, starts the Asio io_context event loop. + + ~~~{.cpp} + // Listen on port 9002 +@@ -73,7 +73,7 @@ m_endpoint.listen(9002); + // Queues a connection accept operation + m_endpoint.start_accept(); + +-// Start the Asio io_service run loop ++// Start the Asio io_context run loop + m_endpoint.run(); + ~~~ + +@@ -123,7 +123,7 @@ public: + // Queues a connection accept operation + m_endpoint.start_accept(); + +- // Start the Asio io_service run loop ++ // Start the Asio io_context run loop + m_endpoint.run(); + } + private: +diff --git a/websocketpp/roles/server_endpoint.hpp b/websocketpp/roles/server_endpoint.hpp +index 04fee18f9..b69281fdb 100644 +--- a/websocketpp/roles/server_endpoint.hpp ++++ b/websocketpp/roles/server_endpoint.hpp +@@ -137,8 +137,8 @@ class server : public endpoint,config> { + /// Starts the server's async connection acceptance loop (exception free) + /** + * Initiates the server connection acceptance loop. Must be called after +- * listen. This method will have no effect until the underlying io_service +- * starts running. It may be called after the io_service is already running. ++ * listen. This method will have no effect until the underlying io_context ++ * starts running. It may be called after the io_context is already running. + * + * Refer to documentation for the transport policy you are using for + * instructions on how to stop this acceptance loop. +diff --git a/websocketpp/transport/asio/base.hpp b/websocketpp/transport/asio/base.hpp +index b945fe11f..8d980ad7c 100644 +--- a/websocketpp/transport/asio/base.hpp ++++ b/websocketpp/transport/asio/base.hpp +@@ -40,7 +40,7 @@ namespace websocketpp { + namespace transport { + /// Transport policy that uses asio + /** +- * This policy uses a single asio io_service to provide transport ++ * This policy uses a single asio io_context to provide transport + * services to a WebSocket++ endpoint. + */ + namespace asio { +diff --git a/websocketpp/transport/asio/connection.hpp b/websocketpp/transport/asio/connection.hpp +index ea18e3e6d..af8eec5e1 100644 +--- a/websocketpp/transport/asio/connection.hpp ++++ b/websocketpp/transport/asio/connection.hpp +@@ -85,10 +85,10 @@ class connection : public config::socket_type::socket_con_type { + typedef typename config::response_type response_type; + typedef typename response_type::ptr response_ptr; + +- /// Type of a pointer to the Asio io_service being used +- typedef lib::asio::io_service * io_service_ptr; +- /// Type of a pointer to the Asio io_service::strand being used +- typedef lib::shared_ptr strand_ptr; ++ /// Type of a pointer to the Asio io_context being used ++ typedef lib::asio::io_context * io_context_ptr; ++ /// Type of a pointer to the Asio io_context::strand being used ++ typedef lib::shared_ptr strand_ptr; + /// Type of a pointer to the Asio timer class + typedef lib::shared_ptr timer_ptr; + +@@ -97,7 +97,7 @@ class connection : public config::socket_type::socket_con_type { + // to the public api. + friend class endpoint; + +- // generate and manage our own io_service ++ // generate and manage our own io_context + explicit connection(bool is_server, const lib::shared_ptr & alog, const lib::shared_ptr & elog) + : m_is_server(is_server) + , m_alog(alog) +@@ -319,7 +319,7 @@ class connection : public config::socket_type::socket_con_type { + timer_ptr set_timer(long duration, timer_handler callback) { + timer_ptr new_timer( + new lib::asio::steady_timer( +- *m_io_service, ++ *m_io_context, + lib::asio::milliseconds(duration)) + ); + +@@ -399,7 +399,7 @@ class connection : public config::socket_type::socket_con_type { + /// Initialize transport for reading + /** + * init_asio is called once immediately after construction to initialize +- * Asio components to the io_service ++ * Asio components to the io_context + * + * The transport initialization sequence consists of the following steps: + * - Pre-init: the underlying socket is initialized to the point where +@@ -457,21 +457,21 @@ class connection : public config::socket_type::socket_con_type { + /// Finish constructing the transport + /** + * init_asio is called once immediately after construction to initialize +- * Asio components to the io_service. ++ * Asio components to the io_context. + * +- * @param io_service A pointer to the io_service to register with this ++ * @param io_context A pointer to the io_context to register with this + * connection + * + * @return Status code for the success or failure of the initialization + */ +- lib::error_code init_asio (io_service_ptr io_service) { +- m_io_service = io_service; ++ lib::error_code init_asio (io_context_ptr io_context) { ++ m_io_context = io_context; + + if (config::enable_multithreading) { +- m_strand.reset(new lib::asio::io_service::strand(*io_service)); ++ m_strand.reset(new lib::asio::io_context::strand(*io_context)); + } + +- lib::error_code ec = socket_con_type::init_asio(io_service, m_strand, ++ lib::error_code ec = socket_con_type::init_asio(io_context, m_strand, + m_is_server); + + return ec; +@@ -579,7 +579,7 @@ class connection : public config::socket_type::socket_con_type { + lib::error_code const & ec) + { + if (ec == transport::error::operation_aborted || +- (post_timer && lib::asio::is_neg(post_timer->expires_from_now()))) ++ (post_timer && lib::asio::is_neg(post_timer->expiry() - std::chrono::steady_clock::now()))) + { + m_alog->write(log::alevel::devel,"post_init cancelled"); + return; +@@ -685,7 +685,7 @@ class connection : public config::socket_type::socket_con_type { + // Whatever aborted it will be issuing the callback so we are safe to + // return + if (ec == lib::asio::error::operation_aborted || +- lib::asio::is_neg(m_proxy_data->timer->expires_from_now())) ++ lib::asio::is_neg(m_proxy_data->timer->expiry() - std::chrono::steady_clock::now())) + { + m_elog->write(log::elevel::devel,"write operation aborted"); + return; +@@ -756,7 +756,7 @@ class connection : public config::socket_type::socket_con_type { + // Whatever aborted it will be issuing the callback so we are safe to + // return + if (ec == lib::asio::error::operation_aborted || +- lib::asio::is_neg(m_proxy_data->timer->expires_from_now())) ++ lib::asio::is_neg(m_proxy_data->timer->expiry() - std::chrono::steady_clock::now())) + { + m_elog->write(log::elevel::devel,"read operation aborted"); + return; +@@ -1030,18 +1030,18 @@ class connection : public config::socket_type::socket_con_type { + */ + lib::error_code interrupt(interrupt_handler handler) { + if (config::enable_multithreading) { +- m_io_service->post(m_strand->wrap(handler)); ++ boost::asio::post(m_io_context->get_executor(), m_strand->wrap(handler)); + } else { +- m_io_service->post(handler); ++ boost::asio::post(m_io_context->get_executor(), handler); + } + return lib::error_code(); + } + + lib::error_code dispatch(dispatch_handler handler) { + if (config::enable_multithreading) { +- m_io_service->post(m_strand->wrap(handler)); ++ boost::asio::post(m_io_context->get_executor(), m_strand->wrap(handler)); + } else { +- m_io_service->post(handler); ++ boost::asio::post(m_io_context->get_executor(), handler); + } + return lib::error_code(); + } +@@ -1113,7 +1113,7 @@ class connection : public config::socket_type::socket_con_type { + callback, lib::asio::error_code const & ec) + { + if (ec == lib::asio::error::operation_aborted || +- lib::asio::is_neg(shutdown_timer->expires_from_now())) ++ lib::asio::is_neg(shutdown_timer->expiry() - std::chrono::steady_clock::now())) + { + m_alog->write(log::alevel::devel,"async_shutdown cancelled"); + return; +@@ -1190,7 +1190,7 @@ class connection : public config::socket_type::socket_con_type { + lib::shared_ptr m_proxy_data; + + // transport resources +- io_service_ptr m_io_service; ++ io_context_ptr m_io_context; + strand_ptr m_strand; + connection_hdl m_connection_hdl; + +diff --git a/websocketpp/transport/asio/endpoint.hpp b/websocketpp/transport/asio/endpoint.hpp +index 125b87642..05453437b 100644 +--- a/websocketpp/transport/asio/endpoint.hpp ++++ b/websocketpp/transport/asio/endpoint.hpp +@@ -77,25 +77,25 @@ class endpoint : public config::socket_type { + /// associated with this endpoint transport component + typedef typename transport_con_type::ptr transport_con_ptr; + +- /// Type of a pointer to the ASIO io_service being used +- typedef lib::asio::io_service * io_service_ptr; ++ /// Type of a pointer to the ASIO io_context being used ++ typedef lib::asio::io_context * io_context_ptr; + /// Type of a shared pointer to the acceptor being used + typedef lib::shared_ptr acceptor_ptr; + /// Type of a shared pointer to the resolver being used + typedef lib::shared_ptr resolver_ptr; + /// Type of timer handle + typedef lib::shared_ptr timer_ptr; +- /// Type of a shared pointer to an io_service work object +- typedef lib::shared_ptr work_ptr; ++ /// Type of a shared pointer to an io_context work object ++ typedef lib::shared_ptr> work_ptr; + + /// Type of socket pre-bind handler + typedef lib::function tcp_pre_bind_handler; + +- // generate and manage our own io_service ++ // generate and manage our own io_context + explicit endpoint() +- : m_io_service(NULL) +- , m_external_io_service(false) +- , m_listen_backlog(lib::asio::socket_base::max_connections) ++ : m_io_context(NULL) ++ , m_external_io_context(false) ++ , m_listen_backlog(lib::asio::socket_base::max_listen_connections) + , m_reuse_addr(false) + , m_state(UNINITIALIZED) + { +@@ -103,14 +103,14 @@ class endpoint : public config::socket_type { + } + + ~endpoint() { +- // clean up our io_service if we were initialized with an internal one. ++ // clean up our io_context if we were initialized with an internal one. + + // Explicitly destroy local objects + m_acceptor.reset(); + m_resolver.reset(); + m_work.reset(); +- if (m_state != UNINITIALIZED && !m_external_io_service) { +- delete m_io_service; ++ if (m_state != UNINITIALIZED && !m_external_io_context) { ++ delete m_io_context; + } + } + +@@ -132,34 +132,34 @@ class endpoint : public config::socket_type { + : config::socket_type(std::move(src)) + , m_tcp_pre_init_handler(src.m_tcp_pre_init_handler) + , m_tcp_post_init_handler(src.m_tcp_post_init_handler) +- , m_io_service(src.m_io_service) +- , m_external_io_service(src.m_external_io_service) ++ , m_io_context(src.m_io_context) ++ , m_external_io_context(src.m_external_io_context) + , m_acceptor(src.m_acceptor) +- , m_listen_backlog(lib::asio::socket_base::max_connections) ++ , m_listen_backlog(lib::asio::socket_base::max_listen_connections) + , m_reuse_addr(src.m_reuse_addr) + , m_elog(src.m_elog) + , m_alog(src.m_alog) + , m_state(src.m_state) + { +- src.m_io_service = NULL; +- src.m_external_io_service = false; ++ src.m_io_context = NULL; ++ src.m_external_io_context = false; + src.m_acceptor = NULL; + src.m_state = UNINITIALIZED; + } + + /*endpoint & operator= (const endpoint && rhs) { + if (this != &rhs) { +- m_io_service = rhs.m_io_service; +- m_external_io_service = rhs.m_external_io_service; ++ m_io_context = rhs.m_io_context; ++ m_external_io_context = rhs.m_external_io_context; + m_acceptor = rhs.m_acceptor; + m_listen_backlog = rhs.m_listen_backlog; + m_reuse_addr = rhs.m_reuse_addr; + m_state = rhs.m_state; + +- rhs.m_io_service = NULL; +- rhs.m_external_io_service = false; ++ rhs.m_io_context = NULL; ++ rhs.m_external_io_context = false; + rhs.m_acceptor = NULL; +- rhs.m_listen_backlog = lib::asio::socket_base::max_connections; ++ rhs.m_listen_backlog = lib::asio::socket_base::max_listen_connections; + rhs.m_state = UNINITIALIZED; + + // TODO: this needs to be updated +@@ -173,16 +173,16 @@ class endpoint : public config::socket_type { + return socket_type::is_secure(); + } + +- /// initialize asio transport with external io_service (exception free) ++ /// initialize asio transport with external io_context (exception free) + /** + * Initialize the ASIO transport policy for this endpoint using the provided +- * io_service object. asio_init must be called exactly once on any endpoint ++ * io_context object. asio_init must be called exactly once on any endpoint + * that uses transport::asio before it can be used. + * +- * @param ptr A pointer to the io_service to use for asio events ++ * @param ptr A pointer to the io_context to use for asio events + * @param ec Set to indicate what error occurred, if any. + */ +- void init_asio(io_service_ptr ptr, lib::error_code & ec) { ++ void init_asio(io_context_ptr ptr, lib::error_code & ec) { + if (m_state != UNINITIALIZED) { + m_elog->write(log::elevel::library, + "asio::init_asio called from the wrong state"); +@@ -193,36 +193,36 @@ class endpoint : public config::socket_type { + + m_alog->write(log::alevel::devel,"asio::init_asio"); + +- m_io_service = ptr; +- m_external_io_service = true; +- m_acceptor.reset(new lib::asio::ip::tcp::acceptor(*m_io_service)); ++ m_io_context = ptr; ++ m_external_io_context = true; ++ m_acceptor.reset(new lib::asio::ip::tcp::acceptor(*m_io_context)); + + m_state = READY; + ec = lib::error_code(); + } + + #ifndef _WEBSOCKETPP_NO_EXCEPTIONS_ +- /// initialize asio transport with external io_service ++ /// initialize asio transport with external io_context + /** + * Initialize the ASIO transport policy for this endpoint using the provided +- * io_service object. asio_init must be called exactly once on any endpoint ++ * io_context object. asio_init must be called exactly once on any endpoint + * that uses transport::asio before it can be used. + * +- * @param ptr A pointer to the io_service to use for asio events ++ * @param ptr A pointer to the io_context to use for asio events + */ +- void init_asio(io_service_ptr ptr) { ++ void init_asio(io_context_ptr ptr) { + lib::error_code ec; + init_asio(ptr,ec); + if (ec) { throw exception(ec); } + } + #endif // _WEBSOCKETPP_NO_EXCEPTIONS_ + +- /// Initialize asio transport with internal io_service (exception free) ++ /// Initialize asio transport with internal io_context (exception free) + /** + * This method of initialization will allocate and use an internally managed +- * io_service. ++ * io_context. + * +- * @see init_asio(io_service_ptr ptr) ++ * @see init_asio(io_context_ptr ptr) + * + * @param ec Set to indicate what error occurred, if any. + */ +@@ -232,22 +232,22 @@ class endpoint : public config::socket_type { + // TODO: remove the use of auto_ptr when C++98/03 support is no longer + // necessary. + #ifdef _WEBSOCKETPP_CPP11_MEMORY_ +- lib::unique_ptr service(new lib::asio::io_service()); ++ lib::unique_ptr context(new lib::asio::io_context()); + #else +- lib::auto_ptr service(new lib::asio::io_service()); ++ lib::auto_ptr context(new lib::asio::io_context()); + #endif +- init_asio(service.get(), ec); +- if( !ec ) service.release(); // Call was successful, transfer ownership +- m_external_io_service = false; ++ init_asio(context.get(), ec); ++ if( !ec ) context.release(); // Call was successful, transfer ownership ++ m_external_io_context = false; + } + + #ifndef _WEBSOCKETPP_NO_EXCEPTIONS_ +- /// Initialize asio transport with internal io_service ++ /// Initialize asio transport with internal io_context + /** + * This method of initialization will allocate and use an internally managed +- * io_service. ++ * io_context. + * +- * @see init_asio(io_service_ptr ptr) ++ * @see init_asio(io_context_ptr ptr) + */ + void init_asio() { + // Use a smart pointer until the call is successful and ownership has +@@ -255,14 +255,14 @@ class endpoint : public config::socket_type { + // TODO: remove the use of auto_ptr when C++98/03 support is no longer + // necessary. + #ifdef _WEBSOCKETPP_CPP11_MEMORY_ +- lib::unique_ptr service(new lib::asio::io_service()); ++ lib::unique_ptr context(new lib::asio::io_context()); + #else +- lib::auto_ptr service(new lib::asio::io_service()); ++ lib::auto_ptr context(new lib::asio::io_context()); + #endif +- init_asio( service.get() ); ++ init_asio( context.get() ); + // If control got this far without an exception, then ownership has successfully been taken +- service.release(); +- m_external_io_service = false; ++ context.release(); ++ m_external_io_context = false; + } + #endif // _WEBSOCKETPP_NO_EXCEPTIONS_ + +@@ -334,7 +334,7 @@ class endpoint : public config::socket_type { + * + * New values affect future calls to listen only. + * +- * The default value is specified as *::asio::socket_base::max_connections ++ * The default value is specified as *::asio::socket_base::max_listen_connections + * which uses the operating system defined maximum queue length. Your OS + * may restrict or silently lower this value. A value of zero may cause + * all connections to be rejected. +@@ -368,19 +368,19 @@ class endpoint : public config::socket_type { + m_reuse_addr = value; + } + +- /// Retrieve a reference to the endpoint's io_service ++ /// Retrieve a reference to the endpoint's io_context + /** +- * The io_service may be an internal or external one. This may be used to +- * call methods of the io_service that are not explicitly wrapped by the ++ * The io_context may be an internal or external one. This may be used to ++ * call methods of the io_context that are not explicitly wrapped by the + * endpoint. + * + * This method is only valid after the endpoint has been initialized with + * `init_asio`. No error will be returned if it isn't. + * +- * @return A reference to the endpoint's io_service ++ * @return A reference to the endpoint's io_context + */ +- lib::asio::io_service & get_io_service() { +- return *m_io_service; ++ lib::asio::io_context & get_io_context() { ++ return *m_io_context; + } + + /// Get local TCP endpoint +@@ -501,7 +501,7 @@ class endpoint : public config::socket_type { + * The endpoint must have been initialized by calling init_asio before + * listening. + * +- * Once listening the underlying io_service will be kept open indefinitely. ++ * Once listening the underlying io_context will be kept open indefinitely. + * Calling endpoint::stop_listening will stop the endpoint from accepting + * new connections. See the documentation for stop listening for more details + * about shutting down Asio Transport based endpoints. +@@ -518,17 +518,15 @@ class endpoint : public config::socket_type { + lib::error_code & ec) + { + using lib::asio::ip::tcp; +- tcp::resolver r(*m_io_service); +- tcp::resolver::query query(host, service); +- tcp::resolver::iterator endpoint_iterator = r.resolve(query); +- tcp::resolver::iterator end; +- if (endpoint_iterator == end) { ++ tcp::resolver r(*m_io_context); ++ tcp::resolver::results_type endpoints = r.resolve(host, service); ++ if (endpoints.empty()) { + m_elog->write(log::elevel::library, + "asio::listen could not resolve the supplied host or service"); + ec = make_error_code(error::invalid_host_service); + return; + } +- listen(*endpoint_iterator,ec); ++ listen(*endpoints.begin(),ec); + } + + /// Stop listening (exception free) +@@ -621,7 +619,7 @@ class endpoint : public config::socket_type { + * The endpoint must have been initialized by calling init_asio before + * listening. + * +- * Once listening the underlying io_service will be kept open indefinitely. ++ * Once listening the underlying io_context will be kept open indefinitely. + * Calling endpoint::stop_listening will stop the endpoint from accepting + * new connections. See the documentation for stop listening for more + * details about shutting down Asio Transport based endpoints. +@@ -663,42 +661,42 @@ class endpoint : public config::socket_type { + return (m_state == LISTENING); + } + +- /// wraps the run method of the internal io_service object ++ /// wraps the run method of the internal io_context object + std::size_t run() { +- return m_io_service->run(); ++ return m_io_context->run(); + } + +- /// wraps the run_one method of the internal io_service object ++ /// wraps the run_one method of the internal io_context object + /** + * @since 0.3.0-alpha4 + */ + std::size_t run_one() { +- return m_io_service->run_one(); ++ return m_io_context->run_one(); + } + +- /// wraps the stop method of the internal io_service object ++ /// wraps the stop method of the internal io_context object + void stop() { +- m_io_service->stop(); ++ m_io_context->stop(); + } + +- /// wraps the poll method of the internal io_service object ++ /// wraps the poll method of the internal io_context object + std::size_t poll() { +- return m_io_service->poll(); ++ return m_io_context->poll(); + } + +- /// wraps the poll_one method of the internal io_service object ++ /// wraps the poll_one method of the internal io_context object + std::size_t poll_one() { +- return m_io_service->poll_one(); ++ return m_io_context->poll_one(); + } + +- /// wraps the reset method of the internal io_service object ++ /// wraps the restart method of the internal io_context object + void reset() { +- m_io_service->reset(); ++ m_io_context->restart(); + } + +- /// wraps the stopped method of the internal io_service object ++ /// wraps the stopped method of the internal io_context object + bool stopped() const { +- return m_io_service->stopped(); ++ return m_io_context->stopped(); + } + + /// Marks the endpoint as perpetual, stopping it from exiting when empty +@@ -714,7 +712,7 @@ class endpoint : public config::socket_type { + * @since 0.3.0 + */ + void start_perpetual() { +- m_work.reset(new lib::asio::io_service::work(*m_io_service)); ++ m_work.reset(new lib::asio::executor_work_guard(m_io_context->get_executor())); + } + + /// Clears the endpoint's perpetual flag, allowing it to exit when empty +@@ -743,7 +741,7 @@ class endpoint : public config::socket_type { + */ + timer_ptr set_timer(long duration, timer_handler callback) { + timer_ptr new_timer = lib::make_shared( +- *m_io_service, ++ *m_io_context, + lib::asio::milliseconds(duration) + ); + +@@ -880,7 +878,7 @@ class endpoint : public config::socket_type { + + // Create a resolver + if (!m_resolver) { +- m_resolver.reset(new lib::asio::ip::tcp::resolver(*m_io_service)); ++ m_resolver.reset(new lib::asio::ip::tcp::resolver(*m_io_context)); + } + + tcon->set_uri(u); +@@ -912,8 +910,6 @@ class endpoint : public config::socket_type { + port = pu->get_port_str(); + } + +- tcp::resolver::query query(host,port); +- + if (m_alog->static_test(log::alevel::devel)) { + m_alog->write(log::alevel::devel, + "starting async DNS resolve for "+host+":"+port); +@@ -934,7 +930,8 @@ class endpoint : public config::socket_type { + + if (config::enable_multithreading) { + m_resolver->async_resolve( +- query, ++ host, ++ port, + tcon->get_strand()->wrap(lib::bind( + &type::handle_resolve, + this, +@@ -947,7 +944,8 @@ class endpoint : public config::socket_type { + ); + } else { + m_resolver->async_resolve( +- query, ++ host, ++ port, + lib::bind( + &type::handle_resolve, + this, +@@ -995,10 +993,10 @@ class endpoint : public config::socket_type { + + void handle_resolve(transport_con_ptr tcon, timer_ptr dns_timer, + connect_handler callback, lib::asio::error_code const & ec, +- lib::asio::ip::tcp::resolver::iterator iterator) ++ lib::asio::ip::tcp::resolver::results_type endpoints) + { + if (ec == lib::asio::error::operation_aborted || +- lib::asio::is_neg(dns_timer->expires_from_now())) ++ lib::asio::is_neg(dns_timer->expiry() - std::chrono::steady_clock::now())) + { + m_alog->write(log::alevel::devel,"async_resolve cancelled"); + return; +@@ -1016,8 +1014,8 @@ class endpoint : public config::socket_type { + std::stringstream s; + s << "Async DNS resolve successful. Results: "; + +- lib::asio::ip::tcp::resolver::iterator it, end; +- for (it = iterator; it != end; ++it) { ++ lib::asio::ip::tcp::resolver::results_type::iterator it; ++ for (it = endpoints.begin(); it != endpoints.end(); ++it) { + s << (*it).endpoint() << " "; + } + +@@ -1043,7 +1041,7 @@ class endpoint : public config::socket_type { + if (config::enable_multithreading) { + lib::asio::async_connect( + tcon->get_raw_socket(), +- iterator, ++ endpoints, + tcon->get_strand()->wrap(lib::bind( + &type::handle_connect, + this, +@@ -1056,7 +1054,7 @@ class endpoint : public config::socket_type { + } else { + lib::asio::async_connect( + tcon->get_raw_socket(), +- iterator, ++ endpoints, + lib::bind( + &type::handle_connect, + this, +@@ -1106,7 +1104,7 @@ class endpoint : public config::socket_type { + connect_handler callback, lib::asio::error_code const & ec) + { + if (ec == lib::asio::error::operation_aborted || +- lib::asio::is_neg(con_timer->expires_from_now())) ++ lib::asio::is_neg(con_timer->expiry() - std::chrono::steady_clock::now())) + { + m_alog->write(log::alevel::devel,"async_connect cancelled"); + return; +@@ -1148,7 +1146,7 @@ class endpoint : public config::socket_type { + + lib::error_code ec; + +- ec = tcon->init_asio(m_io_service); ++ ec = tcon->init_asio(m_io_context); + if (ec) {return ec;} + + tcon->set_tcp_pre_init_handler(m_tcp_pre_init_handler); +@@ -1187,8 +1185,8 @@ class endpoint : public config::socket_type { + tcp_init_handler m_tcp_post_init_handler; + + // Network Resources +- io_service_ptr m_io_service; +- bool m_external_io_service; ++ io_context_ptr m_io_context; ++ bool m_external_io_context; + acceptor_ptr m_acceptor; + resolver_ptr m_resolver; + work_ptr m_work; +diff --git a/websocketpp/transport/asio/security/none.hpp b/websocketpp/transport/asio/security/none.hpp +index c679378ed..c667b91fe 100644 +--- a/websocketpp/transport/asio/security/none.hpp ++++ b/websocketpp/transport/asio/security/none.hpp +@@ -62,10 +62,10 @@ class connection : public lib::enable_shared_from_this { + /// Type of a shared pointer to this connection socket component + typedef lib::shared_ptr ptr; + +- /// Type of a pointer to the Asio io_service being used +- typedef lib::asio::io_service* io_service_ptr; +- /// Type of a pointer to the Asio io_service strand being used +- typedef lib::shared_ptr strand_ptr; ++ /// Type of a pointer to the Asio io_context being used ++ typedef lib::asio::io_context* io_context_ptr; ++ /// Type of a pointer to the Asio io_context strand being used ++ typedef lib::shared_ptr strand_ptr; + /// Type of the ASIO socket being used + typedef lib::asio::ip::tcp::socket socket_type; + /// Type of a shared pointer to the socket being used. +@@ -156,20 +156,20 @@ class connection : public lib::enable_shared_from_this { + /// Perform one time initializations + /** + * init_asio is called once immediately after construction to initialize +- * Asio components to the io_service. At this stage the connection is ++ * Asio components to the io_context. At this stage the connection is + * speculative, the server may not have actually received a new connection. + * +- * @param service A pointer to the endpoint's io_service ++ * @param service A pointer to the endpoint's io_context + * @param strand A shared pointer to the connection's asio strand + * @param is_server Whether or not the endpoint is a server or not. + */ +- lib::error_code init_asio (io_service_ptr service, strand_ptr, bool) ++ lib::error_code init_asio (io_context_ptr context, strand_ptr, bool) + { + if (m_state != UNINITIALIZED) { + return socket::make_error_code(socket::error::invalid_state); + } + +- m_socket.reset(new lib::asio::ip::tcp::socket(*service)); ++ m_socket.reset(new lib::asio::ip::tcp::socket(*context)); + + m_state = READY; + +diff --git a/websocketpp/transport/asio/security/tls.hpp b/websocketpp/transport/asio/security/tls.hpp +index 25b0d29d0..6e747dfb0 100644 +--- a/websocketpp/transport/asio/security/tls.hpp ++++ b/websocketpp/transport/asio/security/tls.hpp +@@ -71,10 +71,10 @@ class connection : public lib::enable_shared_from_this { + typedef lib::asio::ssl::stream socket_type; + /// Type of a shared pointer to the ASIO socket being used + typedef lib::shared_ptr socket_ptr; +- /// Type of a pointer to the ASIO io_service being used +- typedef lib::asio::io_service * io_service_ptr; +- /// Type of a pointer to the ASIO io_service strand being used +- typedef lib::shared_ptr strand_ptr; ++ /// Type of a pointer to the ASIO io_context being used ++ typedef lib::asio::io_context * io_context_ptr; ++ /// Type of a pointer to the ASIO io_context strand being used ++ typedef lib::shared_ptr strand_ptr; + /// Type of a shared pointer to the ASIO TLS context being used + typedef lib::shared_ptr context_ptr; + +@@ -176,13 +176,13 @@ class connection : public lib::enable_shared_from_this { + /// Perform one time initializations + /** + * init_asio is called once immediately after construction to initialize +- * Asio components to the io_service ++ * Asio components to the io_context + * +- * @param service A pointer to the endpoint's io_service ++ * @param service A pointer to the endpoint's io_context + * @param strand A pointer to the connection's strand + * @param is_server Whether or not the endpoint is a server or not. + */ +- lib::error_code init_asio (io_service_ptr service, strand_ptr strand, ++ lib::error_code init_asio (io_context_ptr context, strand_ptr strand, + bool is_server) + { + if (!m_tls_init_handler) { +@@ -193,9 +193,9 @@ class connection : public lib::enable_shared_from_this { + if (!m_context) { + return socket::make_error_code(socket::error::invalid_tls_context); + } +- m_socket.reset(new socket_type(*service, *m_context)); ++ m_socket.reset(new socket_type(*context, *m_context)); + +- m_io_service = service; ++ m_io_context = context; + m_strand = strand; + m_is_server = is_server; + +@@ -391,7 +391,7 @@ class connection : public lib::enable_shared_from_this { + } + } + +- io_service_ptr m_io_service; ++ io_context_ptr m_io_context; + strand_ptr m_strand; + context_ptr m_context; + socket_ptr m_socket; +diff --git a/websocketpp/transport/debug/endpoint.hpp b/websocketpp/transport/debug/endpoint.hpp +index adc89b382..360644165 100644 +--- a/websocketpp/transport/debug/endpoint.hpp ++++ b/websocketpp/transport/debug/endpoint.hpp +@@ -60,7 +60,7 @@ class endpoint { + /// associated connection transport component + typedef typename transport_con_type::ptr transport_con_ptr; + +- // generate and manage our own io_service ++ // generate and manage our own io_context + explicit endpoint() + { + //std::cout << "transport::iostream::endpoint constructor" << std::endl; +diff --git a/websocketpp/transport/iostream/endpoint.hpp b/websocketpp/transport/iostream/endpoint.hpp +index 14cba7255..257472db8 100644 +--- a/websocketpp/transport/iostream/endpoint.hpp ++++ b/websocketpp/transport/iostream/endpoint.hpp +@@ -64,7 +64,7 @@ class endpoint { + /// associated connection transport component + typedef typename transport_con_type::ptr transport_con_ptr; + +- // generate and manage our own io_service ++ // generate and manage our own io_context + explicit endpoint() : m_output_stream(NULL), m_is_secure(false) + { + //std::cout << "transport::iostream::endpoint constructor" << std::endl; +diff --git a/websocketpp/transport/stub/endpoint.hpp b/websocketpp/transport/stub/endpoint.hpp +index eb6570a4c..e0d5f2d3a 100644 +--- a/websocketpp/transport/stub/endpoint.hpp ++++ b/websocketpp/transport/stub/endpoint.hpp +@@ -60,7 +60,7 @@ class endpoint { + /// associated connection transport component + typedef typename transport_con_type::ptr transport_con_ptr; + +- // generate and manage our own io_service ++ // generate and manage our own io_context + explicit endpoint() + { + //std::cout << "transport::iostream::endpoint constructor" << std::endl; + +From 30e77468e093e8384fa07819b345f81a0431eb37 Mon Sep 17 00:00:00 2001 +From: Amini Allight +Date: Wed, 12 Feb 2025 04:46:30 +0000 +Subject: [PATCH 2/8] updated docstrings + +--- + websocketpp/transport/asio/endpoint.hpp | 4 ++-- + websocketpp/transport/asio/security/none.hpp | 2 +- + websocketpp/transport/asio/security/tls.hpp | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/websocketpp/transport/asio/endpoint.hpp b/websocketpp/transport/asio/endpoint.hpp +index 05453437b..13dda058e 100644 +--- a/websocketpp/transport/asio/endpoint.hpp ++++ b/websocketpp/transport/asio/endpoint.hpp +@@ -510,7 +510,7 @@ class endpoint : public config::socket_type { + * + * @param host A string identifying a location. May be a descriptive name or + * a numeric address string. +- * @param service A string identifying the requested service. This may be a ++ * @param context A string identifying the requested service. This may be a + * descriptive name or a numeric string corresponding to a port number. + * @param ec Set to indicate what error occurred, if any. + */ +@@ -628,7 +628,7 @@ class endpoint : public config::socket_type { + * + * @param host A string identifying a location. May be a descriptive name + * or a numeric address string. +- * @param service A string identifying the requested service. This may be a ++ * @param context A string identifying the requested service. This may be a + * descriptive name or a numeric string corresponding to a port number. + * @param ec Set to indicate what error occurred, if any. + */ +diff --git a/websocketpp/transport/asio/security/none.hpp b/websocketpp/transport/asio/security/none.hpp +index c667b91fe..3033b7648 100644 +--- a/websocketpp/transport/asio/security/none.hpp ++++ b/websocketpp/transport/asio/security/none.hpp +@@ -159,7 +159,7 @@ class connection : public lib::enable_shared_from_this { + * Asio components to the io_context. At this stage the connection is + * speculative, the server may not have actually received a new connection. + * +- * @param service A pointer to the endpoint's io_context ++ * @param context A pointer to the endpoint's io_context + * @param strand A shared pointer to the connection's asio strand + * @param is_server Whether or not the endpoint is a server or not. + */ +diff --git a/websocketpp/transport/asio/security/tls.hpp b/websocketpp/transport/asio/security/tls.hpp +index 6e747dfb0..d65c48cc9 100644 +--- a/websocketpp/transport/asio/security/tls.hpp ++++ b/websocketpp/transport/asio/security/tls.hpp +@@ -178,7 +178,7 @@ class connection : public lib::enable_shared_from_this { + * init_asio is called once immediately after construction to initialize + * Asio components to the io_context + * +- * @param service A pointer to the endpoint's io_context ++ * @param context A pointer to the endpoint's io_context + * @param strand A pointer to the connection's strand + * @param is_server Whether or not the endpoint is a server or not. + */ + +From 3d13472f7489bda718ded20d885dbaf98e36442c Mon Sep 17 00:00:00 2001 +From: Amini Allight +Date: Wed, 12 Feb 2025 04:48:13 +0000 +Subject: [PATCH 3/8] updated docstrings + +--- + websocketpp/transport/asio/endpoint.hpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/websocketpp/transport/asio/endpoint.hpp b/websocketpp/transport/asio/endpoint.hpp +index 13dda058e..05453437b 100644 +--- a/websocketpp/transport/asio/endpoint.hpp ++++ b/websocketpp/transport/asio/endpoint.hpp +@@ -510,7 +510,7 @@ class endpoint : public config::socket_type { + * + * @param host A string identifying a location. May be a descriptive name or + * a numeric address string. +- * @param context A string identifying the requested service. This may be a ++ * @param service A string identifying the requested service. This may be a + * descriptive name or a numeric string corresponding to a port number. + * @param ec Set to indicate what error occurred, if any. + */ +@@ -628,7 +628,7 @@ class endpoint : public config::socket_type { + * + * @param host A string identifying a location. May be a descriptive name + * or a numeric address string. +- * @param context A string identifying the requested service. This may be a ++ * @param service A string identifying the requested service. This may be a + * descriptive name or a numeric string corresponding to a port number. + * @param ec Set to indicate what error occurred, if any. + */ + +From 6867ad089932fc2a786c39dae5ed152991e4ee46 Mon Sep 17 00:00:00 2001 +From: Amini Allight +Date: Fri, 14 Feb 2025 07:48:42 +0000 +Subject: [PATCH 4/8] silenced warning about unused variable in TLS IP address + validation, improved time-to-expiry calculation (credit toonetown), added + CMake flag to compile tests and examples with ASIO standalone, fixed example + and test compilation with ASIO standalone + +--- + CMakeLists.txt | 5 +++ + examples/debug_client/debug_client.cpp | 12 +++--- + .../echo_server_both/echo_server_both.cpp | 16 ++++---- + .../external_io_context.cpp | 2 +- + .../external_io_context/tcp_echo_server.hpp | 28 +++++++------- + .../print_client_tls/print_client_tls.cpp | 14 +++---- + examples/testee_server/testee_server.cpp | 4 +- + test/endpoint/endpoint.cpp | 6 +-- + test/http/parser_perf.cpp | 4 +- + test/transport/asio/timers.cpp | 4 +- + test/transport/integration.cpp | 38 ++++++++++--------- + websocketpp/common/asio.hpp | 2 +- + websocketpp/transport/asio/connection.hpp | 18 ++++----- + websocketpp/transport/asio/endpoint.hpp | 4 +- + websocketpp/transport/asio/security/tls.hpp | 1 + + 15 files changed, 82 insertions(+), 76 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9043db327..badb66409 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -77,6 +77,7 @@ include (CMakeHelpers) + option (ENABLE_CPP11 "Build websocketpp with CPP11 features enabled." TRUE) + option (BUILD_EXAMPLES "Build websocketpp examples." FALSE) + option (BUILD_TESTS "Build websocketpp tests." FALSE) ++option (USE_ASIO_STANDALONE "Build websocketpp examples and tests using the standalone ASIO library." FALSE) + + if (BUILD_TESTS OR BUILD_EXAMPLES) + +@@ -254,6 +255,10 @@ endif() + + ############ Add projects + ++if (USE_ASIO_STANDALONE) ++ add_definitions("-DASIO_STANDALONE -DASIO_HAS_BOOST_DATE_TIME") ++endif () ++ + # Add main library + add_subdirectory (websocketpp) + +diff --git a/examples/debug_client/debug_client.cpp b/examples/debug_client/debug_client.cpp +index 81c595b99..34644583a 100644 +--- a/examples/debug_client/debug_client.cpp ++++ b/examples/debug_client/debug_client.cpp +@@ -43,7 +43,7 @@ using websocketpp::lib::bind; + + // pull out the type of messages sent by our config + typedef websocketpp::config::asio_tls_client::message_type::ptr message_ptr; +-typedef websocketpp::lib::shared_ptr context_ptr; ++typedef websocketpp::lib::shared_ptr context_ptr; + typedef client::connection_ptr connection_ptr; + + +@@ -93,13 +93,13 @@ class perftest { + + context_ptr on_tls_init(websocketpp::connection_hdl) { + m_tls_init = std::chrono::high_resolution_clock::now(); +- context_ptr ctx = websocketpp::lib::make_shared(boost::asio::ssl::context::tlsv1); ++ context_ptr ctx = websocketpp::lib::make_shared(websocketpp::lib::asio::ssl::context::tlsv1); + + try { +- ctx->set_options(boost::asio::ssl::context::default_workarounds | +- boost::asio::ssl::context::no_sslv2 | +- boost::asio::ssl::context::no_sslv3 | +- boost::asio::ssl::context::single_dh_use); ++ ctx->set_options(websocketpp::lib::asio::ssl::context::default_workarounds | ++ websocketpp::lib::asio::ssl::context::no_sslv2 | ++ websocketpp::lib::asio::ssl::context::no_sslv3 | ++ websocketpp::lib::asio::ssl::context::single_dh_use); + } catch (std::exception& e) { + std::cout << e.what() << std::endl; + } +diff --git a/examples/echo_server_both/echo_server_both.cpp b/examples/echo_server_both/echo_server_both.cpp +index a7e020401..c71b9a04c 100644 +--- a/examples/echo_server_both/echo_server_both.cpp ++++ b/examples/echo_server_both/echo_server_both.cpp +@@ -15,7 +15,7 @@ using websocketpp::lib::bind; + using websocketpp::lib::error_code; + + // type of the ssl context pointer is long so alias it +-typedef websocketpp::lib::shared_ptr context_ptr; ++typedef websocketpp::lib::shared_ptr context_ptr; + + // The shared on_message handler takes a template parameter so the function can + // resolve any endpoint dependent types like message_ptr or connection_ptr +@@ -48,16 +48,16 @@ std::string get_password() { + + context_ptr on_tls_init(websocketpp::connection_hdl hdl) { + std::cout << "on_tls_init called with hdl: " << hdl.lock().get() << std::endl; +- context_ptr ctx(new boost::asio::ssl::context(boost::asio::ssl::context::tlsv1)); ++ context_ptr ctx(new websocketpp::lib::asio::ssl::context(websocketpp::lib::asio::ssl::context::tlsv1)); + + try { +- ctx->set_options(boost::asio::ssl::context::default_workarounds | +- boost::asio::ssl::context::no_sslv2 | +- boost::asio::ssl::context::no_sslv3 | +- boost::asio::ssl::context::single_dh_use); ++ ctx->set_options(websocketpp::lib::asio::ssl::context::default_workarounds | ++ websocketpp::lib::asio::ssl::context::no_sslv2 | ++ websocketpp::lib::asio::ssl::context::no_sslv3 | ++ websocketpp::lib::asio::ssl::context::single_dh_use); + ctx->set_password_callback(bind(&get_password)); + ctx->use_certificate_chain_file("server.pem"); +- ctx->use_private_key_file("server.pem", boost::asio::ssl::context::pem); ++ ctx->use_private_key_file("server.pem", websocketpp::lib::asio::ssl::context::pem); + } catch (std::exception& e) { + std::cout << e.what() << std::endl; + } +@@ -67,7 +67,7 @@ context_ptr on_tls_init(websocketpp::connection_hdl hdl) { + int main() { + // set up an external io_context to run both endpoints on. This is not + // strictly necessary, but simplifies thread management a bit. +- boost::asio::io_context ios; ++ websocketpp::lib::asio::io_context ios; + + // set up plain endpoint + server_plain endpoint_plain; +diff --git a/examples/external_io_context/external_io_context.cpp b/examples/external_io_context/external_io_context.cpp +index 08ca8e9f8..18ae2d12d 100644 +--- a/examples/external_io_context/external_io_context.cpp ++++ b/examples/external_io_context/external_io_context.cpp +@@ -66,7 +66,7 @@ void on_end_accept(error_code lib_ec, error_code trans_ec) { + } + + int main() { +- asio::io_context context; ++ websocketpp::lib::asio::io_context context; + + // Add a TCP echo server on port 9003 + tcp_echo_server custom_http_server(context, 9003); +diff --git a/examples/external_io_context/tcp_echo_server.hpp b/examples/external_io_context/tcp_echo_server.hpp +index 2e14703f5..f132c062e 100644 +--- a/examples/external_io_context/tcp_echo_server.hpp ++++ b/examples/external_io_context/tcp_echo_server.hpp +@@ -39,42 +39,40 @@ using websocketpp::lib::placeholders::_1; + using websocketpp::lib::placeholders::_2; + using websocketpp::lib::bind; + +-namespace asio = websocketpp::lib::asio; +- + struct tcp_echo_session : websocketpp::lib::enable_shared_from_this { + typedef websocketpp::lib::shared_ptr ptr; + +- tcp_echo_session(asio::io_context & context) : m_socket(context) {} ++ tcp_echo_session(websocketpp::lib::asio::io_context & context) : m_socket(context) {} + + void start() { +- m_socket.async_read_some(asio::buffer(m_buffer, sizeof(m_buffer)), ++ m_socket.async_read_some(websocketpp::lib::asio::buffer(m_buffer, sizeof(m_buffer)), + websocketpp::lib::bind( + &tcp_echo_session::handle_read, shared_from_this(), _1, _2)); + } + +- void handle_read(const asio::error_code & ec, size_t transferred) { ++ void handle_read(const websocketpp::lib::asio::error_code & ec, size_t transferred) { + if (!ec) { +- asio::async_write(m_socket, +- asio::buffer(m_buffer, transferred), ++ websocketpp::lib::asio::async_write(m_socket, ++ websocketpp::lib::asio::buffer(m_buffer, transferred), + bind(&tcp_echo_session::handle_write, shared_from_this(), _1)); + } + } + +- void handle_write(const asio::error_code & ec) { ++ void handle_write(const websocketpp::lib::asio::error_code & ec) { + if (!ec) { +- m_socket.async_read_some(asio::buffer(m_buffer, sizeof(m_buffer)), ++ m_socket.async_read_some(websocketpp::lib::asio::buffer(m_buffer, sizeof(m_buffer)), + bind(&tcp_echo_session::handle_read, shared_from_this(), _1, _2)); + } + } + +- asio::ip::tcp::socket m_socket; ++ websocketpp::lib::asio::ip::tcp::socket m_socket; + char m_buffer[1024]; + }; + + struct tcp_echo_server { +- tcp_echo_server(asio::io_context & context, short port) ++ tcp_echo_server(websocketpp::lib::asio::io_context & context, short port) + : m_context(context) +- , m_acceptor(context, asio::ip::tcp::endpoint(asio::ip::tcp::v6(), port)) ++ , m_acceptor(context, websocketpp::lib::asio::ip::tcp::endpoint(websocketpp::lib::asio::ip::tcp::v6(), port)) + { + this->start_accept(); + } +@@ -85,13 +83,13 @@ struct tcp_echo_server { + bind(&tcp_echo_server::handle_accept, this, new_session, _1)); + } + +- void handle_accept(tcp_echo_session::ptr new_session, const asio::error_code & ec) { ++ void handle_accept(tcp_echo_session::ptr new_session, const websocketpp::lib::asio::error_code & ec) { + if (!ec) { + new_session->start(); + } + start_accept(); + } + +- asio::io_context & m_context; +- asio::ip::tcp::acceptor m_acceptor; ++ websocketpp::lib::asio::io_context & m_context; ++ websocketpp::lib::asio::ip::tcp::acceptor m_acceptor; + }; +diff --git a/examples/print_client_tls/print_client_tls.cpp b/examples/print_client_tls/print_client_tls.cpp +index 43164eaf7..cf616e165 100644 +--- a/examples/print_client_tls/print_client_tls.cpp ++++ b/examples/print_client_tls/print_client_tls.cpp +@@ -112,7 +112,7 @@ bool verify_common_name(char const * hostname, X509 * cert) { + * and + * https://github.com/iSECPartners/ssl-conservatory + */ +-bool verify_certificate(const char * hostname, bool preverified, boost::asio::ssl::verify_context& ctx) { ++bool verify_certificate(const char * hostname, bool preverified, websocketpp::lib::asio::ssl::verify_context& ctx) { + // The verify callback can be used to check whether the certificate that is + // being presented is valid for the peer. For example, RFC 2818 describes + // the steps involved in doing this for HTTPS. Consult the OpenSSL +@@ -176,16 +176,16 @@ bool verify_certificate(const char * hostname, bool preverified, boost::asio::ss + * (websocketpp.org, for example). + */ + context_ptr on_tls_init(const char * hostname, websocketpp::connection_hdl) { +- context_ptr ctx = websocketpp::lib::make_shared(boost::asio::ssl::context::sslv23); ++ context_ptr ctx = websocketpp::lib::make_shared(websocketpp::lib::asio::ssl::context::sslv23); + + try { +- ctx->set_options(boost::asio::ssl::context::default_workarounds | +- boost::asio::ssl::context::no_sslv2 | +- boost::asio::ssl::context::no_sslv3 | +- boost::asio::ssl::context::single_dh_use); ++ ctx->set_options(websocketpp::lib::asio::ssl::context::default_workarounds | ++ websocketpp::lib::asio::ssl::context::no_sslv2 | ++ websocketpp::lib::asio::ssl::context::no_sslv3 | ++ websocketpp::lib::asio::ssl::context::single_dh_use); + + +- ctx->set_verify_mode(boost::asio::ssl::verify_peer); ++ ctx->set_verify_mode(websocketpp::lib::asio::ssl::verify_peer); + ctx->set_verify_callback(bind(&verify_certificate, hostname, ::_1, ::_2)); + + // Here we load the CA certificates of all CA's that this client trusts. +diff --git a/examples/testee_server/testee_server.cpp b/examples/testee_server/testee_server.cpp +index 7ff1b050f..7689644c9 100644 +--- a/examples/testee_server/testee_server.cpp ++++ b/examples/testee_server/testee_server.cpp +@@ -88,8 +88,8 @@ void on_message(server* s, websocketpp::connection_hdl hdl, message_ptr msg) { + s->send(hdl, msg->get_payload(), msg->get_opcode()); + } + +-void on_socket_init(websocketpp::connection_hdl, boost::asio::ip::tcp::socket & s) { +- boost::asio::ip::tcp::no_delay option(true); ++void on_socket_init(websocketpp::connection_hdl, websocketpp::lib::asio::ip::tcp::socket & s) { ++ websocketpp::lib::asio::ip::tcp::no_delay option(true); + s.set_option(option); + } + +diff --git a/test/endpoint/endpoint.cpp b/test/endpoint/endpoint.cpp +index fa58e6678..c5f5a82d4 100644 +--- a/test/endpoint/endpoint.cpp ++++ b/test/endpoint/endpoint.cpp +@@ -53,7 +53,7 @@ BOOST_AUTO_TEST_CASE( initialize_server_asio ) { + + BOOST_AUTO_TEST_CASE( initialize_server_asio_external ) { + websocketpp::server s; +- boost::asio::io_context ios; ++ websocketpp::lib::asio::io_context ios; + s.init_asio(&ios); + } + +@@ -141,8 +141,8 @@ BOOST_AUTO_TEST_CASE( listen_after_listen_failure ) { + server1.init_asio(); + server2.init_asio(); + +- boost::asio::ip::tcp::endpoint ep1(boost::asio::ip::make_address("127.0.0.1"), 12345); +- boost::asio::ip::tcp::endpoint ep2(boost::asio::ip::make_address("127.0.0.1"), 23456); ++ websocketpp::lib::asio::ip::tcp::endpoint ep1(websocketpp::lib::asio::ip::make_address("127.0.0.1"), 12345); ++ websocketpp::lib::asio::ip::tcp::endpoint ep2(websocketpp::lib::asio::ip::make_address("127.0.0.1"), 23456); + + server1.listen(ep1, ec); + BOOST_CHECK(!ec); +diff --git a/test/http/parser_perf.cpp b/test/http/parser_perf.cpp +index 0c76bc77a..0a9cc0bf2 100644 +--- a/test/http/parser_perf.cpp ++++ b/test/http/parser_perf.cpp +@@ -31,11 +31,11 @@ + + class scoped_timer { + public: +- scoped_timer(std::string i) : m_id(i),m_start(std::chrono::steady_clock::now()) { ++ scoped_timer(std::string i) : m_id(i),m_start(timer_ptr::element_type::clock_type::now()) { + std::cout << "Clock " << i << ": "; + } + ~scoped_timer() { +- std::chrono::nanoseconds time_taken = std::chrono::steady_clock::now()-m_start; ++ std::chrono::nanoseconds time_taken = timer_ptr::element_type::clock_type::now()-m_start; + + //nanoseconds_per_test + +diff --git a/test/transport/asio/timers.cpp b/test/transport/asio/timers.cpp +index 391b755ff..d59654d19 100644 +--- a/test/transport/asio/timers.cpp ++++ b/test/transport/asio/timers.cpp +@@ -106,9 +106,9 @@ struct config { + }; + + // Mock context that does no validation +-typedef websocketpp::lib::shared_ptr context_ptr; ++typedef websocketpp::lib::shared_ptr context_ptr; + context_ptr on_tls_init(websocketpp::connection_hdl) { +- return context_ptr(new boost::asio::ssl::context(boost::asio::ssl::context::sslv23)); ++ return context_ptr(new websocketpp::lib::asio::ssl::context(websocketpp::lib::asio::ssl::context::sslv23)); + } + + // Mock connection +diff --git a/test/transport/integration.cpp b/test/transport/integration.cpp +index ab82b1ab6..526b24302 100644 +--- a/test/transport/integration.cpp ++++ b/test/transport/integration.cpp +@@ -38,6 +38,8 @@ + #include + #include + ++#include "boost/date_time/posix_time/posix_time.hpp" ++ + struct config : public websocketpp::config::asio_client { + typedef config type; + typedef websocketpp::config::asio base; +@@ -218,19 +220,19 @@ void run_time_limited_client(client & c, std::string uri, long timeout, + } + + void run_dummy_server(int port) { +- using boost::asio::ip::tcp; ++ using websocketpp::lib::asio::ip::tcp; + + try { +- boost::asio::io_context io_context; ++ websocketpp::lib::asio::io_context io_context; + tcp::acceptor acceptor(io_context, tcp::endpoint(tcp::v6(), port)); + tcp::socket socket(io_context); + + acceptor.accept(socket); + for (;;) { + char data[512]; +- boost::system::error_code ec; +- socket.read_some(boost::asio::buffer(data), ec); +- if (ec == boost::asio::error::eof) { ++ websocketpp::lib::asio::error_code ec; ++ socket.read_some(websocketpp::lib::asio::buffer(data), ec); ++ if (ec == websocketpp::lib::asio::error::eof) { + break; + } else if (ec) { + // other error +@@ -239,26 +241,26 @@ void run_dummy_server(int port) { + } + } catch (std::exception & e) { + std::cout << e.what() << std::endl; +- } catch (boost::system::error_code & ec) { ++ } catch (websocketpp::lib::asio::error_code & ec) { + std::cout << ec.message() << std::endl; + } + } + + void run_dummy_client(std::string port) { +- using boost::asio::ip::tcp; ++ using websocketpp::lib::asio::ip::tcp; + + try { +- boost::asio::io_context io_context; ++ websocketpp::lib::asio::io_context io_context; + tcp::resolver resolver(io_context); + tcp::resolver::results_type endpoints = resolver.resolve("localhost", port); + tcp::socket socket(io_context); + +- boost::asio::connect(socket, endpoints); ++ websocketpp::lib::asio::connect(socket, endpoints); + for (;;) { + char data[512]; +- boost::system::error_code ec; +- socket.read_some(boost::asio::buffer(data), ec); +- if (ec == boost::asio::error::eof) { ++ websocketpp::lib::asio::error_code ec; ++ socket.read_some(websocketpp::lib::asio::buffer(data), ec); ++ if (ec == websocketpp::lib::asio::error::eof) { + break; + } else if (ec) { + // other error +@@ -267,7 +269,7 @@ void run_dummy_client(std::string port) { + } + } catch (std::exception & e) { + std::cout << e.what() << std::endl; +- } catch (boost::system::error_code & ec) { ++ } catch (websocketpp::lib::asio::error_code & ec) { + std::cout << ec.message() << std::endl; + } + } +@@ -360,7 +362,7 @@ class test_deadline_timer + : m_timer(m_io_context, boost::posix_time::seconds(seconds)) + { + m_timer.async_wait(bind(&test_deadline_timer::expired, this, ::_1)); +- std::size_t (boost::asio::io_context::*run)() = &boost::asio::io_context::run; ++ std::size_t (websocketpp::lib::asio::io_context::*run)() = &websocketpp::lib::asio::io_context::run; + m_timer_thread = websocketpp::lib::thread(websocketpp::lib::bind(run, &m_io_context)); + } + ~test_deadline_timer() +@@ -370,16 +372,16 @@ class test_deadline_timer + } + + private: +- void expired(const boost::system::error_code & ec) ++ void expired(const websocketpp::lib::asio::error_code & ec) + { +- if (ec == boost::asio::error::operation_aborted) ++ if (ec == websocketpp::lib::asio::error::operation_aborted) + return; + BOOST_CHECK(!ec); + BOOST_FAIL("Test timed out"); + } + +- boost::asio::io_context m_io_context; +- boost::asio::deadline_timer m_timer; ++ websocketpp::lib::asio::io_context m_io_context; ++ websocketpp::lib::asio::deadline_timer m_timer; + websocketpp::lib::thread m_timer_thread; + }; + +diff --git a/websocketpp/common/asio.hpp b/websocketpp/common/asio.hpp +index 3c8fa13e9..7322c25ae 100644 +--- a/websocketpp/common/asio.hpp ++++ b/websocketpp/common/asio.hpp +@@ -51,7 +51,7 @@ + + #include + #include +- #include ++ #include + #else + #include + +diff --git a/websocketpp/transport/asio/connection.hpp b/websocketpp/transport/asio/connection.hpp +index af8eec5e1..389f72768 100644 +--- a/websocketpp/transport/asio/connection.hpp ++++ b/websocketpp/transport/asio/connection.hpp +@@ -380,7 +380,7 @@ class connection : public config::socket_type::socket_con_type { + * fail handler is called. + * + * Primarily used if you are using mismatched asio / system_error +- * implementations such as `boost::asio` with `std::system_error`. In these ++ * implementations such as `lib::asio` with `std::system_error`. In these + * cases the transport error type is different than the library error type + * and some WebSocket++ functions that return transport errors via the + * library error code type will be coerced into a catch all `pass_through` +@@ -579,7 +579,7 @@ class connection : public config::socket_type::socket_con_type { + lib::error_code const & ec) + { + if (ec == transport::error::operation_aborted || +- (post_timer && lib::asio::is_neg(post_timer->expiry() - std::chrono::steady_clock::now()))) ++ (post_timer && lib::asio::is_neg(post_timer->expiry() - timer_ptr::element_type::clock_type::now()))) + { + m_alog->write(log::alevel::devel,"post_init cancelled"); + return; +@@ -685,7 +685,7 @@ class connection : public config::socket_type::socket_con_type { + // Whatever aborted it will be issuing the callback so we are safe to + // return + if (ec == lib::asio::error::operation_aborted || +- lib::asio::is_neg(m_proxy_data->timer->expiry() - std::chrono::steady_clock::now())) ++ lib::asio::is_neg(m_proxy_data->timer->expiry() - timer_ptr::element_type::clock_type::now())) + { + m_elog->write(log::elevel::devel,"write operation aborted"); + return; +@@ -756,7 +756,7 @@ class connection : public config::socket_type::socket_con_type { + // Whatever aborted it will be issuing the callback so we are safe to + // return + if (ec == lib::asio::error::operation_aborted || +- lib::asio::is_neg(m_proxy_data->timer->expiry() - std::chrono::steady_clock::now())) ++ lib::asio::is_neg(m_proxy_data->timer->expiry() - timer_ptr::element_type::clock_type::now())) + { + m_elog->write(log::elevel::devel,"read operation aborted"); + return; +@@ -1030,18 +1030,18 @@ class connection : public config::socket_type::socket_con_type { + */ + lib::error_code interrupt(interrupt_handler handler) { + if (config::enable_multithreading) { +- boost::asio::post(m_io_context->get_executor(), m_strand->wrap(handler)); ++ lib::asio::post(m_io_context->get_executor(), m_strand->wrap(handler)); + } else { +- boost::asio::post(m_io_context->get_executor(), handler); ++ lib::asio::post(m_io_context->get_executor(), handler); + } + return lib::error_code(); + } + + lib::error_code dispatch(dispatch_handler handler) { + if (config::enable_multithreading) { +- boost::asio::post(m_io_context->get_executor(), m_strand->wrap(handler)); ++ lib::asio::post(m_io_context->get_executor(), m_strand->wrap(handler)); + } else { +- boost::asio::post(m_io_context->get_executor(), handler); ++ lib::asio::post(m_io_context->get_executor(), handler); + } + return lib::error_code(); + } +@@ -1113,7 +1113,7 @@ class connection : public config::socket_type::socket_con_type { + callback, lib::asio::error_code const & ec) + { + if (ec == lib::asio::error::operation_aborted || +- lib::asio::is_neg(shutdown_timer->expiry() - std::chrono::steady_clock::now())) ++ lib::asio::is_neg(shutdown_timer->expiry() - timer_ptr::element_type::clock_type::now())) + { + m_alog->write(log::alevel::devel,"async_shutdown cancelled"); + return; +diff --git a/websocketpp/transport/asio/endpoint.hpp b/websocketpp/transport/asio/endpoint.hpp +index 05453437b..2871ff678 100644 +--- a/websocketpp/transport/asio/endpoint.hpp ++++ b/websocketpp/transport/asio/endpoint.hpp +@@ -996,7 +996,7 @@ class endpoint : public config::socket_type { + lib::asio::ip::tcp::resolver::results_type endpoints) + { + if (ec == lib::asio::error::operation_aborted || +- lib::asio::is_neg(dns_timer->expiry() - std::chrono::steady_clock::now())) ++ lib::asio::is_neg(dns_timer->expiry() - timer_ptr::element_type::clock_type::now())) + { + m_alog->write(log::alevel::devel,"async_resolve cancelled"); + return; +@@ -1104,7 +1104,7 @@ class endpoint : public config::socket_type { + connect_handler callback, lib::asio::error_code const & ec) + { + if (ec == lib::asio::error::operation_aborted || +- lib::asio::is_neg(con_timer->expiry() - std::chrono::steady_clock::now())) ++ lib::asio::is_neg(con_timer->expiry() - timer_ptr::element_type::clock_type::now())) + { + m_alog->write(log::alevel::devel,"async_connect cancelled"); + return; +diff --git a/websocketpp/transport/asio/security/tls.hpp b/websocketpp/transport/asio/security/tls.hpp +index d65c48cc9..1db1a1074 100644 +--- a/websocketpp/transport/asio/security/tls.hpp ++++ b/websocketpp/transport/asio/security/tls.hpp +@@ -240,6 +240,7 @@ class connection : public lib::enable_shared_from_this { + + // run the hostname through make_address to check if it is a valid IP literal + lib::asio::ip::address addr = lib::asio::ip::make_address(host, ec_addr); ++ (void)addr; + + // If the parsing as an IP literal fails, proceed to register the hostname + // with the TLS handshake via SNI. + +From dbdde20a9b4ffd49f480fd9e6e29ea212a73253b Mon Sep 17 00:00:00 2001 +From: Amini Allight +Date: Fri, 14 Feb 2025 23:13:38 +0000 +Subject: [PATCH 5/8] improved variable names and fixed comments + +--- + .../echo_server_both/echo_server_both.cpp | 8 ++--- + test/endpoint/endpoint.cpp | 4 +-- + test/transport/asio/timers.cpp | 4 +-- + test/transport/integration.cpp | 4 +-- + websocketpp/transport/asio/connection.hpp | 2 +- + websocketpp/transport/asio/endpoint.hpp | 30 +++++++++---------- + 6 files changed, 25 insertions(+), 27 deletions(-) + +diff --git a/examples/echo_server_both/echo_server_both.cpp b/examples/echo_server_both/echo_server_both.cpp +index c71b9a04c..af33cd23e 100644 +--- a/examples/echo_server_both/echo_server_both.cpp ++++ b/examples/echo_server_both/echo_server_both.cpp +@@ -67,12 +67,12 @@ context_ptr on_tls_init(websocketpp::connection_hdl hdl) { + int main() { + // set up an external io_context to run both endpoints on. This is not + // strictly necessary, but simplifies thread management a bit. +- websocketpp::lib::asio::io_context ios; ++ websocketpp::lib::asio::io_context ctx; + + // set up plain endpoint + server_plain endpoint_plain; + // initialize asio with our external io_context rather than an internal one +- endpoint_plain.init_asio(&ios); ++ endpoint_plain.init_asio(&ctx); + endpoint_plain.set_message_handler( + bind(&on_message,&endpoint_plain,::_1,::_2)); + endpoint_plain.listen(80); +@@ -80,7 +80,7 @@ int main() { + + // set up tls endpoint + server_tls endpoint_tls; +- endpoint_tls.init_asio(&ios); ++ endpoint_tls.init_asio(&ctx); + endpoint_tls.set_message_handler( + bind(&on_message,&endpoint_tls,::_1,::_2)); + // TLS endpoint has an extra handler for the tls init +@@ -90,5 +90,5 @@ int main() { + endpoint_tls.start_accept(&on_end_accept); + + // Start the ASIO io_context run loop running both endpoints +- ios.run(); ++ ctx.run(); + } +diff --git a/test/endpoint/endpoint.cpp b/test/endpoint/endpoint.cpp +index c5f5a82d4..184027848 100644 +--- a/test/endpoint/endpoint.cpp ++++ b/test/endpoint/endpoint.cpp +@@ -53,8 +53,8 @@ BOOST_AUTO_TEST_CASE( initialize_server_asio ) { + + BOOST_AUTO_TEST_CASE( initialize_server_asio_external ) { + websocketpp::server s; +- websocketpp::lib::asio::io_context ios; +- s.init_asio(&ios); ++ websocketpp::lib::asio::io_context ctx; ++ s.init_asio(&ctx); + } + + #ifdef _WEBSOCKETPP_MOVE_SEMANTICS_ +diff --git a/test/transport/asio/timers.cpp b/test/transport/asio/timers.cpp +index d59654d19..84938cbf0 100644 +--- a/test/transport/asio/timers.cpp ++++ b/test/transport/asio/timers.cpp +@@ -79,8 +79,8 @@ void run_dummy_server(int port) { + + // Wait for the specified time period then fail the test + void run_test_timer(long value) { +- boost::asio::io_context ios; +- boost::asio::deadline_timer t(ios,boost::posix_time::milliseconds(value)); ++ boost::asio::io_context ctx; ++ boost::asio::deadline_timer t(ctx,boost::posix_time::milliseconds(value)); + boost::system::error_code ec; + t.wait(ec); + BOOST_FAIL( "Test timed out" ); +diff --git a/test/transport/integration.cpp b/test/transport/integration.cpp +index 526b24302..371c5540f 100644 +--- a/test/transport/integration.cpp ++++ b/test/transport/integration.cpp +@@ -252,10 +252,10 @@ void run_dummy_client(std::string port) { + try { + websocketpp::lib::asio::io_context io_context; + tcp::resolver resolver(io_context); +- tcp::resolver::results_type endpoints = resolver.resolve("localhost", port); ++ tcp::resolver::results_type results = resolver.resolve("localhost", port); + tcp::socket socket(io_context); + +- websocketpp::lib::asio::connect(socket, endpoints); ++ websocketpp::lib::asio::connect(socket, results); + for (;;) { + char data[512]; + websocketpp::lib::asio::error_code ec; +diff --git a/websocketpp/transport/asio/connection.hpp b/websocketpp/transport/asio/connection.hpp +index 389f72768..3c14261fa 100644 +--- a/websocketpp/transport/asio/connection.hpp ++++ b/websocketpp/transport/asio/connection.hpp +@@ -380,7 +380,7 @@ class connection : public config::socket_type::socket_con_type { + * fail handler is called. + * + * Primarily used if you are using mismatched asio / system_error +- * implementations such as `lib::asio` with `std::system_error`. In these ++ * implementations such as `boost::asio` with `std::system_error`. In these + * cases the transport error type is different than the library error type + * and some WebSocket++ functions that return transport errors via the + * library error code type will be coerced into a catch all `pass_through` +diff --git a/websocketpp/transport/asio/endpoint.hpp b/websocketpp/transport/asio/endpoint.hpp +index 2871ff678..60b457610 100644 +--- a/websocketpp/transport/asio/endpoint.hpp ++++ b/websocketpp/transport/asio/endpoint.hpp +@@ -86,7 +86,7 @@ class endpoint : public config::socket_type { + /// Type of timer handle + typedef lib::shared_ptr timer_ptr; + /// Type of a shared pointer to an io_context work object +- typedef lib::shared_ptr> work_ptr; ++ typedef lib::shared_ptr> work_guard_ptr; + + /// Type of socket pre-bind handler + typedef lib::function tcp_pre_bind_handler; +@@ -108,7 +108,7 @@ class endpoint : public config::socket_type { + // Explicitly destroy local objects + m_acceptor.reset(); + m_resolver.reset(); +- m_work.reset(); ++ m_work_guard.reset(); + if (m_state != UNINITIALIZED && !m_external_io_context) { + delete m_io_context; + } +@@ -495,8 +495,7 @@ class endpoint : public config::socket_type { + /** + * Bind the internal acceptor using the given host and service. More details + * about what host and service can be are available in the Asio +- * documentation for ip::basic_resolver_query::basic_resolver_query's +- * constructors. ++ * documentation for the ip::basic_resolver::resolve function. + * + * The endpoint must have been initialized by calling init_asio before + * listening. +@@ -519,14 +518,14 @@ class endpoint : public config::socket_type { + { + using lib::asio::ip::tcp; + tcp::resolver r(*m_io_context); +- tcp::resolver::results_type endpoints = r.resolve(host, service); +- if (endpoints.empty()) { ++ tcp::resolver::results_type results = r.resolve(host, service); ++ if (results.empty()) { + m_elog->write(log::elevel::library, + "asio::listen could not resolve the supplied host or service"); + ec = make_error_code(error::invalid_host_service); + return; + } +- listen(*endpoints.begin(),ec); ++ listen(*(results.begin()),ec); + } + + /// Stop listening (exception free) +@@ -613,8 +612,7 @@ class endpoint : public config::socket_type { + /** + * Bind the internal acceptor using the given host and service. More + * details about what host and service can be are available in the Asio +- * documentation for ip::basic_resolver_query::basic_resolver_query's +- * constructors. ++ * documentation for the ip::basic_resolver::resolve function. + * + * The endpoint must have been initialized by calling init_asio before + * listening. +@@ -712,7 +710,7 @@ class endpoint : public config::socket_type { + * @since 0.3.0 + */ + void start_perpetual() { +- m_work.reset(new lib::asio::executor_work_guard(m_io_context->get_executor())); ++ m_work_guard.reset(new lib::asio::executor_work_guard(m_io_context->get_executor())); + } + + /// Clears the endpoint's perpetual flag, allowing it to exit when empty +@@ -724,7 +722,7 @@ class endpoint : public config::socket_type { + * @since 0.3.0 + */ + void stop_perpetual() { +- m_work.reset(); ++ m_work_guard.reset(); + } + + /// Call back a function after a period of time. +@@ -993,7 +991,7 @@ class endpoint : public config::socket_type { + + void handle_resolve(transport_con_ptr tcon, timer_ptr dns_timer, + connect_handler callback, lib::asio::error_code const & ec, +- lib::asio::ip::tcp::resolver::results_type endpoints) ++ lib::asio::ip::tcp::resolver::results_type results) + { + if (ec == lib::asio::error::operation_aborted || + lib::asio::is_neg(dns_timer->expiry() - timer_ptr::element_type::clock_type::now())) +@@ -1015,7 +1013,7 @@ class endpoint : public config::socket_type { + s << "Async DNS resolve successful. Results: "; + + lib::asio::ip::tcp::resolver::results_type::iterator it; +- for (it = endpoints.begin(); it != endpoints.end(); ++it) { ++ for (it = results.begin(); it != results.end(); ++it) { + s << (*it).endpoint() << " "; + } + +@@ -1041,7 +1039,7 @@ class endpoint : public config::socket_type { + if (config::enable_multithreading) { + lib::asio::async_connect( + tcon->get_raw_socket(), +- endpoints, ++ results, + tcon->get_strand()->wrap(lib::bind( + &type::handle_connect, + this, +@@ -1054,7 +1052,7 @@ class endpoint : public config::socket_type { + } else { + lib::asio::async_connect( + tcon->get_raw_socket(), +- endpoints, ++ results, + lib::bind( + &type::handle_connect, + this, +@@ -1189,7 +1187,7 @@ class endpoint : public config::socket_type { + bool m_external_io_context; + acceptor_ptr m_acceptor; + resolver_ptr m_resolver; +- work_ptr m_work; ++ work_guard_ptr m_work_guard; + + // Network constants + int m_listen_backlog; + +From 096487461fe834c30fb322ac0b9088ad82e5a2d5 Mon Sep 17 00:00:00 2001 +From: Amini Allight +Date: Thu, 20 Feb 2025 06:19:46 +0000 +Subject: [PATCH 6/8] fixed use of deprecated boost::asio::deadline_timer in + tests + +--- + test/transport/asio/timers.cpp | 3 ++- + test/transport/integration.cpp | 27 ++++++++++++++------------- + 2 files changed, 16 insertions(+), 14 deletions(-) + +diff --git a/test/transport/asio/timers.cpp b/test/transport/asio/timers.cpp +index 84938cbf0..22a4bba82 100644 +--- a/test/transport/asio/timers.cpp ++++ b/test/transport/asio/timers.cpp +@@ -80,7 +80,8 @@ void run_dummy_server(int port) { + // Wait for the specified time period then fail the test + void run_test_timer(long value) { + boost::asio::io_context ctx; +- boost::asio::deadline_timer t(ctx,boost::posix_time::milliseconds(value)); ++ boost::asio::system_timer t(ctx); ++ t.expires_after(std::chrono::milliseconds(value)); + boost::system::error_code ec; + t.wait(ec); + BOOST_FAIL( "Test timed out" ); +diff --git a/test/transport/integration.cpp b/test/transport/integration.cpp +index 371c5540f..70f444292 100644 +--- a/test/transport/integration.cpp ++++ b/test/transport/integration.cpp +@@ -355,17 +355,18 @@ void close(T * e, websocketpp::connection_hdl hdl) { + e->get_con_from_hdl(hdl)->close(websocketpp::close::status::normal,""); + } + +-class test_deadline_timer ++class test_system_timer + { + public: +- test_deadline_timer(int seconds) +- : m_timer(m_io_context, boost::posix_time::seconds(seconds)) ++ test_system_timer(int seconds) ++ : m_timer(m_io_context) + { +- m_timer.async_wait(bind(&test_deadline_timer::expired, this, ::_1)); ++ m_timer.expires_after(std::chrono::seconds(seconds)); ++ m_timer.async_wait(bind(&test_system_timer::expired, this, ::_1)); + std::size_t (websocketpp::lib::asio::io_context::*run)() = &websocketpp::lib::asio::io_context::run; + m_timer_thread = websocketpp::lib::thread(websocketpp::lib::bind(run, &m_io_context)); + } +- ~test_deadline_timer() ++ ~test_system_timer() + { + m_timer.cancel(); + m_timer_thread.join(); +@@ -381,7 +382,7 @@ class test_deadline_timer + } + + websocketpp::lib::asio::io_context m_io_context; +- websocketpp::lib::asio::deadline_timer m_timer; ++ websocketpp::lib::asio::system_timer m_timer; + websocketpp::lib::thread m_timer_thread; + }; + +@@ -427,7 +428,7 @@ BOOST_AUTO_TEST_CASE( pong_timeout ) { + websocketpp::lib::thread sthread(websocketpp::lib::bind(&run_server,&s,9005,false)); + sleep(1); // give the server thread some time to start + +- test_deadline_timer deadline(10); ++ test_system_timer deadline(10); + + run_client(c, "http://localhost:9005",false); + +@@ -448,7 +449,7 @@ BOOST_AUTO_TEST_CASE( client_open_handshake_timeout ) { + + sleep(1); // give the server thread some time to start + +- test_deadline_timer deadline(10); ++ test_system_timer deadline(10); + + run_client(c, "http://localhost:9005"); + } +@@ -464,7 +465,7 @@ BOOST_AUTO_TEST_CASE( server_open_handshake_timeout ) { + + websocketpp::lib::thread sthread(websocketpp::lib::bind(&run_server,&s,9005,false)); + +- test_deadline_timer deadline(10); ++ test_system_timer deadline(10); + + sleep(1); // give the server thread some time to start + +@@ -489,7 +490,7 @@ BOOST_AUTO_TEST_CASE( client_self_initiated_close_handshake_timeout ) { + + websocketpp::lib::thread sthread(websocketpp::lib::bind(&run_server,&s,9005,false)); + +- test_deadline_timer deadline(10); ++ test_system_timer deadline(10); + + sleep(1); // give the server thread some time to start + +@@ -522,7 +523,7 @@ BOOST_AUTO_TEST_CASE( server_self_initiated_close_handshake_timeout ) { + c.set_open_handler(bind(&delay,::_1,1)); + + websocketpp::lib::thread sthread(websocketpp::lib::bind(&run_server,&s,9005,false)); +- test_deadline_timer deadline(10); ++ test_system_timer deadline(10); + + sleep(1); // give the server thread some time to start + +@@ -534,7 +535,7 @@ BOOST_AUTO_TEST_CASE( server_self_initiated_close_handshake_timeout ) { + BOOST_AUTO_TEST_CASE( client_runs_out_of_work ) { + client c; + +- test_deadline_timer deadline(3); ++ test_system_timer deadline(3); + + websocketpp::lib::error_code ec; + c.init_asio(ec); +@@ -600,7 +601,7 @@ BOOST_AUTO_TEST_CASE( stop_listening ) { + c.set_open_handler(bind(&close,&c,::_1)); + + websocketpp::lib::thread sthread(websocketpp::lib::bind(&run_server,&s,9005,false)); +- test_deadline_timer deadline(5); ++ test_system_timer deadline(5); + + sleep(1); // give the server thread some time to start + + +From a11fa6fe4937ca251753e90b1836a68bf57768a9 Mon Sep 17 00:00:00 2001 +From: Amini Allight +Date: Thu, 20 Feb 2025 17:25:03 +0000 +Subject: [PATCH 7/8] replaced uses of boost::asio::io_context::strand::wrap + with boost::asio::bind_executor to avoid future deprecation issues + +--- + websocketpp/transport/asio/connection.hpp | 16 ++++++++-------- + websocketpp/transport/asio/endpoint.hpp | 6 +++--- + websocketpp/transport/asio/security/tls.hpp | 4 ++-- + 3 files changed, 13 insertions(+), 13 deletions(-) + +diff --git a/websocketpp/transport/asio/connection.hpp b/websocketpp/transport/asio/connection.hpp +index 3c14261fa..5f47466e7 100644 +--- a/websocketpp/transport/asio/connection.hpp ++++ b/websocketpp/transport/asio/connection.hpp +@@ -324,7 +324,7 @@ class connection : public config::socket_type::socket_con_type { + ); + + if (config::enable_multithreading) { +- new_timer->async_wait(m_strand->wrap(lib::bind( ++ new_timer->async_wait(lib::asio::bind_executor(*m_strand, lib::bind( + &type::handle_timer, get_shared(), + new_timer, + callback, +@@ -635,7 +635,7 @@ class connection : public config::socket_type::socket_con_type { + lib::asio::async_write( + socket_con_type::get_next_layer(), + m_bufs, +- m_strand->wrap(lib::bind( ++ lib::asio::bind_executor(*m_strand, lib::bind( + &type::handle_proxy_write, get_shared(), + callback, + lib::placeholders::_1 +@@ -718,7 +718,7 @@ class connection : public config::socket_type::socket_con_type { + socket_con_type::get_next_layer(), + m_proxy_data->read_buf, + "\r\n\r\n", +- m_strand->wrap(lib::bind( ++ lib::asio::bind_executor(*m_strand, lib::bind( + &type::handle_proxy_read, get_shared(), + callback, + lib::placeholders::_1, lib::placeholders::_2 +@@ -856,7 +856,7 @@ class connection : public config::socket_type::socket_con_type { + socket_con_type::get_socket(), + lib::asio::buffer(buf,len), + lib::asio::transfer_at_least(num_bytes), +- m_strand->wrap(make_custom_alloc_handler( ++ lib::asio::bind_executor(*m_strand, make_custom_alloc_handler( + m_read_handler_allocator, + lib::bind( + &type::handle_async_read, get_shared(), +@@ -925,7 +925,7 @@ class connection : public config::socket_type::socket_con_type { + lib::asio::async_write( + socket_con_type::get_socket(), + m_bufs, +- m_strand->wrap(make_custom_alloc_handler( ++ lib::asio::bind_executor(*m_strand, make_custom_alloc_handler( + m_write_handler_allocator, + lib::bind( + &type::handle_async_write, get_shared(), +@@ -965,7 +965,7 @@ class connection : public config::socket_type::socket_con_type { + lib::asio::async_write( + socket_con_type::get_socket(), + m_bufs, +- m_strand->wrap(make_custom_alloc_handler( ++ lib::asio::bind_executor(*m_strand, make_custom_alloc_handler( + m_write_handler_allocator, + lib::bind( + &type::handle_async_write, get_shared(), +@@ -1030,7 +1030,7 @@ class connection : public config::socket_type::socket_con_type { + */ + lib::error_code interrupt(interrupt_handler handler) { + if (config::enable_multithreading) { +- lib::asio::post(m_io_context->get_executor(), m_strand->wrap(handler)); ++ lib::asio::post(m_io_context->get_executor(), lib::asio::bind_executor(*m_strand, handler)); + } else { + lib::asio::post(m_io_context->get_executor(), handler); + } +@@ -1039,7 +1039,7 @@ class connection : public config::socket_type::socket_con_type { + + lib::error_code dispatch(dispatch_handler handler) { + if (config::enable_multithreading) { +- lib::asio::post(m_io_context->get_executor(), m_strand->wrap(handler)); ++ lib::asio::post(m_io_context->get_executor(), lib::asio::bind_executor(*m_strand, handler)); + } else { + lib::asio::post(m_io_context->get_executor(), handler); + } +diff --git a/websocketpp/transport/asio/endpoint.hpp b/websocketpp/transport/asio/endpoint.hpp +index 60b457610..4d03ba51f 100644 +--- a/websocketpp/transport/asio/endpoint.hpp ++++ b/websocketpp/transport/asio/endpoint.hpp +@@ -802,7 +802,7 @@ class endpoint : public config::socket_type { + if (config::enable_multithreading) { + m_acceptor->async_accept( + tcon->get_raw_socket(), +- tcon->get_strand()->wrap(lib::bind( ++ lib::asio::bind_executor(*tcon->get_strand(), lib::bind( + &type::handle_accept, + this, + callback, +@@ -930,7 +930,7 @@ class endpoint : public config::socket_type { + m_resolver->async_resolve( + host, + port, +- tcon->get_strand()->wrap(lib::bind( ++ lib::asio::bind_executor(*tcon->get_strand(), lib::bind( + &type::handle_resolve, + this, + tcon, +@@ -1040,7 +1040,7 @@ class endpoint : public config::socket_type { + lib::asio::async_connect( + tcon->get_raw_socket(), + results, +- tcon->get_strand()->wrap(lib::bind( ++ lib::asio::bind_executor(*tcon->get_strand(), lib::bind( + &type::handle_connect, + this, + tcon, +diff --git a/websocketpp/transport/asio/security/tls.hpp b/websocketpp/transport/asio/security/tls.hpp +index 1db1a1074..f894f0e89 100644 +--- a/websocketpp/transport/asio/security/tls.hpp ++++ b/websocketpp/transport/asio/security/tls.hpp +@@ -277,7 +277,7 @@ class connection : public lib::enable_shared_from_this { + if (m_strand) { + m_socket->async_handshake( + get_handshake_type(), +- m_strand->wrap(lib::bind( ++ lib::asio::bind_executor(*m_strand, lib::bind( + &type::handle_init, get_shared(), + callback, + lib::placeholders::_1 +@@ -337,7 +337,7 @@ class connection : public lib::enable_shared_from_this { + + void async_shutdown(socket::shutdown_handler callback) { + if (m_strand) { +- m_socket->async_shutdown(m_strand->wrap(callback)); ++ m_socket->async_shutdown(lib::asio::bind_executor(*m_strand, callback)); + } else { + m_socket->async_shutdown(callback); + } + +From ee8cf4257e001d939839cff5b1766a835b749cd6 Mon Sep 17 00:00:00 2001 +From: Amini Allight +Date: Wed, 9 Apr 2025 05:45:40 +0000 +Subject: [PATCH 8/8] increased minimum Boost version in CMakeLists, fixed use + of FindBoost in CMakeLists, bumped CMakeLists version, removed unnecessary + boost compatibility macros + +--- + CMakeLists.txt | 5 ++--- + websocketpp/common/random.hpp | 12 ++---------- + 2 files changed, 4 insertions(+), 13 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index badb66409..43f7f3255 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,7 +2,7 @@ + ############ Setup project and cmake + # Minimum cmake requirement. We should require a quite recent + # cmake for the dependency find macros etc. to be up to date. +-cmake_minimum_required (VERSION 2.8.8) ++cmake_minimum_required (VERSION 3.10) + + ############ Paths + +@@ -222,9 +222,8 @@ if (BUILD_TESTS OR BUILD_EXAMPLES) + set (Boost_FIND_QUIETLY TRUE) + set (Boost_DEBUG FALSE) + set (Boost_USE_MULTITHREADED TRUE) +- set (Boost_ADDITIONAL_VERSIONS "1.39.0" "1.40.0" "1.41.0" "1.42.0" "1.43.0" "1.44.0" "1.46.1") # todo: someone who knows better spesify these! + +- find_package (Boost 1.39.0 COMPONENTS ${WEBSOCKETPP_BOOST_LIBS}) ++ find_package (Boost 1.66.0 NO_MODULE COMPONENTS ${WEBSOCKETPP_BOOST_LIBS}) + + if (Boost_FOUND) + # Boost is a project wide global dependency. +diff --git a/websocketpp/common/random.hpp b/websocketpp/common/random.hpp +index ddf996941..7ac974563 100644 +--- a/websocketpp/common/random.hpp ++++ b/websocketpp/common/random.hpp +@@ -53,16 +53,8 @@ + #ifdef _WEBSOCKETPP_CPP11_RANDOM_DEVICE_ + #include + #else +- #include +- +- #if (BOOST_VERSION/100000) == 1 && ((BOOST_VERSION/100)%1000) > 46 +- #include +- #include +- #elif (BOOST_VERSION/100000) == 1 && ((BOOST_VERSION/100)%1000) >= 43 +- #include +- #else +- // TODO: static_assert(false, "Could not find a suitable random_device") +- #endif ++ #include ++ #include + #endif + + namespace websocketpp { diff --git a/websocketpp-0.8.2-cpp20-fixes.patch b/websocketpp-0.8.2-cpp20-fixes.patch deleted file mode 100644 index 65c2fb8..0000000 --- a/websocketpp-0.8.2-cpp20-fixes.patch +++ /dev/null @@ -1,106 +0,0 @@ -From 3197a520eb4c1e4754860441918a5930160373eb Mon Sep 17 00:00:00 2001 -From: Peter Thorson -Date: Tue, 29 Jun 2021 09:13:12 -0500 -Subject: [PATCH] [core] Remove the use of simple template ids as they have - been removed in c++20. - https://timsong-cpp.github.io/cppwp/n4861/diff.cpp17.class#2 references #991 - ---- - websocketpp/endpoint.hpp | 2 +- - websocketpp/logger/basic.hpp | 14 +++++++------- - websocketpp/roles/server_endpoint.hpp | 6 +++--- - 3 files changed, 11 insertions(+), 11 deletions(-) - -diff --git a/websocketpp/endpoint.hpp b/websocketpp/endpoint.hpp -index 825eaa46d..10f525689 100644 ---- a/websocketpp/endpoint.hpp -+++ b/websocketpp/endpoint.hpp -@@ -111,7 +111,7 @@ class endpoint : public config::transport_type, public config::endpoint_base { - - - /// Destructor -- ~endpoint() {} -+ ~endpoint() {} - - #ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_ - // no copy constructor because endpoints are not copyable -diff --git a/websocketpp/logger/basic.hpp b/websocketpp/logger/basic.hpp -index 84514130e..4c9d83649 100644 ---- a/websocketpp/logger/basic.hpp -+++ b/websocketpp/logger/basic.hpp -@@ -58,33 +58,33 @@ namespace log { - template - class basic { - public: -- basic(channel_type_hint::value h = -+ basic(channel_type_hint::value h = - channel_type_hint::access) - : m_static_channels(0xffffffff) - , m_dynamic_channels(0) - , m_out(h == channel_type_hint::error ? &std::cerr : &std::cout) {} - -- basic(std::ostream * out) -+ basic(std::ostream * out) - : m_static_channels(0xffffffff) - , m_dynamic_channels(0) - , m_out(out) {} - -- basic(level c, channel_type_hint::value h = -+ basic(level c, channel_type_hint::value h = - channel_type_hint::access) - : m_static_channels(c) - , m_dynamic_channels(0) - , m_out(h == channel_type_hint::error ? &std::cerr : &std::cout) {} - -- basic(level c, std::ostream * out) -+ basic(level c, std::ostream * out) - : m_static_channels(c) - , m_dynamic_channels(0) - , m_out(out) {} - - /// Destructor -- ~basic() {} -+ ~basic() {} - - /// Copy constructor -- basic(basic const & other) -+ basic(basic const & other) - : m_static_channels(other.m_static_channels) - , m_dynamic_channels(other.m_dynamic_channels) - , m_out(other.m_out) -@@ -97,7 +97,7 @@ class basic { - - #ifdef _WEBSOCKETPP_MOVE_SEMANTICS_ - /// Move constructor -- basic(basic && other) -+ basic(basic && other) - : m_static_channels(other.m_static_channels) - , m_dynamic_channels(other.m_dynamic_channels) - , m_out(other.m_out) -diff --git a/websocketpp/roles/server_endpoint.hpp b/websocketpp/roles/server_endpoint.hpp -index 4a5865eff..04fee18f9 100644 ---- a/websocketpp/roles/server_endpoint.hpp -+++ b/websocketpp/roles/server_endpoint.hpp -@@ -75,11 +75,11 @@ class server : public endpoint,config> { - } - - /// Destructor -- ~server() {} -+ ~server() {} - - #ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_ - // no copy constructor because endpoints are not copyable -- server(server &) = delete; -+ server(server &) = delete; - - // no copy assignment operator because endpoints are not copyable - server & operator=(server const &) = delete; -@@ -87,7 +87,7 @@ class server : public endpoint,config> { - - #ifdef _WEBSOCKETPP_MOVE_SEMANTICS_ - /// Move constructor -- server(server && o) : endpoint,config>(std::move(o)) {} -+ server(server && o) : endpoint,config>(std::move(o)) {} - - #ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_ - // no move assignment operator because of const member variables diff --git a/websocketpp-0.8.2-fix-cmake-find-boost.patch b/websocketpp-0.8.2-fix-cmake-find-boost.patch deleted file mode 100644 index d941e0b..0000000 --- a/websocketpp-0.8.2-fix-cmake-find-boost.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 3590d77bb9753fbbf076028e2395182ced6466ba Mon Sep 17 00:00:00 2001 -From: Gianfranco Costamagna -Date: Wed, 8 Jan 2020 17:59:48 +0100 -Subject: [PATCH] Fix cmake find boost with version >= 1.71 - -For some reasons "system;thread;random;unit_test_framework" was seen as a single module, because of the quotes. ---- - CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2d13117ba..9a46bc10c 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -211,7 +211,7 @@ if (BUILD_TESTS OR BUILD_EXAMPLES) - set (Boost_USE_MULTITHREADED TRUE) - set (Boost_ADDITIONAL_VERSIONS "1.39.0" "1.40.0" "1.41.0" "1.42.0" "1.43.0" "1.44.0" "1.46.1") # todo: someone who knows better spesify these! - -- find_package (Boost 1.39.0 COMPONENTS "${WEBSOCKETPP_BOOST_LIBS}") -+ find_package (Boost 1.39.0 COMPONENTS ${WEBSOCKETPP_BOOST_LIBS}) - - if (Boost_FOUND) - # Boost is a project wide global dependency. diff --git a/websocketpp-0.8.3-cmake_noarch.patch b/websocketpp-0.8.3-cmake_noarch.patch new file mode 100644 index 0000000..b27fa08 --- /dev/null +++ b/websocketpp-0.8.3-cmake_noarch.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt 2022-05-24 17:42:50.000000000 +0200 ++++ b/CMakeLists.txt 2026-01-27 20:15:14.456352600 +0100 +@@ -45,7 +45,7 @@ set(INSTALL_INCLUDE_DIR include CACHE PA + if (WIN32 AND NOT CYGWIN) + set (DEF_INSTALL_CMAKE_DIR cmake) + else () +- set (DEF_INSTALL_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/websocketpp) ++ set (DEF_INSTALL_CMAKE_DIR share/cmake/websocketpp) + endif () + set (INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files") + diff --git a/websocketpp.spec b/websocketpp.spec index 2378d2e..af8525d 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -1,18 +1,26 @@ +%global basever 0.8.2 +%global commit b9aeec6eaf3d5610503439b4fae3581d9aff08e8 +%global shortcommit %{sub %{commit} 1 7} +%global snapdate 20220525 Name: websocketpp Summary: C++ WebSocket Protocol Library -Version: 0.8.2 -Release: 20%{?dist} +Version: %{basever}%{?snapdate:^git%{snapdate}.%{shortcommit}} +Release: 1%{?dist} # Automatically converted from old format: BSD - review is highly recommended. License: LicenseRef-Callaway-BSD Url: https://www.zaphoyd.com/websocketpp +%if %{defined snapdate} +Source0: https://github.com/zaphoyd/websocketpp/archive/%{commit}/%{name}-%{commit}.tar.gz +%else Source0: https://github.com/zaphoyd/websocketpp/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz +%endif Source1: websocketpp.pc BuildArch: noarch # put cmake files in share/cmake instead of lib/cmake -Patch1: websocketpp-0.7.0-cmake_noarch.patch +Patch1: websocketpp-0.8.3-cmake_noarch.patch # Switch from ExactVersion to AnyNewerVersion to improve compatibility # https://cmake.org/cmake/help/v3.0/module/CMakePackageConfigHelpers.html @@ -25,19 +33,10 @@ Patch2: websocketpp-0.8.1-cmake-configversion-compatibility-anynewerversion.patc # Disable the following tests, which fail occasionally: test_transport, test_transport_asio_timers Patch3: websocketpp-0.7.0-disable-test_transport-test_transport_asio_timers.patch -# Fix cmake find boost -# https://github.com/zaphoyd/websocketpp/pull/855 -# https://github.com/zaphoyd/websocketpp/commit/3590d77 -Patch4: websocketpp-0.8.2-fix-cmake-find-boost.patch - -# fix c++20 build error -# https://github.com/zaphoyd/websocketpp/issues/991 -# https://github.com/zaphoyd/websocketpp/commit/3197a520eb4c1e4754860441918a5930160373eb -Patch5: websocketpp-0.8.2-cpp20-fixes.patch - -# Update minimum required CMake version to comply with CMake 4.0 -# https://github.com/zaphoyd/websocketpp/commit/deb0a334471362608958ce59a6b0bcd3e5b73c24 -Patch6: websocketpp-0.8.2-cmake40.patch +# Compatibility fixes for Boost 1.87 +# https://github.com/zaphoyd/websocketpp/pull/1164 +# Patch from PR at commit ee8cf42, 2025-04-09 +Patch4: websocketpp-0.8.2-compatibility_fixes_for_boost_1.87.patch BuildRequires: boost-devel BuildRequires: cmake @@ -66,7 +65,11 @@ iostreams and one based on Boost Asio. %prep +%if %{defined snapdate} +%autosetup -p1 -n %{name}-%{commit} +%else %autosetup -p1 +%endif %build @@ -97,6 +100,17 @@ rm -rfv %{buildroot}%{_includedir}/test_connection/ %changelog +* Tue Jan 27 2026 Wolfgang Stöggl - 0.8.2^git20220525.b9aeec6-1 +- Update to post-release git snapshot on 0.8.2 +- Add patch: + websocketpp-0.8.2-compatibility_fixes_for_boost_1.87.patch, which + fixes FTBFS with Boost 1.90 +- Update cmake_noarch patch +- Drop patches: + websocketpp-0.8.2-fix-cmake-find-boost.patch + websocketpp-0.8.2-cpp20-fixes.patch + websocketpp-0.8.2-cmake40.patch + * Sat Jan 17 2026 Fedora Release Engineering - 0.8.2-20 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild From 08bae0e928ec5464ab9ea388770e19478723199c Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Fri, 12 Jun 2026 20:05:00 -0400 Subject: [PATCH 53/55] Rebuilt for openssl 4.0 --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index af8525d..75e687a 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -6,7 +6,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: %{basever}%{?snapdate:^git%{snapdate}.%{shortcommit}} -Release: 1%{?dist} +Release: 2%{?dist} # Automatically converted from old format: BSD - review is highly recommended. License: LicenseRef-Callaway-BSD @@ -100,6 +100,9 @@ rm -rfv %{buildroot}%{_includedir}/test_connection/ %changelog +* Sat Jun 13 2026 Yaakov Selkowitz - 0.8.2^git20220525.b9aeec6-2 +- Rebuilt for openssl 4.0 + * Tue Jan 27 2026 Wolfgang Stöggl - 0.8.2^git20220525.b9aeec6-1 - Update to post-release git snapshot on 0.8.2 - Add patch: From 6f10d7f42d34571b063e02b5508565c0a7565f6c Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Sun, 14 Jun 2026 12:51:03 -0400 Subject: [PATCH 54/55] Drop unused openssl-devel-engine dependency --- websocketpp.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index 75e687a..fad5430 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -43,7 +43,6 @@ BuildRequires: cmake BuildRequires: gcc-c++ # needed for tests mostly BuildRequires: pkgconfig(openssl) -BuildRequires: openssl-devel-engine BuildRequires: zlib-devel %description From 494d34987c79145e291e6be693f7d68e3d50d5cd Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jul 2026 08:45:12 +0000 Subject: [PATCH 55/55] Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild --- websocketpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocketpp.spec b/websocketpp.spec index fad5430..702f6fb 100644 --- a/websocketpp.spec +++ b/websocketpp.spec @@ -6,7 +6,7 @@ Name: websocketpp Summary: C++ WebSocket Protocol Library Version: %{basever}%{?snapdate:^git%{snapdate}.%{shortcommit}} -Release: 2%{?dist} +Release: 3%{?dist} # Automatically converted from old format: BSD - review is highly recommended. License: LicenseRef-Callaway-BSD @@ -99,6 +99,9 @@ rm -rfv %{buildroot}%{_includedir}/test_connection/ %changelog +* Fri Jul 17 2026 Fedora Release Engineering - 0.8.2^git20220525.b9aeec6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild + * Sat Jun 13 2026 Yaakov Selkowitz - 0.8.2^git20220525.b9aeec6-2 - Rebuilt for openssl 4.0