Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52309 - in branches/release: . boost/asio boost/asio/detail boost/asio/ip boost/asio/ssl/detail libs/asio/doc libs/asio/test/archetypes libs/asio/test/ip
From: chris_at_[hidden]
Date: 2009-04-10 19:44:57


Author: chris_kohlhoff
Date: 2009-04-10 19:44:53 EDT (Fri, 10 Apr 2009)
New Revision: 52309
URL: http://svn.boost.org/trac/boost/changeset/52309

Log:
Merged revisions 52288-52294 via svnmerge from
https://svn.boost.org/svn/boost/trunk

........
  r52288 | chris_kohlhoff | 2009-04-09 21:50:42 +1000 (Thu, 09 Apr 2009) | 2 lines
  
  Prevent locales from affecting the formatting of endpoints. Fixes #2682.
........
  r52289 | chris_kohlhoff | 2009-04-09 22:00:36 +1000 (Thu, 09 Apr 2009) | 3 lines
  
  Correct documentation of read, read_at, write and write_at functions to
  match new CompletionCondition concept. Fixes #2871.
........
  r52290 | chris_kohlhoff | 2009-04-09 22:03:01 +1000 (Thu, 09 Apr 2009) | 2 lines
  
  Fix some warnings that occur with MSVC at warning level 4. Fixes #2828.
........
  r52291 | chris_kohlhoff | 2009-04-09 22:04:39 +1000 (Thu, 09 Apr 2009) | 3 lines
  
  As a performance optimisation, add an explicit check for an empty vector of
  timer queues.
........
  r52292 | chris_kohlhoff | 2009-04-09 22:09:16 +1000 (Thu, 09 Apr 2009) | 6 lines
  
  Implement automatic resizing of the bucket array in the internal hash maps.
  This is to improve performance for very large numbers of asynchronous
  operations and also to reduce memory usage for very small numbers. A new
  macro BOOST_ASIO_HASH_MAP_BUCKETS may be used to tweak the sizes used for the
  bucket arrays.
........
  r52293 | chris_kohlhoff | 2009-04-09 22:12:50 +1000 (Thu, 09 Apr 2009) | 3 lines
  
  Prevent memory leaks when an async SSL operation's completion handler throws.
  Fixes #2910.
........
  r52294 | chris_kohlhoff | 2009-04-09 22:16:02 +1000 (Thu, 09 Apr 2009) | 3 lines
  
  Fix implementation of io_control() so that it adheres to the type
  requirements for IoControlCommand. Fixes #2820.
........

Added:
   branches/release/libs/asio/test/archetypes/
      - copied from r52294, /trunk/libs/asio/test/archetypes/
   branches/release/libs/asio/test/archetypes/io_control_command.hpp
      - copied unchanged from r52294, /trunk/libs/asio/test/archetypes/io_control_command.hpp
Properties modified:
   branches/release/ (props changed)
Text files modified:
   branches/release/boost/asio/detail/hash_map.hpp | 77 +++++++++++++++++++++++++++++++++------
   branches/release/boost/asio/detail/reactive_socket_service.hpp | 2
   branches/release/boost/asio/detail/win_iocp_io_service.hpp | 13 ++++--
   branches/release/boost/asio/detail/win_iocp_overlapped_ptr.hpp | 3 +
   branches/release/boost/asio/detail/win_iocp_serial_port_service.hpp | 2
   branches/release/boost/asio/detail/win_iocp_socket_service.hpp | 4 +
   branches/release/boost/asio/ip/basic_endpoint.hpp | 19 ++++++---
   branches/release/boost/asio/read.hpp | 12 +++---
   branches/release/boost/asio/read_at.hpp | 12 +++---
   branches/release/boost/asio/ssl/detail/openssl_stream_service.hpp | 7 ++-
   branches/release/boost/asio/write.hpp | 12 +++---
   branches/release/boost/asio/write_at.hpp | 12 +++---
   branches/release/libs/asio/doc/using.qbk | 21 ++++++++++
   branches/release/libs/asio/test/ip/tcp.cpp | 3 +
   branches/release/libs/asio/test/ip/udp.cpp | 3 +
   15 files changed, 146 insertions(+), 56 deletions(-)

