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:
imaginos
2008-04-02 16:15:24 +00:00
parent 6d957ed93c
commit 3583b4b5de
2 changed files with 18 additions and 7 deletions
+10 -3
View File
@@ -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 );