|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r69680 - in branches/release: boost/asio boost/asio/detail boost/asio/detail/impl libs/asio/doc
From: chris_at_[hidden]
Date: 2011-03-08 06:07:07
Author: chris_kohlhoff
Date: 2011-03-08 06:07:01 EST (Tue, 08 Mar 2011)
New Revision: 69680
URL: http://svn.boost.org/trac/boost/changeset/69680
Log:
Merge selected bug fixes from trunk:
* Fixed a compile error on some versions of g++ due to anonymous enums.
Fixes #4883.
* Fixed a bug in asio::streambuf where the consume() function did not
always update the internal buffer pointers correctly. The problem may
occur when the asio::streambuf is filled with data using the standard
C++ member functions such as sputn(). (Note: the problem does not
manifest when the streambuf is populated by the Asio free functions
read(), async_read(), read_until() or async_read_until().)
* EV_ONESHOT seems to cause problems on some versions of Mac OS X, with
the io_service destructor getting stuck inside the close() system
call. Use EV_CLEAR instead. Fixes #5021.
* Fixed a bug on kqueue-based platforms, where reactor read operations
that return false from their perform() function are not correctly
re-registered with kqueue.
* Fixed the linger socket option on non-Windows platforms.
* Fixed function name in comment for asio::placeholders::iterator.
Text files modified:
branches/release/boost/asio/basic_streambuf.hpp | 2 ++
branches/release/boost/asio/detail/dev_poll_reactor.hpp | 2 +-
branches/release/boost/asio/detail/epoll_reactor.hpp | 2 +-
branches/release/boost/asio/detail/impl/kqueue_reactor.ipp | 24 +++++++++++++-----------
branches/release/boost/asio/detail/impl/reactive_socket_service_base.ipp | 2 +-
branches/release/boost/asio/detail/select_reactor.hpp | 4 ++--
branches/release/boost/asio/placeholders.hpp | 2 +-
branches/release/boost/asio/version.hpp | 2 +-
branches/release/libs/asio/doc/history.qbk | 21 +++++++++++++++++++--
9 files changed, 41 insertions(+), 20 deletions(-)
Modified: branches/release/boost/asio/basic_streambuf.hpp
==============================================================================
--- branches/release/boost/asio/basic_streambuf.hpp (original)
+++ branches/release/boost/asio/basic_streambuf.hpp 2011-03-08 06:07:01 EST (Tue, 08 Mar 2011)
@@ -237,6 +237,8 @@
*/
void consume(std::size_t n)
{
+ if (egptr() < pptr())
+ setg(&buffer_[0], gptr(), pptr());
if (gptr() + n > pptr())
n = pptr() - gptr();
gbump(static_cast<int>(n));
Modified: branches/release/boost/asio/detail/dev_poll_reactor.hpp
==============================================================================
--- branches/release/boost/asio/detail/dev_poll_reactor.hpp (original)
+++ branches/release/boost/asio/detail/dev_poll_reactor.hpp 2011-03-08 06:07:01 EST (Tue, 08 Mar 2011)
@@ -46,7 +46,7 @@
: public boost::asio::detail::service_base<dev_poll_reactor>
{
public:
- enum { read_op = 0, write_op = 1,
+ enum op_types { read_op = 0, write_op = 1,
connect_op = 1, except_op = 2, max_ops = 3 };
// Per-descriptor data.
Modified: branches/release/boost/asio/detail/epoll_reactor.hpp
==============================================================================
--- branches/release/boost/asio/detail/epoll_reactor.hpp (original)
+++ branches/release/boost/asio/detail/epoll_reactor.hpp 2011-03-08 06:07:01 EST (Tue, 08 Mar 2011)
@@ -42,7 +42,7 @@
: public boost::asio::detail::service_base<epoll_reactor>
{
public:
- enum { read_op = 0, write_op = 1,
+ enum op_types { read_op = 0, write_op = 1,
connect_op = 1, except_op = 2, max_ops = 3 };
// Per-descriptor queues.
Modified: branches/release/boost/asio/detail/impl/kqueue_reactor.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/kqueue_reactor.ipp (original)
+++ branches/release/boost/asio/detail/impl/kqueue_reactor.ipp 2011-03-08 06:07:01 EST (Tue, 08 Mar 2011)
@@ -47,9 +47,9 @@
interrupter_(),
shutdown_(false)
{
- // The interrupter is put into a permanently readable state. Whenever we
- // want to interrupt the blocked kevent call we register a one-shot read
- // operation against the descriptor.
+ // The interrupter is put into a permanently readable state. Whenever we want
+ // to interrupt the blocked kevent call we register a read operation against
+ // the descriptor.
interrupter_.interrupt();
}
@@ -139,17 +139,17 @@
{
case read_op:
BOOST_ASIO_KQUEUE_EV_SET(&event, descriptor, EVFILT_READ,
- EV_ADD | EV_ONESHOT, 0, 0, descriptor_data);
+ EV_ADD | EV_CLEAR, 0, 0, descriptor_data);
break;
case write_op:
BOOST_ASIO_KQUEUE_EV_SET(&event, descriptor, EVFILT_WRITE,
- EV_ADD | EV_ONESHOT, 0, 0, descriptor_data);
+ EV_ADD | EV_CLEAR, 0, 0, descriptor_data);
break;
case except_op:
if (!descriptor_data->op_queue_[read_op].empty())
return; // Already registered for read events.
BOOST_ASIO_KQUEUE_EV_SET(&event, descriptor, EVFILT_READ,
- EV_ADD | EV_ONESHOT, EV_OOBAND, 0, descriptor_data);
+ EV_ADD | EV_CLEAR, EV_OOBAND, 0, descriptor_data);
break;
}
@@ -247,7 +247,7 @@
if (ptr == &interrupter_)
{
// No need to reset the interrupter since we're leaving the descriptor
- // in a ready-to-read state and relying on one-shot notifications.
+ // in a ready-to-read state and relying on edge-triggered notifications.
}
else
{
@@ -296,18 +296,20 @@
case EVFILT_READ:
if (!descriptor_data->op_queue_[read_op].empty())
BOOST_ASIO_KQUEUE_EV_SET(&event, descriptor, EVFILT_READ,
- EV_ADD | EV_ONESHOT, 0, 0, descriptor_data);
+ EV_ADD | EV_CLEAR, 0, 0, descriptor_data);
else if (!descriptor_data->op_queue_[except_op].empty())
BOOST_ASIO_KQUEUE_EV_SET(&event, descriptor, EVFILT_READ,
- EV_ADD | EV_ONESHOT, EV_OOBAND, 0, descriptor_data);
+ EV_ADD | EV_CLEAR, EV_OOBAND, 0, descriptor_data);
else
continue;
+ break;
case EVFILT_WRITE:
if (!descriptor_data->op_queue_[write_op].empty())
BOOST_ASIO_KQUEUE_EV_SET(&event, descriptor, EVFILT_WRITE,
- EV_ADD | EV_ONESHOT, 0, 0, descriptor_data);
+ EV_ADD | EV_CLEAR, 0, 0, descriptor_data);
else
continue;
+ break;
default:
break;
}
@@ -336,7 +338,7 @@
{
struct kevent event;
BOOST_ASIO_KQUEUE_EV_SET(&event, interrupter_.read_descriptor(),
- EVFILT_READ, EV_ADD | EV_ONESHOT, 0, 0, &interrupter_);
+ EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, &interrupter_);
::kevent(kqueue_fd_, &event, 1, 0, 0, 0);
}
Modified: branches/release/boost/asio/detail/impl/reactive_socket_service_base.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/reactive_socket_service_base.ipp (original)
+++ branches/release/boost/asio/detail/impl/reactive_socket_service_base.ipp 2011-03-08 06:07:01 EST (Tue, 08 Mar 2011)
@@ -64,7 +64,7 @@
if (is_open(impl))
reactor_.close_descriptor(impl.socket_, impl.reactor_data_);
- if (socket_ops::close(impl.socket_, impl.state_, true, ec) == 0)
+ if (socket_ops::close(impl.socket_, impl.state_, false, ec) == 0)
construct(impl);
return ec;
Modified: branches/release/boost/asio/detail/select_reactor.hpp
==============================================================================
--- branches/release/boost/asio/detail/select_reactor.hpp (original)
+++ branches/release/boost/asio/detail/select_reactor.hpp 2011-03-08 06:07:01 EST (Tue, 08 Mar 2011)
@@ -51,10 +51,10 @@
{
public:
#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
- enum { read_op = 0, write_op = 1, except_op = 2,
+ enum op_types { read_op = 0, write_op = 1, except_op = 2,
max_select_ops = 3, connect_op = 3, max_ops = 4 };
#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
- enum { read_op = 0, write_op = 1, except_op = 2,
+ enum op_types { read_op = 0, write_op = 1, except_op = 2,
max_select_ops = 3, connect_op = 1, max_ops = 3 };
#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
Modified: branches/release/boost/asio/placeholders.hpp
==============================================================================
--- branches/release/boost/asio/placeholders.hpp (original)
+++ branches/release/boost/asio/placeholders.hpp 2011-03-08 06:07:01 EST (Tue, 08 Mar 2011)
@@ -39,7 +39,7 @@
/// An argument placeholder, for use with boost::bind(), that corresponds to
/// the iterator argument of a handler for asynchronous functions such as
-/// boost::asio::basic_resolver::resolve.
+/// boost::asio::basic_resolver::async_resolve.
unspecified iterator;
#elif defined(__BORLANDC__) || defined(__GNUC__)
Modified: branches/release/boost/asio/version.hpp
==============================================================================
--- branches/release/boost/asio/version.hpp (original)
+++ branches/release/boost/asio/version.hpp 2011-03-08 06:07:01 EST (Tue, 08 Mar 2011)
@@ -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 100408 // 1.4.8
+#define BOOST_ASIO_VERSION 100409 // 1.4.9
#endif // BOOST_ASIO_VERSION_HPP
Modified: branches/release/libs/asio/doc/history.qbk
==============================================================================
--- branches/release/libs/asio/doc/history.qbk (original)
+++ branches/release/libs/asio/doc/history.qbk 2011-03-08 06:07:01 EST (Tue, 08 Mar 2011)
@@ -7,10 +7,27 @@
[section:history Revision History]
+[heading Asio 1.4.9 / Boost 1.46.1]
+
+* `EV_ONESHOT` seems to cause problems on some versions of Mac OS X, with the
+ `io_service` destructor getting stuck inside the `close()` system call.
+ Changed the kqueue backend to use `EV_CLEAR` instead
+ ([@https://svn.boost.org/trac/boost/ticket/5021 #5021]).
+* Fixed compile failures with some versions of [^g++] due to the use of
+ anonymous enums ([@https://svn.boost.org/trac/boost/ticket/4883 #4883]).
+* Fixed a bug on kqueue-based platforms, where some system calls that
+ repeatedly fail with `EWOULDBLOCK` are not correctly re-registered with
+ kqueue.
+* Changed `asio::streambuf` to ensure that its internal pointers are updated
+ correctly after the data has been modified using `std::streambuf` member
+ functions.
+* Fixed a bug that prevented the linger socket option from working on platforms
+ other than Windows.
+
[heading Asio 1.4.8 / Boost 1.46]
-* Fixed an integer overflow problem that occurs when `ip::address_v4::netmask()`
- is used on 64-bit platforms.
+* Fixed an integer overflow problem that occurs when
+ `ip::address_v4::broadcast()` is used on 64-bit platforms.
* Fixed a problem on older Linux kernels (where epoll is used without timerfd
support) that prevents timely delivery of deadline_timer handlers, after the
program has been running for some time
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk