Make get_shutdown return correct results with stunnel

pull/187/head
Nickolas Lapp 2015-11-11 11:43:38 -07:00
parent 28cbe7e7a5
commit e49b12c7cc
1 changed files with 4 additions and 7 deletions

View File

@ -9952,13 +9952,10 @@ void wolfSSL_set_connect_state(WOLFSSL* ssl)
int wolfSSL_get_shutdown(const WOLFSSL* ssl)
{
WOLFSSL_ENTER("wolfSSL_get_shutdown");
#ifdef HAVE_STUNNEL
return (ssl->options.sentNotify << 1) | (ssl->options.closeNotify);
#else
return (ssl->options.isClosed ||
ssl->options.connReset ||
ssl->options.sentNotify);
#endif
/* in OpenSSL, SSL_SENT_SHUTDOWN = 1, when closeNotifySent *
* SSL_RECEIVED_SHUTDOWN = 2, from close notify or fatal err */
return ((ssl->options.closeNotify||ssl->options.connReset) << 1)
| (ssl->options.sentNotify);
}