aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.com>2024-02-02 21:28:03 +0300
committerAlexander Smirnov <alex@ydb.tech>2024-02-09 19:17:23 +0300
commit9b68e5db0394ee81fec88f1684ee44140c7a8804 (patch)
tree9e43e3e70a29e3c408048176d52c163511eb12a0 /contrib
parente48237b5429bb1870710b6303da89b90a7a53f07 (diff)
downloadydb-9b68e5db0394ee81fec88f1684ee44140c7a8804.tar.gz
Update boost/asio and boost/process to 1.70.0
Diffstat (limited to 'contrib')
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/buffer.hpp495
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/array_fwd.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/config.hpp64
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/functional.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/is_buffer_sequence.hpp51
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/memory.hpp72
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/pop_options.hpp14
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/push_options.hpp14
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/string_view.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/throw_exception.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/type_traits.hpp2
-rw-r--r--contrib/restricted/boost/asio/ya.make4
12 files changed, 580 insertions, 144 deletions
diff --git a/contrib/restricted/boost/asio/include/boost/asio/buffer.hpp b/contrib/restricted/boost/asio/include/boost/asio/buffer.hpp
index 29352f6481..6958b2e84a 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/buffer.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/buffer.hpp
@@ -2,7 +2,7 @@
// buffer.hpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2018 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)
@@ -23,6 +23,7 @@
#include <string>
#include <vector>
#include <boost/asio/detail/array_fwd.hpp>
+#include <boost/asio/detail/memory.hpp>
#include <boost/asio/detail/string_view.hpp>
#include <boost/asio/detail/throw_exception.hpp>
#include <boost/asio/detail/type_traits.hpp>
@@ -382,29 +383,45 @@ private:
/*@{*/
/// Get an iterator to the first element in a buffer sequence.
-inline const mutable_buffer* buffer_sequence_begin(const mutable_buffer& b)
+template <typename MutableBuffer>
+inline const mutable_buffer* buffer_sequence_begin(const MutableBuffer& b,
+ typename enable_if<
+ is_convertible<const MutableBuffer*, const mutable_buffer*>::value
+ >::type* = 0) BOOST_ASIO_NOEXCEPT
{
- return &b;
+ return static_cast<const mutable_buffer*>(detail::addressof(b));
}
/// Get an iterator to the first element in a buffer sequence.
-inline const const_buffer* buffer_sequence_begin(const const_buffer& b)
+template <typename ConstBuffer>
+inline const const_buffer* buffer_sequence_begin(const ConstBuffer& b,
+ typename enable_if<
+ is_convertible<const ConstBuffer*, const const_buffer*>::value
+ >::type* = 0) BOOST_ASIO_NOEXCEPT
{
- return &b;
+ return static_cast<const const_buffer*>(detail::addressof(b));
}
#if defined(BOOST_ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION)
/// Get an iterator to the first element in a buffer sequence.
template <typename C>
-inline auto buffer_sequence_begin(C& c) -> decltype(c.begin())
+inline auto buffer_sequence_begin(C& c,
+ typename enable_if<
+ !is_convertible<const C*, const mutable_buffer*>::value
+ && !is_convertible<const C*, const const_buffer*>::value
+ >::type* = 0) BOOST_ASIO_NOEXCEPT -> decltype(c.begin())
{
return c.begin();
}
/// Get an iterator to the first element in a buffer sequence.
template <typename C>
-inline auto buffer_sequence_begin(const C& c) -> decltype(c.begin())
+inline auto buffer_sequence_begin(const C& c,
+ typename enable_if<
+ !is_convertible<const C*, const mutable_buffer*>::value
+ && !is_convertible<const C*, const const_buffer*>::value
+ >::type* = 0) BOOST_ASIO_NOEXCEPT -> decltype(c.begin())
{
return c.begin();
}
@@ -412,13 +429,21 @@ inline auto buffer_sequence_begin(const C& c) -> decltype(c.begin())
#else // defined(BOOST_ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION)
template <typename C>
-inline typename C::iterator buffer_sequence_begin(C& c)
+inline typename C::iterator buffer_sequence_begin(C& c,
+ typename enable_if<
+ !is_convertible<const C*, const mutable_buffer*>::value
+ && !is_convertible<const C*, const const_buffer*>::value
+ >::type* = 0) BOOST_ASIO_NOEXCEPT
{
return c.begin();
}
template <typename C>
-inline typename C::const_iterator buffer_sequence_begin(const C& c)
+inline typename C::const_iterator buffer_sequence_begin(const C& c,
+ typename enable_if<
+ !is_convertible<const C*, const mutable_buffer*>::value
+ && !is_convertible<const C*, const const_buffer*>::value
+ >::type* = 0) BOOST_ASIO_NOEXCEPT
{
return c.begin();
}
@@ -435,29 +460,45 @@ inline typename C::const_iterator buffer_sequence_begin(const C& c)
/*@{*/
/// Get an iterator to one past the end element in a buffer sequence.
-inline const mutable_buffer* buffer_sequence_end(const mutable_buffer& b)
+template <typename MutableBuffer>
+inline const mutable_buffer* buffer_sequence_end(const MutableBuffer& b,
+ typename enable_if<
+ is_convertible<const MutableBuffer*, const mutable_buffer*>::value
+ >::type* = 0) BOOST_ASIO_NOEXCEPT
{
- return &b + 1;
+ return static_cast<const mutable_buffer*>(detail::addressof(b)) + 1;
}
/// Get an iterator to one past the end element in a buffer sequence.
-inline const const_buffer* buffer_sequence_end(const const_buffer& b)
+template <typename ConstBuffer>
+inline const const_buffer* buffer_sequence_end(const ConstBuffer& b,
+ typename enable_if<
+ is_convertible<const ConstBuffer*, const const_buffer*>::value
+ >::type* = 0) BOOST_ASIO_NOEXCEPT
{
- return &b + 1;
+ return static_cast<const const_buffer*>(detail::addressof(b)) + 1;
}
#if defined(BOOST_ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION)
/// Get an iterator to one past the end element in a buffer sequence.
template <typename C>
-inline auto buffer_sequence_end(C& c) -> decltype(c.end())
+inline auto buffer_sequence_end(C& c,
+ typename enable_if<
+ !is_convertible<const C*, const mutable_buffer*>::value
+ && !is_convertible<const C*, const const_buffer*>::value
+ >::type* = 0) BOOST_ASIO_NOEXCEPT -> decltype(c.end())
{
return c.end();
}
/// Get an iterator to one past the end element in a buffer sequence.
template <typename C>
-inline auto buffer_sequence_end(const C& c) -> decltype(c.end())
+inline auto buffer_sequence_end(const C& c,
+ typename enable_if<
+ !is_convertible<const C*, const mutable_buffer*>::value
+ && !is_convertible<const C*, const const_buffer*>::value
+ >::type* = 0) BOOST_ASIO_NOEXCEPT -> decltype(c.end())
{
return c.end();
}
@@ -465,13 +506,21 @@ inline auto buffer_sequence_end(const C& c) -> decltype(c.end())
#else // defined(BOOST_ASIO_HAS_DECLTYPE) || defined(GENERATING_DOCUMENTATION)
template <typename C>
-inline typename C::iterator buffer_sequence_end(C& c)
+inline typename C::iterator buffer_sequence_end(C& c,
+ typename enable_if<
+ !is_convertible<const C*, const mutable_buffer*>::value
+ && !is_convertible<const C*, const const_buffer*>::value
+ >::type* = 0) BOOST_ASIO_NOEXCEPT
{
return c.end();
}
template <typename C>
-inline typename C::const_iterator buffer_sequence_end(const C& c)
+inline typename C::const_iterator buffer_sequence_end(const C& c,
+ typename enable_if<
+ !is_convertible<const C*, const mutable_buffer*>::value
+ && !is_convertible<const C*, const const_buffer*>::value
+ >::type* = 0) BOOST_ASIO_NOEXCEPT
{
return c.end();
}
@@ -1498,19 +1547,23 @@ template <typename Elem, typename Traits, typename Allocator>
class dynamic_string_buffer
{
public:
- /// The type used to represent the input sequence as a list of buffers.
+ /// The type used to represent a sequence of constant buffers that refers to
+ /// the underlying memory.
typedef BOOST_ASIO_CONST_BUFFER const_buffers_type;
- /// The type used to represent the output sequence as a list of buffers.
+ /// The type used to represent a sequence of mutable buffers that refers to
+ /// the underlying memory.
typedef BOOST_ASIO_MUTABLE_BUFFER mutable_buffers_type;
/// Construct a dynamic buffer from a string.
/**
* @param s The string to be used as backing storage for the dynamic buffer.
- * Any existing data in the string is treated as the dynamic buffer's input
- * sequence. The object stores a reference to the string and the user is
- * responsible for ensuring that the string object remains valid until the
- * dynamic_string_buffer object is destroyed.
+ * The object stores a reference to the string and the user is responsible
+ * for ensuring that the string object remains valid while the
+ * dynamic_string_buffer object, and copies of the object, are in use.
+ *
+ * @b DynamicBuffer_v1: Any existing data in the string is treated as the
+ * dynamic buffer's input sequence.
*
* @param maximum_size Specifies a maximum size for the buffer, in bytes.
*/
@@ -1518,64 +1571,131 @@ public:
std::size_t maximum_size =
(std::numeric_limits<std::size_t>::max)()) BOOST_ASIO_NOEXCEPT
: string_(s),
- size_(string_.size()),
+#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
+ size_((std::numeric_limits<std::size_t>::max)()),
+#endif // !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
max_size_(maximum_size)
{
}
+ /// @b DynamicBuffer_v2: Copy construct a dynamic buffer.
+ dynamic_string_buffer(const dynamic_string_buffer& other) BOOST_ASIO_NOEXCEPT
+ : string_(other.string_),
+#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
+ size_(other.size_),
+#endif // !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
+ max_size_(other.max_size_)
+ {
+ }
+
#if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move construct a dynamic buffer.
dynamic_string_buffer(dynamic_string_buffer&& other) BOOST_ASIO_NOEXCEPT
: string_(other.string_),
+#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
size_(other.size_),
+#endif // !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
max_size_(other.max_size_)
{
}
#endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
- /// Get the size of the input sequence.
+ /// @b DynamicBuffer_v1: Get the size of the input sequence.
+ /// @b DynamicBuffer_v2: Get the current size of the underlying memory.
+ /**
+ * @returns @b DynamicBuffer_v1 The current size of the input sequence.
+ * @b DynamicBuffer_v2: The current size of the underlying string if less than
+ * max_size(). Otherwise returns max_size().
+ */
std::size_t size() const BOOST_ASIO_NOEXCEPT
{
- return size_;
+#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
+ if (size_ != (std::numeric_limits<std::size_t>::max)())
+ return size_;
+#endif // !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
+ return (std::min)(string_.size(), max_size());
}
/// Get the maximum size of the dynamic buffer.
/**
- * @returns The allowed maximum of the sum of the sizes of the input sequence
- * and output sequence.
+ * @returns The allowed maximum size of the underlying memory.
*/
std::size_t max_size() const BOOST_ASIO_NOEXCEPT
{
return max_size_;
}
- /// Get the current capacity of the dynamic buffer.
+ /// Get the maximum size that the buffer may grow to without triggering
+ /// reallocation.
/**
- * @returns The current total capacity of the buffer, i.e. for both the input
- * sequence and output sequence.
+ * @returns The current capacity of the underlying string if less than
+ * max_size(). Otherwise returns max_size().
*/
std::size_t capacity() const BOOST_ASIO_NOEXCEPT
{
- return string_.capacity();
+ return (std::min)(string_.capacity(), max_size());
}
- /// Get a list of buffers that represents the input sequence.
+#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
+ /// @b DynamicBuffer_v1: Get a list of buffers that represents the input
+ /// sequence.
/**
* @returns An object of type @c const_buffers_type that satisfies
* ConstBufferSequence requirements, representing the basic_string memory in
- * input sequence.
+ * the input sequence.
*
* @note The returned object is invalidated by any @c dynamic_string_buffer
- * or @c basic_string member function that modifies the input sequence or
- * output sequence.
+ * or @c basic_string member function that resizes or erases the string.
*/
const_buffers_type data() const BOOST_ASIO_NOEXCEPT
{
return const_buffers_type(boost::asio::buffer(string_, size_));
}
+#endif // !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
- /// Get a list of buffers that represents the output sequence, with the given
- /// size.
+ /// @b DynamicBuffer_v2: Get a sequence of buffers that represents the
+ /// underlying memory.
+ /**
+ * @param pos Position of the first byte to represent in the buffer sequence
+ *
+ * @param n The number of bytes to return in the buffer sequence. If the
+ * underlying memory is shorter, the buffer sequence represents as many bytes
+ * as are available.
+ *
+ * @returns An object of type @c mutable_buffers_type that satisfies
+ * MutableBufferSequence requirements, representing the basic_string memory.
+ *
+ * @note The returned object is invalidated by any @c dynamic_string_buffer
+ * or @c basic_string member function that resizes or erases the string.
+ */
+ mutable_buffers_type data(std::size_t pos, std::size_t n) BOOST_ASIO_NOEXCEPT
+ {
+ return mutable_buffers_type(boost::asio::buffer(
+ boost::asio::buffer(string_, max_size_) + pos, n));
+ }
+
+ /// @b DynamicBuffer_v2: Get a sequence of buffers that represents the
+ /// underlying memory.
+ /**
+ * @param pos Position of the first byte to represent in the buffer sequence
+ *
+ * @param n The number of bytes to return in the buffer sequence. If the
+ * underlying memory is shorter, the buffer sequence represents as many bytes
+ * as are available.
+ *
+ * @note The returned object is invalidated by any @c dynamic_string_buffer
+ * or @c basic_string member function that resizes or erases the string.
+ */
+ const_buffers_type data(std::size_t pos,
+ std::size_t n) const BOOST_ASIO_NOEXCEPT
+ {
+ return const_buffers_type(boost::asio::buffer(
+ boost::asio::buffer(string_, max_size_) + pos, n));
+ }
+
+#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
+ /// @b DynamicBuffer_v1: Get a list of buffers that represents the output
+ /// sequence, with the given size.
/**
* Ensures that the output sequence can accommodate @c n bytes, resizing the
* basic_string object as necessary.
@@ -1592,18 +1712,22 @@ public:
*/
mutable_buffers_type prepare(std::size_t n)
{
- if (size () > max_size() || max_size() - size() < n)
+ if (size() > max_size() || max_size() - size() < n)
{
std::length_error ex("dynamic_string_buffer too long");
boost::asio::detail::throw_exception(ex);
}
+ if (size_ == (std::numeric_limits<std::size_t>::max)())
+ size_ = string_.size(); // Enable v1 behaviour.
+
string_.resize(size_ + n);
return boost::asio::buffer(boost::asio::buffer(string_) + size_, n);
}
- /// Move bytes from the output sequence to the input sequence.
+ /// @b DynamicBuffer_v1: Move bytes from the output sequence to the input
+ /// sequence.
/**
* @param n The number of bytes to append from the start of the output
* sequence to the end of the input sequence. The remainder of the output
@@ -1620,24 +1744,69 @@ public:
size_ += (std::min)(n, string_.size() - size_);
string_.resize(size_);
}
+#endif // !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
- /// Remove characters from the input sequence.
+ /// @b DynamicBuffer_v2: Grow the underlying memory by the specified number of
+ /// bytes.
/**
- * Removes @c n characters from the beginning of the input sequence.
+ * Resizes the string to accommodate an additional @c n bytes at the end.
*
- * @note If @c n is greater than the size of the input sequence, the entire
- * input sequence is consumed and no error is issued.
+ * @throws std::length_error If <tt>size() + n > max_size()</tt>.
+ */
+ void grow(std::size_t n)
+ {
+ if (size() > max_size() || max_size() - size() < n)
+ {
+ std::length_error ex("dynamic_string_buffer too long");
+ boost::asio::detail::throw_exception(ex);
+ }
+
+ string_.resize(size() + n);
+ }
+
+ /// @b DynamicBuffer_v2: Shrink the underlying memory by the specified number
+ /// of bytes.
+ /**
+ * Erases @c n bytes from the end of the string by resizing the basic_string
+ * object. If @c n is greater than the current size of the string, the string
+ * is emptied.
+ */
+ void shrink(std::size_t n)
+ {
+ string_.resize(n > size() ? 0 : size() - n);
+ }
+
+ /// @b DynamicBuffer_v1: Remove characters from the input sequence.
+ /// @b DynamicBuffer_v2: Consume the specified number of bytes from the
+ /// beginning of the underlying memory.
+ /**
+ * @b DynamicBuffer_v1: Removes @c n characters from the beginning of the
+ * input sequence. @note If @c n is greater than the size of the input
+ * sequence, the entire input sequence is consumed and no error is issued.
+ *
+ * @b DynamicBuffer_v2: Erases @c n bytes from the beginning of the string.
+ * If @c n is greater than the current size of the string, the string is
+ * emptied.
*/
void consume(std::size_t n)
{
- std::size_t consume_length = (std::min)(n, size_);
- string_.erase(0, consume_length);
- size_ -= consume_length;
+#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
+ if (size_ != (std::numeric_limits<std::size_t>::max)())
+ {
+ std::size_t consume_length = (std::min)(n, size_);
+ string_.erase(0, consume_length);
+ size_ -= consume_length;
+ return;
+ }
+#endif // !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
+ string_.erase(0, n);
}
private:
std::basic_string<Elem, Traits, Allocator>& string_;
+#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
std::size_t size_;
+#endif // !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
const std::size_t max_size_;
};
@@ -1649,19 +1818,20 @@ template <typename Elem, typename Allocator>
class dynamic_vector_buffer
{
public:
- /// The type used to represent the input sequence as a list of buffers.
+ /// The type used to represent a sequence of constant buffers that refers to
+ /// the underlying memory.
typedef BOOST_ASIO_CONST_BUFFER const_buffers_type;
- /// The type used to represent the output sequence as a list of buffers.
+ /// The type used to represent a sequence of mutable buffers that refers to
+ /// the underlying memory.
typedef BOOST_ASIO_MUTABLE_BUFFER mutable_buffers_type;
- /// Construct a dynamic buffer from a string.
+ /// Construct a dynamic buffer from a vector.
/**
* @param v The vector to be used as backing storage for the dynamic buffer.
- * Any existing data in the vector is treated as the dynamic buffer's input
- * sequence. The object stores a reference to the vector and the user is
- * responsible for ensuring that the vector object remains valid until the
- * dynamic_vector_buffer object is destroyed.
+ * The object stores a reference to the vector and the user is responsible
+ * for ensuring that the vector object remains valid while the
+ * dynamic_vector_buffer object, and copies of the object, are in use.
*
* @param maximum_size Specifies a maximum size for the buffer, in bytes.
*/
@@ -1669,77 +1839,149 @@ public:
std::size_t maximum_size =
(std::numeric_limits<std::size_t>::max)()) BOOST_ASIO_NOEXCEPT
: vector_(v),
- size_(vector_.size()),
+#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
+ size_((std::numeric_limits<std::size_t>::max)()),
+#endif // !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
max_size_(maximum_size)
{
}
+ /// @b DynamicBuffer_v2: Copy construct a dynamic buffer.
+ dynamic_vector_buffer(const dynamic_vector_buffer& other) BOOST_ASIO_NOEXCEPT
+ : vector_(other.vector_),
+#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
+ size_(other.size_),
+#endif // !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
+ max_size_(other.max_size_)
+ {
+ }
+
#if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move construct a dynamic buffer.
dynamic_vector_buffer(dynamic_vector_buffer&& other) BOOST_ASIO_NOEXCEPT
: vector_(other.vector_),
+#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
size_(other.size_),
+#endif // !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
max_size_(other.max_size_)
{
}
#endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
- /// Get the size of the input sequence.
+ /// @b DynamicBuffer_v1: Get the size of the input sequence.
+ /// @b DynamicBuffer_v2: Get the current size of the underlying memory.
+ /**
+ * @returns @b DynamicBuffer_v1 The current size of the input sequence.
+ * @b DynamicBuffer_v2: The current size of the underlying vector if less than
+ * max_size(). Otherwise returns max_size().
+ */
std::size_t size() const BOOST_ASIO_NOEXCEPT
{
- return size_;
+#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
+ if (size_ != (std::numeric_limits<std::size_t>::max)())
+ return size_;
+#endif // !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
+ return (std::min)(vector_.size(), max_size());
}
/// Get the maximum size of the dynamic buffer.
/**
- * @returns The allowed maximum of the sum of the sizes of the input sequence
- * and output sequence.
+ * @returns @b DynamicBuffer_v1: The allowed maximum of the sum of the sizes
+ * of the input sequence and output sequence. @b DynamicBuffer_v2: The allowed
+ * maximum size of the underlying memory.
*/
std::size_t max_size() const BOOST_ASIO_NOEXCEPT
{
return max_size_;
}
- /// Get the current capacity of the dynamic buffer.
+ /// Get the maximum size that the buffer may grow to without triggering
+ /// reallocation.
/**
- * @returns The current total capacity of the buffer, i.e. for both the input
- * sequence and output sequence.
+ * @returns @b DynamicBuffer_v1: The current total capacity of the buffer,
+ * i.e. for both the input sequence and output sequence. @b DynamicBuffer_v2:
+ * The current capacity of the underlying vector if less than max_size().
+ * Otherwise returns max_size().
*/
std::size_t capacity() const BOOST_ASIO_NOEXCEPT
{
- return vector_.capacity();
+ return (std::min)(vector_.capacity(), max_size());
}
- /// Get a list of buffers that represents the input sequence.
+#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
+ /// @b DynamicBuffer_v1: Get a list of buffers that represents the input
+ /// sequence.
/**
* @returns An object of type @c const_buffers_type that satisfies
- * ConstBufferSequence requirements, representing the basic_string memory in
+ * ConstBufferSequence requirements, representing the vector memory in the
* input sequence.
*
* @note The returned object is invalidated by any @c dynamic_vector_buffer
- * or @c basic_string member function that modifies the input sequence or
- * output sequence.
+ * or @c vector member function that modifies the input sequence or output
+ * sequence.
*/
const_buffers_type data() const BOOST_ASIO_NOEXCEPT
{
return const_buffers_type(boost::asio::buffer(vector_, size_));
}
+#endif // !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
- /// Get a list of buffers that represents the output sequence, with the given
- /// size.
+ /// @b DynamicBuffer_v2: Get a sequence of buffers that represents the
+ /// underlying memory.
+ /**
+ * @param pos Position of the first byte to represent in the buffer sequence
+ *
+ * @param n The number of bytes to return in the buffer sequence. If the
+ * underlying memory is shorter, the buffer sequence represents as many bytes
+ * as are available.
+ *
+ * @returns An object of type @c mutable_buffers_type that satisfies
+ * MutableBufferSequence requirements, representing the vector memory.
+ *
+ * @note The returned object is invalidated by any @c dynamic_vector_buffer
+ * or @c vector member function that resizes or erases the vector.
+ */
+ mutable_buffers_type data(std::size_t pos, std::size_t n) BOOST_ASIO_NOEXCEPT
+ {
+ return mutable_buffers_type(boost::asio::buffer(
+ boost::asio::buffer(vector_, max_size_) + pos, n));
+ }
+
+ /// @b DynamicBuffer_v2: Get a sequence of buffers that represents the
+ /// underlying memory.
+ /**
+ * @param pos Position of the first byte to represent in the buffer sequence
+ *
+ * @param n The number of bytes to return in the buffer sequence. If the
+ * underlying memory is shorter, the buffer sequence represents as many bytes
+ * as are available.
+ *
+ * @note The returned object is invalidated by any @c dynamic_vector_buffer
+ * or @c vector member function that resizes or erases the vector.
+ */
+ const_buffers_type data(std::size_t pos,
+ std::size_t n) const BOOST_ASIO_NOEXCEPT
+ {
+ return const_buffers_type(boost::asio::buffer(
+ boost::asio::buffer(vector_, max_size_) + pos, n));
+ }
+
+#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
+ /// @b DynamicBuffer_v1: Get a list of buffers that represents the output
+ /// sequence, with the given size.
/**
* Ensures that the output sequence can accommodate @c n bytes, resizing the
- * basic_string object as necessary.
+ * vector object as necessary.
*
* @returns An object of type @c mutable_buffers_type that satisfies
- * MutableBufferSequence requirements, representing basic_string memory
- * at the start of the output sequence of size @c n.
+ * MutableBufferSequence requirements, representing vector memory at the
+ * start of the output sequence of size @c n.
*
* @throws std::length_error If <tt>size() + n > max_size()</tt>.
*
* @note The returned object is invalidated by any @c dynamic_vector_buffer
- * or @c basic_string member function that modifies the input sequence or
- * output sequence.
+ * or @c vector member function that modifies the input sequence or output
+ * sequence.
*/
mutable_buffers_type prepare(std::size_t n)
{
@@ -1749,12 +1991,16 @@ public:
boost::asio::detail::throw_exception(ex);
}
+ if (size_ == (std::numeric_limits<std::size_t>::max)())
+ size_ = vector_.size(); // Enable v1 behaviour.
+
vector_.resize(size_ + n);
return boost::asio::buffer(boost::asio::buffer(vector_) + size_, n);
}
- /// Move bytes from the output sequence to the input sequence.
+ /// @b DynamicBuffer_v1: Move bytes from the output sequence to the input
+ /// sequence.
/**
* @param n The number of bytes to append from the start of the output
* sequence to the end of the input sequence. The remainder of the output
@@ -1771,24 +2017,69 @@ public:
size_ += (std::min)(n, vector_.size() - size_);
vector_.resize(size_);
}
+#endif // !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
- /// Remove characters from the input sequence.
+ /// @b DynamicBuffer_v2: Grow the underlying memory by the specified number of
+ /// bytes.
/**
- * Removes @c n characters from the beginning of the input sequence.
+ * Resizes the vector to accommodate an additional @c n bytes at the end.
*
- * @note If @c n is greater than the size of the input sequence, the entire
- * input sequence is consumed and no error is issued.
+ * @throws std::length_error If <tt>size() + n > max_size()</tt>.
+ */
+ void grow(std::size_t n)
+ {
+ if (size() > max_size() || max_size() - size() < n)
+ {
+ std::length_error ex("dynamic_vector_buffer too long");
+ boost::asio::detail::throw_exception(ex);
+ }
+
+ vector_.resize(size() + n);
+ }
+
+ /// @b DynamicBuffer_v2: Shrink the underlying memory by the specified number
+ /// of bytes.
+ /**
+ * Erases @c n bytes from the end of the vector by resizing the vector
+ * object. If @c n is greater than the current size of the vector, the vector
+ * is emptied.
+ */
+ void shrink(std::size_t n)
+ {
+ vector_.resize(n > size() ? 0 : size() - n);
+ }
+
+ /// @b DynamicBuffer_v1: Remove characters from the input sequence.
+ /// @b DynamicBuffer_v2: Consume the specified number of bytes from the
+ /// beginning of the underlying memory.
+ /**
+ * @b DynamicBuffer_v1: Removes @c n characters from the beginning of the
+ * input sequence. @note If @c n is greater than the size of the input
+ * sequence, the entire input sequence is consumed and no error is issued.
+ *
+ * @b DynamicBuffer_v2: Erases @c n bytes from the beginning of the vector.
+ * If @c n is greater than the current size of the vector, the vector is
+ * emptied.
*/
void consume(std::size_t n)
{
- std::size_t consume_length = (std::min)(n, size_);
- vector_.erase(vector_.begin(), vector_.begin() + consume_length);
- size_ -= consume_length;
+#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
+ if (size_ != (std::numeric_limits<std::size_t>::max)())
+ {
+ std::size_t consume_length = (std::min)(n, size_);
+ vector_.erase(vector_.begin(), vector_.begin() + consume_length);
+ size_ -= consume_length;
+ return;
+ }
+#endif // !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
+ vector_.erase(vector_.begin(), vector_.begin() + (std::min)(size(), n));
}
private:
std::vector<Elem, Allocator>& vector_;
+#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
std::size_t size_;
+#endif // !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
const std::size_t max_size_;
};
@@ -2154,17 +2445,51 @@ struct is_const_buffer_sequence
{
};
-/// Trait to determine whether a type satisfies the DynamicBuffer requirements.
+#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
+/// Trait to determine whether a type satisfies the DynamicBuffer_v1
+/// requirements.
template <typename T>
-struct is_dynamic_buffer
+struct is_dynamic_buffer_v1
+#if defined(GENERATING_DOCUMENTATION)
+ : integral_constant<bool, automatically_determined>
+#else // defined(GENERATING_DOCUMENTATION)
+ : boost::asio::detail::is_dynamic_buffer_v1<T>
+#endif // defined(GENERATING_DOCUMENTATION)
+{
+};
+#endif // !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
+
+/// Trait to determine whether a type satisfies the DynamicBuffer_v2
+/// requirements.
+template <typename T>
+struct is_dynamic_buffer_v2
#if defined(GENERATING_DOCUMENTATION)
: integral_constant<bool, automatically_determined>
#else // defined(GENERATING_DOCUMENTATION)
- : boost::asio::detail::is_dynamic_buffer<T>
+ : boost::asio::detail::is_dynamic_buffer_v2<T>
#endif // defined(GENERATING_DOCUMENTATION)
{
};
+/// Trait to determine whether a type satisfies the DynamicBuffer requirements.
+/**
+ * If @c BOOST_ASIO_NO_DYNAMIC_BUFFER_V1 is not defined, determines whether the
+ * type satisfies the DynamicBuffer_v1 requirements. Otherwise, if @c
+ * BOOST_ASIO_NO_DYNAMIC_BUFFER_V1 is defined, determines whether the type
+ * satisfies the DynamicBuffer_v1 requirements.
+ */
+template <typename T>
+struct is_dynamic_buffer
+#if defined(GENERATING_DOCUMENTATION)
+ : integral_constant<bool, automatically_determined>
+#elif defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
+ : boost::asio::is_dynamic_buffer_v2<T>
+#else // defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
+ : boost::asio::is_dynamic_buffer_v1<T>
+#endif // defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
+{
+};
+
} // namespace asio
} // namespace boost
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/array_fwd.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/array_fwd.hpp
index 82f357785d..25a0c61496 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/array_fwd.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/array_fwd.hpp
@@ -2,7 +2,7 @@
// detail/array_fwd.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2018 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)
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/config.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/config.hpp
index c810625592..7a09afbd94 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/config.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/config.hpp
@@ -2,7 +2,7 @@
// detail/config.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2018 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)
@@ -120,11 +120,14 @@
#endif // !defined(BOOST_ASIO_HAS_MOVE)
// If BOOST_ASIO_MOVE_CAST isn't defined, and move support is available, define
-// BOOST_ASIO_MOVE_ARG and BOOST_ASIO_MOVE_CAST to take advantage of rvalue
-// references and perfect forwarding.
+// * BOOST_ASIO_MOVE_ARG,
+// * BOOST_ASIO_NONDEDUCED_MOVE_ARG, and
+// * BOOST_ASIO_MOVE_CAST
+// to take advantage of rvalue references and perfect forwarding.
#if defined(BOOST_ASIO_HAS_MOVE) && !defined(BOOST_ASIO_MOVE_CAST)
# define BOOST_ASIO_MOVE_ARG(type) type&&
# define BOOST_ASIO_MOVE_ARG2(type1, type2) type1, type2&&
+# define BOOST_ASIO_NONDEDUCED_MOVE_ARG(type) type&
# define BOOST_ASIO_MOVE_CAST(type) static_cast<type&&>
# define BOOST_ASIO_MOVE_CAST2(type1, type2) static_cast<type1, type2&&>
#endif // defined(BOOST_ASIO_HAS_MOVE) && !defined(BOOST_ASIO_MOVE_CAST)
@@ -150,6 +153,7 @@
# else
# define BOOST_ASIO_MOVE_ARG(type) type
# endif
+# define BOOST_ASIO_NONDEDUCED_MOVE_ARG(type) const type&
# define BOOST_ASIO_MOVE_CAST(type) static_cast<const type&>
# define BOOST_ASIO_MOVE_CAST2(type1, type2) static_cast<const type1, type2&>
#endif // !defined(BOOST_ASIO_MOVE_CAST)
@@ -280,9 +284,9 @@
# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
# endif // defined(__GNUC__)
# if defined(BOOST_ASIO_MSVC)
-# if (_MSC_VER >= 1700)
+# if (_MSC_VER >= 1800)
# define BOOST_ASIO_HAS_DECLTYPE 1
-# endif // (_MSC_VER >= 1700)
+# endif // (_MSC_VER >= 1800)
# endif // defined(BOOST_ASIO_MSVC)
# endif // !defined(BOOST_ASIO_DISABLE_DECLTYPE)
#endif // !defined(BOOST_ASIO_HAS_DECLTYPE)
@@ -446,7 +450,13 @@
# if __has_include(<atomic>)
# define BOOST_ASIO_HAS_STD_ATOMIC 1
# endif // __has_include(<atomic>)
-# endif // (__cplusplus >= 201103)
+# elif defined(__apple_build_version__) && defined(_LIBCPP_VERSION)
+# if (__clang_major__ >= 10)
+# if __has_include(<atomic>)
+# define BOOST_ASIO_HAS_STD_ATOMIC 1
+# endif // __has_include(<atomic>)
+# endif // (__clang_major__ >= 10)
+# endif /// defined(__apple_build_version__) && defined(_LIBCPP_VERSION)
# endif // defined(__clang__)
# if defined(__GNUC__)
# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
@@ -929,15 +939,15 @@
# if defined(_MSC_VER) || defined(__BORLANDC__)
# pragma message( \
"Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example:\n"\
- "- add -D_WIN32_WINNT=0x0501 to the compiler command line; or\n"\
- "- add _WIN32_WINNT=0x0501 to your project's Preprocessor Definitions.\n"\
- "Assuming _WIN32_WINNT=0x0501 (i.e. Windows XP target).")
+ "- add -D_WIN32_WINNT=0x0601 to the compiler command line; or\n"\
+ "- add _WIN32_WINNT=0x0601 to your project's Preprocessor Definitions.\n"\
+ "Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target).")
# else // defined(_MSC_VER) || defined(__BORLANDC__)
# warning Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately.
-# warning For example, add -D_WIN32_WINNT=0x0501 to the compiler command line.
-# warning Assuming _WIN32_WINNT=0x0501 (i.e. Windows XP target).
+# warning For example, add -D_WIN32_WINNT=0x0601 to the compiler command line.
+# warning Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target).
# endif // defined(_MSC_VER) || defined(__BORLANDC__)
-# define _WIN32_WINNT 0x0501
+# define _WIN32_WINNT 0x0601
# endif // !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS)
# if defined(_MSC_VER)
# if defined(_WIN32) && !defined(WIN32)
@@ -1008,7 +1018,8 @@
|| defined(__FreeBSD__) \
|| defined(__NetBSD__) \
|| defined(__OpenBSD__) \
- || defined(__linux__)
+ || defined(__linux__) \
+ || defined(__HAIKU__)
# define BOOST_ASIO_HAS_UNISTD_H 1
# endif
# endif // !defined(BOOST_ASIO_HAS_BOOST_CONFIG)
@@ -1372,33 +1383,6 @@
// || (defined(__MACH__) && defined(__APPLE__))
#endif // !defined(BOOST_ASIO_DISABLE_SSIZE_T)
-// Helper macros to manage the transition away from the old services-based API.
-#if defined(BOOST_ASIO_ENABLE_OLD_SERVICES)
-# define BOOST_ASIO_SVC_TPARAM , typename Service
-# define BOOST_ASIO_SVC_TPARAM_DEF1(d1) , typename Service d1
-# define BOOST_ASIO_SVC_TPARAM_DEF2(d1, d2) , typename Service d1, d2
-# define BOOST_ASIO_SVC_TARG , Service
-# define BOOST_ASIO_SVC_T Service
-# define BOOST_ASIO_SVC_TPARAM1 , typename Service1
-# define BOOST_ASIO_SVC_TPARAM1_DEF1(d1) , typename Service1 d1
-# define BOOST_ASIO_SVC_TPARAM1_DEF2(d1, d2) , typename Service1 d1, d2
-# define BOOST_ASIO_SVC_TARG1 , Service1
-# define BOOST_ASIO_SVC_T1 Service1
-# define BOOST_ASIO_SVC_ACCESS public
-#else // defined(BOOST_ASIO_ENABLE_OLD_SERVICES)
-# define BOOST_ASIO_SVC_TPARAM
-# define BOOST_ASIO_SVC_TPARAM_DEF1(d1)
-# define BOOST_ASIO_SVC_TPARAM_DEF2(d1, d2)
-# define BOOST_ASIO_SVC_TARG
-// BOOST_ASIO_SVC_T is defined at each point of use.
-# define BOOST_ASIO_SVC_TPARAM1
-# define BOOST_ASIO_SVC_TPARAM1_DEF1(d1)
-# define BOOST_ASIO_SVC_TPARAM1_DEF2(d1, d2)
-# define BOOST_ASIO_SVC_TARG1
-// BOOST_ASIO_SVC_T1 is defined at each point of use.
-# define BOOST_ASIO_SVC_ACCESS protected
-#endif // defined(BOOST_ASIO_ENABLE_OLD_SERVICES)
-
// Helper macros to manage transition away from error_code return values.
#if defined(BOOST_ASIO_NO_DEPRECATED)
# define BOOST_ASIO_SYNC_OP_VOID void
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/functional.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/functional.hpp
index 23218bb5df..73f06ece21 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/functional.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/functional.hpp
@@ -2,7 +2,7 @@
// detail/functional.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2018 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)
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/is_buffer_sequence.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/is_buffer_sequence.hpp
index a3fb9931d2..89b8df762d 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/is_buffer_sequence.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/is_buffer_sequence.hpp
@@ -2,7 +2,7 @@
// detail/is_buffer_sequence.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2018 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)
@@ -39,6 +39,8 @@ struct buffer_sequence_memfns_base
void prepare();
void commit();
void consume();
+ void grow();
+ void shrink();
};
template <typename T>
@@ -157,6 +159,24 @@ char consume_memfn_helper(
void (buffer_sequence_memfns_base::*)(),
&buffer_sequence_memfns_derived<T>::consume>*);
+template <typename>
+char (&grow_memfn_helper(...))[2];
+
+template <typename T>
+char grow_memfn_helper(
+ buffer_sequence_memfns_check<
+ void (buffer_sequence_memfns_base::*)(),
+ &buffer_sequence_memfns_derived<T>::grow>*);
+
+template <typename>
+char (&shrink_memfn_helper(...))[2];
+
+template <typename T>
+char shrink_memfn_helper(
+ buffer_sequence_memfns_check<
+ void (buffer_sequence_memfns_base::*)(),
+ &buffer_sequence_memfns_derived<T>::shrink>*);
+
template <typename, typename>
char (&buffer_sequence_element_type_helper(...))[2];
@@ -234,7 +254,7 @@ struct is_buffer_sequence<const_buffer, mutable_buffer>
};
template <typename T>
-struct is_dynamic_buffer_class
+struct is_dynamic_buffer_class_v1
: integral_constant<bool,
sizeof(size_memfn_helper<T>(0)) != 1 &&
sizeof(max_size_memfn_helper<T>(0)) != 1 &&
@@ -249,9 +269,32 @@ struct is_dynamic_buffer_class
};
template <typename T>
-struct is_dynamic_buffer
+struct is_dynamic_buffer_v1
+ : conditional<is_class<T>::value,
+ is_dynamic_buffer_class_v1<T>,
+ false_type>::type
+{
+};
+
+template <typename T>
+struct is_dynamic_buffer_class_v2
+ : integral_constant<bool,
+ sizeof(size_memfn_helper<T>(0)) != 1 &&
+ sizeof(max_size_memfn_helper<T>(0)) != 1 &&
+ sizeof(capacity_memfn_helper<T>(0)) != 1 &&
+ sizeof(data_memfn_helper<T>(0)) != 1 &&
+ sizeof(consume_memfn_helper<T>(0)) != 1 &&
+ sizeof(grow_memfn_helper<T>(0)) != 1 &&
+ sizeof(shrink_memfn_helper<T>(0)) != 1 &&
+ sizeof(const_buffers_type_typedef_helper<T>(0)) == 1 &&
+ sizeof(mutable_buffers_type_typedef_helper<T>(0)) == 1>
+{
+};
+
+template <typename T>
+struct is_dynamic_buffer_v2
: conditional<is_class<T>::value,
- is_dynamic_buffer_class<T>,
+ is_dynamic_buffer_class_v2<T>,
false_type>::type
{
};
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/memory.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/memory.hpp
new file mode 100644
index 0000000000..a18b4d9acc
--- /dev/null
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/memory.hpp
@@ -0,0 +1,72 @@
+//
+// detail/memory.hpp
+// ~~~~~~~~~~~~~~~~~
+//
+// 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)
+//
+
+#ifndef BOOST_ASIO_DETAIL_MEMORY_HPP
+#define BOOST_ASIO_DETAIL_MEMORY_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+#include <memory>
+
+#if !defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
+# include <boost/shared_ptr.hpp>
+# include <boost/weak_ptr.hpp>
+#endif // !defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
+
+#if !defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
+# include <boost/utility/addressof.hpp>
+#endif // !defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
+
+namespace boost {
+namespace asio {
+namespace detail {
+
+#if defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
+using std::shared_ptr;
+using std::weak_ptr;
+#else // defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
+using boost::shared_ptr;
+using boost::weak_ptr;
+#endif // defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
+
+#if defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
+using std::addressof;
+#else // defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
+using boost::addressof;
+#endif // defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
+
+} // namespace detail
+
+#if defined(BOOST_ASIO_HAS_CXX11_ALLOCATORS)
+using std::allocator_arg_t;
+# define BOOST_ASIO_USES_ALLOCATOR(t) \
+ namespace std { \
+ template <typename Allocator> \
+ struct uses_allocator<t, Allocator> : true_type {}; \
+ } \
+ /**/
+# define BOOST_ASIO_REBIND_ALLOC(alloc, t) \
+ typename std::allocator_traits<alloc>::template rebind_alloc<t>
+ /**/
+#else // defined(BOOST_ASIO_HAS_CXX11_ALLOCATORS)
+struct allocator_arg_t {};
+# define BOOST_ASIO_USES_ALLOCATOR(t)
+# define BOOST_ASIO_REBIND_ALLOC(alloc, t) \
+ typename alloc::template rebind<t>::other
+ /**/
+#endif // defined(BOOST_ASIO_HAS_CXX11_ALLOCATORS)
+
+} // namespace asio
+} // namespace boost
+
+#endif // BOOST_ASIO_DETAIL_MEMORY_HPP
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/pop_options.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/pop_options.hpp
index 10450eacb5..3346b96fa4 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/pop_options.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/pop_options.hpp
@@ -2,7 +2,7 @@
// detail/pop_options.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2018 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)
@@ -24,7 +24,9 @@
// Intel C++
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
-# pragma GCC visibility pop
+# if !defined(BOOST_ASIO_DISABLE_VISIBILITY)
+# pragma GCC visibility pop
+# endif // !defined(BOOST_ASIO_DISABLE_VISIBILITY)
# endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
#elif defined(__clang__)
@@ -42,7 +44,9 @@
# endif
# if !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32)
-# pragma GCC visibility pop
+# if !defined(BOOST_ASIO_DISABLE_VISIBILITY)
+# pragma GCC visibility pop
+# endif // !defined(BOOST_ASIO_DISABLE_VISIBILITY)
# endif // !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32)
#elif defined(__GNUC__)
@@ -64,7 +68,9 @@
# endif
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
-# pragma GCC visibility pop
+# if !defined(BOOST_ASIO_DISABLE_VISIBILITY)
+# pragma GCC visibility pop
+# endif // !defined(BOOST_ASIO_DISABLE_VISIBILITY)
# endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
# if (__GNUC__ >= 7)
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/push_options.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/push_options.hpp
index 4927df93a2..679ac273c2 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/push_options.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/push_options.hpp
@@ -2,7 +2,7 @@
// detail/push_options.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2018 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)
@@ -24,7 +24,9 @@
// Intel C++
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
-# pragma GCC visibility push (default)
+# if !defined(BOOST_ASIO_DISABLE_VISIBILITY)
+# pragma GCC visibility push (default)
+# endif // !defined(BOOST_ASIO_DISABLE_VISIBILITY)
# endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
#elif defined(__clang__)
@@ -44,7 +46,9 @@
# endif
# if !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32)
-# pragma GCC visibility push (default)
+# if !defined(BOOST_ASIO_DISABLE_VISIBILITY)
+# pragma GCC visibility push (default)
+# endif // !defined(BOOST_ASIO_DISABLE_VISIBILITY)
# endif // !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32)
#elif defined(__GNUC__)
@@ -68,7 +72,9 @@
# endif
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
-# pragma GCC visibility push (default)
+# if !defined(BOOST_ASIO_DISABLE_VISIBILITY)
+# pragma GCC visibility push (default)
+# endif // !defined(BOOST_ASIO_DISABLE_VISIBILITY)
# endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
# if (__GNUC__ >= 7)
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/string_view.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/string_view.hpp
index fa2ee54f10..42a405a4dc 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/string_view.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/string_view.hpp
@@ -2,7 +2,7 @@
// detail/string_view.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2018 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)
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/throw_exception.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/throw_exception.hpp
index 8690fa6f63..6190419f55 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/throw_exception.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/throw_exception.hpp
@@ -2,7 +2,7 @@
// detail/throw_exception.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2018 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)
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/type_traits.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/type_traits.hpp
index a0d4cb4902..c53a7e745c 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/type_traits.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/type_traits.hpp
@@ -2,7 +2,7 @@
// detail/type_traits.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2018 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)
diff --git a/contrib/restricted/boost/asio/ya.make b/contrib/restricted/boost/asio/ya.make
index 7f16fb3076..4fe8fe8d54 100644
--- a/contrib/restricted/boost/asio/ya.make
+++ b/contrib/restricted/boost/asio/ya.make
@@ -9,9 +9,9 @@ LICENSE(
LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-VERSION(1.69.0)
+VERSION(1.70.0)
-ORIGINAL_SOURCE(https://github.com/boostorg/asio/archive/boost-1.69.0.tar.gz)
+ORIGINAL_SOURCE(https://github.com/boostorg/asio/archive/boost-1.70.0.tar.gz)
PEERDIR(
contrib/libs/openssl