Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r86470 - in branches/release: boost/asio boost/asio/detail boost/asio/ssl/impl libs/asio/doc libs/asio/doc/overview libs/system/src
From: chris_at_[hidden]
Date: 2013-10-26 19:25:53


Author: chris_kohlhoff
Date: 2013-10-26 19:25:53 EDT (Sat, 26 Oct 2013)
New Revision: 86470
URL: http://svn.boost.org/trac/boost/changeset/86470

Log:
Merge from trunk.

------------------------------------------------------------------------
r86152 | chris_kohlhoff | 2013-10-04 09:59:54 +1000 (Fri, 04 Oct 2013) | 1 line

Fix WinRT detection.
------------------------------------------------------------------------
r86153 | chris_kohlhoff | 2013-10-04 10:00:46 +1000 (Fri, 04 Oct 2013) | 1 line

Add WinRT implementation notes.
------------------------------------------------------------------------
r86154 | chris_kohlhoff | 2013-10-04 10:03:36 +1000 (Fri, 04 Oct 2013) | 1 line

Fix dead links in documentation.
------------------------------------------------------------------------
r86462 | chris_kohlhoff | 2013-10-27 09:32:01 +1100 (Sun, 27 Oct 2013) | 1 line

Suppress conversion warnings reported by MSVC.
------------------------------------------------------------------------
r86463 | chris_kohlhoff | 2013-10-27 09:35:32 +1100 (Sun, 27 Oct 2013) | 1 line

Support older versions of OpenSSL that don't supply SSL_CTX_clear_options.
------------------------------------------------------------------------
r86464 | chris_kohlhoff | 2013-10-27 09:39:23 +1100 (Sun, 27 Oct 2013) | 1 line

Add a note to clarify that concurrent invocation is not guaranteed for handlers in different strands.
------------------------------------------------------------------------
r86465 | chris_kohlhoff | 2013-10-27 09:42:53 +1100 (Sun, 27 Oct 2013) | 1 line

Fix typos in spawn() documentation.
------------------------------------------------------------------------
r86468 | chris_kohlhoff | 2013-10-27 09:49:17 +1100 (Sun, 27 Oct 2013) | 1 line

Updated revision history.
------------------------------------------------------------------------

Text files modified:
   branches/release/boost/asio/detail/config.hpp | 13 ++++++-----
   branches/release/boost/asio/spawn.hpp | 4 +-
   branches/release/boost/asio/ssl/impl/context.ipp | 21 +++++++++++++-----
   branches/release/boost/asio/strand.hpp | 3 ++
   branches/release/libs/asio/doc/history.qbk | 4 ++
   branches/release/libs/asio/doc/overview/implementation.qbk | 44 +++++++++++++++++++++++++++++++++++++++
   branches/release/libs/asio/doc/reference.qbk | 18 ++++++++++++---
   branches/release/libs/asio/doc/reference.xsl | 3 ++
   branches/release/libs/system/src/error_code.cpp | 4 +-
   9 files changed, 92 insertions(+), 22 deletions(-)

Modified: branches/release/boost/asio/detail/config.hpp
==============================================================================
--- branches/release/boost/asio/detail/config.hpp Sat Oct 26 18:57:10 2013 (r86469)
+++ branches/release/boost/asio/detail/config.hpp 2013-10-26 19:25:53 EDT (Sat, 26 Oct 2013) (r86470)
@@ -454,11 +454,12 @@
 
 // WinRT target.
 #if !defined(BOOST_ASIO_WINDOWS_RUNTIME)
-# if defined(WINAPI_FAMILY)
-# if ((WINAPI_FAMILY & WINAPI_PARTITION_APP) != 0)
+# if defined(__cplusplus_winrt)
+# include <winapifamily.h>
+# if WINAPI_FAMILY_ONE_PARTITION(WINAPI_FAMILY, WINAPI_PARTITION_APP)
 # define BOOST_ASIO_WINDOWS_RUNTIME 1
-# endif // ((WINAPI_FAMILY & WINAPI_PARTITION_APP) != 0)
-# endif // defined(WINAPI_FAMILY)
+# endif // WINAPI_FAMILY_ONE_PARTITION(WINAPI_FAMILY, WINAPI_PARTITION_APP)
+# endif // defined(__cplusplus_winrt)
 #endif // !defined(BOOST_ASIO_WINDOWS_RUNTIME)
 
 // Windows target. Excludes WinRT.