Modified: branches/release/boost/asio/detail/hash_map.hpp
==============================================================================
--- branches/release/boost/asio/detail/hash_map.hpp (original)
+++ branches/release/boost/asio/detail/hash_map.hpp 2009-04-10 19:44:53 EDT (Fri, 10 Apr 2009)
@@ -21,6 +21,7 @@
 #include <cassert>
 #include <list>
 #include <utility>
+#include <vector>
 #include <boost/functional/hash.hpp>
 #include <boost/asio/detail/pop_options.hpp>
 
@@ -61,10 +62,9 @@
 
   // Constructor.
   hash_map()
+ : size_(0)
   {
- // Initialise all buckets to empty.
- for (size_t i = 0; i < num_buckets; ++i)
- buckets_[i].first = buckets_[i].last = values_.end();
+ rehash(hash_size(0));
   }
 
   // Get an iterator for the beginning of the map.
@@ -100,7 +100,7 @@
   // Find an entry in the map.
   iterator find(const K& k)
   {
- size_t bucket = calculate_hash_value(k) % num_buckets;
+ size_t bucket = calculate_hash_value(k) % buckets_.size();
     iterator it = buckets_[bucket].first;
     if (it == values_.end())
       return values_.end();
@@ -118,7 +118,7 @@
   // Find an entry in the map.
   const_iterator find(const K& k) const
   {
- size_t bucket = calculate_hash_value(k) % num_buckets;
+ size_t bucket = calculate_hash_value(k) % buckets_.size();
     const_iterator it = buckets_[bucket].first;
     if (it == values_.end())
       return it;
@@ -136,12 +136,15 @@
   // Insert a new entry into the map.
   std::pair<iterator, bool> insert(const value_type& v)
   {
- size_t bucket = calculate_hash_value(v.first) % num_buckets;
+ if (size_ + 1 >= buckets_.size())
+ rehash(hash_size(size_ + 1));
+ size_t bucket = calculate_hash_value(v.first) % buckets_.size();
     iterator it = buckets_[bucket].first;
     if (it == values_.end())
     {
       buckets_[bucket].first = buckets_[bucket].last =
         values_insert(values_.end(), v);
+ ++size_;
       return std::pair<iterator, bool>(buckets_[bucket].last, true);
     }
     iterator end = buckets_[bucket].last;
@@ -153,6 +156,7 @@
       ++it;
     }
     buckets_[bucket].last = values_insert(end, v);
+ ++size_;
     return std::pair<iterator, bool>(buckets_[bucket].last, true);
   }
 
@@ -161,7 +165,7 @@
   {
     assert(it != values_.end());
 
- size_t bucket = calculate_hash_value(it->first) % num_buckets;
+ size_t bucket = calculate_hash_value(it->first) % buckets_.size();
     bool is_first = (it == buckets_[bucket].first);
     bool is_last = (it == buckets_[bucket].last);
     if (is_first && is_last)
@@ -172,6 +176,7 @@
       --buckets_[bucket].last;
 
     values_erase(it);
+ --size_;
   }
 
   // Remove all entries from the map.
@@ -179,13 +184,61 @@
   {
     // Clear the values.
     values_.clear();
+ size_ = 0;
 
     // Initialise all buckets to empty.
- for (size_t i = 0; i < num_buckets; ++i)
+ for (size_t i = 0; i < buckets_.size(); ++i)
       buckets_[i].first = buckets_[i].last = values_.end();
   }
 
 private:
+ // Calculate the hash size for the specified number of elements.
+ static std::size_t hash_size(std::size_t num_elems)
+ {
+ static std::size_t sizes[] =
+ {
+#if defined(BOOST_ASIO_HASH_MAP_BUCKETS)
+ BOOST_ASIO_HASH_MAP_BUCKETS
+#else // BOOST_ASIO_HASH_MAP_BUCKETS
+ 3, 13, 23, 53, 97, 193, 389, 769, 1543, 3079, 6151, 12289, 24593,
+ 49157, 98317, 196613, 393241, 786433, 1572869, 3145739, 6291469,
+ 12582917, 25165843
+#endif // BOOST_ASIO_HASH_MAP_BUCKETS
+ };
+ const std::size_t nth_size = sizeof(sizes) / sizeof(std::size_t) - 1;
+ for (std::size_t i = 0; i < nth_size; ++i)
+ if (num_elems < sizes[i])
+ return sizes[i];
+ return sizes[nth_size];
+ }
+
+ // Re-initialise the hash from the values already contained in the list.
+ void rehash(std::size_t num_buckets)
+ {
+ iterator end = values_.end();
+
+ // Update number of buckets and initialise all buckets to empty.
+ buckets_.resize(num_buckets);
+ for (std::size_t i = 0; i < buckets_.size(); ++i)
+ buckets_[i].first = buckets_[i].last = end;
+
+ // Put all values back into the hash.
+ iterator iter = values_.begin();
+ while (iter != end)
+ {
+ std::size_t bucket = calculate_hash_value(iter->first) % buckets_.size();
+ if (buckets_[bucket].last == end)
+ {
+ buckets_[bucket].first = buckets_[bucket].last = iter++;
+ }
+ else
+ {
+ values_.splice(++buckets_[bucket].last, values_, iter++);
+ --buckets_[bucket].last;
+ }
+ }
+ }
+
   // Insert an element into the values list by splicing from the spares list,
   // if a spare is available, and otherwise by inserting a new element.
   iterator values_insert(iterator it, const value_type& v)
@@ -209,6 +262,9 @@
     spares_.splice(spares_.begin(), values_, it);
   }
 
