diff options
Diffstat (limited to '3rdParty/Boost/src/boost/asio')
172 files changed, 1350 insertions, 786 deletions
diff --git a/3rdParty/Boost/src/boost/asio/basic_datagram_socket.hpp b/3rdParty/Boost/src/boost/asio/basic_datagram_socket.hpp index 8fa870b..3b3dedb 100644 --- a/3rdParty/Boost/src/boost/asio/basic_datagram_socket.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_datagram_socket.hpp @@ -2,7 +2,7 @@ // basic_datagram_socket.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/basic_deadline_timer.hpp b/3rdParty/Boost/src/boost/asio/basic_deadline_timer.hpp index 65256b8..1284daa 100644 --- a/3rdParty/Boost/src/boost/asio/basic_deadline_timer.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_deadline_timer.hpp @@ -2,7 +2,7 @@ // basic_deadline_timer.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -35,6 +35,10 @@ namespace asio { * The basic_deadline_timer class template provides the ability to perform a * blocking or asynchronous wait for a timer to expire. * + * A deadline timer is always in one of two states: "expired" or "not expired". + * If the wait() or async_wait() function is called on an expired timer, the + * wait operation will complete immediately. + * * Most applications will use the boost::asio::deadline_timer typedef. * * @par Thread Safety @@ -193,6 +197,16 @@ public: * @return The number of asynchronous operations that were cancelled. * * @throws boost::system::system_error Thrown on failure. + * + * @note If the timer has already expired when cancel() is called, then the + * handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. */ std::size_t cancel() { @@ -213,6 +227,16 @@ public: * @param ec Set to indicate what error occurred, if any. * * @return The number of asynchronous operations that were cancelled. + * + * @note If the timer has already expired when cancel() is called, then the + * handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. */ std::size_t cancel(boost::system::error_code& ec) { @@ -240,6 +264,16 @@ public: * @return The number of asynchronous operations that were cancelled. * * @throws boost::system::system_error Thrown on failure. + * + * @note If the timer has already expired when expires_at() is called, then + * the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. */ std::size_t expires_at(const time_type& expiry_time) { @@ -261,6 +295,16 @@ public: * @param ec Set to indicate what error occurred, if any. * * @return The number of asynchronous operations that were cancelled. + * + * @note If the timer has already expired when expires_at() is called, then + * the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. */ std::size_t expires_at(const time_type& expiry_time, boost::system::error_code& ec) @@ -289,6 +333,16 @@ public: * @return The number of asynchronous operations that were cancelled. * * @throws boost::system::system_error Thrown on failure. + * + * @note If the timer has already expired when expires_from_now() is called, + * then the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. */ std::size_t expires_from_now(const duration_type& expiry_time) { @@ -310,6 +364,16 @@ public: * @param ec Set to indicate what error occurred, if any. * * @return The number of asynchronous operations that were cancelled. + * + * @note If the timer has already expired when expires_from_now() is called, + * then the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. */ std::size_t expires_from_now(const duration_type& expiry_time, boost::system::error_code& ec) diff --git a/3rdParty/Boost/src/boost/asio/basic_io_object.hpp b/3rdParty/Boost/src/boost/asio/basic_io_object.hpp index 1cbf9bb..3cb6b68 100644 --- a/3rdParty/Boost/src/boost/asio/basic_io_object.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_io_object.hpp @@ -2,7 +2,7 @@ // basic_io_object.hpp // ~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/basic_raw_socket.hpp b/3rdParty/Boost/src/boost/asio/basic_raw_socket.hpp index 1ba5558..09810d4 100644 --- a/3rdParty/Boost/src/boost/asio/basic_raw_socket.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_raw_socket.hpp @@ -2,7 +2,7 @@ // basic_raw_socket.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/basic_serial_port.hpp b/3rdParty/Boost/src/boost/asio/basic_serial_port.hpp index 339d5df..539119a 100644 --- a/3rdParty/Boost/src/boost/asio/basic_serial_port.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_serial_port.hpp @@ -2,7 +2,7 @@ // basic_serial_port.hpp // ~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/3rdParty/Boost/src/boost/asio/basic_socket.hpp b/3rdParty/Boost/src/boost/asio/basic_socket.hpp index c991132..6b89623 100644 --- a/3rdParty/Boost/src/boost/asio/basic_socket.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_socket.hpp @@ -2,7 +2,7 @@ // basic_socket.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/basic_socket_acceptor.hpp b/3rdParty/Boost/src/boost/asio/basic_socket_acceptor.hpp index afa0d63..d23dc33 100644 --- a/3rdParty/Boost/src/boost/asio/basic_socket_acceptor.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_socket_acceptor.hpp @@ -2,7 +2,7 @@ // basic_socket_acceptor.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/basic_socket_iostream.hpp b/3rdParty/Boost/src/boost/asio/basic_socket_iostream.hpp index b0ae259..e4c7ec1 100644 --- a/3rdParty/Boost/src/boost/asio/basic_socket_iostream.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_socket_iostream.hpp @@ -2,7 +2,7 @@ // basic_socket_iostream.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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,12 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/asio/detail/push_options.hpp> +#include <boost/config.hpp> +#include <boost/asio/detail/pop_options.hpp> + +#if !defined(BOOST_NO_IOSTREAM) + +#include <boost/asio/detail/push_options.hpp> #include <boost/preprocessor/arithmetic/inc.hpp> #include <boost/preprocessor/repetition/enum_binary_params.hpp> #include <boost/preprocessor/repetition/enum_params.hpp> @@ -145,6 +151,8 @@ public: #undef BOOST_ASIO_PRIVATE_CTR_DEF #undef BOOST_ASIO_PRIVATE_CONNECT_DEF +#endif // defined(BOOST_NO_IOSTREAM) + #include <boost/asio/detail/pop_options.hpp> #endif // BOOST_ASIO_BASIC_SOCKET_IOSTREAM_HPP diff --git a/3rdParty/Boost/src/boost/asio/basic_socket_streambuf.hpp b/3rdParty/Boost/src/boost/asio/basic_socket_streambuf.hpp index 9977be6..9e96401 100644 --- a/3rdParty/Boost/src/boost/asio/basic_socket_streambuf.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_socket_streambuf.hpp @@ -2,7 +2,7 @@ // basic_socket_streambuf.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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,12 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/asio/detail/push_options.hpp> +#include <boost/config.hpp> +#include <boost/asio/detail/pop_options.hpp> + +#if !defined(BOOST_NO_IOSTREAM) + +#include <boost/asio/detail/push_options.hpp> #include <streambuf> #include <boost/array.hpp> #include <boost/preprocessor/arithmetic/inc.hpp> @@ -282,6 +288,8 @@ private: #undef BOOST_ASIO_PRIVATE_CONNECT_DEF +#endif // !defined(BOOST_NO_IOSTREAM) + #include <boost/asio/detail/pop_options.hpp> #endif // BOOST_ASIO_BASIC_SOCKET_STREAMBUF_HPP diff --git a/3rdParty/Boost/src/boost/asio/basic_stream_socket.hpp b/3rdParty/Boost/src/boost/asio/basic_stream_socket.hpp index c020369..15658bc 100644 --- a/3rdParty/Boost/src/boost/asio/basic_stream_socket.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_stream_socket.hpp @@ -2,7 +2,7 @@ // basic_stream_socket.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/basic_streambuf.hpp b/3rdParty/Boost/src/boost/asio/basic_streambuf.hpp index db0e0c5..e5f8a8d 100644 --- a/3rdParty/Boost/src/boost/asio/basic_streambuf.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_streambuf.hpp @@ -2,7 +2,7 @@ // basic_streambuf.hpp // ~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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,13 +18,20 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/asio/detail/push_options.hpp> +#include <boost/config.hpp> +#include <boost/asio/detail/pop_options.hpp> + +#if !defined(BOOST_NO_IOSTREAM) + +#include <boost/asio/detail/push_options.hpp> #include <algorithm> #include <cstring> -#include <limits> #include <memory> #include <stdexcept> #include <streambuf> #include <vector> +#include <boost/limits.hpp> +#include <boost/throw_exception.hpp> #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/buffer.hpp> @@ -89,7 +96,7 @@ namespace asio { * boost::asio::streambuf b; * * // reserve 512 bytes in output sequence - * boost::asio::streambuf::const_buffers_type bufs = b.prepare(512); + * boost::asio::streambuf::mutable_buffers_type bufs = b.prepare(512); * * size_t n = sock.receive(bufs); * @@ -318,7 +325,8 @@ protected: } else { - throw std::length_error("boost::asio::streambuf too long"); + std::length_error ex("boost::asio::streambuf too long"); + boost::throw_exception(ex); } } @@ -337,4 +345,6 @@ private: #include <boost/asio/detail/pop_options.hpp> +#endif // !defined(BOOST_NO_IOSTREAM) + #endif // BOOST_ASIO_BASIC_STREAMBUF_HPP diff --git a/3rdParty/Boost/src/boost/asio/buffer.hpp b/3rdParty/Boost/src/boost/asio/buffer.hpp index 056d712..3fe8192 100644 --- a/3rdParty/Boost/src/boost/asio/buffer.hpp +++ b/3rdParty/Boost/src/boost/asio/buffer.hpp @@ -2,7 +2,7 @@ // buffer.hpp // ~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -432,12 +432,12 @@ public: ~buffer_debug_check() { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) - // MSVC's string iterator checking may crash in a std::string::iterator +#if BOOST_WORKAROUND(BOOST_MSVC, == 1400) + // MSVC 8's string iterator checking may crash in a std::string::iterator // object's destructor when the iterator points to an already-destroyed // std::string object, unless the iterator is cleared first. iter_ = Iterator(); -#endif // BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#endif // BOOST_WORKAROUND(BOOST_MSVC, == 1400) } void operator()() diff --git a/3rdParty/Boost/src/boost/asio/buffered_read_stream.hpp b/3rdParty/Boost/src/boost/asio/buffered_read_stream.hpp index 742123b..d7bf6ff 100644 --- a/3rdParty/Boost/src/boost/asio/buffered_read_stream.hpp +++ b/3rdParty/Boost/src/boost/asio/buffered_read_stream.hpp @@ -2,7 +2,7 @@ // buffered_read_stream.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -21,7 +21,7 @@ #include <cstddef> #include <cstring> #include <boost/config.hpp> -#include <boost/type_traits.hpp> +#include <boost/type_traits/remove_reference.hpp> #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/buffered_read_stream_fwd.hpp> @@ -230,8 +230,21 @@ public: template <typename MutableBufferSequence> std::size_t read_some(const MutableBufferSequence& buffers) { + typename MutableBufferSequence::const_iterator iter = buffers.begin(); + typename MutableBufferSequence::const_iterator end = buffers.end(); + size_t total_buffer_size = 0; + for (; iter != end; ++iter) + { + boost::asio::mutable_buffer buffer(*iter); + total_buffer_size += boost::asio::buffer_size(buffer); + } + + if (total_buffer_size == 0) + return 0; + if (storage_.empty()) fill(); + return copy(buffers); } @@ -242,8 +255,22 @@ public: boost::system::error_code& ec) { ec = boost::system::error_code(); + + typename MutableBufferSequence::const_iterator iter = buffers.begin(); + typename MutableBufferSequence::const_iterator end = buffers.end(); + size_t total_buffer_size = 0; + for (; iter != end; ++iter) + { + boost::asio::mutable_buffer buffer(*iter); + total_buffer_size += boost::asio::buffer_size(buffer); + } + + if (total_buffer_size == 0) + return 0; + if (storage_.empty() && !fill(ec)) return 0; + return copy(buffers); } @@ -306,7 +333,21 @@ public: void async_read_some(const MutableBufferSequence& buffers, ReadHandler handler) { - if (storage_.empty()) + typename MutableBufferSequence::const_iterator iter = buffers.begin(); + typename MutableBufferSequence::const_iterator end = buffers.end(); + size_t total_buffer_size = 0; + for (; iter != end; ++iter) + { + boost::asio::mutable_buffer buffer(*iter); + total_buffer_size += boost::asio::buffer_size(buffer); + } + + if (total_buffer_size == 0) + { + get_io_service().post(detail::bind_handler( + handler, boost::system::error_code(), 0)); + } + else if (storage_.empty()) { async_fill(read_some_handler<MutableBufferSequence, ReadHandler>( get_io_service(), storage_, buffers, handler)); diff --git a/3rdParty/Boost/src/boost/asio/buffered_read_stream_fwd.hpp b/3rdParty/Boost/src/boost/asio/buffered_read_stream_fwd.hpp index da9765e..8eb24f8 100644 --- a/3rdParty/Boost/src/boost/asio/buffered_read_stream_fwd.hpp +++ b/3rdParty/Boost/src/boost/asio/buffered_read_stream_fwd.hpp @@ -2,7 +2,7 @@ // buffered_read_stream_fwd.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/buffered_stream.hpp b/3rdParty/Boost/src/boost/asio/buffered_stream.hpp index e1b8d38..0cbc280 100644 --- a/3rdParty/Boost/src/boost/asio/buffered_stream.hpp +++ b/3rdParty/Boost/src/boost/asio/buffered_stream.hpp @@ -2,7 +2,7 @@ // buffered_stream.hpp // ~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/buffered_stream_fwd.hpp b/3rdParty/Boost/src/boost/asio/buffered_stream_fwd.hpp index 7641235..066f52c 100644 --- a/3rdParty/Boost/src/boost/asio/buffered_stream_fwd.hpp +++ b/3rdParty/Boost/src/boost/asio/buffered_stream_fwd.hpp @@ -2,7 +2,7 @@ // buffered_stream_fwd.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/buffered_write_stream.hpp b/3rdParty/Boost/src/boost/asio/buffered_write_stream.hpp index 1d06541..fb38b25 100644 --- a/3rdParty/Boost/src/boost/asio/buffered_write_stream.hpp +++ b/3rdParty/Boost/src/boost/asio/buffered_write_stream.hpp @@ -2,7 +2,7 @@ // buffered_write_stream.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -21,7 +21,7 @@ #include <cstddef> #include <cstring> #include <boost/config.hpp> -#include <boost/type_traits.hpp> +#include <boost/type_traits/remove_reference.hpp> #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/buffered_write_stream_fwd.hpp> @@ -187,8 +187,21 @@ public: template <typename ConstBufferSequence> std::size_t write_some(const ConstBufferSequence& buffers) { + typename ConstBufferSequence::const_iterator iter = buffers.begin(); + typename ConstBufferSequence::const_iterator end = buffers.end(); + size_t total_buffer_size = 0; + for (; iter != end; ++iter) + { + boost::asio::const_buffer buffer(*iter); + total_buffer_size += boost::asio::buffer_size(buffer); + } + + if (total_buffer_size == 0) + return 0; + if (storage_.size() == storage_.capacity()) flush(); + return copy(buffers); } @@ -199,8 +212,22 @@ public: boost::system::error_code& ec) { ec = boost::system::error_code(); + + typename ConstBufferSequence::const_iterator iter = buffers.begin(); + typename ConstBufferSequence::const_iterator end = buffers.end(); + size_t total_buffer_size = 0; + for (; iter != end; ++iter) + { + boost::asio::const_buffer buffer(*iter); + total_buffer_size += boost::asio::buffer_size(buffer); + } + + if (total_buffer_size == 0) + return 0; + if (storage_.size() == storage_.capacity() && !flush(ec)) return 0; + return copy(buffers); } @@ -264,7 +291,21 @@ public: void async_write_some(const ConstBufferSequence& buffers, WriteHandler handler) { - if (storage_.size() == storage_.capacity()) + typename ConstBufferSequence::const_iterator iter = buffers.begin(); + typename ConstBufferSequence::const_iterator end = buffers.end(); + size_t total_buffer_size = 0; + for (; iter != end; ++iter) + { + boost::asio::const_buffer buffer(*iter); + total_buffer_size += boost::asio::buffer_size(buffer); + } + + if (total_buffer_size == 0) + { + get_io_service().post(detail::bind_handler( + handler, boost::system::error_code(), 0)); + } + else if (storage_.size() == storage_.capacity()) { async_flush(write_some_handler<ConstBufferSequence, WriteHandler>( get_io_service(), storage_, buffers, handler)); diff --git a/3rdParty/Boost/src/boost/asio/buffered_write_stream_fwd.hpp b/3rdParty/Boost/src/boost/asio/buffered_write_stream_fwd.hpp index 4774e89..74cdb83 100644 --- a/3rdParty/Boost/src/boost/asio/buffered_write_stream_fwd.hpp +++ b/3rdParty/Boost/src/boost/asio/buffered_write_stream_fwd.hpp @@ -2,7 +2,7 @@ // buffered_write_stream_fwd.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/buffers_iterator.hpp b/3rdParty/Boost/src/boost/asio/buffers_iterator.hpp index f9d61da..0d29213 100644 --- a/3rdParty/Boost/src/boost/asio/buffers_iterator.hpp +++ b/3rdParty/Boost/src/boost/asio/buffers_iterator.hpp @@ -2,7 +2,7 @@ // buffers_iterator.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/completion_condition.hpp b/3rdParty/Boost/src/boost/asio/completion_condition.hpp index c317c02..747591c 100644 --- a/3rdParty/Boost/src/boost/asio/completion_condition.hpp +++ b/3rdParty/Boost/src/boost/asio/completion_condition.hpp @@ -2,7 +2,7 @@ // completion_condition.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/datagram_socket_service.hpp b/3rdParty/Boost/src/boost/asio/datagram_socket_service.hpp index 8cc6617..93deddc 100644 --- a/3rdParty/Boost/src/boost/asio/datagram_socket_service.hpp +++ b/3rdParty/Boost/src/boost/asio/datagram_socket_service.hpp @@ -2,7 +2,7 @@ // datagram_socket_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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,12 +24,23 @@ #include <boost/asio/error.hpp> #include <boost/asio/io_service.hpp> -#include <boost/asio/detail/epoll_reactor.hpp> -#include <boost/asio/detail/kqueue_reactor.hpp> -#include <boost/asio/detail/select_reactor.hpp> #include <boost/asio/detail/service_base.hpp> -#include <boost/asio/detail/reactive_socket_service.hpp> -#include <boost/asio/detail/win_iocp_socket_service.hpp> + +#if defined(BOOST_ASIO_HAS_IOCP) +# include <boost/asio/detail/win_iocp_socket_service.hpp> +#elif defined(BOOST_ASIO_HAS_EPOLL) +# include <boost/asio/detail/epoll_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#elif defined(BOOST_ASIO_HAS_KQUEUE) +# include <boost/asio/detail/kqueue_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#elif defined(BOOST_ASIO_HAS_DEV_POLL) +# include <boost/asio/detail/dev_poll_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#else +# include <boost/asio/detail/select_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#endif namespace boost { namespace asio { diff --git a/3rdParty/Boost/src/boost/asio/deadline_timer.hpp b/3rdParty/Boost/src/boost/asio/deadline_timer.hpp index a62a2ce..7f8d1e3 100644 --- a/3rdParty/Boost/src/boost/asio/deadline_timer.hpp +++ b/3rdParty/Boost/src/boost/asio/deadline_timer.hpp @@ -2,7 +2,7 @@ // deadline_timer.hpp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -28,7 +28,7 @@ namespace boost { namespace asio { -/// Typedef for the typical usage of timer. +/// Typedef for the typical usage of timer. Uses a UTC clock. typedef basic_deadline_timer<boost::posix_time::ptime> deadline_timer; } // namespace asio diff --git a/3rdParty/Boost/src/boost/asio/deadline_timer_service.hpp b/3rdParty/Boost/src/boost/asio/deadline_timer_service.hpp index dccd139..90e7482 100644 --- a/3rdParty/Boost/src/boost/asio/deadline_timer_service.hpp +++ b/3rdParty/Boost/src/boost/asio/deadline_timer_service.hpp @@ -2,7 +2,7 @@ // deadline_timer_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -25,11 +25,19 @@ #include <boost/asio/io_service.hpp> #include <boost/asio/time_traits.hpp> #include <boost/asio/detail/deadline_timer_service.hpp> -#include <boost/asio/detail/epoll_reactor.hpp> -#include <boost/asio/detail/kqueue_reactor.hpp> -#include <boost/asio/detail/select_reactor.hpp> #include <boost/asio/detail/service_base.hpp> -#include <boost/asio/detail/win_iocp_io_service.hpp> + +#if defined(BOOST_ASIO_HAS_IOCP) +# include <boost/asio/detail/win_iocp_io_service.hpp> +#elif defined(BOOST_ASIO_HAS_EPOLL) +# include <boost/asio/detail/epoll_reactor.hpp> +#elif defined(BOOST_ASIO_HAS_KQUEUE) +# include <boost/asio/detail/kqueue_reactor.hpp> +#elif defined(BOOST_ASIO_HAS_DEV_POLL) +# include <boost/asio/detail/dev_poll_reactor.hpp> +#else +# include <boost/asio/detail/select_reactor.hpp> +#endif namespace boost { namespace asio { diff --git a/3rdParty/Boost/src/boost/asio/detail/bind_handler.hpp b/3rdParty/Boost/src/boost/asio/detail/bind_handler.hpp index 3a9ad01..e161893 100644 --- a/3rdParty/Boost/src/boost/asio/detail/bind_handler.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/bind_handler.hpp @@ -2,7 +2,7 @@ // bind_handler.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -54,7 +54,7 @@ inline void* asio_handler_allocate(std::size_t size, binder1<Handler, Arg1>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename Handler, typename Arg1> @@ -62,7 +62,7 @@ inline void asio_handler_deallocate(void* pointer, std::size_t size, binder1<Handler, Arg1>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename Handler, typename Arg1> @@ -70,7 +70,7 @@ inline void asio_handler_invoke(const Function& function, binder1<Handler, Arg1>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } template <typename Handler, typename Arg1> @@ -112,7 +112,7 @@ inline void* asio_handler_allocate(std::size_t size, binder2<Handler, Arg1, Arg2>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename Handler, typename Arg1, typename Arg2> @@ -120,7 +120,7 @@ inline void asio_handler_deallocate(void* pointer, std::size_t size, binder2<Handler, Arg1, Arg2>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename Handler, typename Arg1, typename Arg2> @@ -128,7 +128,7 @@ inline void asio_handler_invoke(const Function& function, binder2<Handler, Arg1, Arg2>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } template <typename Handler, typename Arg1, typename Arg2> @@ -173,7 +173,7 @@ inline void* asio_handler_allocate(std::size_t size, binder3<Handler, Arg1, Arg2, Arg3>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename Handler, typename Arg1, typename Arg2, typename Arg3> @@ -181,7 +181,7 @@ inline void asio_handler_deallocate(void* pointer, std::size_t size, binder3<Handler, Arg1, Arg2, Arg3>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename Handler, typename Arg1, typename Arg2, @@ -190,7 +190,7 @@ inline void asio_handler_invoke(const Function& function, binder3<Handler, Arg1, Arg2, Arg3>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } template <typename Handler, typename Arg1, typename Arg2, typename Arg3> @@ -239,7 +239,7 @@ inline void* asio_handler_allocate(std::size_t size, binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename Handler, typename Arg1, typename Arg2, typename Arg3, @@ -248,7 +248,7 @@ inline void asio_handler_deallocate(void* pointer, std::size_t size, binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename Handler, typename Arg1, typename Arg2, @@ -257,7 +257,7 @@ inline void asio_handler_invoke(const Function& function, binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } template <typename Handler, typename Arg1, typename Arg2, typename Arg3, @@ -311,7 +311,7 @@ inline void* asio_handler_allocate(std::size_t size, binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename Handler, typename Arg1, typename Arg2, typename Arg3, @@ -320,7 +320,7 @@ inline void asio_handler_deallocate(void* pointer, std::size_t size, binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename Handler, typename Arg1, typename Arg2, @@ -329,7 +329,7 @@ inline void asio_handler_invoke(const Function& function, binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } template <typename Handler, typename Arg1, typename Arg2, typename Arg3, diff --git a/3rdParty/Boost/src/boost/asio/detail/buffer_resize_guard.hpp b/3rdParty/Boost/src/boost/asio/detail/buffer_resize_guard.hpp index 63d957c..af67c46 100644 --- a/3rdParty/Boost/src/boost/asio/detail/buffer_resize_guard.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/buffer_resize_guard.hpp @@ -2,7 +2,7 @@ // buffer_resize_guard.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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,8 +18,8 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/asio/detail/push_options.hpp> -#include <limits> #include <boost/config.hpp> +#include <boost/limits.hpp> #include <boost/asio/detail/pop_options.hpp> namespace boost { diff --git a/3rdParty/Boost/src/boost/asio/detail/buffered_stream_storage.hpp b/3rdParty/Boost/src/boost/asio/detail/buffered_stream_storage.hpp index f20bf27..9b83426 100644 --- a/3rdParty/Boost/src/boost/asio/detail/buffered_stream_storage.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/buffered_stream_storage.hpp @@ -2,7 +2,7 @@ // buffered_stream_storage.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/call_stack.hpp b/3rdParty/Boost/src/boost/asio/detail/call_stack.hpp index 0096741..0d7d52c 100644 --- a/3rdParty/Boost/src/boost/asio/detail/call_stack.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/call_stack.hpp @@ -2,7 +2,7 @@ // call_stack.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/consuming_buffers.hpp b/3rdParty/Boost/src/boost/asio/detail/consuming_buffers.hpp index 0ed811d..bf04b1b 100644 --- a/3rdParty/Boost/src/boost/asio/detail/consuming_buffers.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/consuming_buffers.hpp @@ -2,7 +2,7 @@ // consuming_buffers.hpp // ~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -20,9 +20,9 @@ #include <boost/asio/detail/push_options.hpp> #include <algorithm> #include <cstddef> -#include <limits> #include <boost/config.hpp> #include <boost/iterator/iterator_facade.hpp> +#include <boost/limits.hpp> #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/buffer.hpp> diff --git a/3rdParty/Boost/src/boost/asio/detail/deadline_timer_service.hpp b/3rdParty/Boost/src/boost/asio/detail/deadline_timer_service.hpp index 16206a7..7885c9a 100644 --- a/3rdParty/Boost/src/boost/asio/detail/deadline_timer_service.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/deadline_timer_service.hpp @@ -2,7 +2,7 @@ // deadline_timer_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/descriptor_ops.hpp b/3rdParty/Boost/src/boost/asio/detail/descriptor_ops.hpp index 2ee1988..c4969f7 100644 --- a/3rdParty/Boost/src/boost/asio/detail/descriptor_ops.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/descriptor_ops.hpp @@ -2,7 +2,7 @@ // descriptor_ops.hpp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/dev_poll_reactor.hpp b/3rdParty/Boost/src/boost/asio/detail/dev_poll_reactor.hpp index 8739085..7315384 100644 --- a/3rdParty/Boost/src/boost/asio/detail/dev_poll_reactor.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/dev_poll_reactor.hpp @@ -2,7 +2,7 @@ // dev_poll_reactor.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -366,23 +366,26 @@ private: // Write the pending event registration changes to the /dev/poll descriptor. std::size_t events_size = sizeof(::pollfd) * pending_event_changes_.size(); - errno = 0; - int result = ::write(dev_poll_fd_, - &pending_event_changes_[0], events_size); - if (result != static_cast<int>(events_size)) + if (events_size > 0) { - for (std::size_t i = 0; i < pending_event_changes_.size(); ++i) + errno = 0; + int result = ::write(dev_poll_fd_, + &pending_event_changes_[0], events_size); + if (result != static_cast<int>(events_size)) { - int descriptor = pending_event_changes_[i].fd; - boost::system::error_code ec = boost::system::error_code( - errno, boost::asio::error::get_system_category()); - read_op_queue_.perform_all_operations(descriptor, ec); - write_op_queue_.perform_all_operations(descriptor, ec); - except_op_queue_.perform_all_operations(descriptor, ec); + for (std::size_t i = 0; i < pending_event_changes_.size(); ++i) + { + int descriptor = pending_event_changes_[i].fd; + boost::system::error_code ec = boost::system::error_code( + errno, boost::asio::error::get_system_category()); + read_op_queue_.perform_all_operations(descriptor, ec); + write_op_queue_.perform_all_operations(descriptor, ec); + except_op_queue_.perform_all_operations(descriptor, ec); + } } + pending_event_changes_.clear(); + pending_event_change_index_.clear(); } - pending_event_changes_.clear(); - pending_event_change_index_.clear(); int timeout = block ? get_timeout() : 0; wait_in_progress_ = true; @@ -399,9 +402,6 @@ private: lock.lock(); wait_in_progress_ = false; - // Block signals while performing operations. - boost::asio::detail::signal_blocker sb; - // Dispatch the waiting events. for (int i = 0; i < num_events; ++i) { @@ -435,7 +435,6 @@ private: more_writes = write_op_queue_.has_operation(descriptor); if ((events[i].events & (POLLERR | POLLHUP)) != 0 - && (events[i].events & ~(POLLERR | POLLHUP)) == 0 && !more_except && !more_reads && !more_writes) { // If we have an event and no operations associated with the diff --git a/3rdParty/Boost/src/boost/asio/detail/dev_poll_reactor_fwd.hpp b/3rdParty/Boost/src/boost/asio/detail/dev_poll_reactor_fwd.hpp index 3308575..d890fa8 100644 --- a/3rdParty/Boost/src/boost/asio/detail/dev_poll_reactor_fwd.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/dev_poll_reactor_fwd.hpp @@ -2,7 +2,7 @@ // dev_poll_reactor_fwd.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/epoll_reactor.hpp b/3rdParty/Boost/src/boost/asio/detail/epoll_reactor.hpp index 2770c6a..6c6bfe3 100644 --- a/3rdParty/Boost/src/boost/asio/detail/epoll_reactor.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/epoll_reactor.hpp @@ -2,7 +2,7 @@ // epoll_reactor.hpp // ~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -472,9 +472,6 @@ private: lock.lock(); wait_in_progress_ = false; - // Block signals while performing operations. - boost::asio::detail::signal_blocker sb; - // Dispatch the waiting events. for (int i = 0; i < num_events; ++i) { diff --git a/3rdParty/Boost/src/boost/asio/detail/epoll_reactor_fwd.hpp b/3rdParty/Boost/src/boost/asio/detail/epoll_reactor_fwd.hpp index 567a966..9659dd4 100644 --- a/3rdParty/Boost/src/boost/asio/detail/epoll_reactor_fwd.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/epoll_reactor_fwd.hpp @@ -2,7 +2,7 @@ // epoll_reactor_fwd.hpp // ~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/event.hpp b/3rdParty/Boost/src/boost/asio/detail/event.hpp index 67a0118..89f9896 100644 --- a/3rdParty/Boost/src/boost/asio/detail/event.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/event.hpp @@ -2,7 +2,7 @@ // event.hpp // ~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/eventfd_select_interrupter.hpp b/3rdParty/Boost/src/boost/asio/detail/eventfd_select_interrupter.hpp index cac8405..4749ec9 100644 --- a/3rdParty/Boost/src/boost/asio/detail/eventfd_select_interrupter.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/eventfd_select_interrupter.hpp @@ -2,7 +2,7 @@ // eventfd_select_interrupter.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // Copyright (c) 2008 Roelof Naude (roelof.naude at gmail dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -24,14 +24,14 @@ #include <boost/system/system_error.hpp> #include <boost/asio/detail/pop_options.hpp> -#if defined(linux) +#if defined(__linux__) # if !defined(BOOST_ASIO_DISABLE_EVENTFD) # include <linux/version.h> # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) # define BOOST_ASIO_HAS_EVENTFD # endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) # endif // !defined(BOOST_ASIO_DISABLE_EVENTFD) -#endif // defined(linux) +#endif // defined(__linux__) #if defined(BOOST_ASIO_HAS_EVENTFD) @@ -108,21 +108,32 @@ public: { if (write_descriptor_ == read_descriptor_) { - // Only perform one read. The kernel maintains an atomic counter. - uint64_t counter(0); - int bytes_read = ::read(read_descriptor_, &counter, sizeof(uint64_t)); - bool was_interrupted = (bytes_read > 0); - return was_interrupted; + for (;;) + { + // Only perform one read. The kernel maintains an atomic counter. + uint64_t counter(0); + errno = 0; + int bytes_read = ::read(read_descriptor_, &counter, sizeof(uint64_t)); + if (bytes_read < 0 && errno == EINTR) + continue; + bool was_interrupted = (bytes_read > 0); + return was_interrupted; + } } else { - // Clear all data from the pipe. - char data[1024]; - int bytes_read = ::read(read_descriptor_, data, sizeof(data)); - bool was_interrupted = (bytes_read > 0); - while (bytes_read == sizeof(data)) - bytes_read = ::read(read_descriptor_, data, sizeof(data)); - return was_interrupted; + for (;;) + { + // Clear all data from the pipe. + char data[1024]; + int bytes_read = ::read(read_descriptor_, data, sizeof(data)); + if (bytes_read < 0 && errno == EINTR) + continue; + bool was_interrupted = (bytes_read > 0); + while (bytes_read == sizeof(data)) + bytes_read = ::read(read_descriptor_, data, sizeof(data)); + return was_interrupted; + } } } diff --git a/3rdParty/Boost/src/boost/asio/detail/fd_set_adapter.hpp b/3rdParty/Boost/src/boost/asio/detail/fd_set_adapter.hpp index 3fff01e..059362e 100644 --- a/3rdParty/Boost/src/boost/asio/detail/fd_set_adapter.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/fd_set_adapter.hpp @@ -2,7 +2,7 @@ // fd_set_adapter.hpp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/handler_alloc_helpers.hpp b/3rdParty/Boost/src/boost/asio/detail/handler_alloc_helpers.hpp index bfc918b..d385972 100644 --- a/3rdParty/Boost/src/boost/asio/detail/handler_alloc_helpers.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/handler_alloc_helpers.hpp @@ -2,7 +2,7 @@ // handler_alloc_helpers.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -19,6 +19,7 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/detail/workaround.hpp> +#include <boost/utility/addressof.hpp> #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/handler_alloc_hook.hpp> @@ -30,24 +31,26 @@ namespace boost_asio_handler_alloc_helpers { template <typename Handler> -inline void* allocate(std::size_t s, Handler* h) +inline void* allocate(std::size_t s, Handler& h) { -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \ + || BOOST_WORKAROUND(__GNUC__, < 3) return ::operator new(s); #else using namespace boost::asio; - return asio_handler_allocate(s, h); + return asio_handler_allocate(s, boost::addressof(h)); #endif } template <typename Handler> -inline void deallocate(void* p, std::size_t s, Handler* h) +inline void deallocate(void* p, std::size_t s, Handler& h) { -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \ + || BOOST_WORKAROUND(__GNUC__, < 3) ::operator delete(p); #else using namespace boost::asio; - asio_handler_deallocate(p, s, h); + asio_handler_deallocate(p, s, boost::addressof(h)); #endif } @@ -85,7 +88,7 @@ public: raw_handler_ptr(handler_type& handler) : handler_(handler), pointer_(static_cast<pointer_type>( - boost_asio_handler_alloc_helpers::allocate(value_size, &handler_))) + boost_asio_handler_alloc_helpers::allocate(value_size, handler_))) { } @@ -95,7 +98,7 @@ public: { if (pointer_) boost_asio_handler_alloc_helpers::deallocate( - pointer_, value_size, &handler_); + pointer_, value_size, handler_); } private: @@ -239,7 +242,7 @@ public: { pointer_->value_type::~value_type(); boost_asio_handler_alloc_helpers::deallocate( - pointer_, value_size, &handler_); + pointer_, value_size, handler_); pointer_ = 0; } } diff --git a/3rdParty/Boost/src/boost/asio/detail/handler_base_from_member.hpp b/3rdParty/Boost/src/boost/asio/detail/handler_base_from_member.hpp index 4bd95ed..4e471e3 100644 --- a/3rdParty/Boost/src/boost/asio/detail/handler_base_from_member.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/handler_base_from_member.hpp @@ -2,7 +2,7 @@ // handler_base_from_member.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -50,7 +50,7 @@ inline void* asio_handler_allocate(std::size_t size, handler_base_from_member<Handler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename Handler> @@ -58,7 +58,7 @@ inline void asio_handler_deallocate(void* pointer, std::size_t size, handler_base_from_member<Handler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename Handler> @@ -66,7 +66,7 @@ inline void asio_handler_invoke(const Function& function, handler_base_from_member<Handler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail diff --git a/3rdParty/Boost/src/boost/asio/detail/handler_invoke_helpers.hpp b/3rdParty/Boost/src/boost/asio/detail/handler_invoke_helpers.hpp index 4da384a..8952d8d 100644 --- a/3rdParty/Boost/src/boost/asio/detail/handler_invoke_helpers.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/handler_invoke_helpers.hpp @@ -2,7 +2,7 @@ // handler_invoke_helpers.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -19,6 +19,7 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/detail/workaround.hpp> +#include <boost/utility/addressof.hpp> #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/handler_invoke_hook.hpp> @@ -29,14 +30,15 @@ namespace boost_asio_handler_invoke_helpers { template <typename Function, typename Context> -inline void invoke(const Function& function, Context* context) +inline void invoke(const Function& function, Context& context) { -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \ + || BOOST_WORKAROUND(__GNUC__, < 3) Function tmp(function); tmp(); #else using namespace boost::asio; - asio_handler_invoke(function, context); + asio_handler_invoke(function, boost::addressof(context)); #endif } diff --git a/3rdParty/Boost/src/boost/asio/detail/handler_queue.hpp b/3rdParty/Boost/src/boost/asio/detail/handler_queue.hpp index ccc1b0c..c1fb988 100644 --- a/3rdParty/Boost/src/boost/asio/detail/handler_queue.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/handler_queue.hpp @@ -2,7 +2,7 @@ // handler_queue.hpp // ~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -189,7 +189,7 @@ private: ptr.reset(); // Make the upcall. - boost_asio_handler_invoke_helpers::invoke(handler, &handler); + boost_asio_handler_invoke_helpers::invoke(handler, handler); } static void do_destroy(handler* base) diff --git a/3rdParty/Boost/src/boost/asio/detail/hash_map.hpp b/3rdParty/Boost/src/boost/asio/detail/hash_map.hpp index 923ae57..c620da7 100644 --- a/3rdParty/Boost/src/boost/asio/detail/hash_map.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/hash_map.hpp @@ -2,7 +2,7 @@ // hash_map.hpp // ~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -215,6 +215,9 @@ private: // Re-initialise the hash from the values already contained in the list. void rehash(std::size_t num_buckets) { + if (num_buckets == buckets_.size()) + return; + iterator end = values_.end(); // Update number of buckets and initialise all buckets to empty. @@ -231,9 +234,13 @@ private: { buckets_[bucket].first = buckets_[bucket].last = iter++; } + else if (++buckets_[bucket].last == iter) + { + ++iter; + } else { - values_.splice(++buckets_[bucket].last, values_, iter++); + values_.splice(buckets_[bucket].last, values_, iter++); --buckets_[bucket].last; } } @@ -275,6 +282,8 @@ private: // The type for a bucket in the hash table. struct bucket_type { + bucket_type() {} + bucket_type(const bucket_type&) { /* noop */ } iterator first; iterator last; }; diff --git a/3rdParty/Boost/src/boost/asio/detail/indirect_handler_queue.hpp b/3rdParty/Boost/src/boost/asio/detail/indirect_handler_queue.hpp index 2775078..72b1030 100644 --- a/3rdParty/Boost/src/boost/asio/detail/indirect_handler_queue.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/indirect_handler_queue.hpp @@ -2,7 +2,7 @@ // indirect_handler_queue.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -236,7 +236,7 @@ private: ptr.reset(); // Make the upcall. - boost_asio_handler_invoke_helpers::invoke(handler, &handler); + boost_asio_handler_invoke_helpers::invoke(handler, handler); } static void do_destroy(handler* base) diff --git a/3rdParty/Boost/src/boost/asio/detail/io_control.hpp b/3rdParty/Boost/src/boost/asio/detail/io_control.hpp index 6730dc3..5021c2e 100644 --- a/3rdParty/Boost/src/boost/asio/detail/io_control.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/io_control.hpp @@ -2,7 +2,7 @@ // io_control.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/kqueue_reactor.hpp b/3rdParty/Boost/src/boost/asio/detail/kqueue_reactor.hpp index 179b7d4..ea8e285 100644 --- a/3rdParty/Boost/src/boost/asio/detail/kqueue_reactor.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/kqueue_reactor.hpp @@ -2,7 +2,7 @@ // kqueue_reactor.hpp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // Copyright (c) 2005 Stefan Arentz (stefan at soze dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -442,9 +442,6 @@ private: lock.lock(); wait_in_progress_ = false; - // Block signals while performing operations. - boost::asio::detail::signal_blocker sb; - // Dispatch the waiting events. for (int i = 0; i < num_events; ++i) { diff --git a/3rdParty/Boost/src/boost/asio/detail/kqueue_reactor_fwd.hpp b/3rdParty/Boost/src/boost/asio/detail/kqueue_reactor_fwd.hpp index e3df284..b2751bf 100644 --- a/3rdParty/Boost/src/boost/asio/detail/kqueue_reactor_fwd.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/kqueue_reactor_fwd.hpp @@ -2,7 +2,7 @@ // kqueue_reactor_fwd.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // Copyright (c) 2005 Stefan Arentz (stefan at soze dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -19,9 +19,11 @@ #include <boost/asio/detail/push_options.hpp> #if !defined(BOOST_ASIO_DISABLE_KQUEUE) -#if defined(__MACH__) && defined(__APPLE__) -// Define this to indicate that epoll is supported on the target platform. +#if (defined(__MACH__) && defined(__APPLE__)) \ + || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) + +// Define this to indicate that kqueue is supported on the target platform. #define BOOST_ASIO_HAS_KQUEUE 1 namespace boost { @@ -35,7 +37,9 @@ class kqueue_reactor; } // namespace asio } // namespace boost -#endif // defined(__MACH__) && defined(__APPLE__) +#endif // (defined(__MACH__) && defined(__APPLE__)) + // || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) + #endif // !defined(BOOST_ASIO_DISABLE_KQUEUE) #include <boost/asio/detail/pop_options.hpp> diff --git a/3rdParty/Boost/src/boost/asio/detail/mutex.hpp b/3rdParty/Boost/src/boost/asio/detail/mutex.hpp index 4f64a28..fc7ed83 100644 --- a/3rdParty/Boost/src/boost/asio/detail/mutex.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/mutex.hpp @@ -2,7 +2,7 @@ // mutex.hpp // ~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/noncopyable.hpp b/3rdParty/Boost/src/boost/asio/detail/noncopyable.hpp index 3a09538..b3a6e7c 100644 --- a/3rdParty/Boost/src/boost/asio/detail/noncopyable.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/noncopyable.hpp @@ -2,7 +2,7 @@ // noncopyable.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/null_event.hpp b/3rdParty/Boost/src/boost/asio/detail/null_event.hpp index 4b667e7..184f753 100644 --- a/3rdParty/Boost/src/boost/asio/detail/null_event.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/null_event.hpp @@ -2,7 +2,7 @@ // null_event.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/null_mutex.hpp b/3rdParty/Boost/src/boost/asio/detail/null_mutex.hpp index 64bf871..bdf5617 100644 --- a/3rdParty/Boost/src/boost/asio/detail/null_mutex.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/null_mutex.hpp @@ -2,7 +2,7 @@ // null_mutex.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/null_signal_blocker.hpp b/3rdParty/Boost/src/boost/asio/detail/null_signal_blocker.hpp index 1fc65c8..7fe5c10 100644 --- a/3rdParty/Boost/src/boost/asio/detail/null_signal_blocker.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/null_signal_blocker.hpp @@ -2,7 +2,7 @@ // null_signal_blocker.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/null_thread.hpp b/3rdParty/Boost/src/boost/asio/detail/null_thread.hpp index 5aed211..0a508f3 100644 --- a/3rdParty/Boost/src/boost/asio/detail/null_thread.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/null_thread.hpp @@ -2,7 +2,7 @@ // null_thread.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/null_tss_ptr.hpp b/3rdParty/Boost/src/boost/asio/detail/null_tss_ptr.hpp index ba4b8f8..7c35b15 100644 --- a/3rdParty/Boost/src/boost/asio/detail/null_tss_ptr.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/null_tss_ptr.hpp @@ -2,7 +2,7 @@ // null_tss_ptr.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/old_win_sdk_compat.hpp b/3rdParty/Boost/src/boost/asio/detail/old_win_sdk_compat.hpp index 5f0aba1..5f84182 100644 --- a/3rdParty/Boost/src/boost/asio/detail/old_win_sdk_compat.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/old_win_sdk_compat.hpp @@ -2,7 +2,7 @@ // old_win_sdk_compat.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/pipe_select_interrupter.hpp b/3rdParty/Boost/src/boost/asio/detail/pipe_select_interrupter.hpp index 51b8c02..7f9e122 100644 --- a/3rdParty/Boost/src/boost/asio/detail/pipe_select_interrupter.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/pipe_select_interrupter.hpp @@ -2,7 +2,7 @@ // pipe_select_interrupter.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -79,12 +79,17 @@ public: // Reset the select interrupt. Returns true if the call was interrupted. bool reset() { - char data[1024]; - int bytes_read = ::read(read_descriptor_, data, sizeof(data)); - bool was_interrupted = (bytes_read > 0); - while (bytes_read == sizeof(data)) - bytes_read = ::read(read_descriptor_, data, sizeof(data)); - return was_interrupted; + for (;;) + { + char data[1024]; + int bytes_read = ::read(read_descriptor_, data, sizeof(data)); + if (bytes_read < 0 && errno == EINTR) + continue; + bool was_interrupted = (bytes_read > 0); + while (bytes_read == sizeof(data)) + bytes_read = ::read(read_descriptor_, data, sizeof(data)); + return was_interrupted; + } } // Get the read descriptor to be passed to select. diff --git a/3rdParty/Boost/src/boost/asio/detail/pop_options.hpp b/3rdParty/Boost/src/boost/asio/detail/pop_options.hpp index 7f56662..a26b203 100644 --- a/3rdParty/Boost/src/boost/asio/detail/pop_options.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/pop_options.hpp @@ -2,7 +2,7 @@ // pop_options.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/posix_event.hpp b/3rdParty/Boost/src/boost/asio/detail/posix_event.hpp index f838342..20c0fe3 100644 --- a/3rdParty/Boost/src/boost/asio/detail/posix_event.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/posix_event.hpp @@ -2,7 +2,7 @@ // posix_event.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/posix_fd_set_adapter.hpp b/3rdParty/Boost/src/boost/asio/detail/posix_fd_set_adapter.hpp index 121b396..09fc28d 100644 --- a/3rdParty/Boost/src/boost/asio/detail/posix_fd_set_adapter.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/posix_fd_set_adapter.hpp @@ -2,7 +2,7 @@ // posix_fd_set_adapter.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/posix_mutex.hpp b/3rdParty/Boost/src/boost/asio/detail/posix_mutex.hpp index 219d6d0..e7209c1 100644 --- a/3rdParty/Boost/src/boost/asio/detail/posix_mutex.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/posix_mutex.hpp @@ -2,7 +2,7 @@ // posix_mutex.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/posix_signal_blocker.hpp b/3rdParty/Boost/src/boost/asio/detail/posix_signal_blocker.hpp index f8234fb..aebe39b 100644 --- a/3rdParty/Boost/src/boost/asio/detail/posix_signal_blocker.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/posix_signal_blocker.hpp @@ -2,7 +2,7 @@ // posix_signal_blocker.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/posix_thread.hpp b/3rdParty/Boost/src/boost/asio/detail/posix_thread.hpp index 1e38618..41d8bc9 100644 --- a/3rdParty/Boost/src/boost/asio/detail/posix_thread.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/posix_thread.hpp @@ -2,7 +2,7 @@ // posix_thread.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -37,7 +37,7 @@ namespace boost { namespace asio { namespace detail { -extern "C" void* asio_detail_posix_thread_function(void* arg); +extern "C" void* boost_asio_detail_posix_thread_function(void* arg); class posix_thread : private noncopyable @@ -50,7 +50,7 @@ public: { std::auto_ptr<func_base> arg(new func<Function>(f)); int error = ::pthread_create(&thread_, 0, - asio_detail_posix_thread_function, arg.get()); + boost_asio_detail_posix_thread_function, arg.get()); if (error != 0) { boost::system::system_error e( @@ -80,7 +80,7 @@ public: } private: - friend void* asio_detail_posix_thread_function(void* arg); + friend void* boost_asio_detail_posix_thread_function(void* arg); class func_base { @@ -112,7 +112,7 @@ private: bool joined_; }; -inline void* asio_detail_posix_thread_function(void* arg) +inline void* boost_asio_detail_posix_thread_function(void* arg) { std::auto_ptr<posix_thread::func_base> f( static_cast<posix_thread::func_base*>(arg)); diff --git a/3rdParty/Boost/src/boost/asio/detail/posix_tss_ptr.hpp b/3rdParty/Boost/src/boost/asio/detail/posix_tss_ptr.hpp index f53c2dc..c83df96 100644 --- a/3rdParty/Boost/src/boost/asio/detail/posix_tss_ptr.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/posix_tss_ptr.hpp @@ -2,7 +2,7 @@ // posix_tss_ptr.hpp // ~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/push_options.hpp b/3rdParty/Boost/src/boost/asio/detail/push_options.hpp index 47524b2..cb0e902 100644 --- a/3rdParty/Boost/src/boost/asio/detail/push_options.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/push_options.hpp @@ -2,7 +2,7 @@ // push_options.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/reactive_descriptor_service.hpp b/3rdParty/Boost/src/boost/asio/detail/reactive_descriptor_service.hpp index ad828aa..61f676b 100644 --- a/3rdParty/Boost/src/boost/asio/detail/reactive_descriptor_service.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/reactive_descriptor_service.hpp @@ -2,7 +2,7 @@ // reactive_descriptor_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -348,16 +348,23 @@ public: boost::asio::buffer_size(buffer)); } - // Write the data. - int bytes = descriptor_ops::gather_write(descriptor_, bufs, i, ec); + for (;;) + { + // Write the data. + int bytes = descriptor_ops::gather_write(descriptor_, bufs, i, ec); - // Check if we need to run the operation again. - if (ec == boost::asio::error::would_block - || ec == boost::asio::error::try_again) - return false; + // Retry operation if interrupted by signal. + if (ec == boost::asio::error::interrupted) + continue; - bytes_transferred = (bytes < 0 ? 0 : bytes); - return true; + // Check if we need to run the operation again. + if (ec == boost::asio::error::would_block + || ec == boost::asio::error::try_again) + return false; + + bytes_transferred = (bytes < 0 ? 0 : bytes); + return true; + } } void complete(const boost::system::error_code& ec, @@ -600,18 +607,25 @@ public: boost::asio::buffer_size(buffer)); } - // Read some data. - int bytes = descriptor_ops::scatter_read(descriptor_, bufs, i, ec); - if (bytes == 0) - ec = boost::asio::error::eof; + for (;;) + { + // Read some data. + int bytes = descriptor_ops::scatter_read(descriptor_, bufs, i, ec); + if (bytes == 0) + ec = boost::asio::error::eof; - // Check if we need to run the operation again. - if (ec == boost::asio::error::would_block - || ec == boost::asio::error::try_again) - return false; + // Retry operation if interrupted by signal. + if (ec == boost::asio::error::interrupted) + continue; - bytes_transferred = (bytes < 0 ? 0 : bytes); - return true; + // Check if we need to run the operation again. + if (ec == boost::asio::error::would_block + || ec == boost::asio::error::try_again) + return false; + + bytes_transferred = (bytes < 0 ? 0 : bytes); + return true; + } } void complete(const boost::system::error_code& ec, diff --git a/3rdParty/Boost/src/boost/asio/detail/reactive_serial_port_service.hpp b/3rdParty/Boost/src/boost/asio/detail/reactive_serial_port_service.hpp index 0beff14..cd163e9 100644 --- a/3rdParty/Boost/src/boost/asio/detail/reactive_serial_port_service.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/reactive_serial_port_service.hpp @@ -2,7 +2,7 @@ // reactive_serial_port_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/3rdParty/Boost/src/boost/asio/detail/reactive_socket_service.hpp b/3rdParty/Boost/src/boost/asio/detail/reactive_socket_service.hpp index 54b8cbd..95d39dd 100644 --- a/3rdParty/Boost/src/boost/asio/detail/reactive_socket_service.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/reactive_socket_service.hpp @@ -2,7 +2,7 @@ // reactive_socket_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -275,12 +275,21 @@ public: return false; } +#if defined(SIOCATMARK) boost::asio::detail::ioctl_arg_type value = 0; socket_ops::ioctl(impl.socket_, SIOCATMARK, &value, ec); -#if defined(ENOTTY) +# if defined(ENOTTY) if (ec.value() == ENOTTY) ec = boost::asio::error::not_socket; -#endif // defined(ENOTTY) +# endif // defined(ENOTTY) +#else // defined(SIOCATMARK) + int value = sockatmark(impl.socket_); + if (value == -1) + ec = boost::system::error_code(errno, + boost::asio::error::get_system_category()); + else + ec = boost::system::error_code(); +#endif // defined(SIOCATMARK) return ec ? false : value != 0; } @@ -644,16 +653,23 @@ public: boost::asio::buffer_size(buffer)); } - // Send the data. - int bytes = socket_ops::send(socket_, bufs, i, flags_, ec); + for (;;) + { + // Send the data. + int bytes = socket_ops::send(socket_, bufs, i, flags_, ec); - // Check if we need to run the operation again. - if (ec == boost::asio::error::would_block - || ec == boost::asio::error::try_again) - return false; + // Retry operation if interrupted by signal. + if (ec == boost::asio::error::interrupted) + continue; - bytes_transferred = (bytes < 0 ? 0 : bytes); - return true; + // Check if we need to run the operation again. + if (ec == boost::asio::error::would_block + || ec == boost::asio::error::try_again) + return false; + + bytes_transferred = (bytes < 0 ? 0 : bytes); + return true; + } } void complete(const boost::system::error_code& ec, @@ -881,17 +897,24 @@ public: boost::asio::buffer_size(buffer)); } - // Send the data. - int bytes = socket_ops::sendto(socket_, bufs, i, flags_, - destination_.data(), destination_.size(), ec); + for (;;) + { + // Send the data. + int bytes = socket_ops::sendto(socket_, bufs, i, flags_, + destination_.data(), destination_.size(), ec); - // Check if we need to run the operation again. - if (ec == boost::asio::error::would_block - || ec == boost::asio::error::try_again) - return false; + // Retry operation if interrupted by signal. + if (ec == boost::asio::error::interrupted) + continue; - bytes_transferred = (bytes < 0 ? 0 : bytes); - return true; + // Check if we need to run the operation again. + if (ec == boost::asio::error::would_block + || ec == boost::asio::error::try_again) + return false; + + bytes_transferred = (bytes < 0 ? 0 : bytes); + return true; + } } void complete(const boost::system::error_code& ec, @@ -1086,18 +1109,25 @@ public: boost::asio::buffer_size(buffer)); } - // Receive some data. - int bytes = socket_ops::recv(socket_, bufs, i, flags_, ec); - if (bytes == 0 && protocol_type_ == SOCK_STREAM) - ec = boost::asio::error::eof; + for (;;) + { + // Receive some data. + int bytes = socket_ops::recv(socket_, bufs, i, flags_, ec); + if (bytes == 0 && protocol_type_ == SOCK_STREAM) + ec = boost::asio::error::eof; - // Check if we need to run the operation again. - if (ec == boost::asio::error::would_block - || ec == boost::asio::error::try_again) - return false; + // Retry operation if interrupted by signal. + if (ec == boost::asio::error::interrupted) + continue; - bytes_transferred = (bytes < 0 ? 0 : bytes); - return true; + // Check if we need to run the operation again. + if (ec == boost::asio::error::would_block + || ec == boost::asio::error::try_again) + return false; + + bytes_transferred = (bytes < 0 ? 0 : bytes); + return true; + } } void complete(const boost::system::error_code& ec, @@ -1331,21 +1361,28 @@ public: boost::asio::buffer_size(buffer)); } - // Receive some data. - std::size_t addr_len = sender_endpoint_.capacity(); - int bytes = socket_ops::recvfrom(socket_, bufs, i, flags_, - sender_endpoint_.data(), &addr_len, ec); - if (bytes == 0 && protocol_type_ == SOCK_STREAM) - ec = boost::asio::error::eof; - - // Check if we need to run the operation again. - if (ec == boost::asio::error::would_block - || ec == boost::asio::error::try_again) - return false; - - sender_endpoint_.resize(addr_len); - bytes_transferred = (bytes < 0 ? 0 : bytes); - return true; + for (;;) + { + // Receive some data. + std::size_t addr_len = sender_endpoint_.capacity(); + int bytes = socket_ops::recvfrom(socket_, bufs, i, flags_, + sender_endpoint_.data(), &addr_len, ec); + if (bytes == 0 && protocol_type_ == SOCK_STREAM) + ec = boost::asio::error::eof; + + // Retry operation if interrupted by signal. + if (ec == boost::asio::error::interrupted) + continue; + + // Check if we need to run the operation again. + if (ec == boost::asio::error::would_block + || ec == boost::asio::error::try_again) + return false; + + sender_endpoint_.resize(addr_len); + bytes_transferred = (bytes < 0 ? 0 : bytes); + return true; + } } void complete(const boost::system::error_code& ec, @@ -1454,7 +1491,6 @@ public: for (;;) { // Try to complete the operation without blocking. - boost::system::error_code ec; socket_holder new_socket; std::size_t addr_len = 0; if (peer_endpoint) @@ -1536,43 +1572,50 @@ public: if (ec) return true; - // Accept the waiting connection. - socket_holder new_socket; - std::size_t addr_len = 0; - if (peer_endpoint_) + for (;;) { - addr_len = peer_endpoint_->capacity(); - new_socket.reset(socket_ops::accept(socket_, - peer_endpoint_->data(), &addr_len, ec)); - } - else - { - new_socket.reset(socket_ops::accept(socket_, 0, 0, ec)); - } + // Accept the waiting connection. + socket_holder new_socket; + std::size_t addr_len = 0; + if (peer_endpoint_) + { + addr_len = peer_endpoint_->capacity(); + new_socket.reset(socket_ops::accept(socket_, + peer_endpoint_->data(), &addr_len, ec)); + } + else + { + new_socket.reset(socket_ops::accept(socket_, 0, 0, ec)); + } - // Check if we need to run the operation again. - if (ec == boost::asio::error::would_block - || ec == boost::asio::error::try_again) - return false; - if (ec == boost::asio::error::connection_aborted - && !enable_connection_aborted_) - return false; + // Retry operation if interrupted by signal. + if (ec == boost::asio::error::interrupted) + continue; + + // Check if we need to run the operation again. + if (ec == boost::asio::error::would_block + || ec == boost::asio::error::try_again) + return false; + if (ec == boost::asio::error::connection_aborted + && !enable_connection_aborted_) + return false; #if defined(EPROTO) - if (ec.value() == EPROTO && !enable_connection_aborted_) - return false; + if (ec.value() == EPROTO && !enable_connection_aborted_) + return false; #endif // defined(EPROTO) - // Transfer ownership of the new socket to the peer object. - if (!ec) - { - if (peer_endpoint_) - peer_endpoint_->resize(addr_len); - peer_.assign(protocol_, new_socket.get(), ec); + // Transfer ownership of the new socket to the peer object. if (!ec) - new_socket.release(); - } + { + if (peer_endpoint_) + peer_endpoint_->resize(addr_len); + peer_.assign(protocol_, new_socket.get(), ec); + if (!ec) + new_socket.release(); + } - return true; + return true; + } } void complete(const boost::system::error_code& ec, std::size_t) diff --git a/3rdParty/Boost/src/boost/asio/detail/reactor_op_queue.hpp b/3rdParty/Boost/src/boost/asio/detail/reactor_op_queue.hpp index 0fbbf23..46f0c10 100644 --- a/3rdParty/Boost/src/boost/asio/detail/reactor_op_queue.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/reactor_op_queue.hpp @@ -2,7 +2,7 @@ // reactor_op_queue.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/resolver_service.hpp b/3rdParty/Boost/src/boost/asio/detail/resolver_service.hpp index 9b0aac9..3270cd6 100644 --- a/3rdParty/Boost/src/boost/asio/detail/resolver_service.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/resolver_service.hpp @@ -2,7 +2,7 @@ // resolver_service.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/scoped_lock.hpp b/3rdParty/Boost/src/boost/asio/detail/scoped_lock.hpp index 1dd2842..c319263 100644 --- a/3rdParty/Boost/src/boost/asio/detail/scoped_lock.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/scoped_lock.hpp @@ -2,7 +2,7 @@ // scoped_lock.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/select_interrupter.hpp b/3rdParty/Boost/src/boost/asio/detail/select_interrupter.hpp index 8bb952c..f844881 100644 --- a/3rdParty/Boost/src/boost/asio/detail/select_interrupter.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/select_interrupter.hpp @@ -2,7 +2,7 @@ // select_interrupter.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -21,9 +21,12 @@ #include <boost/config.hpp> #include <boost/asio/detail/pop_options.hpp> -#include <boost/asio/detail/eventfd_select_interrupter.hpp> -#include <boost/asio/detail/pipe_select_interrupter.hpp> -#include <boost/asio/detail/socket_select_interrupter.hpp> +#if defined(BOOST_WINDOWS) || defined(__CYGWIN__) +# include <boost/asio/detail/socket_select_interrupter.hpp> +#else +# include <boost/asio/detail/eventfd_select_interrupter.hpp> +# include <boost/asio/detail/pipe_select_interrupter.hpp> +#endif namespace boost { namespace asio { diff --git a/3rdParty/Boost/src/boost/asio/detail/select_reactor.hpp b/3rdParty/Boost/src/boost/asio/detail/select_reactor.hpp index 77caf54..ba8b5d3 100644 --- a/3rdParty/Boost/src/boost/asio/detail/select_reactor.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/select_reactor.hpp @@ -2,7 +2,7 @@ // select_reactor.hpp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -369,9 +369,6 @@ private: lock.lock(); select_in_progress_ = false; - // Block signals while dispatching operations. - boost::asio::detail::signal_blocker sb; - // Reset the interrupter. if (retval > 0 && read_fds.is_set(interrupter_.read_descriptor())) interrupter_.reset(); diff --git a/3rdParty/Boost/src/boost/asio/detail/select_reactor_fwd.hpp b/3rdParty/Boost/src/boost/asio/detail/select_reactor_fwd.hpp index 3bd5d86..b48e0f0 100644 --- a/3rdParty/Boost/src/boost/asio/detail/select_reactor_fwd.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/select_reactor_fwd.hpp @@ -2,7 +2,7 @@ // select_reactor_fwd.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/service_base.hpp b/3rdParty/Boost/src/boost/asio/detail/service_base.hpp index f01cdaf..66c2af3 100644 --- a/3rdParty/Boost/src/boost/asio/detail/service_base.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/service_base.hpp @@ -2,7 +2,7 @@ // service_base.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/service_id.hpp b/3rdParty/Boost/src/boost/asio/detail/service_id.hpp index f249ddf..ac0f4d1 100644 --- a/3rdParty/Boost/src/boost/asio/detail/service_id.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/service_id.hpp @@ -2,7 +2,7 @@ // service_id.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/service_registry.hpp b/3rdParty/Boost/src/boost/asio/detail/service_registry.hpp index 6b25663..b648939 100644 --- a/3rdParty/Boost/src/boost/asio/detail/service_registry.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/service_registry.hpp @@ -2,7 +2,7 @@ // service_registry.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/service_registry_fwd.hpp b/3rdParty/Boost/src/boost/asio/detail/service_registry_fwd.hpp index e32647b..4031b1a 100644 --- a/3rdParty/Boost/src/boost/asio/detail/service_registry_fwd.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/service_registry_fwd.hpp @@ -2,7 +2,7 @@ // service_registry_fwd.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/signal_blocker.hpp b/3rdParty/Boost/src/boost/asio/detail/signal_blocker.hpp index a770549..db11fe4 100644 --- a/3rdParty/Boost/src/boost/asio/detail/signal_blocker.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/signal_blocker.hpp @@ -2,7 +2,7 @@ // signal_blocker.hpp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/signal_init.hpp b/3rdParty/Boost/src/boost/asio/detail/signal_init.hpp index e5a3d37..50e06b8 100644 --- a/3rdParty/Boost/src/boost/asio/detail/signal_init.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/signal_init.hpp @@ -2,7 +2,7 @@ // signal_init.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/socket_holder.hpp b/3rdParty/Boost/src/boost/asio/detail/socket_holder.hpp index be144a6..5d6012b 100644 --- a/3rdParty/Boost/src/boost/asio/detail/socket_holder.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/socket_holder.hpp @@ -2,7 +2,7 @@ // socket_holder.hpp // ~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/socket_ops.hpp b/3rdParty/Boost/src/boost/asio/detail/socket_ops.hpp index 4969017..475162a 100644 --- a/3rdParty/Boost/src/boost/asio/detail/socket_ops.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/socket_ops.hpp @@ -2,7 +2,7 @@ // socket_ops.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -1388,8 +1388,9 @@ inline int gai_echeck(const char* host, const char* service, break; case AF_INET: case AF_INET6: - if (socktype != 0 && socktype != SOCK_STREAM && socktype != SOCK_DGRAM) - return EAI_SOCKTYPE; + if (service != 0 && service[0] != '\0') + if (socktype != 0 && socktype != SOCK_STREAM && socktype != SOCK_DGRAM) + return EAI_SOCKTYPE; break; default: return EAI_FAMILY; diff --git a/3rdParty/Boost/src/boost/asio/detail/socket_option.hpp b/3rdParty/Boost/src/boost/asio/detail/socket_option.hpp index c0d7b74..e31aae4 100644 --- a/3rdParty/Boost/src/boost/asio/detail/socket_option.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/socket_option.hpp @@ -2,7 +2,7 @@ // socket_option.hpp // ~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -21,6 +21,7 @@ #include <cstddef> #include <stdexcept> #include <boost/config.hpp> +#include <boost/throw_exception.hpp> #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/detail/socket_types.hpp> @@ -122,7 +123,10 @@ public: case sizeof(value_): break; default: - throw std::length_error("boolean socket option resize"); + { + std::length_error ex("boolean socket option resize"); + boost::throw_exception(ex); + } } } @@ -200,7 +204,10 @@ public: void resize(const Protocol&, std::size_t s) { if (s != sizeof(value_)) - throw std::length_error("integer socket option resize"); + { + std::length_error ex("integer socket option resize"); + boost::throw_exception(ex); + } } private: @@ -294,7 +301,10 @@ public: void resize(const Protocol&, std::size_t s) { if (s != sizeof(value_)) - throw std::length_error("linger socket option resize"); + { + std::length_error ex("linger socket option resize"); + boost::throw_exception(ex); + } } private: diff --git a/3rdParty/Boost/src/boost/asio/detail/socket_select_interrupter.hpp b/3rdParty/Boost/src/boost/asio/detail/socket_select_interrupter.hpp index a767ba0..a538ae5 100644 --- a/3rdParty/Boost/src/boost/asio/detail/socket_select_interrupter.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/socket_select_interrupter.hpp @@ -2,7 +2,7 @@ // socket_select_interrupter.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -72,6 +72,11 @@ public: boost::throw_exception(e); } + // Some broken firewalls on Windows will intermittently cause getsockname to + // return 0.0.0.0 when the socket is actually bound to 127.0.0.1. We + // explicitly specify the target address here to work around this problem. + addr.sin_addr.s_addr = inet_addr("127.0.0.1"); + if (socket_ops::listen(acceptor.get(), SOMAXCONN, ec) == socket_error_retval) { diff --git a/3rdParty/Boost/src/boost/asio/detail/socket_types.hpp b/3rdParty/Boost/src/boost/asio/detail/socket_types.hpp index c7b6a75..7395ee4 100644 --- a/3rdParty/Boost/src/boost/asio/detail/socket_types.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/socket_types.hpp @@ -2,7 +2,7 @@ // socket_types.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -163,7 +163,11 @@ typedef int socket_type; const int invalid_socket = -1; const int socket_error_retval = -1; const int max_addr_v4_str_len = INET_ADDRSTRLEN; +#if defined(INET6_ADDRSTRLEN) const int max_addr_v6_str_len = INET6_ADDRSTRLEN + 1 + IF_NAMESIZE; +#else // defined(INET6_ADDRSTRLEN) +const int max_addr_v6_str_len = 256; +#endif // defined(INET6_ADDRSTRLEN) typedef sockaddr socket_addr_type; typedef in_addr in4_addr_type; # if defined(__hpux) diff --git a/3rdParty/Boost/src/boost/asio/detail/strand_service.hpp b/3rdParty/Boost/src/boost/asio/detail/strand_service.hpp index 2c89a61..b228cec 100644 --- a/3rdParty/Boost/src/boost/asio/detail/strand_service.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/strand_service.hpp @@ -2,7 +2,7 @@ // strand_service.hpp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -20,8 +20,8 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/aligned_storage.hpp> #include <boost/assert.hpp> -#include <boost/detail/atomic_count.hpp> -#include <boost/intrusive_ptr.hpp> +#include <boost/functional/hash.hpp> +#include <boost/scoped_ptr.hpp> #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/io_service.hpp> @@ -49,20 +49,12 @@ public: // The underlying implementation of a strand. class strand_impl { -#if defined (__BORLANDC__) public: -#else - private: -#endif - void add_ref() - { - ++ref_count_; - } - - void release() + strand_impl() + : current_handler_(0), + first_waiter_(0), + last_waiter_(0) { - if (--ref_count_ == 0) - delete this; } private: @@ -71,55 +63,9 @@ public: friend class post_next_waiter_on_exit; friend class invoke_current_handler; - strand_impl(strand_service& owner) - : owner_(owner), - current_handler_(0), - first_waiter_(0), - last_waiter_(0), - ref_count_(0) - { - // Insert implementation into linked list of all implementations. - boost::asio::detail::mutex::scoped_lock lock(owner_.mutex_); - next_ = owner_.impl_list_; - prev_ = 0; - if (owner_.impl_list_) - owner_.impl_list_->prev_ = this; - owner_.impl_list_ = this; - } - - ~strand_impl() - { - // Remove implementation from linked list of all implementations. - boost::asio::detail::mutex::scoped_lock lock(owner_.mutex_); - if (owner_.impl_list_ == this) - owner_.impl_list_ = next_; - if (prev_) - prev_->next_ = next_; - if (next_) - next_->prev_= prev_; - next_ = 0; - prev_ = 0; - lock.unlock(); - - if (current_handler_) - { - current_handler_->destroy(); - } - - while (first_waiter_) - { - handler_base* next = first_waiter_->next_; - first_waiter_->destroy(); - first_waiter_ = next; - } - } - // Mutex to protect access to internal data. boost::asio::detail::mutex mutex_; - // The service that owns this implementation. - strand_service& owner_; - // The handler that is ready to execute. If this pointer is non-null then it // indicates that a handler holds the lock. handler_base* current_handler_; @@ -137,30 +83,11 @@ public: #else handler_storage_type handler_storage_; #endif - - // Pointers to adjacent socket implementations in linked list. - strand_impl* next_; - strand_impl* prev_; - - // The reference count on the strand implementation. - boost::detail::atomic_count ref_count_; - -#if !defined(__BORLANDC__) - friend void intrusive_ptr_add_ref(strand_impl* p) - { - p->add_ref(); - } - - friend void intrusive_ptr_release(strand_impl* p) - { - p->release(); - } -#endif }; friend class strand_impl; - typedef boost::intrusive_ptr<strand_impl> implementation_type; + typedef strand_impl* implementation_type; // Base class for all handler types. class handler_base @@ -328,10 +255,10 @@ public: ptr.reset(); // Indicate that this strand is executing on the current thread. - call_stack<strand_impl>::context ctx(impl.get()); + call_stack<strand_impl>::context ctx(impl); // Make the upcall. - boost_asio_handler_invoke_helpers::invoke(handler, &handler); + boost_asio_handler_invoke_helpers::invoke(handler, handler); } static void do_destroy(handler_base* base) @@ -361,7 +288,7 @@ public: explicit strand_service(boost::asio::io_service& io_service) : boost::asio::detail::service_base<strand_service>(io_service), mutex_(), - impl_list_(0) + salt_(0) { } @@ -370,24 +297,25 @@ public: { // Construct a list of all handlers to be destroyed. boost::asio::detail::mutex::scoped_lock lock(mutex_); - strand_impl* impl = impl_list_; handler_base* first_handler = 0; - while (impl) + for (std::size_t i = 0; i < num_implementations; ++i) { - if (impl->current_handler_) + if (strand_impl* impl = implementations_[i].get()) { - impl->current_handler_->next_ = first_handler; - first_handler = impl->current_handler_; - impl->current_handler_ = 0; - } - if (impl->first_waiter_) - { - impl->last_waiter_->next_ = first_handler; - first_handler = impl->first_waiter_; - impl->first_waiter_ = 0; - impl->last_waiter_ = 0; + if (impl->current_handler_) + { + impl->current_handler_->next_ = first_handler; + first_handler = impl->current_handler_; + impl->current_handler_ = 0; + } + if (impl->first_waiter_) + { + impl->last_waiter_->next_ = first_handler; + first_handler = impl->first_waiter_; + impl->first_waiter_ = 0; + impl->last_waiter_ = 0; + } } - impl = impl->next_; } // Destroy all handlers without holding the lock. @@ -403,22 +331,30 @@ public: // Construct a new strand implementation. void construct(implementation_type& impl) { - impl = implementation_type(new strand_impl(*this)); + std::size_t index = boost::hash_value(&impl); + boost::hash_combine(index, salt_++); + index = index % num_implementations; + + boost::asio::detail::mutex::scoped_lock lock(mutex_); + + if (!implementations_[index]) + implementations_[index].reset(new strand_impl); + impl = implementations_[index].get(); } // Destroy a strand implementation. void destroy(implementation_type& impl) { - implementation_type().swap(impl); + impl = 0; } // Request the io_service to invoke the given handler. template <typename Handler> void dispatch(implementation_type& impl, Handler handler) { - if (call_stack<strand_impl>::contains(impl.get())) + if (call_stack<strand_impl>::contains(impl)) { - boost_asio_handler_invoke_helpers::invoke(handler, &handler); + boost_asio_handler_invoke_helpers::invoke(handler, handler); } else { @@ -496,37 +432,24 @@ public: } private: - // Mutex to protect access to the linked list of implementations. + // Mutex to protect access to the array of implementations. boost::asio::detail::mutex mutex_; + // Number of implementations shared between all strand objects. + enum { num_implementations = 193 }; + // The head of a linked list of all implementations. - strand_impl* impl_list_; + boost::scoped_ptr<strand_impl> implementations_[num_implementations]; + + // Extra value used when hashing to prevent recycled memory locations from + // getting the same strand implementation. + std::size_t salt_; }; } // namespace detail } // namespace asio } // namespace boost -#if defined(__BORLANDC__) - -namespace boost { - -inline void intrusive_ptr_add_ref( - boost::asio::detail::strand_service::strand_impl* p) -{ - p->add_ref(); -} - -inline void intrusive_ptr_release( - boost::asio::detail::strand_service::strand_impl* p) -{ - p->release(); -} - -} // namespace boost - -#endif // defined(__BORLANDC__) - #include <boost/asio/detail/pop_options.hpp> #endif // BOOST_ASIO_DETAIL_STRAND_SERVICE_HPP diff --git a/3rdParty/Boost/src/boost/asio/detail/task_io_service.hpp b/3rdParty/Boost/src/boost/asio/detail/task_io_service.hpp index eeae6b0..ddfea72 100644 --- a/3rdParty/Boost/src/boost/asio/detail/task_io_service.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/task_io_service.hpp @@ -2,7 +2,7 @@ // task_io_service.hpp // ~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -177,7 +177,7 @@ public: void dispatch(Handler handler) { if (call_stack<task_io_service>::contains(this)) - boost_asio_handler_invoke_helpers::invoke(handler, &handler); + boost_asio_handler_invoke_helpers::invoke(handler, handler); else post(handler); } diff --git a/3rdParty/Boost/src/boost/asio/detail/task_io_service_2lock.hpp b/3rdParty/Boost/src/boost/asio/detail/task_io_service_2lock.hpp index bd406cb..71bceef 100644 --- a/3rdParty/Boost/src/boost/asio/detail/task_io_service_2lock.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/task_io_service_2lock.hpp @@ -2,7 +2,7 @@ // task_io_service_2lock.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -50,7 +50,7 @@ public: : boost::asio::detail::service_base<task_io_service<Task> >(io_service), front_mutex_(), back_mutex_(), - task_(&use_service<Task>(io_service)), + task_(0), outstanding_work_(0), front_stopped_(false), back_stopped_(false), @@ -207,7 +207,7 @@ public: void dispatch(Handler handler) { if (call_stack<task_io_service>::contains(this)) - boost_asio_handler_invoke_helpers::invoke(handler, &handler); + boost_asio_handler_invoke_helpers::invoke(handler, handler); else post(handler); } diff --git a/3rdParty/Boost/src/boost/asio/detail/task_io_service_fwd.hpp b/3rdParty/Boost/src/boost/asio/detail/task_io_service_fwd.hpp index 6dc8955..60a0790 100644 --- a/3rdParty/Boost/src/boost/asio/detail/task_io_service_fwd.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/task_io_service_fwd.hpp @@ -2,7 +2,7 @@ // task_io_service_fwd.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/thread.hpp b/3rdParty/Boost/src/boost/asio/detail/thread.hpp index 3db5805..24a7a8c 100644 --- a/3rdParty/Boost/src/boost/asio/detail/thread.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/thread.hpp @@ -2,7 +2,7 @@ // thread.hpp // ~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/throw_error.hpp b/3rdParty/Boost/src/boost/asio/detail/throw_error.hpp index 0786c40..e9406a7 100644 --- a/3rdParty/Boost/src/boost/asio/detail/throw_error.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/throw_error.hpp @@ -2,7 +2,7 @@ // throw_error.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/timer_queue.hpp b/3rdParty/Boost/src/boost/asio/detail/timer_queue.hpp index f5370e5..35c8a77 100644 --- a/3rdParty/Boost/src/boost/asio/detail/timer_queue.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/timer_queue.hpp @@ -2,7 +2,7 @@ // timer_queue.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -20,10 +20,10 @@ #include <boost/asio/detail/push_options.hpp> #include <cstddef> #include <functional> -#include <limits> #include <memory> #include <vector> #include <boost/config.hpp> +#include <boost/limits.hpp> #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/error.hpp> @@ -67,8 +67,10 @@ public: heap_.reserve(heap_.size() + 1); // Create a new timer object. - std::auto_ptr<timer<Handler> > new_timer( - new timer<Handler>(time, handler, token)); + typedef timer<Handler> timer_type; + typedef handler_alloc_traits<Handler, timer_type> alloc_traits; + raw_handler_ptr<alloc_traits> raw_ptr(handler); + handler_ptr<alloc_traits> new_timer(raw_ptr, time, handler, token); // Insert the new timer into the hash. typedef typename hash_map<void*, timer_base*>::iterator iterator; @@ -78,12 +80,12 @@ public: if (!result.second) { result.first->second->prev_ = new_timer.get(); - new_timer->next_ = result.first->second; + new_timer.get()->next_ = result.first->second; result.first->second = new_timer.get(); } // Put the timer at the correct position in the heap. - new_timer->heap_index_ = heap_.size(); + new_timer.get()->heap_index_ = heap_.size(); heap_.push_back(new_timer.get()); up_heap(heap_.size() - 1); bool is_first = (heap_[0] == new_timer.get()); diff --git a/3rdParty/Boost/src/boost/asio/detail/timer_queue_base.hpp b/3rdParty/Boost/src/boost/asio/detail/timer_queue_base.hpp index 1d986c0..cd6a0d3 100644 --- a/3rdParty/Boost/src/boost/asio/detail/timer_queue_base.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/timer_queue_base.hpp @@ -2,7 +2,7 @@ // timer_queue_base.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/tss_ptr.hpp b/3rdParty/Boost/src/boost/asio/detail/tss_ptr.hpp index 2cfd641..9af4965 100644 --- a/3rdParty/Boost/src/boost/asio/detail/tss_ptr.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/tss_ptr.hpp @@ -2,7 +2,7 @@ // tss_ptr.hpp // ~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/win_event.hpp b/3rdParty/Boost/src/boost/asio/detail/win_event.hpp index d0a135e..637b580 100644 --- a/3rdParty/Boost/src/boost/asio/detail/win_event.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/win_event.hpp @@ -2,7 +2,7 @@ // win_event.hpp // ~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/win_fd_set_adapter.hpp b/3rdParty/Boost/src/boost/asio/detail/win_fd_set_adapter.hpp index 9127a41..11c1e15 100644 --- a/3rdParty/Boost/src/boost/asio/detail/win_fd_set_adapter.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/win_fd_set_adapter.hpp @@ -2,7 +2,7 @@ // win_fd_set_adapter.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/win_iocp_handle_service.hpp b/3rdParty/Boost/src/boost/asio/detail/win_iocp_handle_service.hpp index fd204de..6998d57 100644 --- a/3rdParty/Boost/src/boost/asio/detail/win_iocp_handle_service.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/win_iocp_handle_service.hpp @@ -2,7 +2,7 @@ // win_iocp_handle_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -357,6 +357,7 @@ public: DWORD last_error = ::GetLastError(); ec = boost::system::error_code(last_error, boost::asio::error::get_system_category()); + return 0; } ec = boost::system::error_code(); @@ -414,7 +415,7 @@ public: boost::system::error_code ec(last_error, boost::asio::error::get_system_category()); boost_asio_handler_invoke_helpers::invoke( - bind_handler(handler, ec, bytes_transferred), &handler); + bind_handler(handler, ec, bytes_transferred), handler); } static void destroy_impl(operation* op) @@ -456,13 +457,6 @@ public: void async_write_some_at(implementation_type& impl, boost::uint64_t offset, const ConstBufferSequence& buffers, Handler handler) { - if (!is_open(impl)) - { - this->get_io_service().post(bind_handler(handler, - boost::asio::error::bad_descriptor, 0)); - return; - } - // Update the ID of the thread from which cancellation is safe. if (impl.safe_cancellation_thread_id_ == 0) impl.safe_cancellation_thread_id_ = ::GetCurrentThreadId(); @@ -475,6 +469,13 @@ public: raw_handler_ptr<alloc_traits> raw_ptr(handler); handler_ptr<alloc_traits> ptr(raw_ptr, iocp_service_, buffers, handler); + if (!is_open(impl)) + { + ptr.get()->on_immediate_completion(WSAEBADF, 0); + ptr.release(); + return; + } + // Find first buffer of non-zero length. boost::asio::const_buffer buffer; typename ConstBufferSequence::const_iterator iter = buffers.begin(); @@ -489,10 +490,8 @@ public: // A request to write 0 bytes on a handle is a no-op. if (boost::asio::buffer_size(buffer) == 0) { - boost::asio::io_service::work work(this->get_io_service()); - ptr.reset(); - boost::system::error_code error; - iocp_service_.post(bind_handler(handler, error, 0)); + ptr.get()->on_immediate_completion(0, 0); + ptr.release(); return; } @@ -509,14 +508,12 @@ public: // Check if the operation completed immediately. if (!ok && last_error != ERROR_IO_PENDING) { - boost::asio::io_service::work work(this->get_io_service()); - ptr.reset(); - boost::system::error_code ec(last_error, - boost::asio::error::get_system_category()); - iocp_service_.post(bind_handler(handler, ec, bytes_transferred)); + ptr.get()->on_immediate_completion(last_error, bytes_transferred); + ptr.release(); } else { + ptr.get()->on_pending(); ptr.release(); } } @@ -604,6 +601,7 @@ public: ec = boost::system::error_code(last_error, boost::asio::error::get_system_category()); } + return 0; } ec = boost::system::error_code(); @@ -669,7 +667,7 @@ public: // Call the handler. boost_asio_handler_invoke_helpers::invoke( - bind_handler(handler, ec, bytes_transferred), &handler); + bind_handler(handler, ec, bytes_transferred), handler); } static void destroy_impl(operation* op) @@ -714,13 +712,6 @@ public: void async_read_some_at(implementation_type& impl, boost::uint64_t offset, const MutableBufferSequence& buffers, Handler handler) { - if (!is_open(impl)) - { - this->get_io_service().post(bind_handler(handler, - boost::asio::error::bad_descriptor, 0)); - return; - } - // Update the ID of the thread from which cancellation is safe. if (impl.safe_cancellation_thread_id_ == 0) impl.safe_cancellation_thread_id_ = ::GetCurrentThreadId(); @@ -733,6 +724,13 @@ public: raw_handler_ptr<alloc_traits> raw_ptr(handler); handler_ptr<alloc_traits> ptr(raw_ptr, iocp_service_, buffers, handler); + if (!is_open(impl)) + { + ptr.get()->on_immediate_completion(WSAEBADF, 0); + ptr.release(); + return; + } + // Find first buffer of non-zero length. boost::asio::mutable_buffer buffer; typename MutableBufferSequence::const_iterator iter = buffers.begin(); @@ -747,10 +745,8 @@ public: // A request to receive 0 bytes on a stream handle is a no-op. if (boost::asio::buffer_size(buffer) == 0) { - boost::asio::io_service::work work(this->get_io_service()); - ptr.reset(); - boost::system::error_code error; - iocp_service_.post(bind_handler(handler, error, 0)); + ptr.get()->on_immediate_completion(0, 0); + ptr.release(); return; } @@ -765,14 +761,12 @@ public: DWORD last_error = ::GetLastError(); if (!ok && last_error != ERROR_IO_PENDING && last_error != ERROR_MORE_DATA) { - boost::asio::io_service::work work(this->get_io_service()); - ptr.reset(); - boost::system::error_code ec(last_error, - boost::asio::error::get_system_category()); - iocp_service_.post(bind_handler(handler, ec, bytes_transferred)); + ptr.get()->on_immediate_completion(last_error, bytes_transferred); + ptr.release(); } else { + ptr.get()->on_pending(); ptr.release(); } } diff --git a/3rdParty/Boost/src/boost/asio/detail/win_iocp_io_service.hpp b/3rdParty/Boost/src/boost/asio/detail/win_iocp_io_service.hpp index 5818542..1dfb9a1 100644 --- a/3rdParty/Boost/src/boost/asio/detail/win_iocp_io_service.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/win_iocp_io_service.hpp @@ -2,7 +2,7 @@ // win_iocp_io_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -22,7 +22,7 @@ #if defined(BOOST_ASIO_HAS_IOCP) #include <boost/asio/detail/push_options.hpp> -#include <limits> +#include <boost/limits.hpp> #include <boost/throw_exception.hpp> #include <boost/system/system_error.hpp> #include <boost/asio/detail/pop_options.hpp> @@ -50,6 +50,8 @@ public: // This class inherits from OVERLAPPED so that we can downcast to get back to // the operation pointer from the LPOVERLAPPED out parameter of // GetQueuedCompletionStatus. + class operation; + friend class operation; class operation : public OVERLAPPED { @@ -59,7 +61,10 @@ public: operation(win_iocp_io_service& iocp_service, invoke_func_type invoke_func, destroy_func_type destroy_func) - : outstanding_operations_(&iocp_service.outstanding_operations_), + : iocp_service_(iocp_service), + ready_(0), + last_error_(~DWORD(0)), + bytes_transferred_(0), invoke_func_(invoke_func), destroy_func_(destroy_func) { @@ -69,12 +74,48 @@ public: OffsetHigh = 0; hEvent = 0; - ::InterlockedIncrement(outstanding_operations_); + ::InterlockedIncrement(&iocp_service_.outstanding_operations_); + } + + void reset() + { + Internal = 0; + InternalHigh = 0; + Offset = 0; + OffsetHigh = 0; + hEvent = 0; + ready_ = 0; + last_error_ = ~DWORD(0); + bytes_transferred_ = 0; + } + + void on_pending() + { + if (::InterlockedCompareExchange(&ready_, 1, 0) == 1) + iocp_service_.post_completion(this, last_error_, bytes_transferred_); } - void do_completion(DWORD last_error, size_t bytes_transferred) + void on_immediate_completion(DWORD last_error, DWORD bytes_transferred) { - invoke_func_(this, last_error, bytes_transferred); + ready_ = 1; + iocp_service_.post_completion(this, last_error, bytes_transferred); + } + + bool on_completion(DWORD last_error, DWORD bytes_transferred) + { + if (last_error_ == ~DWORD(0)) + { + last_error_ = last_error; + bytes_transferred_ = bytes_transferred; + } + + if (::InterlockedCompareExchange(&ready_, 1, 0) == 1) + { + invoke_func_(this, last_error_, bytes_transferred_); + return true; + } + + return false; } void destroy() @@ -86,16 +127,18 @@ public: // Prevent deletion through this type. ~operation() { - ::InterlockedDecrement(outstanding_operations_); + ::InterlockedDecrement(&iocp_service_.outstanding_operations_); } private: - long* outstanding_operations_; + win_iocp_io_service& iocp_service_; + long ready_; + DWORD last_error_; + DWORD bytes_transferred_; invoke_func_type invoke_func_; destroy_func_type destroy_func_; }; - // Constructor. win_iocp_io_service(boost::asio::io_service& io_service) : boost::asio::detail::service_base<win_iocp_io_service>(io_service), @@ -132,7 +175,7 @@ public: while (::InterlockedExchangeAdd(&outstanding_operations_, 0) > 0) { DWORD bytes_transferred = 0; -#if (WINVER < 0x0500) +#if defined(WINVER) && (WINVER < 0x0500) DWORD completion_key = 0; #else DWORD_PTR completion_key = 0; @@ -276,7 +319,7 @@ public: void dispatch(Handler handler) { if (call_stack<win_iocp_io_service>::contains(this)) - boost_asio_handler_invoke_helpers::invoke(handler, &handler); + boost_asio_handler_invoke_helpers::invoke(handler, handler); else post(handler); } @@ -296,15 +339,7 @@ public: handler_ptr<alloc_traits> ptr(raw_ptr, *this, handler); // Enqueue the operation on the I/O completion port. - if (!::PostQueuedCompletionStatus(iocp_.handle, 0, 0, ptr.get())) - { - DWORD last_error = ::GetLastError(); - boost::system::system_error e( - boost::system::error_code(last_error, - boost::asio::error::get_system_category()), - "pqcs"); - boost::throw_exception(e); - } + ptr.get()->on_immediate_completion(0, 0); // Operation has been successfully posted. ptr.release(); @@ -419,7 +454,7 @@ private: // Get the next operation from the queue. DWORD bytes_transferred = 0; -#if (WINVER < 0x0500) +#if defined(WINVER) && (WINVER < 0x0500) DWORD completion_key = 0; #else DWORD_PTR completion_key = 0; @@ -507,10 +542,11 @@ private: // Dispatch the operation. operation* op = static_cast<operation*>(overlapped); - op->do_completion(last_error, bytes_transferred); - - ec = boost::system::error_code(); - return 1; + if (op->on_completion(last_error, bytes_transferred)) + { + ec = boost::system::error_code(); + return 1; + } } else if (completion_key == transfer_timer_dispatching) { @@ -648,7 +684,7 @@ private: ptr.reset(); // Make the upcall. - boost_asio_handler_invoke_helpers::invoke(handler, &handler); + boost_asio_handler_invoke_helpers::invoke(handler, handler); } static void destroy_impl(operation* op) diff --git a/3rdParty/Boost/src/boost/asio/detail/win_iocp_io_service_fwd.hpp b/3rdParty/Boost/src/boost/asio/detail/win_iocp_io_service_fwd.hpp index c9e6060..be413ec 100644 --- a/3rdParty/Boost/src/boost/asio/detail/win_iocp_io_service_fwd.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/win_iocp_io_service_fwd.hpp @@ -2,7 +2,7 @@ // win_iocp_io_service_fwd.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/win_iocp_overlapped_ptr.hpp b/3rdParty/Boost/src/boost/asio/detail/win_iocp_overlapped_ptr.hpp index e8ab6b0..bb64014 100644 --- a/3rdParty/Boost/src/boost/asio/detail/win_iocp_overlapped_ptr.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/win_iocp_overlapped_ptr.hpp @@ -2,7 +2,7 @@ // win_iocp_overlapped_ptr.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -92,6 +92,9 @@ public: // Release ownership of the OVERLAPPED object. OVERLAPPED* release() { + if (ptr_) + ptr_->on_pending(); + OVERLAPPED* tmp = ptr_; ptr_ = 0; return tmp; @@ -104,8 +107,7 @@ public: if (ptr_) { ptr_->ec_ = ec; - ptr_->io_service_.post_completion(ptr_, 0, - static_cast<DWORD>(bytes_transferred)); + ptr_->on_immediate_completion(0, static_cast<DWORD>(bytes_transferred)); ptr_ = 0; } } @@ -171,7 +173,7 @@ private: // Make the upcall. boost_asio_handler_invoke_helpers::invoke( - bind_handler(handler, ec, bytes_transferred), &handler); + bind_handler(handler, ec, bytes_transferred), handler); } static void destroy_impl(win_iocp_io_service::operation* op) diff --git a/3rdParty/Boost/src/boost/asio/detail/win_iocp_serial_port_service.hpp b/3rdParty/Boost/src/boost/asio/detail/win_iocp_serial_port_service.hpp index 57d56cf..4d6d2e9 100644 --- a/3rdParty/Boost/src/boost/asio/detail/win_iocp_serial_port_service.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/win_iocp_serial_port_service.hpp @@ -2,7 +2,7 @@ // win_iocp_serial_port_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/3rdParty/Boost/src/boost/asio/detail/win_iocp_socket_service.hpp b/3rdParty/Boost/src/boost/asio/detail/win_iocp_socket_service.hpp index 5192612..e0c0806 100644 --- a/3rdParty/Boost/src/boost/asio/detail/win_iocp_socket_service.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/win_iocp_socket_service.hpp @@ -2,7 +2,7 @@ // win_iocp_socket_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -789,7 +789,7 @@ public: // Call the handler. boost_asio_handler_invoke_helpers::invoke( - detail::bind_handler(handler, ec, bytes_transferred), &handler); + detail::bind_handler(handler, ec, bytes_transferred), handler); } static void destroy_impl(operation* op) @@ -823,13 +823,6 @@ public: void async_send(implementation_type& impl, const ConstBufferSequence& buffers, socket_base::message_flags flags, Handler handler) { - if (!is_open(impl)) - { - this->get_io_service().post(bind_handler(handler, - boost::asio::error::bad_descriptor, 0)); - return; - } - #if defined(BOOST_ASIO_ENABLE_CANCELIO) // Update the ID of the thread from which cancellation is safe. if (impl.safe_cancellation_thread_id_ == 0) @@ -845,6 +838,13 @@ public: handler_ptr<alloc_traits> ptr(raw_ptr, iocp_service_, impl.cancel_token_, buffers, handler); + if (!is_open(impl)) + { + ptr.get()->on_immediate_completion(WSAEBADF, 0); + ptr.release(); + return; + } + // Copy buffers into WSABUF array. ::WSABUF bufs[max_buffers]; typename ConstBufferSequence::const_iterator iter = buffers.begin(); @@ -863,10 +863,8 @@ public: // A request to receive 0 bytes on a stream socket is a no-op. if (impl.protocol_.type() == SOCK_STREAM && total_buffer_size == 0) { - boost::asio::io_service::work work(this->get_io_service()); - ptr.reset(); - boost::system::error_code error; - iocp_service_.post(bind_handler(handler, error, 0)); + ptr.get()->on_immediate_completion(0, 0); + ptr.release(); return; } @@ -879,14 +877,12 @@ public: // Check if the operation completed immediately. if (result != 0 && last_error != WSA_IO_PENDING) { - boost::asio::io_service::work work(this->get_io_service()); - ptr.reset(); - boost::system::error_code ec(last_error, - boost::asio::error::get_system_category()); - iocp_service_.post(bind_handler(handler, ec, bytes_transferred)); + ptr.get()->on_immediate_completion(last_error, bytes_transferred); + ptr.release(); } else { + ptr.get()->on_pending(); ptr.release(); } } @@ -1068,7 +1064,7 @@ public: // Call the handler. boost_asio_handler_invoke_helpers::invoke( - detail::bind_handler(handler, ec, bytes_transferred), &handler); + detail::bind_handler(handler, ec, bytes_transferred), handler); } static void destroy_impl(operation* op) @@ -1102,13 +1098,6 @@ public: const ConstBufferSequence& buffers, const endpoint_type& destination, socket_base::message_flags flags, Handler handler) { - if (!is_open(impl)) - { - this->get_io_service().post(bind_handler(handler, - boost::asio::error::bad_descriptor, 0)); - return; - } - #if defined(BOOST_ASIO_ENABLE_CANCELIO) // Update the ID of the thread from which cancellation is safe. if (impl.safe_cancellation_thread_id_ == 0) @@ -1123,6 +1112,13 @@ public: raw_handler_ptr<alloc_traits> raw_ptr(handler); handler_ptr<alloc_traits> ptr(raw_ptr, iocp_service_, buffers, handler); + if (!is_open(impl)) + { + ptr.get()->on_immediate_completion(WSAEBADF, 0); + ptr.release(); + return; + } + // Copy buffers into WSABUF array. ::WSABUF bufs[max_buffers]; typename ConstBufferSequence::const_iterator iter = buffers.begin(); @@ -1145,14 +1141,12 @@ public: // Check if the operation completed immediately. if (result != 0 && last_error != WSA_IO_PENDING) { - boost::asio::io_service::work work(this->get_io_service()); - ptr.reset(); - boost::system::error_code ec(last_error, - boost::asio::error::get_system_category()); - iocp_service_.post(bind_handler(handler, ec, bytes_transferred)); + ptr.get()->on_immediate_completion(last_error, bytes_transferred); + ptr.release(); } else { + ptr.get()->on_pending(); ptr.release(); } } @@ -1339,7 +1333,7 @@ public: // Call the handler. boost_asio_handler_invoke_helpers::invoke( - detail::bind_handler(handler, ec, bytes_transferred), &handler); + detail::bind_handler(handler, ec, bytes_transferred), handler); } static void destroy_impl(operation* op) @@ -1375,13 +1369,6 @@ public: const MutableBufferSequence& buffers, socket_base::message_flags flags, Handler handler) { - if (!is_open(impl)) - { - this->get_io_service().post(bind_handler(handler, - boost::asio::error::bad_descriptor, 0)); - return; - } - #if defined(BOOST_ASIO_ENABLE_CANCELIO) // Update the ID of the thread from which cancellation is safe. if (impl.safe_cancellation_thread_id_ == 0) @@ -1398,6 +1385,13 @@ public: handler_ptr<alloc_traits> ptr(raw_ptr, protocol_type, iocp_service_, impl.cancel_token_, buffers, handler); + if (!is_open(impl)) + { + ptr.get()->on_immediate_completion(WSAEBADF, 0); + ptr.release(); + return; + } + // Copy buffers into WSABUF array. ::WSABUF bufs[max_buffers]; typename MutableBufferSequence::const_iterator iter = buffers.begin(); @@ -1415,10 +1409,8 @@ public: // A request to receive 0 bytes on a stream socket is a no-op. if (impl.protocol_.type() == SOCK_STREAM && total_buffer_size == 0) { - boost::asio::io_service::work work(this->get_io_service()); - ptr.reset(); - boost::system::error_code error; - iocp_service_.post(bind_handler(handler, error, 0)); + ptr.get()->on_immediate_completion(0, 0); + ptr.release(); return; } @@ -1430,14 +1422,12 @@ public: DWORD last_error = ::WSAGetLastError(); if (result != 0 && last_error != WSA_IO_PENDING) { - boost::asio::io_service::work work(this->get_io_service()); - ptr.reset(); - boost::system::error_code ec(last_error, - boost::asio::error::get_system_category()); - iocp_service_.post(bind_handler(handler, ec, bytes_transferred)); + ptr.get()->on_immediate_completion(last_error, bytes_transferred); + ptr.release(); } else { + ptr.get()->on_pending(); ptr.release(); } } @@ -1482,14 +1472,12 @@ public: DWORD last_error = ::WSAGetLastError(); if (result != 0 && last_error != WSA_IO_PENDING) { - boost::asio::io_service::work work(this->get_io_service()); - ptr.reset(); - boost::system::error_code ec(last_error, - boost::asio::error::get_system_category()); - iocp_service_.post(bind_handler(handler, ec, bytes_transferred)); + ptr.get()->on_immediate_completion(last_error, bytes_transferred); + ptr.release(); } else { + ptr.get()->on_pending(); ptr.release(); } } @@ -1672,7 +1660,7 @@ public: // Call the handler. boost_asio_handler_invoke_helpers::invoke( - detail::bind_handler(handler, ec, bytes_transferred), &handler); + detail::bind_handler(handler, ec, bytes_transferred), handler); } static void destroy_impl(operation* op) @@ -1710,13 +1698,6 @@ public: const MutableBufferSequence& buffers, endpoint_type& sender_endp, socket_base::message_flags flags, Handler handler) { - if (!is_open(impl)) - { - this->get_io_service().post(bind_handler(handler, - boost::asio::error::bad_descriptor, 0)); - return; - } - #if defined(BOOST_ASIO_ENABLE_CANCELIO) // Update the ID of the thread from which cancellation is safe. if (impl.safe_cancellation_thread_id_ == 0) @@ -1733,6 +1714,13 @@ public: handler_ptr<alloc_traits> ptr(raw_ptr, protocol_type, iocp_service_, sender_endp, buffers, handler); + if (!is_open(impl)) + { + ptr.get()->on_immediate_completion(WSAEBADF, 0); + ptr.release(); + return; + } + // Copy buffers into WSABUF array. ::WSABUF bufs[max_buffers]; typename MutableBufferSequence::const_iterator iter = buffers.begin(); @@ -1754,14 +1742,12 @@ public: DWORD last_error = ::WSAGetLastError(); if (result != 0 && last_error != WSA_IO_PENDING) { - boost::asio::io_service::work work(this->get_io_service()); - ptr.reset(); - boost::system::error_code ec(last_error, - boost::asio::error::get_system_category()); - iocp_service_.post(bind_handler(handler, ec, bytes_transferred)); + ptr.get()->on_immediate_completion(last_error, bytes_transferred); + ptr.release(); } else { + ptr.get()->on_pending(); ptr.release(); } } @@ -1925,11 +1911,7 @@ public: && !ptr.get()->enable_connection_aborted_) { // Reset OVERLAPPED structure. - ptr.get()->Internal = 0; - ptr.get()->InternalHigh = 0; - ptr.get()->Offset = 0; - ptr.get()->OffsetHigh = 0; - ptr.get()->hEvent = 0; + ptr.get()->reset(); // Create a new socket for the next connection, since the AcceptEx call // fails with WSAEINVAL if we try to reuse the same socket. @@ -1954,7 +1936,7 @@ public: || last_error == WSAECONNABORTED) { // Post this handler so that operation will be restarted again. - ptr.get()->io_service_.post_completion(ptr.get(), last_error, 0); + ptr.get()->on_immediate_completion(last_error, 0); ptr.release(); return; } @@ -1966,6 +1948,7 @@ public: else { // Asynchronous operation has been successfully restarted. + ptr.get()->on_pending(); ptr.release(); return; } @@ -2038,7 +2021,7 @@ public: boost::system::error_code ec(last_error, boost::asio::error::get_system_category()); boost_asio_handler_invoke_helpers::invoke( - detail::bind_handler(handler, ec), &handler); + detail::bind_handler(handler, ec), handler); } static void destroy_impl(operation* op) @@ -2141,7 +2124,7 @@ public: // Post handler so that operation will be restarted again. We do not // perform the AcceptEx again here to avoid the possibility of starving // other handlers. - iocp_service_.post_completion(ptr.get(), last_error, 0); + ptr.get()->on_immediate_completion(last_error, 0); ptr.release(); } else @@ -2155,6 +2138,7 @@ public: } else { + ptr.get()->on_pending(); ptr.release(); } } diff --git a/3rdParty/Boost/src/boost/asio/detail/win_mutex.hpp b/3rdParty/Boost/src/boost/asio/detail/win_mutex.hpp index f5470c4..107d707 100644 --- a/3rdParty/Boost/src/boost/asio/detail/win_mutex.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/win_mutex.hpp @@ -2,7 +2,7 @@ // win_mutex.hpp // ~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/win_signal_blocker.hpp b/3rdParty/Boost/src/boost/asio/detail/win_signal_blocker.hpp index e9b4d37..6d70a16 100644 --- a/3rdParty/Boost/src/boost/asio/detail/win_signal_blocker.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/win_signal_blocker.hpp @@ -2,7 +2,7 @@ // win_signal_blocker.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/win_thread.hpp b/3rdParty/Boost/src/boost/asio/detail/win_thread.hpp index c8058d8..61c9b8a 100644 --- a/3rdParty/Boost/src/boost/asio/detail/win_thread.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/win_thread.hpp @@ -2,7 +2,7 @@ // win_thread.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -40,7 +40,7 @@ namespace detail { unsigned int __stdcall win_thread_function(void* arg); -#if (WINVER < 0x0500) +#if defined(WINVER) && (WINVER < 0x0500) void __stdcall apc_function(ULONG data); #else void __stdcall apc_function(ULONG_PTR data); @@ -156,7 +156,7 @@ public: private: friend unsigned int __stdcall win_thread_function(void* arg); -#if (WINVER < 0x0500) +#if defined(WINVER) && (WINVER < 0x0500) friend void __stdcall apc_function(ULONG); #else friend void __stdcall apc_function(ULONG_PTR); @@ -217,7 +217,7 @@ inline unsigned int __stdcall win_thread_function(void* arg) return 0; } -#if (WINVER < 0x0500) +#if defined(WINVER) && (WINVER < 0x0500) inline void __stdcall apc_function(ULONG) {} #else inline void __stdcall apc_function(ULONG_PTR) {} diff --git a/3rdParty/Boost/src/boost/asio/detail/win_tss_ptr.hpp b/3rdParty/Boost/src/boost/asio/detail/win_tss_ptr.hpp index 5c56454..fa04613 100644 --- a/3rdParty/Boost/src/boost/asio/detail/win_tss_ptr.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/win_tss_ptr.hpp @@ -2,7 +2,7 @@ // win_tss_ptr.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/wince_thread.hpp b/3rdParty/Boost/src/boost/asio/detail/wince_thread.hpp index 7b24ec2..1cb9a7a 100644 --- a/3rdParty/Boost/src/boost/asio/detail/wince_thread.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/wince_thread.hpp @@ -2,7 +2,7 @@ // wince_thread.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/winsock_init.hpp b/3rdParty/Boost/src/boost/asio/detail/winsock_init.hpp index 827cf58..186a8b5 100644 --- a/3rdParty/Boost/src/boost/asio/detail/winsock_init.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/winsock_init.hpp @@ -2,7 +2,7 @@ // winsock_init.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/detail/wrapped_handler.hpp b/3rdParty/Boost/src/boost/asio/detail/wrapped_handler.hpp index 64fc729..8f2f625 100644 --- a/3rdParty/Boost/src/boost/asio/detail/wrapped_handler.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/wrapped_handler.hpp @@ -2,7 +2,7 @@ // wrapped_handler.hpp // ~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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,7 +18,7 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/asio/detail/push_options.hpp> -#include <boost/type_traits.hpp> +#include <boost/type_traits/add_reference.hpp> #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/detail/bind_handler.hpp> @@ -158,7 +158,7 @@ inline void* asio_handler_allocate(std::size_t size, wrapped_handler<Dispatcher, Handler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename Dispatcher, typename Handler> @@ -166,7 +166,7 @@ inline void asio_handler_deallocate(void* pointer, std::size_t size, wrapped_handler<Dispatcher, Handler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename Dispatcher, typename Handler> @@ -183,7 +183,7 @@ inline void* asio_handler_allocate(std::size_t size, rewrapped_handler<Handler, Context>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->context_); + size, this_handler->context_); } template <typename Handler, typename Context> @@ -191,7 +191,7 @@ inline void asio_handler_deallocate(void* pointer, std::size_t size, rewrapped_handler<Handler, Context>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->context_); + pointer, size, this_handler->context_); } template <typename Function, typename Handler, typename Context> @@ -199,7 +199,7 @@ inline void asio_handler_invoke(const Function& function, rewrapped_handler<Handler, Context>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->context_); + function, this_handler->context_); } } // namespace detail diff --git a/3rdParty/Boost/src/boost/asio/error.hpp b/3rdParty/Boost/src/boost/asio/error.hpp index 0101945..0dcb3dc 100644 --- a/3rdParty/Boost/src/boost/asio/error.hpp +++ b/3rdParty/Boost/src/boost/asio/error.hpp @@ -2,7 +2,7 @@ // error.hpp // ~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/handler_alloc_hook.hpp b/3rdParty/Boost/src/boost/asio/handler_alloc_hook.hpp index e949529..5dada4e 100644 --- a/3rdParty/Boost/src/boost/asio/handler_alloc_hook.hpp +++ b/3rdParty/Boost/src/boost/asio/handler_alloc_hook.hpp @@ -2,7 +2,7 @@ // handler_alloc_hook.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/handler_invoke_hook.hpp b/3rdParty/Boost/src/boost/asio/handler_invoke_hook.hpp index d70a717..184f449 100644 --- a/3rdParty/Boost/src/boost/asio/handler_invoke_hook.hpp +++ b/3rdParty/Boost/src/boost/asio/handler_invoke_hook.hpp @@ -2,7 +2,7 @@ // handler_invoke_hook.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -26,10 +26,9 @@ namespace asio { * io_service associated with the corresponding object (e.g. a socket or * deadline_timer). Certain guarantees are made on when the handler may be * invoked, in particular that a handler can only be invoked from a thread that - * is currently calling boost::asio::io_service::run() on the corresponding - * io_service object. Handlers may subsequently be invoked through other - * objects (such as boost::asio::strand objects) that provide additional - * guarantees. + * is currently calling @c run() on the corresponding io_service object. + * Handlers may subsequently be invoked through other objects (such as + * io_service::strand objects) that provide additional guarantees. * * When asynchronous operations are composed from other asynchronous * operations, all intermediate handlers should be invoked using the same diff --git a/3rdParty/Boost/src/boost/asio/impl/io_service.ipp b/3rdParty/Boost/src/boost/asio/impl/io_service.ipp index e936f36..9234dc4 100644 --- a/3rdParty/Boost/src/boost/asio/impl/io_service.ipp +++ b/3rdParty/Boost/src/boost/asio/impl/io_service.ipp @@ -2,7 +2,7 @@ // io_service.ipp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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,17 +18,27 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/asio/detail/push_options.hpp> -#include <limits> +#include <boost/limits.hpp> #include <boost/asio/detail/pop_options.hpp> -#include <boost/asio/detail/dev_poll_reactor.hpp> -#include <boost/asio/detail/epoll_reactor.hpp> -#include <boost/asio/detail/kqueue_reactor.hpp> -#include <boost/asio/detail/select_reactor.hpp> #include <boost/asio/detail/service_registry.hpp> -#include <boost/asio/detail/task_io_service.hpp> #include <boost/asio/detail/throw_error.hpp> -#include <boost/asio/detail/win_iocp_io_service.hpp> + +#if defined(BOOST_ASIO_HAS_IOCP) +# include <boost/asio/detail/win_iocp_io_service.hpp> +#elif defined(BOOST_ASIO_HAS_EPOLL) +# include <boost/asio/detail/epoll_reactor.hpp> +# include <boost/asio/detail/task_io_service.hpp> +#elif defined(BOOST_ASIO_HAS_KQUEUE) +# include <boost/asio/detail/kqueue_reactor.hpp> +# include <boost/asio/detail/task_io_service.hpp> +#elif defined(BOOST_ASIO_HAS_DEV_POLL) +# include <boost/asio/detail/dev_poll_reactor.hpp> +# include <boost/asio/detail/task_io_service.hpp> +#else +# include <boost/asio/detail/select_reactor.hpp> +# include <boost/asio/detail/task_io_service.hpp> +#endif namespace boost { namespace asio { diff --git a/3rdParty/Boost/src/boost/asio/impl/read.ipp b/3rdParty/Boost/src/boost/asio/impl/read.ipp index 453f697..05ea960 100644 --- a/3rdParty/Boost/src/boost/asio/impl/read.ipp +++ b/3rdParty/Boost/src/boost/asio/impl/read.ipp @@ -2,7 +2,7 @@ // read.ipp // ~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -75,6 +75,8 @@ inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, return bytes_transferred; } +#if !defined(BOOST_NO_IOSTREAM) + template <typename SyncReadStream, typename Allocator, typename CompletionCondition> std::size_t read(SyncReadStream& s, @@ -122,6 +124,8 @@ inline std::size_t read(SyncReadStream& s, return bytes_transferred; } +#endif // !defined(BOOST_NO_IOSTREAM) + namespace detail { template <typename AsyncReadStream, typename MutableBufferSequence, @@ -174,7 +178,7 @@ namespace detail CompletionCondition, ReadHandler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename AsyncReadStream, typename MutableBufferSequence, @@ -184,7 +188,7 @@ namespace detail CompletionCondition, ReadHandler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename AsyncReadStream, @@ -195,7 +199,7 @@ namespace detail CompletionCondition, ReadHandler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail @@ -232,6 +236,8 @@ inline void async_read(AsyncReadStream& s, const MutableBufferSequence& buffers, async_read(s, buffers, transfer_all(), handler); } +#if !defined(BOOST_NO_IOSTREAM) + namespace detail { template <typename AsyncReadStream, typename Allocator, @@ -285,7 +291,7 @@ namespace detail CompletionCondition, ReadHandler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename AsyncReadStream, typename Allocator, @@ -295,7 +301,7 @@ namespace detail CompletionCondition, ReadHandler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename AsyncReadStream, @@ -305,7 +311,7 @@ namespace detail CompletionCondition, ReadHandler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail @@ -341,6 +347,8 @@ inline void async_read(AsyncReadStream& s, async_read(s, b, transfer_all(), handler); } +#endif // !defined(BOOST_NO_IOSTREAM) + } // namespace asio } // namespace boost diff --git a/3rdParty/Boost/src/boost/asio/impl/read_at.ipp b/3rdParty/Boost/src/boost/asio/impl/read_at.ipp index bf8a36d..91fd014 100644 --- a/3rdParty/Boost/src/boost/asio/impl/read_at.ipp +++ b/3rdParty/Boost/src/boost/asio/impl/read_at.ipp @@ -2,7 +2,7 @@ // read_at.ipp // ~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -81,6 +81,8 @@ inline std::size_t read_at(SyncRandomAccessReadDevice& d, return bytes_transferred; } +#if !defined(BOOST_NO_IOSTREAM) + template <typename SyncRandomAccessReadDevice, typename Allocator, typename CompletionCondition> std::size_t read_at(SyncRandomAccessReadDevice& d, @@ -126,6 +128,8 @@ inline std::size_t read_at(SyncRandomAccessReadDevice& d, return bytes_transferred; } +#endif // !defined(BOOST_NO_IOSTREAM) + namespace detail { template <typename AsyncRandomAccessReadDevice, @@ -184,7 +188,7 @@ namespace detail CompletionCondition, ReadHandler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename AsyncRandomAccessReadDevice, @@ -195,7 +199,7 @@ namespace detail CompletionCondition, ReadHandler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename AsyncRandomAccessReadDevice, @@ -206,7 +210,7 @@ namespace detail CompletionCondition, ReadHandler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail @@ -245,6 +249,8 @@ inline void async_read_at(AsyncRandomAccessReadDevice& d, async_read_at(d, offset, buffers, transfer_all(), handler); } +#if !defined(BOOST_NO_IOSTREAM) + namespace detail { template <typename AsyncRandomAccessReadDevice, typename Allocator, @@ -301,7 +307,7 @@ namespace detail CompletionCondition, ReadHandler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename AsyncRandomAccessReadDevice, typename Allocator, @@ -311,7 +317,7 @@ namespace detail CompletionCondition, ReadHandler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename AsyncRandomAccessReadDevice, @@ -321,7 +327,7 @@ namespace detail CompletionCondition, ReadHandler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail @@ -359,6 +365,8 @@ inline void async_read_at(AsyncRandomAccessReadDevice& d, async_read_at(d, offset, b, transfer_all(), handler); } +#endif // !defined(BOOST_NO_IOSTREAM) + } // namespace asio } // namespace boost diff --git a/3rdParty/Boost/src/boost/asio/impl/read_until.ipp b/3rdParty/Boost/src/boost/asio/impl/read_until.ipp index df4a568..0ee0de0 100644 --- a/3rdParty/Boost/src/boost/asio/impl/read_until.ipp +++ b/3rdParty/Boost/src/boost/asio/impl/read_until.ipp @@ -2,7 +2,7 @@ // read_until.ipp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -19,9 +19,9 @@ #include <boost/asio/detail/push_options.hpp> #include <algorithm> -#include <limits> #include <string> #include <utility> +#include <boost/limits.hpp> #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/buffer.hpp> @@ -404,7 +404,7 @@ namespace detail Allocator, ReadHandler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename AsyncReadStream, typename Allocator, typename ReadHandler> @@ -413,7 +413,7 @@ namespace detail Allocator, ReadHandler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename AsyncReadStream, typename Allocator, @@ -423,7 +423,7 @@ namespace detail Allocator, ReadHandler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail @@ -560,7 +560,7 @@ namespace detail Allocator, ReadHandler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename AsyncReadStream, typename Allocator, typename ReadHandler> @@ -569,7 +569,7 @@ namespace detail Allocator, ReadHandler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename AsyncReadStream, @@ -579,7 +579,7 @@ namespace detail Allocator, ReadHandler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail @@ -733,7 +733,7 @@ namespace detail Allocator, ReadHandler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename AsyncReadStream, typename Allocator, typename ReadHandler> @@ -742,7 +742,7 @@ namespace detail Allocator, ReadHandler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename AsyncReadStream, typename Allocator, @@ -752,7 +752,7 @@ namespace detail Allocator, ReadHandler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail @@ -903,7 +903,7 @@ namespace detail Allocator, MatchCondition, ReadHandler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename AsyncReadStream, typename Allocator, @@ -913,7 +913,7 @@ namespace detail Allocator, MatchCondition, ReadHandler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename AsyncReadStream, typename Allocator, @@ -923,7 +923,7 @@ namespace detail Allocator, MatchCondition, ReadHandler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail diff --git a/3rdParty/Boost/src/boost/asio/impl/serial_port_base.ipp b/3rdParty/Boost/src/boost/asio/impl/serial_port_base.ipp index 0470ff2..2775a02 100644 --- a/3rdParty/Boost/src/boost/asio/impl/serial_port_base.ipp +++ b/3rdParty/Boost/src/boost/asio/impl/serial_port_base.ipp @@ -2,7 +2,7 @@ // serial_port_base.ipp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -18,6 +18,10 @@ #include <boost/asio/detail/push_options.hpp> +#include <boost/asio/detail/push_options.hpp> +#include <boost/throw_exception.hpp> +#include <boost/asio/detail/pop_options.hpp> + namespace boost { namespace asio { @@ -206,7 +210,10 @@ inline serial_port_base::flow_control::flow_control( : value_(t) { if (t != none && t != software && t != hardware) - throw std::out_of_range("invalid flow_control value"); + { + std::out_of_range ex("invalid flow_control value"); + boost::throw_exception(ex); + } } inline serial_port_base::flow_control::type @@ -314,7 +321,10 @@ inline serial_port_base::parity::parity(serial_port_base::parity::type t) : value_(t) { if (t != none && t != odd && t != even) - throw std::out_of_range("invalid parity value"); + { + std::out_of_range ex("invalid parity value"); + boost::throw_exception(ex); + } } inline serial_port_base::parity::type serial_port_base::parity::value() const @@ -411,7 +421,10 @@ inline serial_port_base::stop_bits::stop_bits( : value_(t) { if (t != one && t != onepointfive && t != two) - throw std::out_of_range("invalid stop_bits value"); + { + std::out_of_range ex("invalid stop_bits value"); + boost::throw_exception(ex); + } } inline serial_port_base::stop_bits::type @@ -487,7 +500,10 @@ inline serial_port_base::character_size::character_size(unsigned int t) : value_(t) { if (t < 5 || t > 8) - throw std::out_of_range("invalid character_size value"); + { + std::out_of_range ex("invalid character_size value"); + boost::throw_exception(ex); + } } inline unsigned int serial_port_base::character_size::value() const diff --git a/3rdParty/Boost/src/boost/asio/impl/write.ipp b/3rdParty/Boost/src/boost/asio/impl/write.ipp index 4434a91..76bace3 100644 --- a/3rdParty/Boost/src/boost/asio/impl/write.ipp +++ b/3rdParty/Boost/src/boost/asio/impl/write.ipp @@ -2,7 +2,7 @@ // write.ipp // ~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -70,6 +70,8 @@ inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, return bytes_transferred; } +#if !defined(BOOST_NO_IOSTREAM) + template <typename SyncWriteStream, typename Allocator, typename CompletionCondition> std::size_t write(SyncWriteStream& s, @@ -103,6 +105,8 @@ inline std::size_t write(SyncWriteStream& s, return bytes_transferred; } +#endif // !defined(BOOST_NO_IOSTREAM) + namespace detail { template <typename AsyncWriteStream, typename ConstBufferSequence, @@ -155,7 +159,7 @@ namespace detail CompletionCondition, WriteHandler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename AsyncWriteStream, typename ConstBufferSequence, @@ -165,7 +169,7 @@ namespace detail CompletionCondition, WriteHandler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename AsyncWriteStream, @@ -176,7 +180,7 @@ namespace detail CompletionCondition, WriteHandler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail @@ -213,6 +217,8 @@ inline void async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers, async_write(s, buffers, transfer_all(), handler); } +#if !defined(BOOST_NO_IOSTREAM) + namespace detail { template <typename AsyncWriteStream, typename Allocator, @@ -246,7 +252,7 @@ namespace detail Allocator, WriteHandler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename AsyncWriteStream, typename Allocator, @@ -256,7 +262,7 @@ namespace detail Allocator, WriteHandler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename AsyncWriteStream, typename Allocator, @@ -266,7 +272,7 @@ namespace detail Allocator, WriteHandler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail @@ -288,6 +294,8 @@ inline void async_write(AsyncWriteStream& s, async_write(s, b, transfer_all(), handler); } +#endif // !defined(BOOST_NO_IOSTREAM) + } // namespace asio } // namespace boost diff --git a/3rdParty/Boost/src/boost/asio/impl/write_at.ipp b/3rdParty/Boost/src/boost/asio/impl/write_at.ipp index ba00567..751229b 100644 --- a/3rdParty/Boost/src/boost/asio/impl/write_at.ipp +++ b/3rdParty/Boost/src/boost/asio/impl/write_at.ipp @@ -2,7 +2,7 @@ // write_at.ipp // ~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -76,6 +76,8 @@ inline std::size_t write_at(SyncRandomAccessWriteDevice& d, return bytes_transferred; } +#if !defined(BOOST_NO_IOSTREAM) + template <typename SyncRandomAccessWriteDevice, typename Allocator, typename CompletionCondition> std::size_t write_at(SyncRandomAccessWriteDevice& d, @@ -111,6 +113,8 @@ inline std::size_t write_at(SyncRandomAccessWriteDevice& d, return bytes_transferred; } +#endif // !defined(BOOST_NO_IOSTREAM) + namespace detail { template <typename AsyncRandomAccessWriteDevice, typename ConstBufferSequence, @@ -167,7 +171,7 @@ namespace detail CompletionCondition, WriteHandler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename AsyncRandomAccessWriteDevice, typename ConstBufferSequence, @@ -177,7 +181,7 @@ namespace detail CompletionCondition, WriteHandler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename AsyncRandomAccessWriteDevice, @@ -188,7 +192,7 @@ namespace detail CompletionCondition, WriteHandler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail @@ -227,6 +231,8 @@ inline void async_write_at(AsyncRandomAccessWriteDevice& d, async_write_at(d, offset, buffers, transfer_all(), handler); } +#if !defined(BOOST_NO_IOSTREAM) + namespace detail { template <typename AsyncRandomAccessWriteDevice, typename Allocator, @@ -261,7 +267,7 @@ namespace detail Allocator, WriteHandler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename AsyncRandomAccessWriteDevice, typename Allocator, @@ -271,7 +277,7 @@ namespace detail Allocator, WriteHandler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename AsyncRandomAccessWriteDevice, @@ -281,7 +287,7 @@ namespace detail Allocator, WriteHandler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail @@ -305,6 +311,8 @@ inline void async_write_at(AsyncRandomAccessWriteDevice& d, async_write_at(d, offset, b, transfer_all(), handler); } +#endif // !defined(BOOST_NO_IOSTREAM) + } // namespace asio } // namespace boost diff --git a/3rdParty/Boost/src/boost/asio/io_service.hpp b/3rdParty/Boost/src/boost/asio/io_service.hpp index e50224a..a34d874 100644 --- a/3rdParty/Boost/src/boost/asio/io_service.hpp +++ b/3rdParty/Boost/src/boost/asio/io_service.hpp @@ -2,7 +2,7 @@ // io_service.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -61,27 +61,36 @@ template <typename Service> bool has_service(io_service& ios); * * @par Thread Safety * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Safe, with the exception that calling reset() - * while there are unfinished run() calls results in undefined behaviour. + * @e Shared @e objects: Safe, with the exception that calling reset() while + * there are unfinished run(), run_one(), poll() or poll_one() calls results in + * undefined behaviour. * * @par Concepts: * Dispatcher. * + * @par Synchronous and asynchronous operations + * + * Synchronous operations on I/O objects implicitly run the io_service object + * for an individual operation. The io_service functions run(), run_one(), + * poll() or poll_one() must be called for the io_service to perform + * asynchronous operations on behalf of a C++ program. Notification that an + * asynchronous operation has completed is delivered by invocation of the + * associated handler. Handlers are invoked only by a thread that is currently + * calling any overload of run(), run_one(), poll() or poll_one() for the + * io_service. + * * @par Effect of exceptions thrown from handlers * * If an exception is thrown from a handler, the exception is allowed to - * propagate through the throwing thread's invocation of - * boost::asio::io_service::run(), boost::asio::io_service::run_one(), - * boost::asio::io_service::poll() or boost::asio::io_service::poll_one(). - * No other threads that are calling any of these functions are affected. It is - * then the responsibility of the application to catch the exception. + * propagate through the throwing thread's invocation of run(), run_one(), + * poll() or poll_one(). No other threads that are calling any of these + * functions are affected. It is then the responsibility of the application to + * catch the exception. * - * After the exception has been caught, the - * boost::asio::io_service::run(), boost::asio::io_service::run_one(), - * boost::asio::io_service::poll() or boost::asio::io_service::poll_one() - * call may be restarted @em without the need for an intervening call to - * boost::asio::io_service::reset(). This allows the thread to rejoin the - * io_service's thread pool without impacting any other threads in the pool. + * After the exception has been caught, the run(), run_one(), poll() or + * poll_one() call may be restarted @em without the need for an intervening + * call to reset(). This allows the thread to rejoin the io_service object's + * thread pool without impacting any other threads in the pool. * * For example: * @@ -104,7 +113,7 @@ template <typename Service> bool has_service(io_service& ios); * * @par Stopping the io_service from running out of work * - * Some applications may need to prevent an io_service's run() call from + * Some applications may need to prevent an io_service object's run() call from * returning when there is no more work to do. For example, the io_service may * be being run in a background thread that is launched prior to the * application's asynchronous operations. The run() call may be kept running by @@ -114,10 +123,10 @@ template <typename Service> bool has_service(io_service& ios); * boost::asio::io_service::work work(io_service); * ... @endcode * - * To effect a shutdown, the application will then need to call the io_service's - * stop() member function. This will cause the io_service run() call to return - * as soon as possible, abandoning unfinished operations and without permitting - * ready handlers to be dispatched. + * To effect a shutdown, the application will then need to call the io_service + * object's stop() member function. This will cause the io_service run() call + * to return as soon as possible, abandoning unfinished operations and without + * permitting ready handlers to be dispatched. * * Alternatively, if the application requires that all operations and handlers * be allowed to finish normally, the work object may be explicitly destroyed. @@ -127,6 +136,43 @@ template <typename Service> bool has_service(io_service& ios); * new boost::asio::io_service::work(io_service)); * ... * work.reset(); // Allow run() to exit. @endcode + * + * @par The io_service class and I/O services + * + * Class io_service implements an extensible, type-safe, polymorphic set of I/O + * services, indexed by service type. An object of class io_service must be + * initialised before I/O objects such as sockets, resolvers and timers can be + * used. These I/O objects are distinguished by having constructors that accept + * an @c io_service& parameter. + * + * I/O services exist to manage the logical interface to the operating system on + * behalf of the I/O objects. In particular, there are resources that are shared + * across a class of I/O objects. For example, timers may be implemented in + * terms of a single timer queue. The I/O services manage these shared + * resources. + * + * Access to the services of an io_service is via three function templates, + * use_service(), add_service() and has_service(). + * + * In a call to @c use_service<Service>(), the type argument chooses a service, + * making available all members of the named type. If @c Service is not present + * in an io_service, an object of type @c Service is created and added to the + * io_service. A C++ program can check if an io_service implements a + * particular service with the function template @c has_service<Service>(). + * + * Service objects may be explicitly added to an io_service using the function + * template @c add_service<Service>(). If the @c Service is already present, the + * service_already_exists exception is thrown. If the owner of the service is + * not the same object as the io_service parameter, the invalid_service_owner + * exception is thrown. + * + * Once a service reference is obtained from an io_service object by calling + * use_service(), that reference remains usable as long as the owning io_service + * object exists. + * + * All I/O service implementations have io_service::service as a public base + * class. Custom I/O services may be implemented by deriving from this class and + * then added to an io_service using the facilities described above. */ class io_service : private noncopyable @@ -169,9 +215,40 @@ public: explicit io_service(std::size_t concurrency_hint); /// Destructor. + /** + * On destruction, the io_service performs the following sequence of + * operations: + * + * @li For each service object @c svc in the io_service set, in reverse order + * of the beginning of service object lifetime, performs + * @c svc->shutdown_service(). + * + * @li Uninvoked handler objects that were scheduled for deferred invocation + * on the io_service, or any associated strand, are destroyed. + * + * @li For each service object @c svc in the io_service set, in reverse order + * of the beginning of service object lifetime, performs + * <tt>delete static_cast<io_service::service*>(svc)</tt>. + * + * @note The destruction sequence described above permits programs to + * simplify their resource management by using @c shared_ptr<>. Where an + * object's lifetime is tied to the lifetime of a connection (or some other + * sequence of asynchronous operations), a @c shared_ptr to the object would + * be bound into the handlers for all asynchronous operations associated with + * it. This works as follows: + * + * @li When a single connection ends, all associated asynchronous operations + * complete. The corresponding handler objects are destroyed, and all + * @c shared_ptr references to the objects are destroyed. + * + * @li To shut down the whole program, the io_service function stop() is + * called to terminate any run() calls as soon as possible. The io_service + * destructor defined above destroys all handlers, causing all @c shared_ptr + * references to all connection objects to be destroyed. + */ ~io_service(); - /// Run the io_service's event processing loop. + /// Run the io_service object's event processing loop. /** * The run() function blocks until all work has finished and there are no * more handlers to be dispatched, or until the io_service has been stopped. @@ -188,12 +265,16 @@ public: * * @throws boost::system::system_error Thrown on failure. * - * @note The poll() function may also be used to dispatch ready handlers, - * but without blocking. + * @note The run() function must not be called from a thread that is currently + * calling one of run(), run_one(), poll() or poll_one() on the same + * io_service object. + * + * The poll() function may also be used to dispatch ready handlers, but + * without blocking. */ std::size_t run(); - /// Run the io_service's event processing loop. + /// Run the io_service object's event processing loop. /** * The run() function blocks until all work has finished and there are no * more handlers to be dispatched, or until the io_service has been stopped. @@ -210,12 +291,17 @@ public: * * @return The number of handlers that were executed. * - * @note The poll() function may also be used to dispatch ready handlers, - * but without blocking. + * @note The run() function must not be called from a thread that is currently + * calling one of run(), run_one(), poll() or poll_one() on the same + * io_service object. + * + * The poll() function may also be used to dispatch ready handlers, but + * without blocking. */ std::size_t run(boost::system::error_code& ec); - /// Run the io_service's event processing loop to execute at most one handler. + /// Run the io_service object's event processing loop to execute at most one + /// handler. /** * The run_one() function blocks until one handler has been dispatched, or * until the io_service has been stopped. @@ -226,7 +312,8 @@ public: */ std::size_t run_one(); - /// Run the io_service's event processing loop to execute at most one handler. + /// Run the io_service object's event processing loop to execute at most one + /// handler. /** * The run_one() function blocks until one handler has been dispatched, or * until the io_service has been stopped. @@ -237,7 +324,8 @@ public: */ std::size_t run_one(boost::system::error_code& ec); - /// Run the io_service's event processing loop to execute ready handlers. + /// Run the io_service object's event processing loop to execute ready + /// handlers. /** * The poll() function runs handlers that are ready to run, without blocking, * until the io_service has been stopped or there are no more ready handlers. @@ -248,7 +336,8 @@ public: */ std::size_t poll(); - /// Run the io_service's event processing loop to execute ready handlers. + /// Run the io_service object's event processing loop to execute ready + /// handlers. /** * The poll() function runs handlers that are ready to run, without blocking, * until the io_service has been stopped or there are no more ready handlers. @@ -259,7 +348,8 @@ public: */ std::size_t poll(boost::system::error_code& ec); - /// Run the io_service's event processing loop to execute one ready handler. + /// Run the io_service object's event processing loop to execute one ready + /// handler. /** * The poll_one() function runs at most one handler that is ready to run, * without blocking. @@ -270,7 +360,8 @@ public: */ std::size_t poll_one(); - /// Run the io_service's event processing loop to execute one ready handler. + /// Run the io_service object's event processing loop to execute one ready + /// handler. /** * The poll_one() function runs at most one handler that is ready to run, * without blocking. @@ -281,7 +372,7 @@ public: */ std::size_t poll_one(boost::system::error_code& ec); - /// Stop the io_service's event processing loop. + /// Stop the io_service object's event processing loop. /** * This function does not block, but instead simply signals the io_service to * stop. All invocations of its run() or run_one() member functions should @@ -340,15 +431,15 @@ public: /// on the io_service. /** * This function is used to create a new handler function object that, when - * invoked, will automatically pass the wrapped handler to the io_service's - * dispatch function. + * invoked, will automatically pass the wrapped handler to the io_service + * object's dispatch function. * * @param handler The handler to be wrapped. The io_service will make a copy * of the handler object as required. The function signature of the handler * must be: @code void handler(A1 a1, ... An an); @endcode * * @return A function object that, when invoked, passes the wrapped handler to - * the io_service's dispatch function. Given a function object with the + * the io_service object's dispatch function. Given a function object with the * signature: * @code R f(A1 a1, ... An an); @endcode * If this function object is passed to the wrap function like so: @@ -430,9 +521,9 @@ private: /// Class to inform the io_service when it has work to do. /** * The work class is used to inform the io_service when work starts and - * finishes. This ensures that the io_service's run() function will not exit - * while work is underway, and that it does exit when there is no unfinished - * work remaining. + * finishes. This ensures that the io_service object's run() function will not + * exit while work is underway, and that it does exit when there is no + * unfinished work remaining. * * The work class is copy-constructible so that it may be used as a data member * in a handler class. It is not assignable. @@ -443,24 +534,24 @@ public: /// Constructor notifies the io_service that work is starting. /** * The constructor is used to inform the io_service that some work has begun. - * This ensures that the io_service's run() function will not exit while the - * work is underway. + * This ensures that the io_service object's run() function will not exit + * while the work is underway. */ explicit work(boost::asio::io_service& io_service); /// Copy constructor notifies the io_service that work is starting. /** * The constructor is used to inform the io_service that some work has begun. - * This ensures that the io_service's run() function will not exit while the - * work is underway. + * This ensures that the io_service object's run() function will not exit + * while the work is underway. */ work(const work& other); /// Destructor notifies the io_service that the work is complete. /** * The destructor is used to inform the io_service that some work has - * finished. Once the count of unfinished work reaches zero, the io_service's - * run() function is permitted to exit. + * finished. Once the count of unfinished work reaches zero, the io_service + * object's run() function is permitted to exit. */ ~work(); diff --git a/3rdParty/Boost/src/boost/asio/ip/address.hpp b/3rdParty/Boost/src/boost/asio/ip/address.hpp index 9f1836e..16113f0 100644 --- a/3rdParty/Boost/src/boost/asio/ip/address.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/address.hpp @@ -2,7 +2,7 @@ // address.hpp // ~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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,7 +18,10 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/asio/detail/push_options.hpp> -#include <iosfwd> +#include <boost/config.hpp> +#if !defined(BOOST_NO_IOSTREAM) +# include <iosfwd> +#endif // !defined(BOOST_NO_IOSTREAM) #include <string> #include <boost/throw_exception.hpp> #include <boost/asio/detail/pop_options.hpp> @@ -250,6 +253,8 @@ private: boost::asio::ip::address_v6 ipv6_address_; }; +#if !defined(BOOST_NO_IOSTREAM) + /// Output an address as a string. /** * Used to output a human-readable string for a specified address. @@ -270,6 +275,8 @@ std::basic_ostream<Elem, Traits>& operator<<( return os; } +#endif // !defined(BOOST_NO_IOSTREAM) + } // namespace ip } // namespace asio } // namespace boost diff --git a/3rdParty/Boost/src/boost/asio/ip/address_v4.hpp b/3rdParty/Boost/src/boost/asio/ip/address_v4.hpp index 357edfa..e0088dc 100644 --- a/3rdParty/Boost/src/boost/asio/ip/address_v4.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/address_v4.hpp @@ -2,7 +2,7 @@ // address_v4.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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,10 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/asio/detail/push_options.hpp> +#include <boost/config.hpp> +#if !defined(BOOST_NO_IOSTREAM) +# include <iosfwd> +#endif // !defined(BOOST_NO_IOSTREAM) #include <climits> #include <string> #include <stdexcept> @@ -269,6 +273,8 @@ private: boost::asio::detail::in4_addr_type addr_; }; +#if !defined(BOOST_NO_IOSTREAM) + /// Output an address as a string. /** * Used to output a human-readable string for a specified address. @@ -300,6 +306,8 @@ std::basic_ostream<Elem, Traits>& operator<<( return os; } +#endif // !defined(BOOST_NO_IOSTREAM) + } // namespace ip } // namespace asio } // namespace boost diff --git a/3rdParty/Boost/src/boost/asio/ip/address_v6.hpp b/3rdParty/Boost/src/boost/asio/ip/address_v6.hpp index 5f5f092..4105c8d 100644 --- a/3rdParty/Boost/src/boost/asio/ip/address_v6.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/address_v6.hpp @@ -2,7 +2,7 @@ // address_v6.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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,10 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/asio/detail/push_options.hpp> +#include <boost/config.hpp> +#if !defined(BOOST_NO_IOSTREAM) +# include <iosfwd> +#endif // !defined(BOOST_NO_IOSTREAM) #include <cstring> #include <string> #include <stdexcept> @@ -383,6 +387,8 @@ private: unsigned long scope_id_; }; +#if !defined(BOOST_NO_IOSTREAM) + /// Output an address as a string. /** * Used to output a human-readable string for a specified address. @@ -414,6 +420,8 @@ std::basic_ostream<Elem, Traits>& operator<<( return os; } +#endif // !defined(BOOST_NO_IOSTREAM) + } // namespace ip } // namespace asio } // namespace boost diff --git a/3rdParty/Boost/src/boost/asio/ip/basic_endpoint.hpp b/3rdParty/Boost/src/boost/asio/ip/basic_endpoint.hpp index 80aaf1e..f191a4c 100644 --- a/3rdParty/Boost/src/boost/asio/ip/basic_endpoint.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/basic_endpoint.hpp @@ -2,7 +2,7 @@ // basic_endpoint.hpp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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,13 +18,16 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/asio/detail/push_options.hpp> +#include <boost/config.hpp> #include <boost/throw_exception.hpp> #include <boost/detail/workaround.hpp> #include <cstring> -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) -# include <ostream> -#endif // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) -#include <sstream> +#if !defined(BOOST_NO_IOSTREAM) +# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +# include <ostream> +# endif // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +# include <sstream> +#endif // !defined(BOOST_NO_IOSTREAM) #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/error.hpp> @@ -297,6 +300,8 @@ private: } data_; }; +#if !defined(BOOST_NO_IOSTREAM) + /// Output an endpoint as a string. /** * Used to output a human-readable string for a specified endpoint. @@ -368,6 +373,8 @@ std::basic_ostream<Elem, Traits>& operator<<( } #endif // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +#endif // !defined(BOOST_NO_IOSTREAM) + } // namespace ip } // namespace asio } // namespace boost diff --git a/3rdParty/Boost/src/boost/asio/ip/basic_resolver.hpp b/3rdParty/Boost/src/boost/asio/ip/basic_resolver.hpp index d0e8eb8..c4f13ab 100644 --- a/3rdParty/Boost/src/boost/asio/ip/basic_resolver.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/basic_resolver.hpp @@ -2,7 +2,7 @@ // basic_resolver.hpp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/ip/basic_resolver_entry.hpp b/3rdParty/Boost/src/boost/asio/ip/basic_resolver_entry.hpp index ba0a020..f2ac595 100644 --- a/3rdParty/Boost/src/boost/asio/ip/basic_resolver_entry.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/basic_resolver_entry.hpp @@ -2,7 +2,7 @@ // basic_resolver_entry.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/ip/basic_resolver_iterator.hpp b/3rdParty/Boost/src/boost/asio/ip/basic_resolver_iterator.hpp index d5860b7..90644a2 100644 --- a/3rdParty/Boost/src/boost/asio/ip/basic_resolver_iterator.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/basic_resolver_iterator.hpp @@ -2,7 +2,7 @@ // basic_resolver_iterator.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/ip/basic_resolver_query.hpp b/3rdParty/Boost/src/boost/asio/ip/basic_resolver_query.hpp index dd08525..e95362b 100644 --- a/3rdParty/Boost/src/boost/asio/ip/basic_resolver_query.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/basic_resolver_query.hpp @@ -2,7 +2,7 @@ // basic_resolver_query.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/ip/detail/socket_option.hpp b/3rdParty/Boost/src/boost/asio/ip/detail/socket_option.hpp index 40226fe..0c26864 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 @@ // socket_option.hpp // ~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -21,6 +21,7 @@ #include <cstddef> #include <cstring> #include <boost/config.hpp> +#include <boost/throw_exception.hpp> #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/ip/address.hpp> @@ -142,8 +143,8 @@ public: { if (s != sizeof(ipv6_value_)) { - throw std::length_error( - "multicast_enable_loopback socket option resize"); + std::length_error ex("multicast_enable_loopback socket option resize"); + boost::throw_exception(ex); } ipv4_value_ = ipv6_value_ ? 1 : 0; } @@ -151,8 +152,8 @@ public: { if (s != sizeof(ipv4_value_)) { - throw std::length_error( - "multicast_enable_loopback socket option resize"); + std::length_error ex("multicast_enable_loopback socket option resize"); + boost::throw_exception(ex); } ipv6_value_ = ipv4_value_ ? 1 : 0; } @@ -237,7 +238,10 @@ public: void resize(const Protocol&, std::size_t s) { if (s != sizeof(value_)) - throw std::length_error("unicast hops socket option resize"); + { + std::length_error ex("unicast hops socket option resize"); + boost::throw_exception(ex); + } #if defined(__hpux) if (value_ < 0) value_ = value_ & 0xFF; @@ -271,7 +275,10 @@ public: explicit multicast_hops(int v) { if (v < 0 || v > 255) - throw std::out_of_range("multicast hops value out of range"); + { + std::out_of_range ex("multicast hops value out of range"); + boost::throw_exception(ex); + } ipv4_value_ = (ipv4_value_type)v; ipv6_value_ = v; } @@ -280,7 +287,10 @@ public: multicast_hops& operator=(int v) { if (v < 0 || v > 255) - throw std::out_of_range("multicast hops value out of range"); + { + std::out_of_range ex("multicast hops value out of range"); + boost::throw_exception(ex); + } ipv4_value_ = (ipv4_value_type)v; ipv6_value_ = v; return *this; @@ -344,7 +354,10 @@ public: if (protocol.family() == PF_INET6) { if (s != sizeof(ipv6_value_)) - throw std::length_error("multicast hops socket option resize"); + { + std::length_error ex("multicast hops socket option resize"); + boost::throw_exception(ex); + } if (ipv6_value_ < 0) ipv4_value_ = 0; else if (ipv6_value_ > 255) @@ -355,7 +368,10 @@ public: else { if (s != sizeof(ipv4_value_)) - throw std::length_error("multicast hops socket option resize"); + { + std::length_error ex("multicast hops socket option resize"); + boost::throw_exception(ex); + } ipv6_value_ = ipv4_value_; } } diff --git a/3rdParty/Boost/src/boost/asio/ip/host_name.hpp b/3rdParty/Boost/src/boost/asio/ip/host_name.hpp index a21950e..fee245b 100644 --- a/3rdParty/Boost/src/boost/asio/ip/host_name.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/host_name.hpp @@ -2,7 +2,7 @@ // host_name.hpp // ~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/ip/icmp.hpp b/3rdParty/Boost/src/boost/asio/ip/icmp.hpp index 1230128..b70d87d 100644 --- a/3rdParty/Boost/src/boost/asio/ip/icmp.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/icmp.hpp @@ -2,7 +2,7 @@ // icmp.hpp // ~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/ip/multicast.hpp b/3rdParty/Boost/src/boost/asio/ip/multicast.hpp index 0f151cd..3aab7f0 100644 --- a/3rdParty/Boost/src/boost/asio/ip/multicast.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/multicast.hpp @@ -2,7 +2,7 @@ // multicast.hpp // ~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/ip/resolver_query_base.hpp b/3rdParty/Boost/src/boost/asio/ip/resolver_query_base.hpp index 67b5c80..d21b462 100644 --- a/3rdParty/Boost/src/boost/asio/ip/resolver_query_base.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/resolver_query_base.hpp @@ -2,7 +2,7 @@ // resolver_query_base.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/ip/resolver_service.hpp b/3rdParty/Boost/src/boost/asio/ip/resolver_service.hpp index 17a9ac1..1cd12b9 100644 --- a/3rdParty/Boost/src/boost/asio/ip/resolver_service.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/resolver_service.hpp @@ -2,7 +2,7 @@ // resolver_service.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/ip/tcp.hpp b/3rdParty/Boost/src/boost/asio/ip/tcp.hpp index 4c282ab..a42c999 100644 --- a/3rdParty/Boost/src/boost/asio/ip/tcp.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/tcp.hpp @@ -2,7 +2,7 @@ // tcp.hpp // ~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -93,8 +93,10 @@ public: /// The TCP resolver type. typedef basic_resolver<tcp> resolver; +#if !defined(BOOST_NO_IOSTREAM) /// The TCP iostream type. typedef basic_socket_iostream<tcp> iostream; +#endif // !defined(BOOST_NO_IOSTREAM) /// Socket option for disabling the Nagle algorithm. /** diff --git a/3rdParty/Boost/src/boost/asio/ip/udp.hpp b/3rdParty/Boost/src/boost/asio/ip/udp.hpp index 886cad8..e1793c7 100644 --- a/3rdParty/Boost/src/boost/asio/ip/udp.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/udp.hpp @@ -2,7 +2,7 @@ // udp.hpp // ~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/ip/unicast.hpp b/3rdParty/Boost/src/boost/asio/ip/unicast.hpp index f603fed..c97e6fd 100644 --- a/3rdParty/Boost/src/boost/asio/ip/unicast.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/unicast.hpp @@ -2,7 +2,7 @@ // unicast.hpp // ~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/ip/v6_only.hpp b/3rdParty/Boost/src/boost/asio/ip/v6_only.hpp index 203776d..9adcbff 100644 --- a/3rdParty/Boost/src/boost/asio/ip/v6_only.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/v6_only.hpp @@ -2,7 +2,7 @@ // v6_only.hpp // ~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/is_read_buffered.hpp b/3rdParty/Boost/src/boost/asio/is_read_buffered.hpp index 92dcc96..f0989a2 100644 --- a/3rdParty/Boost/src/boost/asio/is_read_buffered.hpp +++ b/3rdParty/Boost/src/boost/asio/is_read_buffered.hpp @@ -2,7 +2,7 @@ // is_read_buffered.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/is_write_buffered.hpp b/3rdParty/Boost/src/boost/asio/is_write_buffered.hpp index ba0bb3b..bcdf77d 100644 --- a/3rdParty/Boost/src/boost/asio/is_write_buffered.hpp +++ b/3rdParty/Boost/src/boost/asio/is_write_buffered.hpp @@ -2,7 +2,7 @@ // is_write_buffered.hpp // ~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/local/basic_endpoint.hpp b/3rdParty/Boost/src/boost/asio/local/basic_endpoint.hpp index dc927b7..1e4057f 100644 --- a/3rdParty/Boost/src/boost/asio/local/basic_endpoint.hpp +++ b/3rdParty/Boost/src/boost/asio/local/basic_endpoint.hpp @@ -2,7 +2,7 @@ // basic_endpoint.hpp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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 diff --git a/3rdParty/Boost/src/boost/asio/local/connect_pair.hpp b/3rdParty/Boost/src/boost/asio/local/connect_pair.hpp index 39a5e2a..697a0d2 100644 --- a/3rdParty/Boost/src/boost/asio/local/connect_pair.hpp +++ b/3rdParty/Boost/src/boost/asio/local/connect_pair.hpp @@ -2,7 +2,7 @@ // connect_pair.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/local/datagram_protocol.hpp b/3rdParty/Boost/src/boost/asio/local/datagram_protocol.hpp index 75407c2..1441ee6 100644 --- a/3rdParty/Boost/src/boost/asio/local/datagram_protocol.hpp +++ b/3rdParty/Boost/src/boost/asio/local/datagram_protocol.hpp @@ -2,7 +2,7 @@ // datagram_protocol.hpp // ~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/local/stream_protocol.hpp b/3rdParty/Boost/src/boost/asio/local/stream_protocol.hpp index 8839661..f341a8b 100644 --- a/3rdParty/Boost/src/boost/asio/local/stream_protocol.hpp +++ b/3rdParty/Boost/src/boost/asio/local/stream_protocol.hpp @@ -2,7 +2,7 @@ // stream_protocol.hpp // ~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -72,8 +72,10 @@ public: /// The UNIX domain acceptor type. typedef basic_socket_acceptor<stream_protocol> acceptor; +#if !defined(BOOST_NO_IOSTREAM) /// The UNIX domain iostream type. typedef basic_socket_iostream<stream_protocol> iostream; +#endif // !defined(BOOST_NO_IOSTREAM) }; } // namespace local diff --git a/3rdParty/Boost/src/boost/asio/placeholders.hpp b/3rdParty/Boost/src/boost/asio/placeholders.hpp index 67fc18c..55b6fd7 100644 --- a/3rdParty/Boost/src/boost/asio/placeholders.hpp +++ b/3rdParty/Boost/src/boost/asio/placeholders.hpp @@ -2,7 +2,7 @@ // placeholders.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/posix/basic_descriptor.hpp b/3rdParty/Boost/src/boost/asio/posix/basic_descriptor.hpp index 023d5b3..ff9cb87 100644 --- a/3rdParty/Boost/src/boost/asio/posix/basic_descriptor.hpp +++ b/3rdParty/Boost/src/boost/asio/posix/basic_descriptor.hpp @@ -2,7 +2,7 @@ // basic_descriptor.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/posix/basic_stream_descriptor.hpp b/3rdParty/Boost/src/boost/asio/posix/basic_stream_descriptor.hpp index 6559a68..d83a7f7 100644 --- a/3rdParty/Boost/src/boost/asio/posix/basic_stream_descriptor.hpp +++ b/3rdParty/Boost/src/boost/asio/posix/basic_stream_descriptor.hpp @@ -2,7 +2,7 @@ // basic_stream_descriptor.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/posix/descriptor_base.hpp b/3rdParty/Boost/src/boost/asio/posix/descriptor_base.hpp index 19a5727..ca93f4d 100644 --- a/3rdParty/Boost/src/boost/asio/posix/descriptor_base.hpp +++ b/3rdParty/Boost/src/boost/asio/posix/descriptor_base.hpp @@ -2,7 +2,7 @@ // descriptor_base.hpp // ~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/posix/stream_descriptor.hpp b/3rdParty/Boost/src/boost/asio/posix/stream_descriptor.hpp index ff728e2..3b01618 100644 --- a/3rdParty/Boost/src/boost/asio/posix/stream_descriptor.hpp +++ b/3rdParty/Boost/src/boost/asio/posix/stream_descriptor.hpp @@ -2,7 +2,7 @@ // stream_descriptor.hpp // ~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/posix/stream_descriptor_service.hpp b/3rdParty/Boost/src/boost/asio/posix/stream_descriptor_service.hpp index 0b6d55f..e64a617 100644 --- a/3rdParty/Boost/src/boost/asio/posix/stream_descriptor_service.hpp +++ b/3rdParty/Boost/src/boost/asio/posix/stream_descriptor_service.hpp @@ -2,7 +2,7 @@ // stream_descriptor_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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,11 +24,7 @@ #include <boost/asio/error.hpp> #include <boost/asio/io_service.hpp> -#include <boost/asio/detail/epoll_reactor.hpp> -#include <boost/asio/detail/kqueue_reactor.hpp> -#include <boost/asio/detail/select_reactor.hpp> #include <boost/asio/detail/service_base.hpp> -#include <boost/asio/detail/reactive_descriptor_service.hpp> #if !defined(BOOST_ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR) # if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__) @@ -39,6 +35,20 @@ #if defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR) \ || defined(GENERATING_DOCUMENTATION) +#if defined(BOOST_ASIO_HAS_EPOLL) +# include <boost/asio/detail/epoll_reactor.hpp> +# include <boost/asio/detail/reactive_descriptor_service.hpp> +#elif defined(BOOST_ASIO_HAS_KQUEUE) +# include <boost/asio/detail/kqueue_reactor.hpp> +# include <boost/asio/detail/reactive_descriptor_service.hpp> +#elif defined(BOOST_ASIO_HAS_DEV_POLL) +# include <boost/asio/detail/dev_poll_reactor.hpp> +# include <boost/asio/detail/reactive_descriptor_service.hpp> +#else +# include <boost/asio/detail/select_reactor.hpp> +# include <boost/asio/detail/reactive_descriptor_service.hpp> +#endif + namespace boost { namespace asio { namespace posix { diff --git a/3rdParty/Boost/src/boost/asio/raw_socket_service.hpp b/3rdParty/Boost/src/boost/asio/raw_socket_service.hpp index ec7cc2a..1b5c03c 100644 --- a/3rdParty/Boost/src/boost/asio/raw_socket_service.hpp +++ b/3rdParty/Boost/src/boost/asio/raw_socket_service.hpp @@ -2,7 +2,7 @@ // raw_socket_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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,12 +24,23 @@ #include <boost/asio/error.hpp> #include <boost/asio/io_service.hpp> -#include <boost/asio/detail/epoll_reactor.hpp> -#include <boost/asio/detail/kqueue_reactor.hpp> -#include <boost/asio/detail/select_reactor.hpp> #include <boost/asio/detail/service_base.hpp> -#include <boost/asio/detail/reactive_socket_service.hpp> -#include <boost/asio/detail/win_iocp_socket_service.hpp> + +#if defined(BOOST_ASIO_HAS_IOCP) +# include <boost/asio/detail/win_iocp_socket_service.hpp> +#elif defined(BOOST_ASIO_HAS_EPOLL) +# include <boost/asio/detail/epoll_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#elif defined(BOOST_ASIO_HAS_KQUEUE) +# include <boost/asio/detail/kqueue_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#elif defined(BOOST_ASIO_HAS_DEV_POLL) +# include <boost/asio/detail/dev_poll_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#else +# include <boost/asio/detail/select_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#endif namespace boost { namespace asio { diff --git a/3rdParty/Boost/src/boost/asio/read.hpp b/3rdParty/Boost/src/boost/asio/read.hpp index 0faeb02..8243d0f 100644 --- a/3rdParty/Boost/src/boost/asio/read.hpp +++ b/3rdParty/Boost/src/boost/asio/read.hpp @@ -2,7 +2,7 @@ // read.hpp // ~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -170,6 +170,8 @@ template <typename SyncReadStream, typename MutableBufferSequence, std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, CompletionCondition completion_condition, boost::system::error_code& ec); +#if !defined(BOOST_NO_IOSTREAM) + /// Attempt to read a certain amount of data from a stream before returning. /** * This function is used to read a certain number of bytes of data from a @@ -274,6 +276,8 @@ template <typename SyncReadStream, typename Allocator, std::size_t read(SyncReadStream& s, basic_streambuf<Allocator>& b, CompletionCondition completion_condition, boost::system::error_code& ec); +#endif // !defined(BOOST_NO_IOSTREAM) + /*@}*/ /** * @defgroup async_read boost::asio::async_read @@ -413,6 +417,8 @@ template <typename AsyncReadStream, typename MutableBufferSequence, void async_read(AsyncReadStream& s, const MutableBufferSequence& buffers, CompletionCondition completion_condition, ReadHandler handler); +#if !defined(BOOST_NO_IOSTREAM) + /// Start an asynchronous operation to read a certain amount of data from a /// stream. /** @@ -516,6 +522,8 @@ template <typename AsyncReadStream, typename Allocator, void async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b, CompletionCondition completion_condition, ReadHandler handler); +#endif // !defined(BOOST_NO_IOSTREAM) + /*@}*/ } // namespace asio diff --git a/3rdParty/Boost/src/boost/asio/read_at.hpp b/3rdParty/Boost/src/boost/asio/read_at.hpp index 5b1d5ea..133f143 100644 --- a/3rdParty/Boost/src/boost/asio/read_at.hpp +++ b/3rdParty/Boost/src/boost/asio/read_at.hpp @@ -2,7 +2,7 @@ // read_at.hpp // ~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -186,6 +186,8 @@ std::size_t read_at(SyncRandomAccessReadDevice& d, boost::uint64_t offset, const MutableBufferSequence& buffers, CompletionCondition completion_condition, boost::system::error_code& ec); +#if !defined(BOOST_NO_IOSTREAM) + /// Attempt to read a certain amount of data at the specified offset before /// returning. /** @@ -305,6 +307,8 @@ std::size_t read_at(SyncRandomAccessReadDevice& d, boost::uint64_t offset, basic_streambuf<Allocator>& b, CompletionCondition completion_condition, boost::system::error_code& ec); +#endif // !defined(BOOST_NO_IOSTREAM) + /*@}*/ /** * @defgroup async_read_at boost::asio::async_read_at @@ -449,6 +453,8 @@ void async_read_at(AsyncRandomAccessReadDevice& d, boost::uint64_t offset, const MutableBufferSequence& buffers, CompletionCondition completion_condition, ReadHandler handler); +#if !defined(BOOST_NO_IOSTREAM) + /// Start an asynchronous operation to read a certain amount of data at the /// specified offset. /** @@ -558,6 +564,8 @@ void async_read_at(AsyncRandomAccessReadDevice& d, boost::uint64_t offset, basic_streambuf<Allocator>& b, CompletionCondition completion_condition, ReadHandler handler); +#endif // !defined(BOOST_NO_IOSTREAM) + /*@}*/ } // namespace asio diff --git a/3rdParty/Boost/src/boost/asio/read_until.hpp b/3rdParty/Boost/src/boost/asio/read_until.hpp index 6144e60..2f50072 100644 --- a/3rdParty/Boost/src/boost/asio/read_until.hpp +++ b/3rdParty/Boost/src/boost/asio/read_until.hpp @@ -2,7 +2,7 @@ // read_until.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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,8 +18,13 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/asio/detail/push_options.hpp> -#include <cstddef> #include <boost/config.hpp> +#include <boost/asio/detail/pop_options.hpp> + +#if !defined(BOOST_NO_IOSTREAM) + +#include <boost/asio/detail/push_options.hpp> +#include <cstddef> #include <boost/regex.hpp> #include <boost/type_traits/is_function.hpp> #include <boost/type_traits/remove_pointer.hpp> @@ -836,6 +841,8 @@ void async_read_until(AsyncReadStream& s, #include <boost/asio/impl/read_until.ipp> +#endif // !defined(BOOST_NO_IOSTREAM) + #include <boost/asio/detail/pop_options.hpp> #endif // BOOST_ASIO_READ_UNTIL_HPP diff --git a/3rdParty/Boost/src/boost/asio/serial_port.hpp b/3rdParty/Boost/src/boost/asio/serial_port.hpp index 0be39e0..00546e8 100644 --- a/3rdParty/Boost/src/boost/asio/serial_port.hpp +++ b/3rdParty/Boost/src/boost/asio/serial_port.hpp @@ -2,7 +2,7 @@ // serial_port.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/3rdParty/Boost/src/boost/asio/serial_port_base.hpp b/3rdParty/Boost/src/boost/asio/serial_port_base.hpp index 98557cd..5f96639 100644 --- a/3rdParty/Boost/src/boost/asio/serial_port_base.hpp +++ b/3rdParty/Boost/src/boost/asio/serial_port_base.hpp @@ -2,7 +2,7 @@ // serial_port_base.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/3rdParty/Boost/src/boost/asio/serial_port_service.hpp b/3rdParty/Boost/src/boost/asio/serial_port_service.hpp index fe2ce94..3abd244 100644 --- a/3rdParty/Boost/src/boost/asio/serial_port_service.hpp +++ b/3rdParty/Boost/src/boost/asio/serial_port_service.hpp @@ -2,7 +2,7 @@ // serial_port_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/socket_acceptor_service.hpp b/3rdParty/Boost/src/boost/asio/socket_acceptor_service.hpp index ba78746..edca5b7 100644 --- a/3rdParty/Boost/src/boost/asio/socket_acceptor_service.hpp +++ b/3rdParty/Boost/src/boost/asio/socket_acceptor_service.hpp @@ -2,7 +2,7 @@ // socket_acceptor_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -20,12 +20,23 @@ #include <boost/asio/basic_socket.hpp> #include <boost/asio/error.hpp> #include <boost/asio/io_service.hpp> -#include <boost/asio/detail/epoll_reactor.hpp> -#include <boost/asio/detail/kqueue_reactor.hpp> -#include <boost/asio/detail/select_reactor.hpp> #include <boost/asio/detail/service_base.hpp> -#include <boost/asio/detail/reactive_socket_service.hpp> -#include <boost/asio/detail/win_iocp_socket_service.hpp> + +#if defined(BOOST_ASIO_HAS_IOCP) +# include <boost/asio/detail/win_iocp_socket_service.hpp> +#elif defined(BOOST_ASIO_HAS_EPOLL) +# include <boost/asio/detail/epoll_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#elif defined(BOOST_ASIO_HAS_KQUEUE) +# include <boost/asio/detail/kqueue_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#elif defined(BOOST_ASIO_HAS_DEV_POLL) +# include <boost/asio/detail/dev_poll_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#else +# include <boost/asio/detail/select_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#endif namespace boost { namespace asio { diff --git a/3rdParty/Boost/src/boost/asio/socket_base.hpp b/3rdParty/Boost/src/boost/asio/socket_base.hpp index 5a1b675..75015bf 100644 --- a/3rdParty/Boost/src/boost/asio/socket_base.hpp +++ b/3rdParty/Boost/src/boost/asio/socket_base.hpp @@ -2,7 +2,7 @@ // socket_base.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/strand.hpp b/3rdParty/Boost/src/boost/asio/strand.hpp index b130a84..a64d486 100644 --- a/3rdParty/Boost/src/boost/asio/strand.hpp +++ b/3rdParty/Boost/src/boost/asio/strand.hpp @@ -2,7 +2,7 @@ // strand.hpp // ~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -30,6 +30,46 @@ namespace asio { * handlers with the guarantee that none of those handlers will execute * concurrently. * + * @par Order of handler invocation + * Given: + * + * @li a strand object @c s + * + * @li an object @c a meeting completion handler requirements + * + * @li an object @c a1 which is an arbitrary copy of @c a made by the + * implementation + * + * @li an object @c b meeting completion handler requirements + * + * @li an object @c b1 which is an arbitrary copy of @c b made by the + * implementation + * + * if any of the following conditions are true: + * + * @li @c s.post(a) happens-before @c s.post(b) + * + * @li @c s.post(a) happens-before @c s.dispatch(b), where the latter is + * performed outside the strand + * + * @li @c s.dispatch(a) happens-before @c s.post(b), where the former is + * performed outside the strand + * + * @li @c s.dispatch(a) happens-before @c s.dispatch(b), where both are + * performed outside the strand + * + * then @c asio_handler_invoke(a1, &a1) happens-before + * @c asio_handler_invoke(b1, &b1). + * + * Note that in the following case: + * @code async_op_1(..., s.wrap(a)); + * async_op_2(..., s.wrap(b)); @endcode + * the completion of the first async operation will perform @c s.dispatch(a), + * and the second will perform @c s.dispatch(b), but the order in which those + * are performed is unspecified. That is, you cannot state whether one + * happens-before the other. Therefore none of the above conditions are met and + * no ordering guarantee is made. + * * @par Thread Safety * @e Distinct @e objects: Safe.@n * @e Shared @e objects: Safe. diff --git a/3rdParty/Boost/src/boost/asio/stream_socket_service.hpp b/3rdParty/Boost/src/boost/asio/stream_socket_service.hpp index 502c293..6a8dd36 100644 --- a/3rdParty/Boost/src/boost/asio/stream_socket_service.hpp +++ b/3rdParty/Boost/src/boost/asio/stream_socket_service.hpp @@ -2,7 +2,7 @@ // stream_socket_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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,12 +24,23 @@ #include <boost/asio/error.hpp> #include <boost/asio/io_service.hpp> -#include <boost/asio/detail/epoll_reactor.hpp> -#include <boost/asio/detail/kqueue_reactor.hpp> -#include <boost/asio/detail/select_reactor.hpp> #include <boost/asio/detail/service_base.hpp> -#include <boost/asio/detail/win_iocp_socket_service.hpp> -#include <boost/asio/detail/reactive_socket_service.hpp> + +#if defined(BOOST_ASIO_HAS_IOCP) +# include <boost/asio/detail/win_iocp_socket_service.hpp> +#elif defined(BOOST_ASIO_HAS_EPOLL) +# include <boost/asio/detail/epoll_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#elif defined(BOOST_ASIO_HAS_KQUEUE) +# include <boost/asio/detail/kqueue_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#elif defined(BOOST_ASIO_HAS_DEV_POLL) +# include <boost/asio/detail/dev_poll_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#else +# include <boost/asio/detail/select_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#endif namespace boost { namespace asio { diff --git a/3rdParty/Boost/src/boost/asio/streambuf.hpp b/3rdParty/Boost/src/boost/asio/streambuf.hpp index 63c8a41..c112e64 100644 --- a/3rdParty/Boost/src/boost/asio/streambuf.hpp +++ b/3rdParty/Boost/src/boost/asio/streambuf.hpp @@ -2,7 +2,7 @@ // streambuf.hpp // ~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -19,6 +19,8 @@ #include <boost/asio/basic_streambuf.hpp> +#if !defined(BOOST_NO_IOSTREAM) + namespace boost { namespace asio { @@ -28,6 +30,8 @@ typedef basic_streambuf<> streambuf; } // namespace asio } // namespace boost +#endif // !defined(BOOST_NO_IOSTREAM) + #include <boost/asio/detail/pop_options.hpp> #endif // BOOST_ASIO_STREAMBUF_HPP diff --git a/3rdParty/Boost/src/boost/asio/time_traits.hpp b/3rdParty/Boost/src/boost/asio/time_traits.hpp index 097ece4..e0f40ca 100644 --- a/3rdParty/Boost/src/boost/asio/time_traits.hpp +++ b/3rdParty/Boost/src/boost/asio/time_traits.hpp @@ -2,7 +2,7 @@ // time_traits.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -43,7 +43,11 @@ struct time_traits<boost::posix_time::ptime> /// Get the current time. static time_type now() { +#if defined(BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK) return boost::posix_time::microsec_clock::universal_time(); +#else // defined(BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK) + return boost::posix_time::second_clock::universal_time(); +#endif // defined(BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK) } /// Add a duration to a time. diff --git a/3rdParty/Boost/src/boost/asio/version.hpp b/3rdParty/Boost/src/boost/asio/version.hpp index bb10dc7..67e9171 100644 --- a/3rdParty/Boost/src/boost/asio/version.hpp +++ b/3rdParty/Boost/src/boost/asio/version.hpp @@ -2,7 +2,7 @@ // version.hpp // ~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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,6 @@ // BOOST_ASIO_VERSION % 100 is the sub-minor version // BOOST_ASIO_VERSION / 100 % 1000 is the minor version // BOOST_ASIO_VERSION / 100000 is the major version -#define BOOST_ASIO_VERSION 100402 // 1.4.2 +#define BOOST_ASIO_VERSION 100404 // 1.4.4 #endif // BOOST_ASIO_VERSION_HPP diff --git a/3rdParty/Boost/src/boost/asio/windows/basic_handle.hpp b/3rdParty/Boost/src/boost/asio/windows/basic_handle.hpp index 96a7b90..7bbdb0d 100644 --- a/3rdParty/Boost/src/boost/asio/windows/basic_handle.hpp +++ b/3rdParty/Boost/src/boost/asio/windows/basic_handle.hpp @@ -2,7 +2,7 @@ // basic_handle.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/windows/basic_random_access_handle.hpp b/3rdParty/Boost/src/boost/asio/windows/basic_random_access_handle.hpp index d6b63b1..06239df 100644 --- a/3rdParty/Boost/src/boost/asio/windows/basic_random_access_handle.hpp +++ b/3rdParty/Boost/src/boost/asio/windows/basic_random_access_handle.hpp @@ -2,7 +2,7 @@ // basic_random_access_handle.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/windows/basic_stream_handle.hpp b/3rdParty/Boost/src/boost/asio/windows/basic_stream_handle.hpp index aaa8448..329cc6f 100644 --- a/3rdParty/Boost/src/boost/asio/windows/basic_stream_handle.hpp +++ b/3rdParty/Boost/src/boost/asio/windows/basic_stream_handle.hpp @@ -2,7 +2,7 @@ // basic_stream_handle.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/windows/overlapped_ptr.hpp b/3rdParty/Boost/src/boost/asio/windows/overlapped_ptr.hpp index e97c16e..5880272 100644 --- a/3rdParty/Boost/src/boost/asio/windows/overlapped_ptr.hpp +++ b/3rdParty/Boost/src/boost/asio/windows/overlapped_ptr.hpp @@ -2,7 +2,7 @@ // overlapped_ptr.hpp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/windows/random_access_handle.hpp b/3rdParty/Boost/src/boost/asio/windows/random_access_handle.hpp index 38e79e9..7707aac 100644 --- a/3rdParty/Boost/src/boost/asio/windows/random_access_handle.hpp +++ b/3rdParty/Boost/src/boost/asio/windows/random_access_handle.hpp @@ -2,7 +2,7 @@ // random_access_handle.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/windows/random_access_handle_service.hpp b/3rdParty/Boost/src/boost/asio/windows/random_access_handle_service.hpp index 3b11223..fbbde67 100644 --- a/3rdParty/Boost/src/boost/asio/windows/random_access_handle_service.hpp +++ b/3rdParty/Boost/src/boost/asio/windows/random_access_handle_service.hpp @@ -2,7 +2,7 @@ // random_access_handle_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/windows/stream_handle.hpp b/3rdParty/Boost/src/boost/asio/windows/stream_handle.hpp index b247197..8e9e467 100644 --- a/3rdParty/Boost/src/boost/asio/windows/stream_handle.hpp +++ b/3rdParty/Boost/src/boost/asio/windows/stream_handle.hpp @@ -2,7 +2,7 @@ // stream_handle.hpp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/windows/stream_handle_service.hpp b/3rdParty/Boost/src/boost/asio/windows/stream_handle_service.hpp index 29cdc95..c2224e4 100644 --- a/3rdParty/Boost/src/boost/asio/windows/stream_handle_service.hpp +++ b/3rdParty/Boost/src/boost/asio/windows/stream_handle_service.hpp @@ -2,7 +2,7 @@ // stream_handle_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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/3rdParty/Boost/src/boost/asio/write.hpp b/3rdParty/Boost/src/boost/asio/write.hpp index 61d59a0..2b9d4b7 100644 --- a/3rdParty/Boost/src/boost/asio/write.hpp +++ b/3rdParty/Boost/src/boost/asio/write.hpp @@ -2,7 +2,7 @@ // write.hpp // ~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -169,6 +169,8 @@ template <typename SyncWriteStream, typename ConstBufferSequence, std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, CompletionCondition completion_condition, boost::system::error_code& ec); +#if !defined(BOOST_NO_IOSTREAM) + /// Write all of the supplied data to a stream before returning. /** * This function is used to write a certain number of bytes of data to a stream. @@ -279,6 +281,8 @@ template <typename SyncWriteStream, typename Allocator, std::size_t write(SyncWriteStream& s, basic_streambuf<Allocator>& b, CompletionCondition completion_condition, boost::system::error_code& ec); +#endif // !defined(BOOST_NO_IOSTREAM) + /*@}*/ /** * @defgroup async_write boost::asio::async_write @@ -411,6 +415,8 @@ template <typename AsyncWriteStream, typename ConstBufferSequence, void async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers, CompletionCondition completion_condition, WriteHandler handler); +#if !defined(BOOST_NO_IOSTREAM) + /// Start an asynchronous operation to write all of the supplied data to a /// stream. /** @@ -510,6 +516,8 @@ template <typename AsyncWriteStream, typename Allocator, void async_write(AsyncWriteStream& s, basic_streambuf<Allocator>& b, CompletionCondition completion_condition, WriteHandler handler); +#endif // !defined(BOOST_NO_IOSTREAM) + /*@}*/ } // namespace asio diff --git a/3rdParty/Boost/src/boost/asio/write_at.hpp b/3rdParty/Boost/src/boost/asio/write_at.hpp index 85efbc2..74f080a 100644 --- a/3rdParty/Boost/src/boost/asio/write_at.hpp +++ b/3rdParty/Boost/src/boost/asio/write_at.hpp @@ -2,7 +2,7 @@ // write_at.hpp // ~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 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) @@ -182,6 +182,8 @@ std::size_t write_at(SyncRandomAccessWriteDevice& d, boost::uint64_t offset, const ConstBufferSequence& buffers, CompletionCondition completion_condition, boost::system::error_code& ec); +#if !defined(BOOST_NO_IOSTREAM) + /// Write all of the supplied data at the specified offset before returning. /** * This function is used to write a certain number of bytes of data to a random @@ -303,6 +305,8 @@ std::size_t write_at(SyncRandomAccessWriteDevice& d, boost::uint64_t offset, basic_streambuf<Allocator>& b, CompletionCondition completion_condition, boost::system::error_code& ec); +#endif // !defined(BOOST_NO_IOSTREAM) + /*@}*/ /** * @defgroup async_write_at boost::asio::async_write_at @@ -440,6 +444,8 @@ void async_write_at(AsyncRandomAccessWriteDevice& d, boost::uint64_t offset, const ConstBufferSequence& buffers, CompletionCondition completion_condition, WriteHandler handler); +#if !defined(BOOST_NO_IOSTREAM) + /// Start an asynchronous operation to write all of the supplied data at the /// specified offset. /** @@ -545,6 +551,8 @@ void async_write_at(AsyncRandomAccessWriteDevice& d, boost::uint64_t offset, basic_streambuf<Allocator>& b, CompletionCondition completion_condition, WriteHandler handler); +#endif // !defined(BOOST_NO_IOSTREAM) + /*@}*/ } // namespace asio |