mirror of https://github.com/aria2/aria2
Throw exception with error message if gnutls_global_init() failed.
parent
932c258755
commit
aa13ff5f51
|
@ -68,6 +68,7 @@
|
||||||
|
|
||||||
#include "DlAbortEx.h"
|
#include "DlAbortEx.h"
|
||||||
#include "message.h"
|
#include "message.h"
|
||||||
|
#include "fmt.h"
|
||||||
|
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
|
||||||
|
@ -103,7 +104,13 @@ bool Platform::setUp()
|
||||||
SSL_library_init();
|
SSL_library_init();
|
||||||
#endif // HAVE_OPENSSL
|
#endif // HAVE_OPENSSL
|
||||||
#ifdef HAVE_LIBGNUTLS
|
#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
|
#endif // HAVE_LIBGNUTLS
|
||||||
|
|
||||||
#ifdef CARES_HAVE_ARES_LIBRARY_INIT
|
#ifdef CARES_HAVE_ARES_LIBRARY_INIT
|
||||||
|
|
Loading…
Reference in New Issue