From 558e277968053e028999ec1dacd2c24e273fdcdd Mon Sep 17 00:00:00 2001 From: imaginos Date: Fri, 12 Feb 2010 22:59:04 +0000 Subject: [PATCH] keep supporting older versions of openssl git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1751 726aef4b-f618-498e-8847-2d620e286838 --- Csocket.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Csocket.cpp b/Csocket.cpp index afec535e..2a00f58d 100644 --- a/Csocket.cpp +++ b/Csocket.cpp @@ -2116,10 +2116,15 @@ int Csock::GetPending() // returns an int, they don't bother returning in error to notify us, so basically // we have to always clear errors here generated by SSL_pending, otherwise the stack could // have a lame error on it causing SSL_write to fail in certain instances. +#if OPENSSL_VERSION_NUMBER >= 0x00908 ERR_set_mark(); int iBytes = SSL_pending( m_ssl ); ERR_pop_to_mark(); return( iBytes ); +#else + int iBytes = SSL_pending( m_ssl ); + ERR_clear_error(); // to get safer handling, upgrade your openssl version! +#endif /* OPENSSL_VERSION_NUMBER */ } else return( 0 );