+ // The number of elements in the hash.
+ std::size_t size_;
+
   // The list of all values in the hash map.
   std::list<value_type> values_;
 
@@ -223,11 +279,8 @@
     iterator last;
   };
 
- // The number of buckets in the hash.
- enum { num_buckets = 1021 };
-
   // The buckets in the hash.
- bucket_type buckets_[num_buckets];
+ std::vector<bucket_type> buckets_;
 };
 
 } // namespace detail

Modified: branches/release/boost/asio/detail/reactive_socket_service.hpp
==============================================================================
--- branches/release/boost/asio/detail/reactive_socket_service.hpp (original)
+++ branches/release/boost/asio/detail/reactive_socket_service.hpp 2009-04-10 19:44:53 EDT (Fri, 10 Apr 2009)
@@ -448,7 +448,7 @@
       // Flags are manipulated in a temporary variable so that the socket
       // implementation is not updated unless the ioctl operation succeeds.
       unsigned char new_flags = impl.flags_;
- if (command.get())
+ if (*static_cast<ioctl_arg_type*>(command.data()))
         new_flags |= implementation_type::user_set_non_blocking;
       else
         new_flags &= ~implementation_type::user_set_non_blocking;

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 2009-04-10 19:44:53 EDT (Fri, 10 Apr 2009)
@@ -436,12 +436,15 @@
         try
         {
           boost::asio::detail::mutex::scoped_lock lock(timer_mutex_);
- timer_queues_copy_ = timer_queues_;
- for (std::size_t i = 0; i < timer_queues_copy_.size(); ++i)
+ if (!timer_queues_.empty())
           {
- timer_queues_copy_[i]->dispatch_timers();
- timer_queues_copy_[i]->dispatch_cancellations();
- timer_queues_copy_[i]->complete_timers();
+ timer_queues_copy_ = timer_queues_;
+ for (std::size_t i = 0; i < timer_queues_copy_.size(); ++i)
+ {
+ timer_queues_copy_[i]->dispatch_timers();
+ timer_queues_copy_[i]->dispatch_cancellations();
+ timer_queues_copy_[i]->complete_timers();
+ }
           }
         }
         catch (...)

