Index: boost/asio/ssl/detail/openssl_stream_service.hpp =================================================================== --- boost/asio/ssl/detail/openssl_stream_service.hpp (revision 64767) +++ boost/asio/ssl/detail/openssl_stream_service.hpp (working copy) @@ -161,12 +161,12 @@ ::SSL* ssl; ::BIO* ext_bio; net_buffer recv_buf; + boost::asio::io_service::strand* strand; } * impl_type; // Construct a new stream socket service for the specified io_service. explicit openssl_stream_service(boost::asio::io_service& io_service) - : boost::asio::detail::service_base(io_service), - strand_(io_service) + : boost::asio::detail::service_base(io_service) { } @@ -194,6 +194,7 @@ impl->ext_bio = 0; ::BIO_new_bio_pair(&int_bio, 8192, &impl->ext_bio, 8192); ::SSL_set_bio(impl->ssl, int_bio, int_bio); + impl->strand = new boost::asio::io_service::strand(get_io_service()); } // Destroy a stream implementation. @@ -204,6 +205,7 @@ { ::BIO_free(impl->ext_bio); ::SSL_free(impl->ssl); + delete impl->strand; delete impl; impl = 0; } @@ -262,11 +264,11 @@ boost::arg<1>(), boost::arg<2>() ), - strand_ + *(impl->strand) ); local_handler->set_operation(op); - strand_.post(boost::bind(&openssl_operation::start, op)); + impl->strand->post(boost::bind(&openssl_operation::start, op)); } // Shut down SSL on the stream. @@ -317,11 +319,11 @@ boost::arg<1>(), boost::arg<2>() ), - strand_ + *(impl->strand) ); local_handler->set_operation(op); - strand_.post(boost::bind(&openssl_operation::start, op)); + impl->strand->post(boost::bind(&openssl_operation::start, op)); } // Write some data to the stream. @@ -410,11 +412,11 @@ boost::arg<1>(), boost::arg<2>() ), - strand_ + *(impl->strand) ); local_handler->set_operation(op); - strand_.post(boost::bind(&openssl_operation::start, op)); + impl->strand->post(boost::bind(&openssl_operation::start, op)); } // Read some data from the stream. @@ -503,11 +505,11 @@ boost::arg<1>(), boost::arg<2>() ), - strand_ + *(impl->strand) ); local_handler->set_operation(op); - strand_.post(boost::bind(&openssl_operation::start, op)); + impl->strand->post(boost::bind(&openssl_operation::start, op)); } // Peek at the incoming data on the stream. @@ -529,8 +531,6 @@ } private: - boost::asio::io_service::strand strand_; - typedef boost::asio::detail::mutex mutex_type; template