Update to latest Csocket and use its new init interface

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1288 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2008-12-10 15:53:07 +00:00
parent 9bec4b8048
commit c03bd91589
4 changed files with 47 additions and 29 deletions

View File

@@ -28,7 +28,7 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
* $Revision: 1.89 $
* $Revision: 1.90 $
*/
#include "Csocket.h"
@@ -311,6 +311,31 @@ int GetAddrInfo( const CS_STRING & sHostname, Csock *pSock, CSSockAddr & csSockA
return( ETIMEDOUT );
}
bool InitCsocket()
{
#ifdef _WIN32
WSADATA wsaData;
int iResult = WSAStartup( MAKEWORD( 2, 2 ), &wsaData );
if( iResult != NO_ERROR )
return( false );
#endif /* _WIN32 */
#ifdef HAVE_LIBSSL
if( !InitSSL() )
return( false );
#endif /* HAVE_LIBSSL */
return( true );
}
void ShutdownCsocket()
{
#ifdef HAVE_LIBSSL
ERR_free_strings();
#endif /* HAVE_LIBSSL */
#ifdef _WIN32
WSACleanup();
#endif /* _WIN32 */
}
#ifdef HAVE_LIBSSL
bool InitSSL( ECompType eCompressionType )
{