@@ -869,12 +870,12 @@
 # endif // ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)
 # endif // defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
 # endif // defined(__linux__)
-# if defined(BOOST_ASIO_MSVC) && defined(WINAPI_FAMILY)
+# if defined(BOOST_ASIO_MSVC) && defined(BOOST_ASIO_WINDOWS_RUNTIME)
 # if (_MSC_VER >= 1700)
 # define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
 # define BOOST_ASIO_THREAD_KEYWORD __declspec(thread)
 # endif // (_MSC_VER >= 1700)
-# endif // defined(BOOST_ASIO_MSVC) && defined(WINAPI_FAMILY)
+# endif // defined(BOOST_ASIO_MSVC) && defined(BOOST_ASIO_WINDOWS_RUNTIME)
 #endif // !defined(BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
 #if !defined(BOOST_ASIO_THREAD_KEYWORD)
 # define BOOST_ASIO_THREAD_KEYWORD __thread

Modified: branches/release/boost/asio/spawn.hpp
==============================================================================
--- branches/release/boost/asio/spawn.hpp Sat Oct 26 18:57:10 2013 (r86469)
+++ branches/release/boost/asio/spawn.hpp 2013-10-26 19:25:53 EDT (Sat, 26 Oct 2013) (r86470)
@@ -131,7 +131,7 @@
 };
 
 #if defined(GENERATING_DOCUMENTATION)
-/// Context object the represents the currently executing coroutine.
+/// Context object that represents the currently executing coroutine.
 typedef basic_yield_context<unspecified> yield_context;
 #else // defined(GENERATING_DOCUMENTATION)
 typedef basic_yield_context<
@@ -218,7 +218,7 @@
     const boost::coroutines::attributes& attributes
       = boost::coroutines::attributes());
 
