Throw exception with error message if gnutls_global_init() failed.

pull/1/head
Tatsuhiro Tsujikawa 2011-07-29 22:06:02 +09:00
parent 932c258755
commit aa13ff5f51
1 changed files with 8 additions and 1 deletions

View File

@ -68,6 +68,7 @@
#include "DlAbortEx.h"
#include "message.h"
#include "fmt.h"
namespace aria2 {
@ -103,7 +104,13 @@ bool Platform::setUp()
SSL_library_init();
#endif // HAVE_OPENSSL
#ifdef HAVE_LIBGNUTLS
gnutls_global_init();
{
int r = gnutls_global_init();
if(r != GNUTLS_E_SUCCESS) {
throw DL_ABORT_EX(fmt("gnutls_global_init() failed, cause:%s",
gnutls_strerror(r)));
}
}
#endif // HAVE_LIBGNUTLS
#ifdef CARES_HAVE_ARES_LIBRARY_INIT