valenok/mongoose — pull request #172 by jwang11 (2013-05-17 01:30:11+00:00)
Title: Securely close SSL connection by standard SSL_shutdown

For SSL in close_connection, current implementation use close_socket_gracefully to close socket firstly, then SSL_free. In my testing, this approach may cause some pending write data missing.

I'd suggest use standard SSL_shutdown in SSL conection. It need call twice according to openSSL manual - one call sends the close_notify alert and one call receives the response from the peer

This patch fix issue #168