You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.1 KiB

  1. From 9d226dab339f5767ec01ea1bcc9043ceee185cca Mon Sep 17 00:00:00 2001
  2. From: Rob Peters <info@domoticz.com>
  3. Date: Mon, 25 Mar 2019 08:50:23 +0100
  4. Subject: [PATCH] Fix for boot 1.70 get_io_service, fixed #3117
  5. ---
  6. hardware/Pinger.cpp | 10 ++++++++--
  7. hardware/TCPProxy/tcpproxy_server.cpp | 8 +++++++-
  8. 2 files changed, 15 insertions(+), 3 deletions(-)
  9. diff --git a/hardware/Pinger.cpp b/hardware/Pinger.cpp
  10. index 01a955ba4..184378738 100644
  11. --- a/hardware/Pinger.cpp
  12. +++ b/hardware/Pinger.cpp
  13. @@ -18,6 +18,12 @@
  14. #include <iostream>
  15. +#if BOOST_VERSION >= 107000
  16. +#define GET_IO_SERVICE(s) ((boost::asio::io_context&)(s).get_executor().context())
  17. +#else
  18. +#define GET_IO_SERVICE(s) ((s).get_io_service())
  19. +#endif
  20. +
  21. class pinger
  22. : private domoticz::noncopyable
  23. {
  24. @@ -76,7 +82,7 @@ class pinger
  25. num_tries_++;
  26. if (num_tries_ > 4)
  27. {
  28. - resolver_.get_io_service().stop();
  29. + GET_IO_SERVICE(resolver_).stop();
  30. }
  31. else
  32. {
  33. @@ -118,7 +124,7 @@ class pinger
  34. if (num_replies_++ == 0)
  35. timer_.cancel();
  36. m_PingState = true;
  37. - resolver_.get_io_service().stop();
  38. + GET_IO_SERVICE(resolver_).stop();
  39. }
  40. else
  41. {
  42. diff --git a/hardware/TCPProxy/tcpproxy_server.cpp b/hardware/TCPProxy/tcpproxy_server.cpp
  43. index fddac08de..60445d9c2 100644
  44. --- a/hardware/TCPProxy/tcpproxy_server.cpp
  45. +++ b/hardware/TCPProxy/tcpproxy_server.cpp
  46. @@ -15,6 +15,12 @@
  47. #include "stdafx.h"
  48. #include "tcpproxy_server.h"
  49. +#if BOOST_VERSION >= 107000
  50. +#define GET_IO_SERVICE(s) ((boost::asio::io_context&)(s).get_executor().context())
  51. +#else
  52. +#define GET_IO_SERVICE(s) ((s).get_io_service())
  53. +#endif
  54. +
  55. namespace tcp_proxy
  56. {
  57. bridge::bridge(boost::asio::io_service& ios)
  58. @@ -38,7 +44,7 @@ namespace tcp_proxy
  59. boost::asio::ip::tcp::endpoint end;
  60. - boost::asio::io_service &ios=downstream_socket_.get_io_service();
  61. + boost::asio::io_service &ios= GET_IO_SERVICE(downstream_socket_);
  62. boost::asio::ip::tcp::resolver resolver(ios);
  63. boost::asio::ip::tcp::resolver::query query(upstream_host, upstream_port, boost::asio::ip::resolver_query_base::numeric_service);
  64. boost::asio::ip::tcp::resolver::iterator i = resolver.resolve(query);