0003-Fix-for-boot-1-70-get_io_service.patch.patch 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  6. [Retrieved from:
  7. https://github.com/domoticz/domoticz/commit/9d226dab339f5767ec01ea1bcc9043ceee185cca]
  8. ---
  9. hardware/Pinger.cpp | 10 ++++++++--
  10. hardware/TCPProxy/tcpproxy_server.cpp | 8 +++++++-
  11. 2 files changed, 15 insertions(+), 3 deletions(-)
  12. diff --git a/hardware/Pinger.cpp b/hardware/Pinger.cpp
  13. index 01a955ba4..184378738 100644
  14. --- a/hardware/Pinger.cpp
  15. +++ b/hardware/Pinger.cpp
  16. @@ -18,6 +18,12 @@
  17. #include <iostream>
  18. +#if BOOST_VERSION >= 107000
  19. +#define GET_IO_SERVICE(s) ((boost::asio::io_context&)(s).get_executor().context())
  20. +#else
  21. +#define GET_IO_SERVICE(s) ((s).get_io_service())
  22. +#endif
  23. +
  24. class pinger
  25. : private domoticz::noncopyable
  26. {
  27. @@ -76,7 +82,7 @@ class pinger
  28. num_tries_++;
  29. if (num_tries_ > 4)
  30. {
  31. - resolver_.get_io_service().stop();
  32. + GET_IO_SERVICE(resolver_).stop();
  33. }
  34. else
  35. {
  36. @@ -118,7 +124,7 @@ class pinger
  37. if (num_replies_++ == 0)
  38. timer_.cancel();
  39. m_PingState = true;
  40. - resolver_.get_io_service().stop();
  41. + GET_IO_SERVICE(resolver_).stop();
  42. }
  43. else
  44. {
  45. diff --git a/hardware/TCPProxy/tcpproxy_server.cpp b/hardware/TCPProxy/tcpproxy_server.cpp
  46. index fddac08de..60445d9c2 100644
  47. --- a/hardware/TCPProxy/tcpproxy_server.cpp
  48. +++ b/hardware/TCPProxy/tcpproxy_server.cpp
  49. @@ -15,6 +15,12 @@
  50. #include "stdafx.h"
  51. #include "tcpproxy_server.h"
  52. +#if BOOST_VERSION >= 107000
  53. +#define GET_IO_SERVICE(s) ((boost::asio::io_context&)(s).get_executor().context())
  54. +#else
  55. +#define GET_IO_SERVICE(s) ((s).get_io_service())
  56. +#endif
  57. +
  58. namespace tcp_proxy
  59. {
  60. bridge::bridge(boost::asio::io_service& ios)
  61. @@ -38,7 +44,7 @@ namespace tcp_proxy
  62. boost::asio::ip::tcp::endpoint end;
  63. - boost::asio::io_service &ios=downstream_socket_.get_io_service();
  64. + boost::asio::io_service &ios= GET_IO_SERVICE(downstream_socket_);
  65. boost::asio::ip::tcp::resolver resolver(ios);
  66. boost::asio::ip::tcp::resolver::query query(upstream_host, upstream_port, boost::asio::ip::resolver_query_base::numeric_service);
  67. boost::asio::ip::tcp::resolver::iterator i = resolver.resolve(query);