mirror of
https://github.com/znc/znc.git
synced 2026-05-07 22:04:46 +02:00
fix state bug when connecting to a remote host thats ssl, results from a hostname that resolves to multiple ip's
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1013 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
+10
-3
@@ -28,7 +28,7 @@
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* $Revision: 1.78 $
|
||||
* $Revision: 1.79 $
|
||||
*/
|
||||
|
||||
#include "Csocket.h"
|
||||
@@ -654,6 +654,10 @@ bool Csock::Connect( const CS_STRING & sBindHost, bool bSkipSetup )
|
||||
{
|
||||
if( m_bSkipConnect )
|
||||
{ // this was already called, so skipping now. this is to allow easy pass through
|
||||
if ( m_eConState != CST_OK )
|
||||
{
|
||||
m_eConState = ( GetSSL() ? CST_CONNECTSSL : CST_OK );
|
||||
}
|
||||
return( true );
|
||||
}
|
||||
// bind to a hostname if requested
|
||||
@@ -725,7 +729,9 @@ bool Csock::Connect( const CS_STRING & sBindHost, bool bSkipSetup )
|
||||
}
|
||||
|
||||
if ( m_eConState != CST_OK )
|
||||
m_eConState = CST_OK;
|
||||
{
|
||||
m_eConState = ( GetSSL() ? CST_CONNECTSSL : CST_OK );
|
||||
}
|
||||
|
||||
return( true );
|
||||
}
|
||||
@@ -1114,7 +1120,6 @@ bool Csock::ConnectSSL( const CS_STRING & sBindhost )
|
||||
if ( m_iReadSock == -1 )
|
||||
if ( !Connect( sBindhost ) )
|
||||
return( false );
|
||||
|
||||
if ( !m_ssl )
|
||||
if ( !SSLClientSetup() )
|
||||
return( false );
|
||||
@@ -1142,6 +1147,8 @@ bool Csock::ConnectSSL( const CS_STRING & sBindhost )
|
||||
set_blocking( m_iReadSock );
|
||||
}
|
||||
|
||||
if ( m_eConState != CST_OK )
|
||||
m_eConState = CST_OK;
|
||||
return( bPass );
|
||||
#else
|
||||
return( false );
|
||||
|
||||
Reference in New Issue
Block a user