-/// Start a new stackful coroutine that executes in the contex of a strand.
+/// Start a new stackful coroutine that executes in the context of a strand.
 /**
  * This function is used to launch a new coroutine.
  *

Modified: branches/release/boost/asio/ssl/impl/context.ipp
==============================================================================
--- branches/release/boost/asio/ssl/impl/context.ipp Sat Oct 26 18:57:10 2013 (r86469)
+++ branches/release/boost/asio/ssl/impl/context.ipp 2013-10-26 19:25:53 EDT (Sat, 26 Oct 2013) (r86470)
@@ -236,19 +236,27 @@
 boost::system::error_code context::clear_options(
     context::options o, boost::system::error_code& ec)
 {
-#if !defined(SSL_OP_NO_COMPRESSION)
+#if (OPENSSL_VERSION_NUMBER >= 0x009080DFL) \
+ && (OPENSSL_VERSION_NUMBER != 0x00909000L)
+# if !defined(SSL_OP_NO_COMPRESSION)
   if ((o & context::no_compression) != 0)
   {
-#if (OPENSSL_VERSION_NUMBER >= 0x00908000L)
+# if (OPENSSL_VERSION_NUMBER >= 0x00908000L)
     handle_->comp_methods = SSL_COMP_get_compression_methods();
-#endif // (OPENSSL_VERSION_NUMBER >= 0x00908000L)
+# endif // (OPENSSL_VERSION_NUMBER >= 0x00908000L)
     o ^= context::no_compression;
   }
-#endif // !defined(SSL_OP_NO_COMPRESSION)
+# endif // !defined(SSL_OP_NO_COMPRESSION)
 
   ::SSL_CTX_clear_options(handle_, o);
 
   ec = boost::system::error_code();
+#else // (OPENSSL_VERSION_NUMBER >= 0x009080DFL)
+ // && (OPENSSL_VERSION_NUMBER != 0x00909000L)
+ (void)o;
+ ec = boost::asio::error::operation_not_supported;
+#endif // (OPENSSL_VERSION_NUMBER >= 0x009080DFL)
+ // && (OPENSSL_VERSION_NUMBER != 0x00909000L)
   return ec;
 }
 
@@ -428,7 +436,8 @@
 
   if (format == context_base::asn1)
   {
- if (::SSL_CTX_use_certificate_ASN1(handle_, buffer_size(certificate),
+ if (::SSL_CTX_use_certificate_ASN1(handle_,
+ static_cast<int>(buffer_size(certificate)),
           buffer_cast<const unsigned char*>(certificate)) == 1)
     {
       ec = boost::system::error_code();
@@ -929,7 +938,7 @@
 {
   return ::BIO_new_mem_buf(
       const_cast<void*>(buffer_cast<const void*>(b)),
- buffer_size(b));
+ static_cast<int>(buffer_size(b)));
 }
 
 #endif // !defined(BOOST_ASIO_ENABLE_OLD_SSL)

Modified: branches/release/boost/asio/strand.hpp
==============================================================================
--- branches/release/boost/asio/strand.hpp Sat Oct 26 18:57:10 2013 (r86469)
+++ branches/release/boost/asio/strand.hpp 2013-10-26 19:25:53 EDT (Sat, 26 Oct 2013) (r86470)
@@ -73,6 +73,9 @@
  * happens-before the other. Therefore none of the above conditions are met and
  * no ordering guarantee is made.
  *
+ * @note The implementation makes no guarantee that handlers posted or
+ * dispatched through different @c strand objects will be invoked concurrently.
+ *
  * @par Thread Safety
  * @e Distinct @e objects: Safe._at_n
  * @e Shared @e objects: Safe.

Modified: branches/release/libs/asio/doc/history.qbk
==============================================================================
--- branches/release/libs/asio/doc/history.qbk Sat Oct 26 18:57:10 2013 (r86469)
+++ branches/release/libs/asio/doc/history.qbk 2013-10-26 19:25:53 EDT (Sat, 26 Oct 2013) (r86470)
@@ -58,9 +58,11 @@
 * Removed a use of `std::min` in the Windows IOCP backend to avoid a
   dependency on the `<algorithm>` header ([ticket 8758]).
 * Eliminated some unnecessary handler copies.
+* Fixed support for older versions of OpenSSL that do not provide the
+ `SSL_CTX_clear_options` function ([ticket 9273]).
 * Fixed various minor and cosmetic issues in code and documentation
   (including [ticket 8347], [ticket 8950], [ticket 8953], [ticket 8965],
- [ticket 8997]).
+ [ticket 8997], [ticket 9230]).
 
 [heading Asio 1.10.0 / Boost 1.54]
 

Modified: branches/release/libs/asio/doc/overview/implementation.qbk
==============================================================================
--- branches/release/libs/asio/doc/overview/implementation.qbk Sat Oct 26 18:57:10 2013 (r86469)
+++ branches/release/libs/asio/doc/overview/implementation.qbk 2013-10-26 19:25:53 EDT (Sat, 26 Oct 2013) (r86470)
@@ -226,7 +226,7 @@
 * For sockets, at most 16 buffers may be transferred in a single operation.
 
 
-[heading Windows NT, 2000, XP, 2003 and Vista]
+[heading Windows NT, 2000, XP, 2003, Vista, 7 and 8]
 
 Demultiplexing mechanism:
 
@@ -259,5 +259,47 @@
 * For stream-oriented handles, only one buffer may be transferred in a single
 operation.
 
+[heading Windows Runtime]
+
+Boost.Asio provides limited support for the Windows Runtime. It requires that the
+language extensions be enabled. Due to the restricted facilities exposed by the
+Windows Runtime API, the support comes with the following caveats:
+
+* The core facilities such as the `io_service`, `strand`, buffers, composed
+ operations, timers, etc., should all work as normal.
+
+* For sockets, only client-side TCP is supported.
+
+* Explicit binding of a client-side TCP socket is not supported.
+
+* The `cancel()` function is not supported for sockets. Asynchronous
+ operations may only be cancelled by closing the socket.
+
+* Operations that use `null_buffers` are not supported.
+
+* Only `tcp::no_delay` and `socket_base::keep_alive` options are supported.
+
+* Resolvers do not support service names, only numbers. I.e. you must
+ use "80" rather than "http".
+
+* Most resolver query flags have no effect.
+
+Demultiplexing mechanism:
+
+* Uses the `Windows::Networking::Sockets::StreamSocket` class to implement
+ asynchronous TCP socket operations.
+
+Threads:
+
+* Event completions are delivered to the Windows thread pool and posted to the
+ `io_service` for the handler to be executed.
+
+* An additional thread per `io_service` is used to trigger timers. This thread
+ is created on construction of the first timer objects.
+
+Scatter-Gather:
+
+* For sockets, at most one buffer may be transferred in a single operation.
+
 
 [endsect]

Modified: branches/release/libs/asio/doc/reference.qbk
==============================================================================
--- branches/release/libs/asio/doc/reference.qbk Sat Oct 26 18:57:10 2013 (r86469)
+++ branches/release/libs/asio/doc/reference.qbk 2013-10-26 19:25:53 EDT (Sat, 26 Oct 2013) (r86470)
@@ -61339,6 +61339,11 @@
 the completion of the first async operation will perform `s.dispatch(a)`, and the second will perform `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.
 
 
+[heading Remarks]
+
+The implementation makes no guarantee that handlers posted or dispatched through different `strand` objects will be invoked concurrently.
+
+
 [heading Thread Safety]
   
 ['Distinct] ['objects:] Safe.
@@ -66332,7 +66337,7 @@
 
 
   template<
- typename ``[link boost_asio.reference.EndpointIterator EndpointIterator]``>
+ typename EndpointIterator>
   static basic_resolver_iterator ``[link boost_asio.reference.ip__basic_resolver_iterator.create.overload3 create]``(
       EndpointIterator begin,
       EndpointIterator end,
@@ -66382,7 +66387,7 @@
 
 
   template<
- typename ``[link boost_asio.reference.EndpointIterator EndpointIterator]``>
+ typename EndpointIterator>
   static basic_resolver_iterator create(
       EndpointIterator begin,
       EndpointIterator end,
@@ -88248,7 +88253,7 @@
 [section:overload3 spawn (3 of 4 overloads)]
 
 
-Start a new stackful coroutine that executes in the contex of a strand.
+Start a new stackful coroutine that executes in the context of a strand.
 
 
   template<
@@ -93970,6 +93975,11 @@
 the completion of the first async operation will perform `s.dispatch(a)`, and the second will perform `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.
 
 
+[heading Remarks]
+
+The implementation makes no guarantee that handlers posted or dispatched through different `strand` objects will be invoked concurrently.
+
+
 [heading Thread Safety]
   
 ['Distinct] ['objects:] Safe.
@@ -105301,7 +105311,7 @@
 [section:yield_context yield_context]
 
 [indexterm1 yield_context]
-Context object the represents the currently executing coroutine.
+Context object that represents the currently executing coroutine.
 
 
   typedef basic_yield_context< unspecified > yield_context;

Modified: branches/release/libs/asio/doc/reference.xsl
==============================================================================
--- branches/release/libs/asio/doc/reference.xsl Sat Oct 26 18:57:10 2013 (r86469)
+++ branches/release/libs/asio/doc/reference.xsl 2013-10-26 19:25:53 EDT (Sat, 26 Oct 2013) (r86470)
@@ -1446,6 +1446,9 @@
         <xsl:when test="declname = 'DatagramSocketService1'">
           <xsl:value-of select="concat('``[link boost_asio.reference.DatagramSocketService ', declname, ']``')"/>
         </xsl:when>
+ <xsl:when test="declname = 'EndpointIterator'">
+ <xsl:value-of select="declname"/>
+ </xsl:when>
         <xsl:when test="declname = 'Elem'">
           <xsl:value-of select="declname"/>
         </xsl:when>

Modified: branches/release/libs/system/src/error_code.cpp
==============================================================================
--- branches/release/libs/system/src/error_code.cpp Sat Oct 26 18:57:10 2013 (r86469)
+++ branches/release/libs/system/src/error_code.cpp 2013-10-26 19:25:53 EDT (Sat, 26 Oct 2013) (r86470)
@@ -26,7 +26,7 @@
 
 # if defined( BOOST_WINDOWS_API )
 # include <windows.h>
-# if !defined(WINAPI_FAMILY) || ((WINAPI_FAMILY & WINAPI_PARTITION_APP) == 0)
+# if !defined(WINAPI_FAMILY) || ((WINAPI_FAMILY & WINAPI_PARTITION_DESKTOP) != 0)
 # include "local_free_on_destruction.hpp"
 # endif
 # ifndef ERROR_INCORRECT_SIZE
@@ -372,7 +372,7 @@
 
   std::string system_error_category::message( int ev ) const
   {
-# if defined(WINAPI_FAMILY) && ((WINAPI_FAMILY & WINAPI_PARTITION_APP) != 0)
+# if defined(WINAPI_FAMILY) && ((WINAPI_FAMILY & WINAPI_PARTITION_DESKTOP) == 0)
     std::string str( 128, char() );
     for (;;)
     {


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