Skip to content

Commit

Permalink
Fix recent fallout by boost lib update, as is proposed by Dave Tyson …
Browse files Browse the repository at this point in the history
…with

PR pkg/52969:
With the boost libs updated to 2.6 there are changes so that socket->native()
is no longer supported. use socket->native_handle() instead
  • Loading branch information
mef committed Mar 9, 2018
1 parent fe157c9 commit 5aefdae
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ham/uhd/distinfo
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
$NetBSD: distinfo,v 1.13 2016/05/13 14:57:08 mef Exp $
$NetBSD: distinfo,v 1.14 2018/03/09 11:36:40 mef Exp $

SHA1 (uhd-3.9.4.tar.gz) = 1a328a9bef2def019b06b9e8d32dd3c849265aa9
RMD160 (uhd-3.9.4.tar.gz) = 33d56e442d12c6317e0b5725e92f2c5139b35260
SHA512 (uhd-3.9.4.tar.gz) = 2ff47e1d7af234e256eaef863f60b94a66764cde567338b84f0df3522d7dd43dfd505b077ff8cbf9ca2f75a19ccc5813c27dbb70e6ea2876e9e439b345fa6acd
Size (uhd-3.9.4.tar.gz) = 2443355 bytes
SHA1 (patch-host_examples_network_relay.cpp) = 8762747641ae0609bb0e09bb806e0a7d9126d5be
SHA1 (patch-host_lib_transport_tcp_zero_copy.cpp) = d1dc166766d5603bea5cd3d85e333d453864daac
SHA1 (patch-host_lib_transport_udp_simple.cpp) = 2058587726613f5c300eda4cb8fd428052728326
SHA1 (patch-host_lib_transport_udp_zero_copy.cpp) = 6a39fef6a176cd2de30ec50a07efbea08ac4a60f
28 changes: 28 additions & 0 deletions ham/uhd/patches/patch-host_examples_network_relay.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
$NetBSD: patch-host_examples_network_relay.cpp,v 1.1 2018/03/09 11:36:40 mef Exp $

PR pkg/52969
with the boost libs updated to 2.6 there are changes so that socket->native()
is no longer supported. use socket->native_handle() instead

--- examples/network_relay.cpp.orig
+++ examples/network_relay.cpp
@@ -127,7 +127,7 @@
wait_for_thread.notify_one(); // notify constructor that this thread has started
std::vector<char> buff(insane_mtu);
while (not boost::this_thread::interruption_requested()){
- if (wait_for_recv_ready(_server_socket->native())){
+ if (wait_for_recv_ready(_server_socket->native_handle())){
boost::mutex::scoped_lock lock(_endpoint_mutex);
const size_t len = _server_socket->receive_from(asio::buffer(&buff.front(), buff.size()), _endpoint);
lock.unlock();
@@ -153,7 +153,7 @@
wait_for_thread.notify_one(); // notify constructor that this thread has started
std::vector<char> buff(insane_mtu);
while (not boost::this_thread::interruption_requested()){
- if (wait_for_recv_ready(_client_socket->native())){
+ if (wait_for_recv_ready(_client_socket->native_handle())){
const size_t len = _client_socket->receive(asio::buffer(&buff.front(), buff.size()));
boost::mutex::scoped_lock lock(_endpoint_mutex);
_server_socket->send_to(asio::buffer(&buff.front(), len), _endpoint);

patch-host_lib_transport_tcp_zero_copy.cpp
17 changes: 17 additions & 0 deletions ham/uhd/patches/patch-host_lib_transport_tcp_zero_copy.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$NetBSD: patch-host_lib_transport_tcp_zero_copy.cpp,v 1.1 2018/03/09 11:36:40 mef Exp $

PR pkg/52969
with the boost libs updated to 2.6 there are changes so that socket->native()
is no longer supported. use socket->native_handle() instead

--- lib/transport/tcp_zero_copy.cpp
+++ lib/transport/tcp_zero_copy.cpp.orig
@@ -154,7 +154,7 @@
//create, open, and connect the socket
_socket.reset(new asio::ip::tcp::socket(_io_service));
_socket->connect(receiver_endpoint);
- _sock_fd = _socket->native();
+ _sock_fd = _socket->native_handle();

//packets go out ASAP
asio::ip::tcp::no_delay option(true);
16 changes: 16 additions & 0 deletions ham/uhd/patches/patch-host_lib_transport_udp_simple.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
$NetBSD: patch-host_lib_transport_udp_simple.cpp,v 1.1 2018/03/09 11:36:40 mef Exp $

PR pkg/52969
with the boost libs updated to 2.6 there are changes so that socket->native()
is no longer supported. use socket->native_handle() instead

--- lib/transport/udp_simple.cpp.orig
+++ lib/transport/udp_simple.cpp
@@ -56,7 +56,7 @@
}

size_t recv(const asio::mutable_buffer &buff, double timeout){
- if (not wait_for_recv_ready(_socket->native(), timeout)) return 0;
+ if (not wait_for_recv_ready(_socket->native_handle(), timeout)) return 0;
return _socket->receive_from(asio::buffer(buff), _recv_endpoint);
}
17 changes: 17 additions & 0 deletions ham/uhd/patches/patch-host_lib_transport_udp_zero_copy.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$NetBSD: patch-host_lib_transport_udp_zero_copy.cpp,v 1.1 2018/03/09 11:36:40 mef Exp $

PR pkg/52969
with the boost libs updated to 2.6 there are changes so that socket->native()
is no longer supported. use socket->native_handle() instead

--- lib/transport/udp_zero_copy.cpp.orig
+++ lib/transport/udp_zero_copy.cpp
@@ -190,7 +190,7 @@
_socket = socket_sptr(new asio::ip::udp::socket(_io_service));
_socket->open(asio::ip::udp::v4());
_socket->connect(receiver_endpoint);
- _sock_fd = _socket->native();
+ _sock_fd = _socket->native_handle();

//allocate re-usable managed receive buffers
for (size_t i = 0; i < get_num_recv_frames(); i++){

0 comments on commit 5aefdae

Please sign in to comment.