rpms/Pound/devel pound-2.4.5-openssl.patch, NONE, 1.1 Pound.spec, 1.32, 1.33 pound-2.4.4-openssl.patch, 1.1, NONE
Lubomir Rintel
lkundrak at fedoraproject.org
Wed Nov 11 15:33:32 UTC 2009
- Previous message: rpms/iwl6000-firmware/F-12 iwl6000-firmware.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
- Next message: rpms/libvirt/devel libvirt-qemu-save-restore.patch, NONE, 1.1 libvirt.spec, 1.195, 1.196
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: lkundrak
Update of /cvs/pkgs/rpms/Pound/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv24344
Modified Files:
Pound.spec
Added Files:
pound-2.4.5-openssl.patch
Removed Files:
pound-2.4.4-openssl.patch
Log Message:
* Wed Nov 11 2009 Lubomir Rintel (GoodData) <lubo.rintel at gooddata.com> - 2.4.5-1
- Rebased to new upstream release
pound-2.4.5-openssl.patch:
config.c | 12 +++++++
pound.h | 8 +++++
svc.c | 98 +++++++++++++++++++++++++++++++++++++++++++++------------------
3 files changed, 91 insertions(+), 27 deletions(-)
--- NEW FILE pound-2.4.5-openssl.patch ---
diff -up Pound-2.4.5/config.c.openssl Pound-2.4.5/config.c
--- Pound-2.4.5/config.c.openssl 2009-06-29 17:53:58.000000000 +0200
+++ Pound-2.4.5/config.c 2009-11-11 16:25:16.000000000 +0100
@@ -379,14 +379,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
@@ -409,7 +417,11 @@ parse_service(FILE *const f_conf, const
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
logmsg(LOG_ERR, "line %d: lh_new failed - aborted", n_lin);
exit(1);
}
diff -up Pound-2.4.5/pound.h.openssl Pound-2.4.5/pound.h
--- Pound-2.4.5/pound.h.openssl 2009-06-29 17:53:58.000000000 +0200
+++ Pound-2.4.5/pound.h 2009-11-11 16:25:16.000000000 +0100
@@ -317,6 +317,10 @@ typedef struct _tn {
/* maximal session key size */
#define KEY_SIZE 127
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+DECLARE_LHASH_OF(TABNODE);
+#endif
+
/* service definition */
typedef struct _service {
char name[KEY_SIZE + 1]; /* symbolic name */
@@ -332,7 +336,11 @@ typedef struct _service {
int sess_ttl; /* session time-to-live */
regex_t sess_pat; /* pattern to match the session data */
char *sess_parm; /* session cookie or parameter */
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+ LHASH_OF(TABNODE) *sessions; /* currently active sessions */
+#else
LHASH *sessions; /* currently active sessions */
+#endif
int dynscale; /* true if the back-ends should be dynamically rescaled */
int disabled; /* true if the service is disabled */
struct _service *next;
diff -up Pound-2.4.5/svc.c.openssl Pound-2.4.5/svc.c
--- Pound-2.4.5/svc.c.openssl 2009-06-29 17:53:58.000000000 +0200
+++ Pound-2.4.5/svc.c 2009-11-11 16:27:03.000000000 +0100
@@ -28,12 +28,17 @@
#include "pound.h"
+#ifndef LHASH_OF
+#define LHASH_OF(x) LHASH
+#define CHECKED_LHASH_OF(type, h) h
+#endif
+
/*
* Add a new key/content pair to a hash table
* the table should be already locked
*/
static void
-t_add(LHASH *const tab, const char *key, const void *content, const size_t cont_len)
+t_add(LHASH_OF(TABNODE) *const tab, const char *key, const void *content, const size_t cont_len)
{
TABNODE *t, *old;
@@ -54,7 +59,11 @@ t_add(LHASH *const tab, const char *key,
}
memcpy(t->content, content, cont_len);
t->last_acc = time(NULL);
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+ if((old = LHM_lh_insert(TABNODE, tab, t)) != NULL) {
+#else
if((old = (TABNODE *)lh_insert(tab, t)) != NULL) {
+#endif
free(old->key);
free(old->content);
free(old);
@@ -69,12 +78,16 @@ t_add(LHASH *const tab, const char *key,
* side-effect: update the time of last access
*/
static void *
-t_find(LHASH *const tab, char *const key)
+t_find(LHASH_OF(TABNODE) *const tab, char *const key)
{
TABNODE t, *res;
t.key = key;
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+ if((res = LHM_lh_retrieve(TABNODE, tab, &t)) != NULL) {
+#else
if((res = (TABNODE *)lh_retrieve(tab, &t)) != NULL) {
+#endif
res->last_acc = time(NULL);
return res->content;
}
@@ -85,12 +98,16 @@ t_find(LHASH *const tab, char *const key
* Delete a key
*/
static void
-t_remove(LHASH *const tab, char *const key)
+t_remove(LHASH_OF(TABNODE) *const tab, char *const key)
{
TABNODE t, *res;
t.key = key;
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+ if((res = LHM_lh_delete(TABNODE, tab, &t)) != NULL) {
+#else
if((res = (TABNODE *)lh_delete(tab, &t)) != NULL) {
+#endif
free(res->key);
free(res->content);
free(res);
@@ -99,59 +116,75 @@ t_remove(LHASH *const tab, char *const k
}
typedef struct {
- LHASH *tab;
+ LHASH_OF(TABNODE) *tab;
time_t lim;
void *content;
int cont_len;
} ALL_ARG;
static void
-t_old(TABNODE *t, void *arg)
+t_old_doall_arg(TABNODE *t, ALL_ARG *a)
{
- ALL_ARG *a;
-
- a = (ALL_ARG *)arg;
if(t->last_acc < a->lim)
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+ LHM_lh_delete(TABNODE, a->tab, t);
+#else
lh_delete(a->tab, t);
+#endif
return;
}
-IMPLEMENT_LHASH_DOALL_ARG_FN(t_old, TABNODE *, void *)
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+IMPLEMENT_LHASH_DOALL_ARG_FN(t_old, TABNODE, ALL_ARG)
+#else
+#define t_old t_old_doall_arg
+IMPLEMENT_LHASH_DOALL_ARG_FN(t_old, TABNODE *, ALL_ARG *)
+#endif
/*
* Expire all old nodes
*/
static void
-t_expire(LHASH *const tab, const time_t lim)
+t_expire(LHASH_OF(TABNODE) *const tab, const time_t lim)
{
ALL_ARG a;
int down_load;
a.tab = tab;
a.lim = lim;
- down_load = tab->down_load;
- tab->down_load = 0;
+ down_load = CHECKED_LHASH_OF(TABNODE, tab)->down_load;
+ CHECKED_LHASH_OF(TABNODE, tab)->down_load = 0;
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+ LHM_lh_doall_arg(TABNODE, tab, LHASH_DOALL_ARG_FN(t_old), ALL_ARG, &a);
+#else
lh_doall_arg(tab, LHASH_DOALL_ARG_FN(t_old), &a);
- tab->down_load = down_load;
+#endif
+ CHECKED_LHASH_OF(TABNODE, tab)->down_load = down_load;
return;
}
static void
-t_cont(TABNODE *t, void *arg)
+t_cont_doall_arg(TABNODE *t, ALL_ARG *a)
{
- ALL_ARG *a;
-
- a = (ALL_ARG *)arg;
if(memcmp(t->content, a->content, a->cont_len) == 0)
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+ LHM_lh_delete(TABNODE, a->tab, t);
+#else
lh_delete(a->tab, t);
+#endif
return;
}
-IMPLEMENT_LHASH_DOALL_ARG_FN(t_cont, TABNODE *, void *)
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+IMPLEMENT_LHASH_DOALL_ARG_FN(t_cont, TABNODE, ALL_ARG)
+#else
+#define t_cont t_cont_doall_arg
+IMPLEMENT_LHASH_DOALL_ARG_FN(t_cont, TABNODE *, ALL_ARG *)
+#endif
/*
* Remove all nodes with the given content
*/
static void
-t_clean(LHASH *const tab, void *const content, const size_t cont_len)
+t_clean(LHASH_OF(TABNODE) *const tab, void *const content, const size_t cont_len)
{
ALL_ARG a;
int down_load;
@@ -159,10 +192,14 @@ t_clean(LHASH *const tab, void *const co
a.tab = tab;
a.content = content;
a.cont_len = cont_len;
- down_load = tab->down_load;
- tab->down_load = 0;
+ down_load = CHECKED_LHASH_OF(TABNODE, tab)->down_load;
+ CHECKED_LHASH_OF(TABNODE, tab)->down_load = 0;
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+ LHM_lh_doall_arg(TABNODE, tab, LHASH_DOALL_ARG_FN(t_cont), ALL_ARG, &a);
+#else
lh_doall_arg(tab, LHASH_DOALL_ARG_FN(t_cont), &a);
- tab->down_load = down_load;
+#endif
+ CHECKED_LHASH_OF(TABNODE, tab)->down_load = down_load;
return;
}
@@ -1385,13 +1422,11 @@ typedef struct {
} DUMP_ARG;
static void
-t_dump(TABNODE *t, void *arg)
+t_dump_doall_arg(TABNODE *t, DUMP_ARG *a)
{
- DUMP_ARG *a;
BACKEND *be, *bep;
int n_be, sz;
- a = (DUMP_ARG *)arg;
memcpy(&bep, t->content, sizeof(bep));
for(n_be = 0, be = a->backends; be; be = be->next, n_be++)
if(be == bep)
@@ -1407,19 +1442,28 @@ t_dump(TABNODE *t, void *arg)
return;
}
-IMPLEMENT_LHASH_DOALL_ARG_FN(t_dump, TABNODE *, void *)
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+IMPLEMENT_LHASH_DOALL_ARG_FN(t_dump, TABNODE, DUMP_ARG)
+#else
+#define t_dump t_dump_doall_arg
+IMPLEMENT_LHASH_DOALL_ARG_FN(t_dump, TABNODE *, DUMP_ARG *)
+#endif
/*
* write sessions to the control socket
*/
static void
-dump_sess(const int control_sock, LHASH *const sess, BACKEND *const backends)
+dump_sess(const int control_sock, LHASH_OF(TABNODE) *const sess, BACKEND *const backends)
{
DUMP_ARG a;
a.control_sock = control_sock;
a.backends = backends;
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+ LHM_lh_doall_arg(TABNODE, sess, LHASH_DOALL_ARG_FN(t_dump), DUMP_ARG, &a);
+#else
lh_doall_arg(sess, LHASH_DOALL_ARG_FN(t_dump), &a);
+#endif
return;
}
Index: Pound.spec
===================================================================
RCS file: /cvs/pkgs/rpms/Pound/devel/Pound.spec,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -p -r1.32 -r1.33
--- Pound.spec 26 Aug 2009 18:36:55 -0000 1.32
+++ Pound.spec 11 Nov 2009 15:33:32 -0000 1.33
@@ -3,8 +3,8 @@
%define pound_home %{_localstatedir}/lib/pound
Name: Pound
-Version: 2.4.4
-Release: 4%{?dist}
+Version: 2.4.5
+Release: 1%{?dist}
Summary: Reverse proxy and load balancer
Group: System Environment/Daemons
@@ -17,7 +17,7 @@ BuildRequires: openssl-devel, pcre-devel
# tcmalloc doesn't exist on ppc yet (#238390)
# or sparc arches
-%ifnarch ppc ppc64 sparcv9 sparc64
+%ifnarch ppc ppc64 sparcv9 sparc64 %{?el5:x86_64}
BuildRequires: google-perftools-devel
%endif
@@ -31,7 +31,7 @@ Source0: http://www.apsis.ch/pound/%{na
Source1: pound.init
Source2: pound.cfg
Patch0: pound-remove-owner.patch
-Patch1: pound-2.4.4-openssl.patch
+Patch1: pound-2.4.5-openssl.patch
%description
The Pound program is a reverse proxy, load balancer and
@@ -118,6 +118,9 @@ fi
%attr(-,%{pound_user},%{pound_group}) %dir %{pound_home}
%changelog
+* Wed Nov 11 2009 Lubomir Rintel (GoodData) <lubo.rintel at gooddata.com> - 2.4.5-1
+- Rebased to new upstream release
+
* Wed Aug 26 2009 Tomas Mraz <tmraz at redhat.com> - 2.4.4-4
- rebuilt with new openssl
--- pound-2.4.4-openssl.patch DELETED ---
- Previous message: rpms/iwl6000-firmware/F-12 iwl6000-firmware.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
- Next message: rpms/libvirt/devel libvirt-qemu-save-restore.patch, NONE, 1.1 libvirt.spec, 1.195, 1.196
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the scm-commits
mailing list