Fix long lines. Don't use deprecated ssl::context constructor in examples.

This commit is contained in:
Christopher Kohlhoff 2011-03-17 12:18:41 +11:00
parent 192c85f92d
commit 344b6f19d8
4 changed files with 17 additions and 14 deletions

View File

@ -120,10 +120,10 @@ public:
continue;
}
// The engine wants more data to be read from input. However, we cannot
// allow more than one read operation at a time on the underlying
// transport. The pending_read_ timer's expiry is set to pos_infin if a
// read is in progress, and neg_infin otherwise.
// The engine wants more data to be read from input. However, we
// cannot allow more than one read operation at a time on the
// underlying transport. The pending_read_ timer's expiry is set to
// pos_infin if a read is in progress, and neg_infin otherwise.
if (core_.pending_read_.expires_at() == boost::posix_time::neg_infin)
{
// Prevent other read operations from being started.
@ -171,9 +171,9 @@ public:
default:
// The SSL operation is done and we can invoke the handler, but we have
// to keep in mind that this function might be being called from the
// async operation's initiating function. In this case we're not
// The SSL operation is done and we can invoke the handler, but we
// have to keep in mind that this function might be being called from
// the async operation's initiating function. In this case we're not
// allowed to call the handler directly. Instead, issue a zero-sized
// read so the handler runs "as-if" posted using io_service::post().
if (start)
@ -201,7 +201,8 @@ public:
case engine::want_input_and_retry:
// Add received data to the engine's input.
core_.input_ = asio::buffer(core_.input_buffer_, bytes_transferred);
core_.input_ = asio::buffer(
core_.input_buffer_, bytes_transferred);
core_.input_ = core_.engine_.put_input(core_.input_);
// Release any waiting read operations.

View File

@ -60,8 +60,8 @@ using asio::ssl::old::stream;
* To use the SSL stream template with an ip::tcp::socket, you would write:
* @code
* asio::io_service io_service;
* asio::ssl::context context(io_service, asio::ssl::context::sslv23);
* asio::ssl::stream<asio::ip::tcp::socket> sock(io_service, context);
* asio::ssl::context ctx(asio::ssl::context::sslv23);
* asio::ssl::stream<asio:ip::tcp::socket> sock(io_service, ctx);
* @endcode
*
* @par Concepts:

View File

@ -19,7 +19,8 @@ enum { max_length = 1024 };
class client
{
public:
client(asio::io_service& io_service, asio::ssl::context& context,
client(asio::io_service& io_service,
asio::ssl::context& context,
asio::ip::tcp::resolver::iterator endpoint_iterator)
: socket_(io_service, context)
{
@ -116,7 +117,7 @@ int main(int argc, char* argv[])
asio::ip::tcp::resolver::query query(argv[1], argv[2]);
asio::ip::tcp::resolver::iterator iterator = resolver.resolve(query);
asio::ssl::context ctx(io_service, asio::ssl::context::sslv23);
asio::ssl::context ctx(asio::ssl::context::sslv23);
ctx.set_verify_mode(asio::ssl::context::verify_peer);
ctx.load_verify_file("ca.pem");

View File

@ -19,7 +19,8 @@ typedef asio::ssl::stream<asio::ip::tcp::socket> ssl_socket;
class session
{
public:
session(asio::io_service& io_service, asio::ssl::context& context)
session(asio::io_service& io_service,
asio::ssl::context& context)
: socket_(io_service, context)
{
}
@ -95,7 +96,7 @@ public:
: io_service_(io_service),
acceptor_(io_service,
asio::ip::tcp::endpoint(asio::ip::tcp::v4(), port)),
context_(io_service, asio::ssl::context::sslv23)
context_(asio::ssl::context::sslv23)
{
context_.set_options(
asio::ssl::context::default_workarounds