From 1096a6b82c4110f7a15132c9a2b525899d62380c Mon Sep 17 00:00:00 2001 From: Xavier Roche Date: Mon, 19 Mar 2012 13:02:50 +0000 Subject: httrack 3.43.12 (again) --- src/htsmodules.c | 47 ++++++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 21 deletions(-) (limited to 'src/htsmodules.c') diff --git a/src/htsmodules.c b/src/htsmodules.c index 8f7facc..07291bd 100644 --- a/src/htsmodules.c +++ b/src/htsmodules.c @@ -263,30 +263,35 @@ void htspe_init(void) { handle = LoadLibraryA((char*)"ssleay32"); #else /* We are compatible with 0.9.6/7/8/8b and potentially above */ - handle = dlopen("libssl.so.0.9.8g", RTLD_LAZY); /* added 8g release too (Debarshi Ray) */ - if (handle == NULL) { - handle = dlopen("libssl.so.0.9.8b", RTLD_LAZY); - } - if (handle == NULL) { - handle = dlopen("libssl.so.0.9.8", RTLD_LAZY); - } - if (handle == NULL) { - handle = dlopen("libssl.so.0.9.7", RTLD_LAZY); - } - if (handle == NULL) { - handle = dlopen("libssl.so.0.9.6", RTLD_LAZY); - } - if (handle == NULL) { - /* Try harder with .0 if any */ - handle = dlopen("libssl.so.0", RTLD_LAZY); - } - if (handle == NULL) { - /* Try harder with devel link */ - handle = dlopen("libssl.so", RTLD_LAZY); + static const char *const libs[] = { + "libssl.so.1.0", + "libssl.so.1", + "libssl.so.1.0.0", + /* */ + "libssl.so.0", + "libssl.so.0.9", + "libssl.so.0.9.8p", + "libssl.so.0.9.8o", + "libssl.so.0.9.8n", + "libssl.so.0.9.8m", + "libssl.so.0.9.8l", + "libssl.so.0.9.8k", /* (Debarshi Ray) */ + "libssl.so.0.9.8j", /* (Debarshi Ray) */ + "libssl.so.0.9.8g", /* Added 8g release too (Debarshi Ray) */ + "libssl.so.0.9.8b", + "libssl.so.0.9.8", + "libssl.so.0.9.7", + "libssl.so.0.9.6", + "libssl.so", /* Try harder with devel link */ + NULL + }; + int i; + for(i = 0, handle = NULL ; handle == NULL && libs[i] != NULL ; i++) { + handle = dlopen(libs[i], RTLD_LAZY); } #endif ssl_handle = handle; - if (handle) { + if (handle != NULL) { SSL_shutdown = (t_SSL_shutdown) DynamicGet(handle, (char*)"SSL_shutdown"); SSL_free = (t_SSL_free) DynamicGet(handle, (char*)"SSL_free"); SSL_new = (t_SSL_new) DynamicGet(handle, (char*)"SSL_new"); -- cgit v1.2.3