datastax/cpp-driver — pull request #33 by stanislav-podlesny (2014-04-18 19:35:54+00:00)
Title: Fix preventing segmentation fault in boost asio

The driver's design implies cyclic reading of socket, handling incoming messages. This makes possible closing of a connection while it is doing asynchronous reading from socket. The problem is that boost ASIO library does not support starting of socket asynchronous operation after the socket itself closed, causing race condition and possible SEGFAULT (see corresponding ticket https://svn.boost.org/trac/boost/ticket/7611).
- This fix prevents calling async_read if socket was closed.
- Some extra logging added