diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-04-11 18:19:17 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-04-11 19:20:07 (GMT) |
commit | 857e44c156a1dbefcb49bb5792c4384cebd8762a (patch) | |
tree | 11947fb81ad9c502627f1b2bb8f090fb8d53c107 /3rdParty/Boost/src/boost/asio/detail/reactive_descriptor_service.hpp | |
parent | 77d4eb7588e113beaa03f3347523b26adefdeb06 (diff) | |
download | swift-857e44c156a1dbefcb49bb5792c4384cebd8762a.zip swift-857e44c156a1dbefcb49bb5792c4384cebd8762a.tar.bz2 |
Updated Boost to 1.42.
Diffstat (limited to '3rdParty/Boost/src/boost/asio/detail/reactive_descriptor_service.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/asio/detail/reactive_descriptor_service.hpp | 52 |
1 files changed, 33 insertions, 19 deletions
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, |