Modified: branches/release/boost/asio/detail/win_iocp_overlapped_ptr.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_iocp_overlapped_ptr.hpp (original)
+++ branches/release/boost/asio/detail/win_iocp_overlapped_ptr.hpp 2009-04-10 19:44:53 EDT (Fri, 10 Apr 2009)
@@ -104,7 +104,8 @@
     if (ptr_)
     {
       ptr_->ec_ = ec;
- ptr_->io_service_.post_completion(ptr_, 0, bytes_transferred);
+ ptr_->io_service_.post_completion(ptr_, 0,
+ static_cast<DWORD>(bytes_transferred));
       ptr_ = 0;
     }
   }

Modified: branches/release/boost/asio/detail/win_iocp_serial_port_service.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_iocp_serial_port_service.hpp (original)
+++ branches/release/boost/asio/detail/win_iocp_serial_port_service.hpp 2009-04-10 19:44:53 EDT (Fri, 10 Apr 2009)
@@ -237,7 +237,7 @@
   }
 
   // Send a break sequence to the serial port.
- boost::system::error_code send_break(implementation_type& impl,
+ boost::system::error_code send_break(implementation_type&,
       boost::system::error_code& ec)
   {
     ec = boost::asio::error::operation_not_supported;

Modified: branches/release/boost/asio/detail/win_iocp_socket_service.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_iocp_socket_service.hpp (original)
+++ branches/release/boost/asio/detail/win_iocp_socket_service.hpp 2009-04-10 19:44:53 EDT (Fri, 10 Apr 2009)
@@ -573,7 +573,7 @@
 
     if (!ec && command.name() == static_cast<int>(FIONBIO))
     {
- if (command.get())
+ if (*static_cast<ioctl_arg_type*>(command.data()))
         impl.flags_ |= implementation_type::user_set_non_blocking;
       else
         impl.flags_ &= ~implementation_type::user_set_non_blocking;
@@ -2192,6 +2192,8 @@
     bool perform(boost::system::error_code& ec,
         std::size_t& bytes_transferred)
     {
+ bytes_transferred = 0;
+
       // Check whether the operation was successful.
       if (ec)
         return true;

Modified: branches/release/boost/asio/ip/basic_endpoint.hpp
==============================================================================
--- branches/release/boost/asio/ip/basic_endpoint.hpp (original)
+++ branches/release/boost/asio/ip/basic_endpoint.hpp 2009-04-10 19:44:53 EDT (Fri, 10 Apr 2009)
@@ -24,6 +24,7 @@
 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
 # include <ostream>
 #endif // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+#include <sstream>
 #include <boost/asio/detail/pop_options.hpp>
 
 #include <boost/asio/error.hpp>
@@ -325,11 +326,14 @@
   }
   else
   {
+ std::ostringstream tmp_os;
+ tmp_os.imbue(std::locale::classic());
     if (addr.is_v4())
- os << a;
+ tmp_os << a;
     else
- os << '[' << a << ']';
- os << ':' << endpoint.port();
+ tmp_os << '[' << a << ']';
+ tmp_os << ':' << endpoint.port();
+ os << tmp_os.str();
   }
   return os;
 }
@@ -351,11 +355,14 @@
   }
   else
   {
+ std::ostringstream tmp_os;
+ tmp_os.imbue(std::locale::classic());
     if (addr.is_v4())
- os << a;
+ tmp_os << a;
     else
- os << '[' << a << ']';
- os << ':' << endpoint.port();
+ tmp_os << '[' << a << ']';
+ tmp_os << ':' << endpoint.port();
+ os << tmp_os.str();
   }
   return os;
 }

