summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '3rdParty/Boost/src/boost/asio/ip/detail')
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/detail/endpoint.hpp7
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/detail/impl/endpoint.ipp22
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/detail/socket_option.hpp45
3 files changed, 29 insertions, 45 deletions
diff --git a/3rdParty/Boost/src/boost/asio/ip/detail/endpoint.hpp b/3rdParty/Boost/src/boost/asio/ip/detail/endpoint.hpp
index fe95a00..04335ef 100644
--- a/3rdParty/Boost/src/boost/asio/ip/detail/endpoint.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/detail/endpoint.hpp
@@ -2,7 +2,7 @@
// ip/detail/endpoint.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -78,12 +78,12 @@ public:
}
// Set the underlying size of the endpoint in the native type.
- BOOST_ASIO_DECL void resize(std::size_t size);
+ BOOST_ASIO_DECL void resize(std::size_t new_size);
// Get the capacity of the endpoint in the native type.
std::size_t capacity() const
{
- return sizeof(boost::asio::detail::sockaddr_storage_type);
+ return sizeof(data_);
}
// Get the port associated with the endpoint.
@@ -122,7 +122,6 @@ private:
union data_union
{
boost::asio::detail::socket_addr_type base;
- boost::asio::detail::sockaddr_storage_type storage;
boost::asio::detail::sockaddr_in4_type v4;
boost::asio::detail::sockaddr_in6_type v6;
} data_;
diff --git a/3rdParty/Boost/src/boost/asio/ip/detail/impl/endpoint.ipp b/3rdParty/Boost/src/boost/asio/ip/detail/impl/endpoint.ipp
index 0443d38..24bfce2 100644
--- a/3rdParty/Boost/src/boost/asio/ip/detail/impl/endpoint.ipp
+++ b/3rdParty/Boost/src/boost/asio/ip/detail/impl/endpoint.ipp
@@ -2,7 +2,7 @@
// ip/detail/impl/endpoint.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -57,8 +57,14 @@ endpoint::endpoint(int family, unsigned short port_num)
data_.v6.sin6_port =
boost::asio::detail::socket_ops::host_to_network_short(port_num);
data_.v6.sin6_flowinfo = 0;
- boost::asio::detail::in6_addr_type tmp_addr = IN6ADDR_ANY_INIT;
- data_.v6.sin6_addr = tmp_addr;
+ data_.v6.sin6_addr.s6_addr[0] = 0; data_.v6.sin6_addr.s6_addr[1] = 0;
+ data_.v6.sin6_addr.s6_addr[2] = 0, data_.v6.sin6_addr.s6_addr[3] = 0;
+ data_.v6.sin6_addr.s6_addr[4] = 0, data_.v6.sin6_addr.s6_addr[5] = 0;
+ data_.v6.sin6_addr.s6_addr[6] = 0, data_.v6.sin6_addr.s6_addr[7] = 0;
+ data_.v6.sin6_addr.s6_addr[8] = 0, data_.v6.sin6_addr.s6_addr[9] = 0;
+ data_.v6.sin6_addr.s6_addr[10] = 0, data_.v6.sin6_addr.s6_addr[11] = 0;
+ data_.v6.sin6_addr.s6_addr[12] = 0, data_.v6.sin6_addr.s6_addr[13] = 0;
+ data_.v6.sin6_addr.s6_addr[14] = 0, data_.v6.sin6_addr.s6_addr[15] = 0;
data_.v6.sin6_scope_id = 0;
}
}
@@ -85,14 +91,14 @@ endpoint::endpoint(const boost::asio::ip::address& addr,
data_.v6.sin6_flowinfo = 0;
boost::asio::ip::address_v6 v6_addr = addr.to_v6();
boost::asio::ip::address_v6::bytes_type bytes = v6_addr.to_bytes();
- memcpy(data_.v6.sin6_addr.s6_addr, bytes.elems, 16);
+ memcpy(data_.v6.sin6_addr.s6_addr, bytes.data(), 16);
data_.v6.sin6_scope_id = v6_addr.scope_id();
}
}
-void endpoint::resize(std::size_t size)
+void endpoint::resize(std::size_t new_size)
{
- if (size > sizeof(boost::asio::detail::sockaddr_storage_type))
+ if (new_size > sizeof(boost::asio::detail::sockaddr_storage_type))
{
boost::system::error_code ec(boost::asio::error::invalid_argument);
boost::asio::detail::throw_error(ec);
@@ -139,7 +145,11 @@ boost::asio::ip::address endpoint::address() const
else
{
boost::asio::ip::address_v6::bytes_type bytes;
+#if defined(BOOST_ASIO_HAS_STD_ARRAY)
+ memcpy(bytes.data(), data_.v6.sin6_addr.s6_addr, 16);
+#else // defined(BOOST_ASIO_HAS_STD_ARRAY)
memcpy(bytes.elems, data_.v6.sin6_addr.s6_addr, 16);
+#endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
return boost::asio::ip::address_v6(bytes, data_.v6.sin6_scope_id);
}
}
diff --git a/3rdParty/Boost/src/boost/asio/ip/detail/socket_option.hpp b/3rdParty/Boost/src/boost/asio/ip/detail/socket_option.hpp
index 6fde8c3..041a9f8 100644
--- a/3rdParty/Boost/src/boost/asio/ip/detail/socket_option.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/detail/socket_option.hpp
@@ -2,7 +2,7 @@
// detail/socket_option.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,6 +18,7 @@
#include <boost/asio/detail/config.hpp>
#include <cstddef>
#include <cstring>
+#include <stdexcept>
#include <boost/throw_exception.hpp>
#include <boost/asio/detail/socket_ops.hpp>
#include <boost/asio/detail/socket_types.hpp>
@@ -385,35 +386,22 @@ class multicast_request
public:
// Default constructor.
multicast_request()
+ : ipv4_value_(), // Zero-initialisation gives the "any" address.
+ ipv6_value_() // Zero-initialisation gives the "any" address.
{
- ipv4_value_.imr_multiaddr.s_addr =
- boost::asio::detail::socket_ops::host_to_network_long(
- boost::asio::ip::address_v4::any().to_ulong());
- ipv4_value_.imr_interface.s_addr =
- boost::asio::detail::socket_ops::host_to_network_long(
- boost::asio::ip::address_v4::any().to_ulong());
-
- boost::asio::detail::in6_addr_type tmp_addr = IN6ADDR_ANY_INIT;
- ipv6_value_.ipv6mr_multiaddr = tmp_addr;
- ipv6_value_.ipv6mr_interface = 0;
}
// Construct with multicast address only.
explicit multicast_request(const boost::asio::ip::address& multicast_address)
+ : ipv4_value_(), // Zero-initialisation gives the "any" address.
+ ipv6_value_() // Zero-initialisation gives the "any" address.
{
if (multicast_address.is_v6())
{
- ipv4_value_.imr_multiaddr.s_addr =
- boost::asio::detail::socket_ops::host_to_network_long(
- boost::asio::ip::address_v4::any().to_ulong());
- ipv4_value_.imr_interface.s_addr =
- boost::asio::detail::socket_ops::host_to_network_long(
- boost::asio::ip::address_v4::any().to_ulong());
-
using namespace std; // For memcpy.
boost::asio::ip::address_v6 ipv6_address = multicast_address.to_v6();
boost::asio::ip::address_v6::bytes_type bytes = ipv6_address.to_bytes();
- memcpy(ipv6_value_.ipv6mr_multiaddr.s6_addr, bytes.elems, 16);
+ memcpy(ipv6_value_.ipv6mr_multiaddr.s6_addr, bytes.data(), 16);
ipv6_value_.ipv6mr_interface = 0;
}
else
@@ -424,10 +412,6 @@ public:
ipv4_value_.imr_interface.s_addr =
boost::asio::detail::socket_ops::host_to_network_long(
boost::asio::ip::address_v4::any().to_ulong());
-
- boost::asio::detail::in6_addr_type tmp_addr = IN6ADDR_ANY_INIT;
- ipv6_value_.ipv6mr_multiaddr = tmp_addr;
- ipv6_value_.ipv6mr_interface = 0;
}
}
@@ -436,6 +420,7 @@ public:
const boost::asio::ip::address_v4& multicast_address,
const boost::asio::ip::address_v4& network_interface
= boost::asio::ip::address_v4::any())
+ : ipv6_value_() // Zero-initialisation gives the "any" address.
{
ipv4_value_.imr_multiaddr.s_addr =
boost::asio::detail::socket_ops::host_to_network_long(
@@ -443,28 +428,18 @@ public:
ipv4_value_.imr_interface.s_addr =
boost::asio::detail::socket_ops::host_to_network_long(
network_interface.to_ulong());
-
- boost::asio::detail::in6_addr_type tmp_addr = IN6ADDR_ANY_INIT;
- ipv6_value_.ipv6mr_multiaddr = tmp_addr;
- ipv6_value_.ipv6mr_interface = 0;
}
// Construct with multicast address and IPv6 network interface index.
explicit multicast_request(
const boost::asio::ip::address_v6& multicast_address,
unsigned long network_interface = 0)
+ : ipv4_value_() // Zero-initialisation gives the "any" address.
{
- ipv4_value_.imr_multiaddr.s_addr =
- boost::asio::detail::socket_ops::host_to_network_long(
- boost::asio::ip::address_v4::any().to_ulong());
- ipv4_value_.imr_interface.s_addr =
- boost::asio::detail::socket_ops::host_to_network_long(
- boost::asio::ip::address_v4::any().to_ulong());
-
using namespace std; // For memcpy.
boost::asio::ip::address_v6::bytes_type bytes =
multicast_address.to_bytes();
- memcpy(ipv6_value_.ipv6mr_multiaddr.s6_addr, bytes.elems, 16);
+ memcpy(ipv6_value_.ipv6mr_multiaddr.s6_addr, bytes.data(), 16);
ipv6_value_.ipv6mr_interface = network_interface;
}