Fix sample code issue
I still need to take a pass over the new functions in buffer.h, bufferevent.h, and bufferevent_ssl.h.
Fixed wrong variable reference in bev r/w timeouts section.
Make the SSL_shutdown() hack actually work
The proposed hack does not achieve the goal, because it will lead to an unclean shutdown on the other end, which means that the other end will mark the session unclean and drop it from the session cache, leading to degraded performance exactly as if we just closed the socket. So instead of setting both SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN, only set SSL_RECEIVED_SHUTDOWN and let OpenSSL send a close notify. Because there is no distinction in the protocol between close notify requests and close notify replies, this has the net effect of a clean shutdown on both ends of the SSL connection. Also note that SSL_shutdown() will not block on a non-blocking socket. Instead of blocking, it will return -1 with one of SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE, telling us to retry SSL_shutdown() after the underlying socket has become readable or writable, respectively.
bufferevent_socket_connect PF_UNSPEC -> AF_INET fix
Added note about how to cleanly shutdown a ssl bufferevent.
These are marginally advanced topics in OpenSSL usage, and I'd rather not have them cargo-culting around in everybody else's code because of our doing them here. In particular, I'm really not comfortable with telling everybody that they ought to be using RC4.