Modified: branches/release/boost/asio/read.hpp
==============================================================================
--- branches/release/boost/asio/read.hpp (original)
+++ branches/release/boost/asio/read.hpp 2009-04-10 19:44:53 EDT (Fri, 10 Apr 2009)
@@ -83,7 +83,7 @@
  * @li The supplied buffers are full. That is, the bytes transferred is equal to
  * the sum of the buffer sizes.
  *
- * @li The completion_condition function object returns true.
+ * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the stream's
  * read_some function.
@@ -134,7 +134,7 @@
  * @li The supplied buffers are full. That is, the bytes transferred is equal to
  * the sum of the buffer sizes.
  *
- * @li The completion_condition function object returns true.
+ * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the stream's
  * read_some function.
@@ -202,7 +202,7 @@
  * This function is used to read a certain number of bytes of data from a
  * stream. The call will block until one of the following conditions is true:
  *
- * @li The completion_condition function object returns true.
+ * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the stream's
  * read_some function.
@@ -240,7 +240,7 @@
  * This function is used to read a certain number of bytes of data from a
  * stream. The call will block until one of the following conditions is true:
  *
- * @li The completion_condition function object returns true.
+ * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the stream's
  * read_some function.
@@ -356,7 +356,7 @@
  * @li The supplied buffers are full. That is, the bytes transferred is equal to
  * the sum of the buffer sizes.
  *
- * @li The completion_condition function object returns true.
+ * @li The completion_condition function object returns 0.
  *
  * @param s The stream from which the data is to be read. The type must support
  * the AsyncReadStream concept.
@@ -468,7 +468,7 @@
  * asynchronous operation will continue until one of the following conditions is
  * true:
  *
- * @li The completion_condition function object returns true.
+ * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the stream's
  * async_read_some function.

Modified: branches/release/boost/asio/read_at.hpp
==============================================================================
--- branches/release/boost/asio/read_at.hpp (original)
+++ branches/release/boost/asio/read_at.hpp 2009-04-10 19:44:53 EDT (Fri, 10 Apr 2009)
@@ -91,7 +91,7 @@
  * @li The supplied buffers are full. That is, the bytes transferred is equal to
  * the sum of the buffer sizes.
  *
- * @li The completion_condition function object returns true.
+ * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the device's
  * read_some_at function.
@@ -147,7 +147,7 @@
  * @li The supplied buffers are full. That is, the bytes transferred is equal to
  * the sum of the buffer sizes.
  *
- * @li The completion_condition function object returns true.
+ * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the device's
  * read_some_at function.
@@ -225,7 +225,7 @@
  * random access device at the specified offset. The call will block until one
  * of the following conditions is true:
  *
- * @li The completion_condition function object returns true.
+ * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the device's
  * read_some_at function.
@@ -268,7 +268,7 @@
  * random access device at the specified offset. The call will block until one
  * of the following conditions is true:
  *
- * @li The completion_condition function object returns true.
+ * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the device's
  * read_some_at function.
@@ -389,7 +389,7 @@
  * @li The supplied buffers are full. That is, the bytes transferred is equal to
  * the sum of the buffer sizes.
  *
- * @li The completion_condition function object returns true.
+ * @li The completion_condition function object returns 0.
  *
  * @param d The device from which the data is to be read. The type must support
  * the AsyncRandomAccessReadDevice concept.
@@ -507,7 +507,7 @@
  * always returns immediately. The asynchronous operation will continue until
  * one of the following conditions is true:
  *
- * @li The completion_condition function object returns true.
+ * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the device's
  * async_read_some_at function.

