mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
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:
27
Csocket.cpp
27
Csocket.cpp
@@ -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 )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user