43 lines
1.2 KiB
Plaintext
43 lines
1.2 KiB
Plaintext
$OpenBSD: patch-config_c,v 1.1 2010/10/04 08:47:22 sthen Exp $
|
|
|
|
fix for openssl 1.0
|
|
http://www.apsis.ch/pound/pound_list/archive/2010/2010-02/1266065082000
|
|
|
|
--- config.c.orig Tue Feb 2 11:49:02 2010
|
|
+++ config.c Sun Oct 3 23:27:58 2010
|
|
@@ -431,14 +431,22 @@ t_hash(const TABNODE *e)
|
|
res = (res ^ *k++) * 16777619;
|
|
return res;
|
|
}
|
|
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
|
|
+static IMPLEMENT_LHASH_HASH_FN(t, TABNODE)
|
|
+#else
|
|
static IMPLEMENT_LHASH_HASH_FN(t_hash, const TABNODE *)
|
|
+#endif
|
|
|
|
static int
|
|
t_cmp(const TABNODE *d1, const TABNODE *d2)
|
|
{
|
|
return strcmp(d1->key, d2->key);
|
|
}
|
|
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
|
|
+static IMPLEMENT_LHASH_COMP_FN(t, TABNODE)
|
|
+#else
|
|
static IMPLEMENT_LHASH_COMP_FN(t_cmp, const TABNODE *)
|
|
+#endif
|
|
|
|
/*
|
|
* parse a service
|
|
@@ -460,7 +468,11 @@ parse_service(const char *svc_name)
|
|
pthread_mutex_init(&res->mut, NULL);
|
|
if(svc_name)
|
|
strncpy(res->name, svc_name, KEY_SIZE);
|
|
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
|
|
+ if((res->sessions = LHM_lh_new(TABNODE, t)) == NULL)
|
|
+#else
|
|
if((res->sessions = lh_new(LHASH_HASH_FN(t_hash), LHASH_COMP_FN(t_cmp))) == NULL)
|
|
+#endif
|
|
conf_err("lh_new failed - aborted");
|
|
ign_case = ignore_case;
|
|
while(conf_fgets(lin, MAXBUF)) {
|