Modified: branches/release/boost/asio/ssl/detail/openssl_stream_service.hpp
==============================================================================
--- branches/release/boost/asio/ssl/detail/openssl_stream_service.hpp (original)
+++ branches/release/boost/asio/ssl/detail/openssl_stream_service.hpp 2009-04-10 19:44:53 EDT (Fri, 10 Apr 2009)
@@ -21,6 +21,7 @@
 #include <boost/asio/detail/push_options.hpp>
 #include <cstddef>
 #include <climits>
+#include <memory>
 #include <boost/config.hpp>
 #include <boost/noncopyable.hpp>
 #include <boost/function.hpp>
@@ -100,8 +101,8 @@
     Handler handler_;
     void handler_impl(const boost::system::error_code& error, size_t size)
     {
+ std::auto_ptr<io_handler<Stream, Handler> > this_ptr(this);
       handler_(error, size);
- delete this;
     }
   }; // class io_handler
 
@@ -124,8 +125,8 @@
     Handler handler_;
     void handler_impl(const boost::system::error_code& error, size_t)
     {
+ std::auto_ptr<handshake_handler<Stream, Handler> > this_ptr(this);
       handler_(error);
- delete this;
     }
 
   }; // class handshake_handler
@@ -149,8 +150,8 @@
     Handler handler_;
     void handler_impl(const boost::system::error_code& error, size_t)
     {
+ std::auto_ptr<shutdown_handler<Stream, Handler> > this_ptr(this);
       handler_(error);
- delete this;
     }
   }; // class shutdown_handler
 

Modified: branches/release/boost/asio/write.hpp
==============================================================================
--- branches/release/boost/asio/write.hpp (original)
+++ branches/release/boost/asio/write.hpp 2009-04-10 19:44:53 EDT (Fri, 10 Apr 2009)
@@ -82,7 +82,7 @@
  * @li All of the data in the supplied buffers has been written. That is, the
  * bytes transferred is equal to the sum of the buffer sizes.
  *
- * @li The completion_condition function object returns true.
+ * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the stream's
  * write_some function.
@@ -133,7 +133,7 @@
  * @li All of the data in the supplied buffers has been written. That is, the
  * bytes transferred is equal to the sum of the buffer sizes.
  *
- * @li The completion_condition function object returns true.
+ * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the stream's
  * write_some function.
@@ -205,7 +205,7 @@
  *
  * @li All of the data in the supplied basic_streambuf has been written.
  *
- * @li The completion_condition function object returns true.
+ * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the stream's
  * write_some function.
@@ -245,7 +245,7 @@
  *
  * @li All of the data in the supplied basic_streambuf has been written.
  *
- * @li The completion_condition function object returns true.
+ * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the stream's
  * write_some function.
@@ -353,7 +353,7 @@
  * @li All of the data in the supplied buffers has been written. That is, the
  * bytes transferred is equal to the sum of the buffer sizes.
  *
- * @li The completion_condition function object returns true.
+ * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the stream's
  * async_write_some function.
@@ -463,7 +463,7 @@
  *
  * @li All of the data in the supplied basic_streambuf has been written.
  *
- * @li The completion_condition function object returns true.
+ * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the stream's
  * async_write_some function.

Modified: branches/release/boost/asio/write_at.hpp
==============================================================================
--- branches/release/boost/asio/write_at.hpp (original)
+++ branches/release/boost/asio/write_at.hpp 2009-04-10 19:44:53 EDT (Fri, 10 Apr 2009)
@@ -88,7 +88,7 @@
  * @li All of the data in the supplied buffers has been written. That is, the
  * bytes transferred is equal to the sum of the buffer sizes.
  *
- * @li The completion_condition function object returns true.
+ * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the device's
  * write_some_at function.
@@ -143,7 +143,7 @@
  * @li All of the data in the supplied buffers has been written. That is, the
  * bytes transferred is equal to the sum of the buffer sizes.
  *
- * @li The completion_condition function object returns true.
+ * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the device's
  * write_some_at function.
@@ -223,7 +223,7 @@
  *
  * @li All of the data in the supplied basic_streambuf has been written.
  *
