update boost on linux
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// local/basic_endpoint.hpp
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
//
|
||||
// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
||||
// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
||||
// Derived from a public domain implementation written by Daniel Casimiro.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
@@ -77,6 +77,14 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
#if defined(BOOST_ASIO_HAS_STRING_VIEW)
|
||||
/// Construct an endpoint using the specified path name.
|
||||
basic_endpoint(string_view path_name)
|
||||
: impl_(path_name)
|
||||
{
|
||||
}
|
||||
#endif // defined(BOOST_ASIO_HAS_STRING_VIEW)
|
||||
|
||||
/// Copy constructor.
|
||||
basic_endpoint(const basic_endpoint& other)
|
||||
: impl_(other.impl_)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// local/connect_pair.hpp
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~
|
||||
//
|
||||
// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
||||
// Copyright (c) 2003-2019 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)
|
||||
@@ -33,33 +33,28 @@ namespace asio {
|
||||
namespace local {
|
||||
|
||||
/// Create a pair of connected sockets.
|
||||
template <typename Protocol, typename SocketService1, typename SocketService2>
|
||||
void connect_pair(
|
||||
basic_socket<Protocol, SocketService1>& socket1,
|
||||
basic_socket<Protocol, SocketService2>& socket2);
|
||||
template <typename Protocol, typename Executor1, typename Executor2>
|
||||
void connect_pair(basic_socket<Protocol, Executor1>& socket1,
|
||||
basic_socket<Protocol, Executor2>& socket2);
|
||||
|
||||
/// Create a pair of connected sockets.
|
||||
template <typename Protocol, typename SocketService1, typename SocketService2>
|
||||
boost::system::error_code connect_pair(
|
||||
basic_socket<Protocol, SocketService1>& socket1,
|
||||
basic_socket<Protocol, SocketService2>& socket2,
|
||||
boost::system::error_code& ec);
|
||||
template <typename Protocol, typename Executor1, typename Executor2>
|
||||
BOOST_ASIO_SYNC_OP_VOID connect_pair(basic_socket<Protocol, Executor1>& socket1,
|
||||
basic_socket<Protocol, Executor2>& socket2, boost::system::error_code& ec);
|
||||
|
||||
template <typename Protocol, typename SocketService1, typename SocketService2>
|
||||
inline void connect_pair(
|
||||
basic_socket<Protocol, SocketService1>& socket1,
|
||||
basic_socket<Protocol, SocketService2>& socket2)
|
||||
template <typename Protocol, typename Executor1, typename Executor2>
|
||||
inline void connect_pair(basic_socket<Protocol, Executor1>& socket1,
|
||||
basic_socket<Protocol, Executor2>& socket2)
|
||||
{
|
||||
boost::system::error_code ec;
|
||||
connect_pair(socket1, socket2, ec);
|
||||
boost::asio::detail::throw_error(ec, "connect_pair");
|
||||
}
|
||||
|
||||
template <typename Protocol, typename SocketService1, typename SocketService2>
|
||||
inline boost::system::error_code connect_pair(
|
||||
basic_socket<Protocol, SocketService1>& socket1,
|
||||
basic_socket<Protocol, SocketService2>& socket2,
|
||||
boost::system::error_code& ec)
|
||||
template <typename Protocol, typename Executor1, typename Executor2>
|
||||
inline BOOST_ASIO_SYNC_OP_VOID connect_pair(
|
||||
basic_socket<Protocol, Executor1>& socket1,
|
||||
basic_socket<Protocol, Executor2>& socket2, boost::system::error_code& ec)
|
||||
{
|
||||
// Check that this function is only being used with a UNIX domain socket.
|
||||
boost::asio::local::basic_endpoint<Protocol>* tmp
|
||||
@@ -71,27 +66,29 @@ inline boost::system::error_code connect_pair(
|
||||
if (boost::asio::detail::socket_ops::socketpair(protocol.family(),
|
||||
protocol.type(), protocol.protocol(), sv, ec)
|
||||
== boost::asio::detail::socket_error_retval)
|
||||
return ec;
|
||||
BOOST_ASIO_SYNC_OP_VOID_RETURN(ec);
|
||||
|
||||
if (socket1.assign(protocol, sv[0], ec))
|
||||
socket1.assign(protocol, sv[0], ec);
|
||||
if (ec)
|
||||
{
|
||||
boost::system::error_code temp_ec;
|
||||
boost::asio::detail::socket_ops::state_type state[2] = { 0, 0 };
|
||||
boost::asio::detail::socket_ops::close(sv[0], state[0], true, temp_ec);
|
||||
boost::asio::detail::socket_ops::close(sv[1], state[1], true, temp_ec);
|
||||
return ec;
|
||||
BOOST_ASIO_SYNC_OP_VOID_RETURN(ec);
|
||||
}
|
||||
|
||||
if (socket2.assign(protocol, sv[1], ec))
|
||||
socket2.assign(protocol, sv[1], ec);
|
||||
if (ec)
|
||||
{
|
||||
boost::system::error_code temp_ec;
|
||||
socket1.close(temp_ec);
|
||||
boost::asio::detail::socket_ops::state_type state = 0;
|
||||
boost::asio::detail::socket_ops::close(sv[1], state, true, temp_ec);
|
||||
return ec;
|
||||
BOOST_ASIO_SYNC_OP_VOID_RETURN(ec);
|
||||
}
|
||||
|
||||
return ec;
|
||||
BOOST_ASIO_SYNC_OP_VOID_RETURN(ec);
|
||||
}
|
||||
|
||||
} // namespace local
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// local/datagram_protocol.hpp
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
//
|
||||
// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
||||
// Copyright (c) 2003-2019 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)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// local/detail/endpoint.hpp
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
//
|
||||
// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
||||
// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
||||
// Derived from a public domain implementation written by Daniel Casimiro.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
#include <boost/asio/detail/socket_types.hpp>
|
||||
#include <boost/asio/detail/string_view.hpp>
|
||||
|
||||
#include <boost/asio/detail/push_options.hpp>
|
||||
|
||||
@@ -44,6 +45,11 @@ public:
|
||||
// Construct an endpoint using the specified path name.
|
||||
BOOST_ASIO_DECL endpoint(const std::string& path_name);
|
||||
|
||||
#if defined(BOOST_ASIO_HAS_STRING_VIEW)
|
||||
// Construct an endpoint using the specified path name.
|
||||
BOOST_ASIO_DECL endpoint(string_view path_name);
|
||||
#endif // defined(BOOST_ASIO_HAS_STRING_VIEW)
|
||||
|
||||
// Copy constructor.
|
||||
endpoint(const endpoint& other)
|
||||
: data_(other.data_),
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// local/detail/impl/endpoint.hpp
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
//
|
||||
// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
||||
// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
||||
// Derived from a public domain implementation written by Daniel Casimiro.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
@@ -49,6 +49,13 @@ endpoint::endpoint(const std::string& path_name)
|
||||
init(path_name.data(), path_name.length());
|
||||
}
|
||||
|
||||
#if defined(BOOST_ASIO_HAS_STRING_VIEW)
|
||||
endpoint::endpoint(string_view path_name)
|
||||
{
|
||||
init(path_name.data(), path_name.length());
|
||||
}
|
||||
#endif // defined(BOOST_ASIO_HAS_STRING_VIEW)
|
||||
|
||||
void endpoint::resize(std::size_t new_size)
|
||||
{
|
||||
if (new_size > sizeof(boost::asio::detail::sockaddr_un_type))
|
||||
@@ -109,7 +116,8 @@ void endpoint::init(const char* path_name, std::size_t path_length)
|
||||
using namespace std; // For memcpy.
|
||||
data_.local = boost::asio::detail::sockaddr_un_type();
|
||||
data_.local.sun_family = AF_UNIX;
|
||||
memcpy(data_.local.sun_path, path_name, path_length);
|
||||
if (path_length > 0)
|
||||
memcpy(data_.local.sun_path, path_name, path_length);
|
||||
path_length_ = path_length;
|
||||
|
||||
// NUL-terminate normal path names. Names that start with a NUL are in the
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// local/stream_protocol.hpp
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
//
|
||||
// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
||||
// Copyright (c) 2003-2019 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)
|
||||
|
||||
Reference in New Issue
Block a user