$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r82290 - in branches/release: boost/asio boost/asio/detail boost/asio/detail/impl boost/asio/impl boost/asio/ip/detail/impl boost/asio/ip/impl boost/asio/ssl boost/asio/ssl/detail boost/asio/ssl/detail/impl boost/asio/ssl/impl boost/asio/ssl/old/detail boost/asio/windows libs/asio/doc libs/asio/example/local
From: chris_at_[hidden]
Date: 2012-12-30 18:17:20
Author: chris_kohlhoff
Date: 2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
New Revision: 82290
URL: http://svn.boost.org/trac/boost/changeset/82290
Log:
Merge from trunk:
* Fix some 64-to-32-bit conversion warnings. Fixes #7459
* Fix typos in comments. Fixes #7761
* Fix error in example embedded in basic_socket::get_option's documentation. Fixes #7562
* Use long rather than int for SSL_CTX options, to match OpenSSL. Fixes #7209
* Use _snwprintf to address a compile error due to the changed swprintf signature in recent versions of MinGW. Fixes #7373
* Fix deadlock that can occur on Windows when shutting down a pool of io_service threads due to running out of work. Fixes #7552
* Enable noexcept qualifier for error categories. Fixes #7797
* Treat errors from accept as non-fatal. Fixes #7488
* Add a small block recycling optimisation.
* Version bump.
* Regenerate documentation.
Added:
   branches/release/boost/asio/detail/task_io_service_thread_info.hpp   (contents, props changed)
   branches/release/boost/asio/detail/thread_info_base.hpp   (contents, props changed)
   branches/release/boost/asio/detail/win_iocp_thread_info.hpp   (contents, props changed)
   branches/release/boost/asio/impl/handler_alloc_hook.ipp   (contents, props changed)
Text files modified: 
   branches/release/boost/asio/basic_socket.hpp                        |     4 +-                                      
   branches/release/boost/asio/detail/call_stack.hpp                   |     7 +++                                     
   branches/release/boost/asio/detail/config.hpp                       |    13 ++++++                                  
   branches/release/boost/asio/detail/descriptor_ops.hpp               |     4 +-                                      
   branches/release/boost/asio/detail/impl/descriptor_ops.ipp          |    16 +++++---                                
   branches/release/boost/asio/detail/impl/kqueue_reactor.ipp          |     5 +-                                      
   branches/release/boost/asio/detail/impl/pipe_select_interrupter.ipp |     5 +-                                      
   branches/release/boost/asio/detail/impl/posix_event.ipp             |     1                                         
   branches/release/boost/asio/detail/impl/signal_set_service.ipp      |     2                                         
   branches/release/boost/asio/detail/impl/socket_ops.ipp              |    74 ++++++++++++++++++++++----------------- 
   branches/release/boost/asio/detail/impl/task_io_service.ipp         |     9 ----                                    
   branches/release/boost/asio/detail/impl/win_iocp_io_service.hpp     |     2                                         
   branches/release/boost/asio/detail/impl/win_iocp_io_service.ipp     |    52 +++++++++++++++++----------             
   branches/release/boost/asio/detail/impl/win_static_mutex.ipp        |     6 +-                                      
   branches/release/boost/asio/detail/socket_ops.hpp                   |    23 ++++++-----                             
   branches/release/boost/asio/detail/socket_types.hpp                 |     6 +++                                     
   branches/release/boost/asio/detail/task_io_service.hpp              |     2                                         
   branches/release/boost/asio/detail/task_io_service_fwd.hpp          |     2 +                                       
   branches/release/boost/asio/detail/win_iocp_io_service.hpp          |    12 +++++                                   
   branches/release/boost/asio/detail/win_iocp_socket_service_base.hpp |     2                                         
   branches/release/boost/asio/handler_alloc_hook.hpp                  |    29 ++++++---------                         
   branches/release/boost/asio/impl/error.ipp                          |     6 +-                                      
   branches/release/boost/asio/impl/src.hpp                            |     1                                         
   branches/release/boost/asio/ip/detail/impl/endpoint.ipp             |     7 ++-                                     
   branches/release/boost/asio/ip/impl/address_v4.ipp                  |     3 +                                       
   branches/release/boost/asio/ssl/context_base.hpp                    |    22 +++++-----                              
   branches/release/boost/asio/ssl/detail/impl/engine.ipp              |    15 ++++---                                 
   branches/release/boost/asio/ssl/detail/stream_core.hpp              |     2                                         
   branches/release/boost/asio/ssl/impl/context.ipp                    |    31 ++++++++++-----                         
   branches/release/boost/asio/ssl/impl/error.ipp                      |     2                                         
   branches/release/boost/asio/ssl/old/detail/openssl_operation.hpp    |     2                                         
   branches/release/boost/asio/version.hpp                             |     2                                         
   branches/release/boost/asio/windows/basic_random_access_handle.hpp  |     2                                         
   branches/release/libs/asio/doc/reference.qbk                        |    64 ++++++++++++++--------------------      
   branches/release/libs/asio/example/local/stream_server.cpp          |     9 ++--                                    
   35 files changed, 253 insertions(+), 191 deletions(-)
Modified: branches/release/boost/asio/basic_socket.hpp
==============================================================================
--- branches/release/boost/asio/basic_socket.hpp	(original)
+++ branches/release/boost/asio/basic_socket.hpp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -843,7 +843,7 @@
    * ...
    * boost::asio::ip::tcp::socket::keep_alive option;
    * socket.get_option(option);
-   * bool is_set = option.get();
+   * bool is_set = option.value();
    * @endcode
    */
   template <typename GettableSocketOption>
@@ -891,7 +891,7 @@
    * {
    *   // An error occurred.
    * }
-   * bool is_set = option.get();
+   * bool is_set = option.value();
    * @endcode
    */
   template <typename GettableSocketOption>
Modified: branches/release/boost/asio/detail/call_stack.hpp
==============================================================================
--- branches/release/boost/asio/detail/call_stack.hpp	(original)
+++ branches/release/boost/asio/detail/call_stack.hpp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -102,6 +102,13 @@
     return 0;
   }
 
+  // Obtain the value at the top of the stack.
+  static Value* top()
+  {
+    context* elem = top_;
+    return elem ? elem->value_ : 0;
+  }
+
 private:
   // The top of the stack of calls for the current thread.
   static tss_ptr<context> top_;
Modified: branches/release/boost/asio/detail/config.hpp
==============================================================================
--- branches/release/boost/asio/detail/config.hpp	(original)
+++ branches/release/boost/asio/detail/config.hpp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -114,7 +114,9 @@
 
 // Compliant C++11 compilers put noexcept specifiers on error_category members.
 #if !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
-# if defined(__GNUC__)
+# if (BOOST_VERSION >= 105300)
+#  define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT BOOST_NOEXCEPT
+# elif defined(__GNUC__)
 #  if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
 #   if defined(__GXX_EXPERIMENTAL_CXX0X__)
 #     define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
@@ -386,4 +388,13 @@
 # endif // defined(__linux__)
 #endif // !defined(BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
 
+// Support for POSIX ssize_t typedef.
+#if !defined(BOOST_ASIO_DISABLE_SSIZE_T)
+# if defined(__linux__) \
+   || (defined(__MACH__) && defined(__APPLE__))
+#  define BOOST_ASIO_HAS_SSIZE_T 1
+# endif // defined(__linux__)
+        //   || (defined(__MACH__) && defined(__APPLE__))
+#endif // !defined(BOOST_ASIO_DISABLE_SSIZE_T)
+
 #endif // BOOST_ASIO_DETAIL_CONFIG_HPP
Modified: branches/release/boost/asio/detail/descriptor_ops.hpp
==============================================================================
--- branches/release/boost/asio/detail/descriptor_ops.hpp	(original)
+++ branches/release/boost/asio/detail/descriptor_ops.hpp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -88,9 +88,9 @@
 BOOST_ASIO_DECL int ioctl(int d, state_type& state, long cmd,
     ioctl_arg_type* arg, boost::system::error_code& ec);
 
-BOOST_ASIO_DECL int fcntl(int d, long cmd, boost::system::error_code& ec);
+BOOST_ASIO_DECL int fcntl(int d, int cmd, boost::system::error_code& ec);
 