- * @li The completion_condition function object returns true.
+ * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the device's
  * write_some_at function.
@@ -266,7 +266,7 @@
  *
  * @li All of the data in the supplied basic_streambuf has been written.
  *
- * @li The completion_condition function object returns true.
+ * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the device's
  * write_some_at function.
@@ -379,7 +379,7 @@
  * @li All of the data in the supplied buffers has been written. That is, the
  * bytes transferred is equal to the sum of the buffer sizes.
  *
- * @li The completion_condition function object returns true.
+ * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the device's
  * async_write_some_at function.
@@ -495,7 +495,7 @@
  *
  * @li All of the data in the supplied basic_streambuf has been written.
  *
- * @li The completion_condition function object returns true.
+ * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the device's
  * async_write_some_at function.

Modified: branches/release/libs/asio/doc/using.qbk
==============================================================================
--- branches/release/libs/asio/doc/using.qbk (original)
+++ branches/release/libs/asio/doc/using.qbk 2009-04-10 19:44:53 EDT (Fri, 10 Apr 2009)
@@ -269,6 +269,27 @@
       automatically if `BOOST_NO_TYPEID` is defined.
     ]
   ]
+ [
+ [`BOOST_ASIO_HASH_MAP_BUCKETS`]
+ [
+ Determines the number of buckets in Boost.Asio's internal `hash_map`
+ objects. The value should be a comma separated list of prime numbers, in
+ ascending order. The `hash_map` implementation will automatically
+ increase the number of buckets as the number of elements in the map
+ increases.
+
+ Some examples:
+
+ * Defining `BOOST_ASIO_HASH_MAP_BUCKETS` to `1021` means that the
+ `hash_map` objects will always contain 1021 buckets, irrespective of
+ the number of elements in the map.
+
+ * Defining `BOOST_ASIO_HASH_MAP_BUCKETS` to `53,389,1543` means that the
+ `hash_map` objects will initially contain 53 buckets. The number of
+ buckets will be increased to 389 and then 1543 as elements are added to
+ the map.
+ ]
+ ]
 ]
 
 [heading Mailing List]

Modified: branches/release/libs/asio/test/ip/tcp.cpp
==============================================================================
--- branches/release/libs/asio/test/ip/tcp.cpp (original)
+++ branches/release/libs/asio/test/ip/tcp.cpp 2009-04-10 19:44:53 EDT (Fri, 10 Apr 2009)
@@ -20,6 +20,7 @@
 #include <cstring>
 #include <boost/asio.hpp>
 #include "../unit_test.hpp"
+#include "../archetypes/io_control_command.hpp"
 
 //------------------------------------------------------------------------------
 
@@ -149,7 +150,7 @@
     const char const_char_buffer[128] = "";
     socket_base::message_flags in_flags = 0;
     socket_base::keep_alive socket_option;
- socket_base::bytes_readable io_control_command;
+ archetypes::io_control_command io_control_command;
     boost::system::error_code ec;
 
     // basic_stream_socket constructors.

Modified: branches/release/libs/asio/test/ip/udp.cpp
==============================================================================
--- branches/release/libs/asio/test/ip/udp.cpp (original)
+++ branches/release/libs/asio/test/ip/udp.cpp 2009-04-10 19:44:53 EDT (Fri, 10 Apr 2009)
@@ -20,6 +20,7 @@
 #include <cstring>
 #include <boost/asio.hpp>
 #include "../unit_test.hpp"
+#include "../archetypes/io_control_command.hpp"
 
 //------------------------------------------------------------------------------
 
@@ -54,7 +55,7 @@
     const char const_char_buffer[128] = "";
     socket_base::message_flags in_flags = 0;
     socket_base::keep_alive socket_option;
- socket_base::bytes_readable io_control_command;
+ archetypes::io_control_command io_control_command;
     boost::system::error_code ec;
 
     // basic_datagram_socket constructors.


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