-BOOST_ASIO_DECL int fcntl(int d, long cmd,
+BOOST_ASIO_DECL int fcntl(int d, int cmd,
     long arg, boost::system::error_code& ec);
 
 BOOST_ASIO_DECL int poll_read(int d,
Modified: branches/release/boost/asio/detail/impl/descriptor_ops.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/descriptor_ops.ipp	(original)
+++ branches/release/boost/asio/detail/impl/descriptor_ops.ipp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -183,7 +183,8 @@
   {
     // Try to complete the operation without blocking.
     errno = 0;
-    int bytes = error_wrapper(::readv(d, bufs, static_cast<int>(count)), ec);
+    signed_size_type bytes = error_wrapper(::readv(
+          d, bufs, static_cast<int>(count)), ec);
 
     // Check if operation succeeded.
     if (bytes > 0)
@@ -215,7 +216,8 @@
   {
     // Read some data.
     errno = 0;
-    int bytes = error_wrapper(::readv(d, bufs, static_cast<int>(count)), ec);
+    signed_size_type bytes = error_wrapper(::readv(
+          d, bufs, static_cast<int>(count)), ec);
 
     // Check for end of stream.
     if (bytes == 0)
@@ -267,7 +269,8 @@
   {
     // Try to complete the operation without blocking.
     errno = 0;
-    int bytes = error_wrapper(::writev(d, bufs, static_cast<int>(count)), ec);
+    signed_size_type bytes = error_wrapper(::writev(
+          d, bufs, static_cast<int>(count)), ec);
 
     // Check if operation succeeded.
     if (bytes > 0)
@@ -292,7 +295,8 @@
   {
     // Write some data.
     errno = 0;
-    int bytes = error_wrapper(::writev(d, bufs, static_cast<int>(count)), ec);
+    signed_size_type bytes = error_wrapper(::writev(
+          d, bufs, static_cast<int>(count)), ec);
 
     // Retry operation if interrupted by signal.
     if (ec == boost::asio::error::interrupted)
@@ -357,7 +361,7 @@
   return result;
 }
 
-int fcntl(int d, long cmd, boost::system::error_code& ec)
+int fcntl(int d, int cmd, boost::system::error_code& ec)
 {
   if (d == -1)
   {
@@ -372,7 +376,7 @@
   return result;
 }
 
-int fcntl(int d, long cmd, long arg, boost::system::error_code& ec)
+int fcntl(int d, int cmd, long arg, boost::system::error_code& ec)
 {
   if (d == -1)
   {
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	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -367,7 +367,7 @@
   // Dispatch the waiting events.
   for (int i = 0; i < num_events; ++i)
   {
-    int descriptor = events[i].ident;
+    int descriptor = static_cast<int>(events[i].ident);
     void* ptr = reinterpret_cast<void*>(events[i].udata);
     if (ptr == &interrupter_)
     {
@@ -397,7 +397,8 @@
             {
               if (events[i].flags & EV_ERROR)
               {
-                op->ec_ = boost::system::error_code(events[i].data,
+                op->ec_ = boost::system::error_code(
+                    static_cast<int>(events[i].data),
                     boost::asio::error::get_system_category());
                 descriptor_data->op_queue_[j].pop();
                 ops.push(op);
Modified: branches/release/boost/asio/detail/impl/pipe_select_interrupter.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/pipe_select_interrupter.ipp	(original)
+++ branches/release/boost/asio/detail/impl/pipe_select_interrupter.ipp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -27,6 +27,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 #include <boost/asio/detail/pipe_select_interrupter.hpp>
+#include <boost/asio/detail/socket_types.hpp>
 #include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/error.hpp>
 
@@ -90,7 +91,7 @@
 void pipe_select_interrupter::interrupt()
 {
   char byte = 0;
-  int result = ::write(write_descriptor_, &byte, 1);
+  signed_size_type result = ::write(write_descriptor_, &byte, 1);
   (void)result;
 }
 
@@ -99,7 +100,7 @@
   for (;;)
   {
     char data[1024];
-    int bytes_read = ::read(read_descriptor_, data, sizeof(data));
+    signed_size_type bytes_read = ::read(read_descriptor_, data, sizeof(data));
     if (bytes_read < 0 && errno == EINTR)
       continue;
     bool was_interrupted = (bytes_read > 0);
Modified: branches/release/boost/asio/detail/impl/posix_event.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/posix_event.ipp	(original)
+++ branches/release/boost/asio/detail/impl/posix_event.ipp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -21,6 +21,7 @@
 
 #include <boost/asio/detail/posix_event.hpp>
 #include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/error.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
 
Modified: branches/release/boost/asio/detail/impl/signal_set_service.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/signal_set_service.ipp	(original)
+++ branches/release/boost/asio/detail/impl/signal_set_service.ipp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -64,7 +64,7 @@
 #else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
   int saved_errno = errno;
   signal_state* state = get_signal_state();
-  int result = ::write(state->write_descriptor_,
+  signed_size_type result = ::write(state->write_descriptor_,
       &signal_number, sizeof(signal_number));
   (void)result;
   errno = saved_errno;
Modified: branches/release/boost/asio/detail/impl/socket_ops.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/socket_ops.ipp	(original)
+++ branches/release/boost/asio/detail/impl/socket_ops.ipp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -670,8 +670,8 @@
   name = reinterpret_cast<T>(const_cast<socket_addr_type*>(addr));
 }
 
-int recv(socket_type s, buf* bufs, size_t count, int flags,
-    boost::system::error_code& ec)
+signed_size_type recv(socket_type s, buf* bufs, size_t count,
+    int flags, boost::system::error_code& ec)
 {
   clear_last_error();
 #if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
@@ -692,8 +692,8 @@
 #else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
   msghdr msg = msghdr();
   msg.msg_iov = bufs;
-  msg.msg_iovlen = count;
-  int result = error_wrapper(::recvmsg(s, &msg, flags), ec);
+  msg.msg_iovlen = static_cast<int>(count);
+  signed_size_type result = error_wrapper(::recvmsg(s, &msg, flags), ec);
   if (result >= 0)
     ec = boost::system::error_code();
   return result;
@@ -720,7 +720,7 @@
   for (;;)
   {
     // Try to complete the operation without blocking.
-    int bytes = socket_ops::recv(s, bufs, count, flags, ec);
+    signed_size_type bytes = socket_ops::recv(s, bufs, count, flags, ec);
 
     // Check if operation succeeded.
     if (bytes > 0)
@@ -782,7 +782,7 @@
   for (;;)
   {
     // Read some data.
-    int bytes = socket_ops::recv(s, bufs, count, flags, ec);
+    signed_size_type bytes = socket_ops::recv(s, bufs, count, flags, ec);
 
     // Check for end of stream.
     if (is_stream && bytes == 0)
@@ -815,8 +815,8 @@
 
 #endif // defined(BOOST_ASIO_HAS_IOCP)
 
-int recvfrom(socket_type s, buf* bufs, size_t count, int flags,
-    socket_addr_type* addr, std::size_t* addrlen,
+signed_size_type recvfrom(socket_type s, buf* bufs, size_t count,
+    int flags, socket_addr_type* addr, std::size_t* addrlen,
     boost::system::error_code& ec)
 {
   clear_last_error();
@@ -840,10 +840,10 @@
 #else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
   msghdr msg = msghdr();
   init_msghdr_msg_name(msg.msg_name, addr);
-  msg.msg_namelen = *addrlen;
+  msg.msg_namelen = static_cast<int>(*addrlen);
   msg.msg_iov = bufs;
-  msg.msg_iovlen = count;
-  int result = error_wrapper(::recvmsg(s, &msg, flags), ec);
+  msg.msg_iovlen = static_cast<int>(count);
+  signed_size_type result = error_wrapper(::recvmsg(s, &msg, flags), ec);
   *addrlen = msg.msg_namelen;
   if (result >= 0)
     ec = boost::system::error_code();
@@ -865,7 +865,8 @@
   for (;;)
   {
     // Try to complete the operation without blocking.
-    int bytes = socket_ops::recvfrom(s, bufs, count, flags, addr, addrlen, ec);
+    signed_size_type bytes = socket_ops::recvfrom(
+        s, bufs, count, flags, addr, addrlen, ec);
 
     // Check if operation succeeded.
     if (bytes >= 0)
@@ -913,7 +914,8 @@
   for (;;)
   {
     // Read some data.
-    int bytes = socket_ops::recvfrom(s, bufs, count, flags, addr, addrlen, ec);
+    signed_size_type bytes = socket_ops::recvfrom(
+        s, bufs, count, flags, addr, addrlen, ec);
 
     // Retry operation if interrupted by signal.
     if (ec == boost::asio::error::interrupted)
@@ -939,7 +941,7 @@
 
 #endif // defined(BOOST_ASIO_HAS_IOCP)
 
-int recvmsg(socket_type s, buf* bufs, size_t count,
+signed_size_type recvmsg(socket_type s, buf* bufs, size_t count,
     int in_flags, int& out_flags, boost::system::error_code& ec)
 {
   clear_last_error();
@@ -949,8 +951,8 @@
 #else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
   msghdr msg = msghdr();
   msg.msg_iov = bufs;
-  msg.msg_iovlen = count;
-  int result = error_wrapper(::recvmsg(s, &msg, in_flags), ec);
+  msg.msg_iovlen = static_cast<int>(count);
+  signed_size_type result = error_wrapper(::recvmsg(s, &msg, in_flags), ec);
   if (result >= 0)
   {
     ec = boost::system::error_code();
@@ -976,7 +978,8 @@
   for (;;)
   {
     // Try to complete the operation without blocking.
-    int bytes = socket_ops::recvmsg(s, bufs, count, in_flags, out_flags, ec);
+    signed_size_type bytes = socket_ops::recvmsg(
+        s, bufs, count, in_flags, out_flags, ec);
 
     // Check if operation succeeded.
     if (bytes >= 0)
@@ -1023,7 +1026,8 @@
   for (;;)
   {
     // Read some data.
-    int bytes = socket_ops::recvmsg(s, bufs, count, in_flags, out_flags, ec);
+    signed_size_type bytes = socket_ops::recvmsg(
+        s, bufs, count, in_flags, out_flags, ec);
 
     // Retry operation if interrupted by signal.
     if (ec == boost::asio::error::interrupted)
@@ -1049,8 +1053,8 @@
 
 #endif // defined(BOOST_ASIO_HAS_IOCP)
 
-int send(socket_type s, const buf* bufs, size_t count, int flags,
-    boost::system::error_code& ec)
+signed_size_type send(socket_type s, const buf* bufs, size_t count,
+    int flags, boost::system::error_code& ec)
 {
   clear_last_error();
 #if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
@@ -1071,11 +1075,11 @@
 #else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
   msghdr msg = msghdr();
   msg.msg_iov = const_cast<buf*>(bufs);
-  msg.msg_iovlen = count;
+  msg.msg_iovlen = static_cast<int>(count);
 #if defined(__linux__)
   flags |= MSG_NOSIGNAL;
 #endif // defined(__linux__)
-  int result = error_wrapper(::sendmsg(s, &msg, flags), ec);
+  signed_size_type result = error_wrapper(::sendmsg(s, &msg, flags), ec);
   if (result >= 0)
     ec = boost::system::error_code();
   return result;
@@ -1102,7 +1106,7 @@
   for (;;)
   {
     // Try to complete the operation without blocking.
-    int bytes = socket_ops::send(s, bufs, count, flags, ec);
+    signed_size_type bytes = socket_ops::send(s, bufs, count, flags, ec);
 
     // Check if operation succeeded.
     if (bytes >= 0)
@@ -1149,7 +1153,7 @@
   for (;;)
   {
     // Write some data.
-    int bytes = socket_ops::send(s, bufs, count, flags, ec);
+    signed_size_type bytes = socket_ops::send(s, bufs, count, flags, ec);
 
     // Retry operation if interrupted by signal.
     if (ec == boost::asio::error::interrupted)
@@ -1175,8 +1179,8 @@
 
 #endif // defined(BOOST_ASIO_HAS_IOCP)
 
-int sendto(socket_type s, const buf* bufs, size_t count, int flags,
-    const socket_addr_type* addr, std::size_t addrlen,
+signed_size_type sendto(socket_type s, const buf* bufs, size_t count,
+    int flags, const socket_addr_type* addr, std::size_t addrlen,
     boost::system::error_code& ec)
 {
   clear_last_error();
@@ -1198,13 +1202,13 @@
 #else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
   msghdr msg = msghdr();
   init_msghdr_msg_name(msg.msg_name, addr);
-  msg.msg_namelen = addrlen;
+  msg.msg_namelen = static_cast<int>(addrlen);
   msg.msg_iov = const_cast<buf*>(bufs);
-  msg.msg_iovlen = count;
+  msg.msg_iovlen = static_cast<int>(count);
 #if defined(__linux__)
   flags |= MSG_NOSIGNAL;
 #endif // defined(__linux__)
-  int result = error_wrapper(::sendmsg(s, &msg, flags), ec);
+  signed_size_type result = error_wrapper(::sendmsg(s, &msg, flags), ec);
   if (result >= 0)
     ec = boost::system::error_code();
   return result;
@@ -1225,7 +1229,8 @@
   for (;;)
   {
     // Try to complete the operation without blocking.
-    int bytes = socket_ops::sendto(s, bufs, count, flags, addr, addrlen, ec);
+    signed_size_type bytes = socket_ops::sendto(
+        s, bufs, count, flags, addr, addrlen, ec);
 
     // Check if operation succeeded.
     if (bytes >= 0)
@@ -1253,7 +1258,8 @@
   for (;;)
   {
     // Write some data.
-    int bytes = socket_ops::sendto(s, bufs, count, flags, addr, addrlen, ec);
+    signed_size_type bytes = socket_ops::sendto(
+        s, bufs, count, flags, addr, addrlen, ec);
 
     // Retry operation if interrupted by signal.
     if (ec == boost::asio::error::interrupted)
@@ -1868,7 +1874,8 @@
 
   return result == socket_error_retval ? 0 : dest;
 #else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
-  const char* result = error_wrapper(::inet_ntop(af, src, dest, length), ec);
+  const char* result = error_wrapper(::inet_ntop(
+        af, src, dest, static_cast<int>(length)), ec);
   if (result == 0 && !ec)
     ec = boost::asio::error::invalid_argument;
   if (result != 0 && af == AF_INET6 && scope_id != 0)
@@ -1878,7 +1885,8 @@
     const in6_addr_type* ipv6_address = static_cast<const in6_addr_type*>(src);
     bool is_link_local = ((ipv6_address->s6_addr[0] == 0xfe)
         && ((ipv6_address->s6_addr[1] & 0xc0) == 0x80));
-    if (!is_link_local || if_indextoname(scope_id, if_name + 1) == 0)
+    if (!is_link_local
+        || if_indextoname(static_cast<unsigned>(scope_id), if_name + 1) == 0)
       sprintf(if_name + 1, "%lu", scope_id);
     strcat(dest, if_name);
   }
Modified: branches/release/boost/asio/detail/impl/task_io_service.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/task_io_service.ipp	(original)
+++ branches/release/boost/asio/detail/impl/task_io_service.ipp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -23,6 +23,7 @@
 #include <boost/asio/detail/event.hpp>
 #include <boost/asio/detail/reactor.hpp>
 #include <boost/asio/detail/task_io_service.hpp>
+#include <boost/asio/detail/task_io_service_thread_info.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -30,14 +31,6 @@
 namespace asio {
 namespace detail {
 
-struct task_io_service::thread_info
-{
-  event* wakeup_event;
-  op_queue<operation> private_op_queue;
-  long private_outstanding_work;
-  thread_info* next;
-};
-
 struct task_io_service::task_cleanup
 {
   ~task_cleanup()
Modified: branches/release/boost/asio/detail/impl/win_iocp_io_service.hpp
==============================================================================
--- branches/release/boost/asio/detail/impl/win_iocp_io_service.hpp	(original)
+++ branches/release/boost/asio/detail/impl/win_iocp_io_service.hpp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -33,7 +33,7 @@
 template <typename Handler>
 void win_iocp_io_service::dispatch(Handler handler)
 {
-  if (call_stack<win_iocp_io_service>::contains(this))
+  if (thread_call_stack::contains(this))
   {
     fenced_block b(fenced_block::full);
     boost_asio_handler_invoke_helpers::invoke(handler, handler);
Modified: branches/release/boost/asio/detail/impl/win_iocp_io_service.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/win_iocp_io_service.ipp	(original)
+++ branches/release/boost/asio/detail/impl/win_iocp_io_service.ipp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -68,6 +68,7 @@
     iocp_(),
     outstanding_work_(0),
     stopped_(0),
+    stop_event_posted_(0),
     shutdown_(0),
     dispatch_required_(0)
 {
@@ -148,12 +149,13 @@
 {
   if (::InterlockedExchangeAdd(&outstanding_work_, 0) == 0)
   {
-    InterlockedExchange(&stopped_, 1);
+    stop();
     ec = boost::system::error_code();
     return 0;
   }
 
-  call_stack<win_iocp_io_service>::context ctx(this);
+  win_iocp_thread_info this_thread;
+  thread_call_stack::context ctx(this, this_thread);
 
   size_t n = 0;
   while (do_one(true, ec))
@@ -166,12 +168,13 @@
 {
   if (::InterlockedExchangeAdd(&outstanding_work_, 0) == 0)
   {
-    InterlockedExchange(&stopped_, 1);
+    stop();
     ec = boost::system::error_code();
     return 0;
   }
 
-  call_stack<win_iocp_io_service>::context ctx(this);
+  win_iocp_thread_info this_thread;
+  thread_call_stack::context ctx(this, this_thread);
 
   return do_one(true, ec);
 }
@@ -180,12 +183,13 @@
 {
   if (::InterlockedExchangeAdd(&outstanding_work_, 0) == 0)
   {
-    InterlockedExchange(&stopped_, 1);
+    stop();
     ec = boost::system::error_code();
     return 0;
   }
 
-  call_stack<win_iocp_io_service>::context ctx(this);
+  win_iocp_thread_info this_thread;
+  thread_call_stack::context ctx(this, this_thread);
 
   size_t n = 0;
   while (do_one(false, ec))
@@ -198,12 +202,13 @@
 {
   if (::InterlockedExchangeAdd(&outstanding_work_, 0) == 0)
   {
-    InterlockedExchange(&stopped_, 1);
+    stop();
     ec = boost::system::error_code();
     return 0;
   }
 
-  call_stack<win_iocp_io_service>::context ctx(this);
+  win_iocp_thread_info this_thread;
+  thread_call_stack::context ctx(this, this_thread);
 
   return do_one(false, ec);
 }
@@ -212,12 +217,15 @@
 {
   if (::InterlockedExchange(&stopped_, 1) == 0)
   {
-    if (!::PostQueuedCompletionStatus(iocp_.handle, 0, 0, 0))
+    if (::InterlockedExchange(&stop_event_posted_, 1) == 0)
     {
-      DWORD last_error = ::GetLastError();
-      boost::system::error_code ec(last_error,
-          boost::asio::error::get_system_category());
-      boost::asio::detail::throw_error(ec, "pqcs");
+      if (!::PostQueuedCompletionStatus(iocp_.handle, 0, 0, 0))
+      {
+        DWORD last_error = ::GetLastError();
+        boost::system::error_code ec(last_error,
+            boost::asio::error::get_system_category());
+        boost::asio::detail::throw_error(ec, "pqcs");
+      }
     }
   }
 }
@@ -421,17 +429,23 @@
     }
     else
     {
+      // Indicate that there is no longer an in-flight stop event.
+      ::InterlockedExchange(&stop_event_posted_, 0);
+
       // The stopped_ flag is always checked to ensure that any leftover
-      // interrupts from a previous run invocation are ignored.
+      // stop events from a previous run invocation are ignored.
       if (::InterlockedExchangeAdd(&stopped_, 0) != 0)
       {
         // Wake up next thread that is blocked on GetQueuedCompletionStatus.
-        if (!::PostQueuedCompletionStatus(iocp_.handle, 0, 0, 0))
+        if (::InterlockedExchange(&stop_event_posted_, 1) == 0)
         {
-          last_error = ::GetLastError();
-          ec = boost::system::error_code(last_error,
-              boost::asio::error::get_system_category());
-          return 0;
+          if (!::PostQueuedCompletionStatus(iocp_.handle, 0, 0, 0))
+          {
+            last_error = ::GetLastError();
+            ec = boost::system::error_code(last_error,
+                boost::asio::error::get_system_category());
+            return 0;
+          }
         }
 
         ec = boost::system::error_code();
Modified: branches/release/boost/asio/detail/impl/win_static_mutex.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/win_static_mutex.ipp	(original)
+++ branches/release/boost/asio/detail/impl/win_static_mutex.ipp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -43,11 +43,11 @@
   using namespace std; // For sprintf.
   wchar_t mutex_name[128];
 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
-  swprintf_s(mutex_name, 128,
+  swprintf_s(
 #else // BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
-  swprintf(mutex_name,
+  _snwprintf(
 #endif // BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
-      L"asio-58CCDC44-6264-4842-90C2-F3C545CB8AA7-%u-%p",
+      mutex_name, 128, L"asio-58CCDC44-6264-4842-90C2-F3C545CB8AA7-%u-%p",
       static_cast<unsigned int>(::GetCurrentProcessId()), this);
 
   HANDLE mutex = ::CreateMutexW(0, TRUE, mutex_name);
Modified: branches/release/boost/asio/detail/socket_ops.hpp
==============================================================================
--- branches/release/boost/asio/detail/socket_ops.hpp	(original)
+++ branches/release/boost/asio/detail/socket_ops.hpp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -129,8 +129,8 @@
 
 BOOST_ASIO_DECL void init_buf(buf& b, const void* data, size_t size);
 
-BOOST_ASIO_DECL int recv(socket_type s, buf* bufs, size_t count, int flags,
-    boost::system::error_code& ec);
+BOOST_ASIO_DECL signed_size_type recv(socket_type s, buf* bufs,
+    size_t count, int flags, boost::system::error_code& ec);
 
 BOOST_ASIO_DECL size_t sync_recv(socket_type s, state_type state, buf* bufs,
     size_t count, int flags, bool all_empty, boost::system::error_code& ec);
@@ -149,9 +149,9 @@
 
 #endif // defined(BOOST_ASIO_HAS_IOCP)
 
-BOOST_ASIO_DECL int recvfrom(socket_type s, buf* bufs, size_t count, int flags,
-    socket_addr_type* addr, std::size_t* addrlen,
-    boost::system::error_code& ec);
+BOOST_ASIO_DECL signed_size_type recvfrom(socket_type s, buf* bufs,
+    size_t count, int flags, socket_addr_type* addr,
+    std::size_t* addrlen, boost::system::error_code& ec);
 
 BOOST_ASIO_DECL size_t sync_recvfrom(socket_type s, state_type state,
     buf* bufs, size_t count, int flags, socket_addr_type* addr,
@@ -172,8 +172,9 @@
 
 #endif // defined(BOOST_ASIO_HAS_IOCP)
 
-BOOST_ASIO_DECL int recvmsg(socket_type s, buf* bufs, size_t count,
-    int in_flags, int& out_flags, boost::system::error_code& ec);
+BOOST_ASIO_DECL signed_size_type recvmsg(socket_type s, buf* bufs,
+    size_t count, int in_flags, int& out_flags,
+    boost::system::error_code& ec);
 
 BOOST_ASIO_DECL size_t sync_recvmsg(socket_type s, state_type state,
     buf* bufs, size_t count, int in_flags, int& out_flags,
@@ -193,7 +194,7 @@
 
 #endif // defined(BOOST_ASIO_HAS_IOCP)
 
-BOOST_ASIO_DECL int send(socket_type s, const buf* bufs,
+BOOST_ASIO_DECL signed_size_type send(socket_type s, const buf* bufs,
     size_t count, int flags, boost::system::error_code& ec);
 
 BOOST_ASIO_DECL size_t sync_send(socket_type s, state_type state,
@@ -214,9 +215,9 @@
 
 #endif // defined(BOOST_ASIO_HAS_IOCP)
 
-BOOST_ASIO_DECL int sendto(socket_type s, const buf* bufs, size_t count,
-    int flags, const socket_addr_type* addr, std::size_t addrlen,
-    boost::system::error_code& ec);
+BOOST_ASIO_DECL signed_size_type sendto(socket_type s, const buf* bufs,
+    size_t count, int flags, const socket_addr_type* addr,
+    std::size_t addrlen, boost::system::error_code& ec);
 
 BOOST_ASIO_DECL size_t sync_sendto(socket_type s, state_type state,
     const buf* bufs, size_t count, int flags, const socket_addr_type* addr,
Modified: branches/release/boost/asio/detail/socket_types.hpp
==============================================================================
--- branches/release/boost/asio/detail/socket_types.hpp	(original)
+++ branches/release/boost/asio/detail/socket_types.hpp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -107,6 +107,7 @@
 typedef unsigned long ioctl_arg_type;
 typedef u_long u_long_type;
 typedef u_short u_short_type;
+typedef int signed_size_type;
 const int shutdown_receive = SD_RECEIVE;
 const int shutdown_send = SD_SEND;
 const int shutdown_both = SD_BOTH;
@@ -151,6 +152,11 @@
 typedef int ioctl_arg_type;
 typedef uint32_t u_long_type;
 typedef uint16_t u_short_type;
+#if defined(BOOST_ASIO_HAS_SSIZE_T)
+typedef ssize_t signed_size_type;
+#else // defined(BOOST_ASIO_HAS_SSIZE_T)
+typedef int signed_size_type;
+#endif // defined(BOOST_ASIO_HAS_SSIZE_T)
 const int shutdown_receive = SHUT_RD;
 const int shutdown_send = SHUT_WR;
 const int shutdown_both = SHUT_RDWR;
Modified: branches/release/boost/asio/detail/task_io_service.hpp
==============================================================================
--- branches/release/boost/asio/detail/task_io_service.hpp	(original)
+++ branches/release/boost/asio/detail/task_io_service.hpp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -128,7 +128,7 @@
 
 private:
   // Structure containing information about an idle thread.
-  struct thread_info;
+  typedef task_io_service_thread_info thread_info;
 
   // Request invocation of the given operation, avoiding the thread-private
   // queue, and return immediately. Assumes that work_started() has not yet
Modified: branches/release/boost/asio/detail/task_io_service_fwd.hpp
==============================================================================
--- branches/release/boost/asio/detail/task_io_service_fwd.hpp	(original)
+++ branches/release/boost/asio/detail/task_io_service_fwd.hpp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -20,6 +20,8 @@
 namespace detail {
 
 class task_io_service;
+class task_io_service_operation;
+struct task_io_service_thread_info;
 
 } // namespace detail
 } // namespace asio
Added: branches/release/boost/asio/detail/task_io_service_thread_info.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/detail/task_io_service_thread_info.hpp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -0,0 +1,43 @@
+//
+// detail/task_io_service_thread_info.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_DETAIL_TASK_IO_SERVICE_THREAD_INFO_HPP
+#define BOOST_ASIO_DETAIL_TASK_IO_SERVICE_THREAD_INFO_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/event.hpp>
+#include <boost/asio/detail/op_queue.hpp>
+#include <boost/asio/detail/task_io_service_fwd.hpp>
+#include <boost/asio/detail/thread_info_base.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace detail {
+
+struct task_io_service_thread_info : public thread_info_base
+{
+  event* wakeup_event;
+  op_queue<task_io_service_operation> private_op_queue;
+  long private_outstanding_work;
+  task_io_service_thread_info* next;
+};
+
+} // namespace detail
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_DETAIL_TASK_IO_SERVICE_THREAD_INFO_HPP
Added: branches/release/boost/asio/detail/thread_info_base.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/detail/thread_info_base.hpp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -0,0 +1,93 @@
+//
+// detail/thread_info_base.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_DETAIL_THREAD_INFO_BASE_HPP
+#define BOOST_ASIO_DETAIL_THREAD_INFO_BASE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <climits>
+#include <cstddef>
+#include <boost/asio/detail/noncopyable.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace detail {
+
+class thread_info_base
+  : private noncopyable
+{
+public:
+  thread_info_base()
+    : reusable_memory_(0)
+  {
+  }
+
+  ~thread_info_base()
+  {
+    if (reusable_memory_)
+      ::operator delete(reusable_memory_);
+  }
+
+  static void* allocate(thread_info_base* this_thread, std::size_t size)
+  {
+    if (this_thread && this_thread->reusable_memory_)
+    {
+      void* const pointer = this_thread->reusable_memory_;
+      this_thread->reusable_memory_ = 0;
+
+      unsigned char* const mem = static_cast<unsigned char*>(pointer);
+      if (static_cast<std::size_t>(mem[0]) >= size)
+      {
+        mem[size] = mem[0];
+        return pointer;
+      }
+
+      ::operator delete(pointer);
+    }
+
+    void* const pointer = ::operator new(size + 1);
+    unsigned char* const mem = static_cast<unsigned char*>(pointer);
+    mem[size] = (size <= UCHAR_MAX) ? static_cast<unsigned char>(size) : 0;
+    return pointer;
+  }
+
+  static void deallocate(thread_info_base* this_thread,
+      void* pointer, std::size_t size)
+  {
+    if (size <= UCHAR_MAX)
+    {
+      if (this_thread && this_thread->reusable_memory_ == 0)
+      {
+        unsigned char* const mem = static_cast<unsigned char*>(pointer);
+        mem[0] = mem[size];
+        this_thread->reusable_memory_ = pointer;
+        return;
+      }
+    }
+
+    ::operator delete(pointer);
+  }
+
+private:
+  void* reusable_memory_;
+};
+
+} // namespace detail
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_DETAIL_THREAD_INFO_BASE_HPP
Modified: branches/release/boost/asio/detail/win_iocp_io_service.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_iocp_io_service.hpp	(original)
+++ branches/release/boost/asio/detail/win_iocp_io_service.hpp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -33,6 +33,7 @@
 #include <boost/asio/detail/wait_op.hpp>
 #include <boost/asio/detail/win_iocp_io_service_fwd.hpp>
 #include <boost/asio/detail/win_iocp_operation.hpp>
+#include <boost/asio/detail/win_iocp_thread_info.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -107,7 +108,7 @@
   // Return whether a handler can be dispatched immediately.
   bool can_dispatch()
   {
-    return call_stack<win_iocp_io_service>::contains(this) != 0;
+    return thread_call_stack::contains(this) != 0;
   }
 
   // Request invocation of the given handler.
@@ -237,6 +238,11 @@
   // Flag to indicate whether the event loop has been stopped.
   mutable long stopped_;
 
+  // Flag to indicate whether there is an in-flight stop event. Every event
+  // posted using PostQueuedCompletionStatus consumes non-paged pool, so to
+  // avoid exhausting this resouce we limit the number of outstanding events.
+  long stop_event_posted_;
+
   // Flag to indicate whether the service has been shut down.
   long shutdown_;
 
@@ -285,6 +291,10 @@
 
   // The operations that are ready to dispatch.
   op_queue<win_iocp_operation> completed_ops_;
+
+  // Per-thread call stack to track the state of each thread in the io_service.
+  typedef call_stack<win_iocp_io_service,
+      win_iocp_thread_info> thread_call_stack;
 };
 
 } // namespace detail
Modified: branches/release/boost/asio/detail/win_iocp_socket_service_base.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_iocp_socket_service_base.hpp	(original)
+++ branches/release/boost/asio/detail/win_iocp_socket_service_base.hpp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -446,7 +446,7 @@
       bool peer_is_open, socket_holder& new_socket, int family, int type,
       int protocol, void* output_buffer, DWORD address_length, operation* op);
 
-  // Start an asynchronous read or write operation using the the reactor.
+  // Start an asynchronous read or write operation using the reactor.
   BOOST_ASIO_DECL void start_reactor_op(base_implementation_type& impl,
       int op_type, reactor_op* op);
 
Added: branches/release/boost/asio/detail/win_iocp_thread_info.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/detail/win_iocp_thread_info.hpp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -0,0 +1,36 @@
+//
+// detail/win_iocp_thread_info.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_DETAIL_WIN_IOCP_THREAD_INFO_HPP
+#define BOOST_ASIO_DETAIL_WIN_IOCP_THREAD_INFO_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/thread_info_base.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace detail {
+
+struct win_iocp_thread_info : public thread_info_base
+{
+};
+
+} // namespace detail
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_DETAIL_WIN_IOCP_THREAD_INFO_HPP
Modified: branches/release/boost/asio/handler_alloc_hook.hpp
==============================================================================
--- branches/release/boost/asio/handler_alloc_hook.hpp	(original)
+++ branches/release/boost/asio/handler_alloc_hook.hpp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -32,10 +32,8 @@
  * Implement asio_handler_allocate and asio_handler_deallocate for your own
  * handlers to provide custom allocation for these temporary objects.
  *
- * This default implementation is simply:
- * @code
- * return ::operator new(size);
- * @endcode
+ * The default implementation of these allocation hooks uses <tt>::operator
+ * new</tt> and <tt>::operator delete</tt>.
  *
  * @note All temporary objects associated with a handler will be deallocated
  * before the upcall to the handler is performed. This allows the same memory to
@@ -57,32 +55,29 @@
  * }
  * @endcode
  */
-inline void* asio_handler_allocate(std::size_t size, ...)
-{
-  return ::operator new(size);
-}
+BOOST_ASIO_DECL void* asio_handler_allocate(
+    std::size_t size, ...);
 
 /// Default deallocation function for handlers.
 /**
  * Implement asio_handler_allocate and asio_handler_deallocate for your own
  * handlers to provide custom allocation for the associated temporary objects.
  *
- * This default implementation is simply:
- * @code
- * ::operator delete(pointer);
- * @endcode
+ * The default implementation of these allocation hooks uses <tt>::operator
+ * new</tt> and <tt>::operator delete</tt>.
  *
  * @sa asio_handler_allocate.
  */
-inline void asio_handler_deallocate(void* pointer, std::size_t size, ...)
-{
-  (void)(size);
-  ::operator delete(pointer);
-}
+BOOST_ASIO_DECL void asio_handler_deallocate(
+    void* pointer, std::size_t size, ...);
 
 } // namespace asio
 } // namespace boost
 
 #include <boost/asio/detail/pop_options.hpp>
 
+#if defined(BOOST_ASIO_HEADER_ONLY)
+# include <boost/asio/impl/handler_alloc_hook.ipp>
+#endif // defined(BOOST_ASIO_HEADER_ONLY)
+
 #endif // BOOST_ASIO_HANDLER_ALLOC_HOOK_HPP
Modified: branches/release/boost/asio/impl/error.ipp
==============================================================================
--- branches/release/boost/asio/impl/error.ipp	(original)
+++ branches/release/boost/asio/impl/error.ipp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -31,7 +31,7 @@
 class netdb_category : public boost::system::error_category
 {
 public:
-  const char* name() const
+  const char* name() const BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT
   {
     return "asio.netdb";
   }
@@ -63,7 +63,7 @@
 class addrinfo_category : public boost::system::error_category
 {
 public:
-  const char* name() const
+  const char* name() const BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT
   {
     return "asio.addrinfo";
   }
@@ -93,7 +93,7 @@
 class misc_category : public boost::system::error_category
 {
 public:
-  const char* name() const
+  const char* name() const BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT
   {
     return "asio.misc";
   }
Added: branches/release/boost/asio/impl/handler_alloc_hook.ipp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/impl/handler_alloc_hook.ipp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -0,0 +1,76 @@
+//
+// impl/handler_alloc_hook.ipp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_IMPL_HANDLER_ALLOC_HOOK_IPP
+#define BOOST_ASIO_IMPL_HANDLER_ALLOC_HOOK_IPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+#include <boost/asio/detail/call_stack.hpp>
+#include <boost/asio/handler_alloc_hook.hpp>
+
+#if !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
+# if defined(BOOST_ASIO_HAS_IOCP)
+#  include <boost/asio/detail/win_iocp_io_service_fwd.hpp>
+#  include <boost/asio/detail/win_iocp_thread_info.hpp>
+# else // defined(BOOST_ASIO_HAS_IOCP)
+#  include <boost/asio/detail/task_io_service_thread_info.hpp>
+# endif // defined(BOOST_ASIO_HAS_IOCP)
+#endif // !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+
+void* asio_handler_allocate(std::size_t size, ...)
+{
+#if !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
+# if defined(BOOST_ASIO_HAS_IOCP)
+  typedef detail::win_iocp_io_service io_service_impl;
+  typedef detail::win_iocp_thread_info thread_info;
+# else // defined(BOOST_ASIO_HAS_IOCP)
+  typedef detail::task_io_service io_service_impl;
+  typedef detail::task_io_service_thread_info thread_info;
+# endif // defined(BOOST_ASIO_HAS_IOCP)
+  typedef detail::call_stack<io_service_impl, thread_info> call_stack;
+  return thread_info::allocate(call_stack::top(), size);
+#else // !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
+  return ::operator new(size);
+#endif // !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
+}
+
+void asio_handler_deallocate(void* pointer, std::size_t size, ...)
+{
+#if !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
+# if defined(BOOST_ASIO_HAS_IOCP)
+  typedef detail::win_iocp_io_service io_service_impl;
+  typedef detail::win_iocp_thread_info thread_info;
+# else // defined(BOOST_ASIO_HAS_IOCP)
+  typedef detail::task_io_service io_service_impl;
+  typedef detail::task_io_service_thread_info thread_info;
+# endif // defined(BOOST_ASIO_HAS_IOCP)
+  typedef detail::call_stack<io_service_impl, thread_info> call_stack;
+  thread_info::deallocate(call_stack::top(), pointer, size);
+#else // !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
+  (void)size;
+  ::operator delete(pointer);
+#endif // !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
+}
+
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_IMPL_HANDLER_ALLOC_HOOK_IPP
Modified: branches/release/boost/asio/impl/src.hpp
==============================================================================
--- branches/release/boost/asio/impl/src.hpp	(original)
+++ branches/release/boost/asio/impl/src.hpp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -20,6 +20,7 @@
 #endif
 
 #include <boost/asio/impl/error.ipp>
+#include <boost/asio/impl/handler_alloc_hook.ipp>
 #include <boost/asio/impl/io_service.ipp>
 #include <boost/asio/impl/serial_port_base.ipp>
 #include <boost/asio/detail/impl/descriptor_ops.ipp>
Modified: branches/release/boost/asio/ip/detail/impl/endpoint.ipp
==============================================================================
--- branches/release/boost/asio/ip/detail/impl/endpoint.ipp	(original)
+++ branches/release/boost/asio/ip/detail/impl/endpoint.ipp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -81,7 +81,8 @@
       boost::asio::detail::socket_ops::host_to_network_short(port_num);
     data_.v4.sin_addr.s_addr =
       boost::asio::detail::socket_ops::host_to_network_long(
-          addr.to_v4().to_ulong());
+          static_cast<boost::asio::detail::u_long_type>(
+            addr.to_v4().to_ulong()));
   }
   else
   {
@@ -92,7 +93,9 @@
     boost::asio::ip::address_v6 v6_addr = addr.to_v6();
     boost::asio::ip::address_v6::bytes_type bytes = v6_addr.to_bytes();
     memcpy(data_.v6.sin6_addr.s6_addr, bytes.data(), 16);
-    data_.v6.sin6_scope_id = v6_addr.scope_id();
+    data_.v6.sin6_scope_id =
+      static_cast<boost::asio::detail::u_long_type>(
+        v6_addr.scope_id());
   }
 }
 
Modified: branches/release/boost/asio/ip/impl/address_v4.ipp
==============================================================================
--- branches/release/boost/asio/ip/impl/address_v4.ipp	(original)
+++ branches/release/boost/asio/ip/impl/address_v4.ipp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -55,7 +55,8 @@
   }
 #endif // ULONG_MAX > 0xFFFFFFFF
 
-  addr_.s_addr = boost::asio::detail::socket_ops::host_to_network_long(addr);
+  addr_.s_addr = boost::asio::detail::socket_ops::host_to_network_long(
+      static_cast<boost::asio::detail::u_long_type>(addr));
 }
 
 address_v4::bytes_type address_v4::to_bytes() const
Modified: branches/release/boost/asio/ssl/context_base.hpp
==============================================================================
--- branches/release/boost/asio/ssl/context_base.hpp	(original)
+++ branches/release/boost/asio/ssl/context_base.hpp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -71,29 +71,29 @@
   };
 
   /// Bitmask type for SSL options.
-  typedef int options;
+  typedef long options;
 
 #if defined(GENERATING_DOCUMENTATION)
   /// Implement various bug workarounds.
-  static const int default_workarounds = implementation_defined;
+  static const long default_workarounds = implementation_defined;
 
   /// Always create a new key when using tmp_dh parameters.
-  static const int single_dh_use = implementation_defined;
+  static const long single_dh_use = implementation_defined;
 
   /// Disable SSL v2.
-  static const int no_sslv2 = implementation_defined;
+  static const long no_sslv2 = implementation_defined;
 
   /// Disable SSL v3.
-  static const int no_sslv3 = implementation_defined;
+  static const long no_sslv3 = implementation_defined;
 
   /// Disable TLS v1.
-  static const int no_tlsv1 = implementation_defined;
+  static const long no_tlsv1 = implementation_defined;
 #else
-  BOOST_STATIC_CONSTANT(int, default_workarounds = SSL_OP_ALL);
-  BOOST_STATIC_CONSTANT(int, single_dh_use = SSL_OP_SINGLE_DH_USE);
-  BOOST_STATIC_CONSTANT(int, no_sslv2 = SSL_OP_NO_SSLv2);
-  BOOST_STATIC_CONSTANT(int, no_sslv3 = SSL_OP_NO_SSLv3);
-  BOOST_STATIC_CONSTANT(int, no_tlsv1 = SSL_OP_NO_TLSv1);
+  BOOST_STATIC_CONSTANT(long, default_workarounds = SSL_OP_ALL);
+  BOOST_STATIC_CONSTANT(long, single_dh_use = SSL_OP_SINGLE_DH_USE);
+  BOOST_STATIC_CONSTANT(long, no_sslv2 = SSL_OP_NO_SSLv2);
+  BOOST_STATIC_CONSTANT(long, no_sslv3 = SSL_OP_NO_SSLv3);
+  BOOST_STATIC_CONSTANT(long, no_tlsv1 = SSL_OP_NO_TLSv1);
 #endif
 
   /// File format types.
Modified: branches/release/boost/asio/ssl/detail/impl/engine.ipp
==============================================================================
--- branches/release/boost/asio/ssl/detail/impl/engine.ipp	(original)
+++ branches/release/boost/asio/ssl/detail/impl/engine.ipp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -39,7 +39,8 @@
 {
   if (!ssl_)
   {
-    boost::system::error_code ec(::ERR_get_error(),
+    boost::system::error_code ec(
+        static_cast<int>(::ERR_get_error()),
         boost::asio::error::get_ssl_category());
     boost::asio::detail::throw_error(ec, "engine");
   }
@@ -166,7 +167,7 @@
 {
   int length = ::BIO_read(ext_bio_,
       boost::asio::buffer_cast<void*>(data),
-      boost::asio::buffer_size(data));
+      static_cast<int>(boost::asio::buffer_size(data)));
 
   return boost::asio::buffer(data,
       length > 0 ? static_cast<std::size_t>(length) : 0);
@@ -177,7 +178,7 @@
 {
   int length = ::BIO_write(ext_bio_,
       boost::asio::buffer_cast<const void*>(data),
-      boost::asio::buffer_size(data));
+      static_cast<int>(boost::asio::buffer_size(data)));
 
   return boost::asio::buffer(data +
       (length > 0 ? static_cast<std::size_t>(length) : 0));
@@ -228,7 +229,7 @@
   std::size_t pending_output_before = ::BIO_ctrl_pending(ext_bio_);
   int result = (this->*op)(data, length);
   int ssl_error = ::SSL_get_error(ssl_, result);
-  int sys_error = ::ERR_get_error();
+  int sys_error = static_cast<int>(::ERR_get_error());
   std::size_t pending_output_after = ::BIO_ctrl_pending(ext_bio_);
 
   if (ssl_error == SSL_ERROR_SSL)
@@ -296,12 +297,14 @@
 
 int engine::do_read(void* data, std::size_t length)
 {
-  return ::SSL_read(ssl_, data, length < INT_MAX ? length : INT_MAX);
+  return ::SSL_read(ssl_, data,
+      length < INT_MAX ? static_cast<int>(length) : INT_MAX);
 }
 
 int engine::do_write(void* data, std::size_t length)
 {
-  return ::SSL_write(ssl_, data, length < INT_MAX ? length : INT_MAX);
+  return ::SSL_write(ssl_, data,
+      length < INT_MAX ? static_cast<int>(length) : INT_MAX);
 }
 
 #endif // !defined(BOOST_ASIO_ENABLE_OLD_SSL)
Modified: branches/release/boost/asio/ssl/detail/stream_core.hpp
==============================================================================
--- branches/release/boost/asio/ssl/detail/stream_core.hpp	(original)
+++ branches/release/boost/asio/ssl/detail/stream_core.hpp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -34,7 +34,7 @@
 
 struct stream_core
 {
-  // According to the OpenSSL documentation, this is the buffer size that is is
+  // According to the OpenSSL documentation, this is the buffer size that is
   // sufficient to hold the largest possible TLS record.
   enum { max_tls_record_size = 17 * 1024 };
 
Modified: branches/release/boost/asio/ssl/impl/context.ipp
==============================================================================
--- branches/release/boost/asio/ssl/impl/context.ipp	(original)
+++ branches/release/boost/asio/ssl/impl/context.ipp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -91,7 +91,8 @@
 
   if (handle_ == 0)
   {
-    boost::system::error_code ec(::ERR_get_error(),
+    boost::system::error_code ec(
+        static_cast<int>(::ERR_get_error()),
         boost::asio::error::get_ssl_category());
     boost::asio::detail::throw_error(ec, "context");
   }
@@ -201,7 +202,8 @@
 {
   if (::SSL_CTX_load_verify_locations(handle_, filename.c_str(), 0) != 1)
   {
-    ec = boost::system::error_code(::ERR_get_error(),
+    ec = boost::system::error_code(
+        static_cast<int>(::ERR_get_error()),
         boost::asio::error::get_ssl_category());
     return ec;
   }
@@ -222,7 +224,8 @@
 {
   if (::SSL_CTX_set_default_verify_paths(handle_) != 1)
   {
-    ec = boost::system::error_code(::ERR_get_error(),
+    ec = boost::system::error_code(
+        static_cast<int>(::ERR_get_error()),
         boost::asio::error::get_ssl_category());
     return ec;
   }
@@ -243,7 +246,8 @@
 {
   if (::SSL_CTX_load_verify_locations(handle_, 0, path.c_str()) != 1)
   {
-    ec = boost::system::error_code(::ERR_get_error(),
+    ec = boost::system::error_code(
+        static_cast<int>(::ERR_get_error()),
         boost::asio::error::get_ssl_category());
     return ec;
   }
@@ -282,7 +286,8 @@
 
   if (::SSL_CTX_use_certificate_file(handle_, filename.c_str(), file_type) != 1)
   {
-    ec = boost::system::error_code(::ERR_get_error(),
+    ec = boost::system::error_code(
+        static_cast<int>(::ERR_get_error()),
         boost::asio::error::get_ssl_category());
     return ec;
   }
@@ -303,7 +308,8 @@
 {
   if (::SSL_CTX_use_certificate_chain_file(handle_, filename.c_str()) != 1)
   {
-    ec = boost::system::error_code(::ERR_get_error(),
+    ec = boost::system::error_code(
+        static_cast<int>(::ERR_get_error()),
         boost::asio::error::get_ssl_category());
     return ec;
   }
@@ -342,7 +348,8 @@
 
   if (::SSL_CTX_use_PrivateKey_file(handle_, filename.c_str(), file_type) != 1)
   {
-    ec = boost::system::error_code(::ERR_get_error(),
+    ec = boost::system::error_code(
+        static_cast<int>(::ERR_get_error()),
         boost::asio::error::get_ssl_category());
     return ec;
   }
@@ -382,7 +389,8 @@
   if (::SSL_CTX_use_RSAPrivateKey_file(
         handle_, filename.c_str(), file_type) != 1)
   {
-    ec = boost::system::error_code(::ERR_get_error(),
+    ec = boost::system::error_code(
+        static_cast<int>(::ERR_get_error()),
         boost::asio::error::get_ssl_category());
     return ec;
   }
@@ -417,11 +425,12 @@
   }
 
   ::BIO_free(bio);
-  int result = ::SSL_CTX_set_tmp_dh(handle_, dh);
+  long result = ::SSL_CTX_set_tmp_dh(handle_, dh);
   ::DH_free(dh);
   if (result != 1)
   {
-    ec = boost::system::error_code(::ERR_get_error(),
+    ec = boost::system::error_code(
+        static_cast<int>(::ERR_get_error()),
         boost::asio::error::get_ssl_category());
     return ec;
   }
@@ -510,7 +519,7 @@
     strncat(buf, passwd.c_str(), size);
 #endif
 
-    return strlen(buf);
+    return static_cast<int>(strlen(buf));
   }
 
   return 0;
Modified: branches/release/boost/asio/ssl/impl/error.ipp
==============================================================================
--- branches/release/boost/asio/ssl/impl/error.ipp	(original)
+++ branches/release/boost/asio/ssl/impl/error.ipp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -30,7 +30,7 @@
 class ssl_category : public boost::system::error_category
 {
 public:
-  const char* name() const
+  const char* name() const BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT
   {
     return "asio.ssl";
   }
Modified: branches/release/boost/asio/ssl/old/detail/openssl_operation.hpp
==============================================================================
--- branches/release/boost/asio/ssl/old/detail/openssl_operation.hpp	(original)
+++ branches/release/boost/asio/ssl/old/detail/openssl_operation.hpp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -154,7 +154,7 @@
                 // For connect/accept/shutdown, the operation
                 // is done, when return code is 1
                 // for write, it is done, when is retcode > 0
-                // for read, is is done when retcode > 0
+                // for read, it is done when retcode > 0
 
     int error_code =  !is_operation_done ?
           ::SSL_get_error( session_, rc ) :
Modified: branches/release/boost/asio/version.hpp
==============================================================================
--- branches/release/boost/asio/version.hpp	(original)
+++ branches/release/boost/asio/version.hpp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -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 100802 // 1.8.2
+#define BOOST_ASIO_VERSION 100803 // 1.8.3
 
 #endif // BOOST_ASIO_VERSION_HPP
Modified: branches/release/boost/asio/windows/basic_random_access_handle.hpp
==============================================================================
--- branches/release/boost/asio/windows/basic_random_access_handle.hpp	(original)
+++ branches/release/boost/asio/windows/basic_random_access_handle.hpp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -58,7 +58,7 @@
   /// Construct a basic_random_access_handle without opening it.
   /**
    * This constructor creates a random-access handle without opening it. The
-   * handle needs to be opened before data can be written to or or read from it.
+   * handle needs to be opened before data can be written to or read from it.
    *
    * @param io_service The io_service object that the random-access handle will
    * use to dispatch handlers for any asynchronous operations performed on the
Modified: branches/release/libs/asio/doc/reference.qbk
==============================================================================
--- branches/release/libs/asio/doc/reference.qbk	(original)
+++ branches/release/libs/asio/doc/reference.qbk	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -135,12 +135,7 @@
 
 Implement asio\_handler\_allocate and asio\_handler\_deallocate for your own handlers to provide custom allocation for these temporary objects.
 
-This default implementation is simply: 
-
-   return ::operator new(size);
-
-
-
+The default implementation of these allocation hooks uses `operator new` and `operator delete`.
 
 
 [heading Remarks]
@@ -195,12 +190,7 @@
 
 Implement asio\_handler\_allocate and asio\_handler\_deallocate for your own handlers to provide custom allocation for the associated temporary objects.
 
-This default implementation is simply: 
-
-   ::operator delete(pointer);
-
-
-
+The default implementation of these allocation hooks uses `operator new` and `operator delete`.
 
 
 
@@ -5137,7 +5127,7 @@
    ...
    boost::asio::ip::tcp::socket::keep_alive option;
    socket.get_option(option);
-   bool is_set = option.get();
+   bool is_set = option.value();
 
 
 
@@ -5194,7 +5184,7 @@
    {
      // An error occurred.
    }
-   bool is_set = option.get();
+   bool is_set = option.value();
 
 
 
@@ -12603,7 +12593,7 @@
    ...
    boost::asio::ip::tcp::socket::keep_alive option;
    socket.get_option(option);
-   bool is_set = option.get();
+   bool is_set = option.value();
 
 
 
@@ -12660,7 +12650,7 @@
    {
      // An error occurred.
    }
-   bool is_set = option.get();
+   bool is_set = option.value();
 
 
 
@@ -18046,7 +18036,7 @@
    ...
    boost::asio::ip::tcp::socket::keep_alive option;
    socket.get_option(option);
-   bool is_set = option.get();
+   bool is_set = option.value();
 
 
 
@@ -18103,7 +18093,7 @@
    {
      // An error occurred.
    }
-   bool is_set = option.get();
+   bool is_set = option.value();
 
 
 
@@ -25770,7 +25760,7 @@
    ...
    boost::asio::ip::tcp::socket::keep_alive option;
    socket.get_option(option);
-   bool is_set = option.get();
+   bool is_set = option.value();
 
 
 
@@ -25824,7 +25814,7 @@
    {
      // An error occurred.
    }
-   bool is_set = option.get();
+   bool is_set = option.value();
 
 
 
@@ -34188,7 +34178,7 @@
    ...
    boost::asio::ip::tcp::socket::keep_alive option;
    socket.get_option(option);
-   bool is_set = option.get();
+   bool is_set = option.value();
 
 
 
@@ -34245,7 +34235,7 @@
    {
      // An error occurred.
    }
-   bool is_set = option.get();
+   bool is_set = option.value();
 
 
 
@@ -39209,7 +39199,7 @@
    ...
    boost::asio::ip::tcp::socket::keep_alive option;
    socket.get_option(option);
-   bool is_set = option.get();
+   bool is_set = option.value();
 
 
 
@@ -39266,7 +39256,7 @@
    {
      // An error occurred.
    }
-   bool is_set = option.get();
+   bool is_set = option.value();
 
 
 
@@ -82770,7 +82760,7 @@
 Implement various bug workarounds. 
 
 
-  static const int default_workarounds = implementation_defined;
+  static const long default_workarounds = implementation_defined;
 
 
 
@@ -83080,7 +83070,7 @@
 Disable SSL v2. 
 
 
-  static const int no_sslv2 = implementation_defined;
+  static const long no_sslv2 = implementation_defined;
 
 
 
@@ -83094,7 +83084,7 @@
 Disable SSL v3. 
 
 
-  static const int no_sslv3 = implementation_defined;
+  static const long no_sslv3 = implementation_defined;
 
 
 
@@ -83108,7 +83098,7 @@
 Disable TLS v1. 
 
 
-  static const int no_tlsv1 = implementation_defined;
+  static const long no_tlsv1 = implementation_defined;
 
 
 
@@ -83161,7 +83151,7 @@
 Bitmask type for SSL options. 
 
 
-  typedef int options;
+  typedef long options;
 
 
 
@@ -83732,7 +83722,7 @@
 Always create a new key when using tmp\_dh parameters. 
 
 
-  static const int single_dh_use = implementation_defined;
+  static const long single_dh_use = implementation_defined;
 
 
 
@@ -84368,7 +84358,7 @@
 Implement various bug workarounds. 
 
 
-  static const int default_workarounds = implementation_defined;
+  static const long default_workarounds = implementation_defined;
 
 
 
@@ -84506,7 +84496,7 @@
 Disable SSL v2. 
 
 
-  static const int no_sslv2 = implementation_defined;
+  static const long no_sslv2 = implementation_defined;
 
 
 
@@ -84520,7 +84510,7 @@
 Disable SSL v3. 
 
 
-  static const int no_sslv3 = implementation_defined;
+  static const long no_sslv3 = implementation_defined;
 
 
 
@@ -84534,7 +84524,7 @@
 Disable TLS v1. 
 
 
-  static const int no_tlsv1 = implementation_defined;
+  static const long no_tlsv1 = implementation_defined;
 
 
 
@@ -84548,7 +84538,7 @@
 Bitmask type for SSL options. 
 
 
-  typedef int options;
+  typedef long options;
 
 
 
@@ -84601,7 +84591,7 @@
 Always create a new key when using tmp\_dh parameters. 
 
 
-  static const int single_dh_use = implementation_defined;
+  static const long single_dh_use = implementation_defined;
 
 
 
@@ -91774,7 +91764,7 @@
       boost::asio::io_service & io_service);
 
 
-This constructor creates a random-access handle without opening it. The handle needs to be opened before data can be written to or or read from it.
+This constructor creates a random-access handle without opening it. The handle needs to be opened before data can be written to or read from it.
 
 
 [heading Parameters]
Modified: branches/release/libs/asio/example/local/stream_server.cpp
==============================================================================
--- branches/release/libs/asio/example/local/stream_server.cpp	(original)
+++ branches/release/libs/asio/example/local/stream_server.cpp	2012-12-30 18:17:13 EST (Sun, 30 Dec 2012)
@@ -97,11 +97,12 @@
     if (!error)
     {
       new_session->start();
-      new_session.reset(new session(io_service_));
-      acceptor_.async_accept(new_session->socket(),
-          boost::bind(&server::handle_accept, this, new_session,
-            boost::asio::placeholders::error));
     }
+
+    new_session.reset(new session(io_service_));
+    acceptor_.async_accept(new_session->socket(),
+        boost::bind(&server::handle_accept, this, new_session,
+          boost::asio::placeholders::error));
   }
 
 private: