diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2007-09-05 08:48:43 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2007-09-05 08:48:43 +0000 |
commit | 1074ccbebd18c34270e1184e07b0bd2173585f78 (patch) | |
tree | 4e1dd9bdf76b0296cd3f1b85b41014e259405ed9 /usr.sbin/relayd/relayd.c | |
parent | b774198ec751ffa1f4a79ba09b955577f3da58b0 (diff) |
store relay sessions in SPLAY trees instead of TAILQ lists. this will
be used for faster lookups of sessions based on different criteria.
ok pyr@
Diffstat (limited to 'usr.sbin/relayd/relayd.c')
-rw-r--r-- | usr.sbin/relayd/relayd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/relayd/relayd.c b/usr.sbin/relayd/relayd.c index 2de941c0367..22a72cf18c1 100644 --- a/usr.sbin/relayd/relayd.c +++ b/usr.sbin/relayd/relayd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: relayd.c,v 1.38 2007/07/05 09:42:26 thib Exp $ */ +/* $OpenBSD: relayd.c,v 1.39 2007/09/05 08:48:42 reyk Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -472,8 +472,8 @@ purge_config(struct hoststated *env, u_int8_t what) if (what & PURGE_RELAYS) { while ((rly = TAILQ_FIRST(&env->relays)) != NULL) { TAILQ_REMOVE(&env->relays, rly, entry); - while ((sess = TAILQ_FIRST(&rly->sessions)) != NULL) { - TAILQ_REMOVE(&rly->sessions, sess, entry); + while ((sess = SPLAY_ROOT(&rly->sessions)) != NULL) { + SPLAY_REMOVE(session_tree, &rly->sessions, sess); free(sess); } if (rly->bev != NULL) @@ -744,7 +744,7 @@ session_find(struct hoststated *env, objid_t id) struct session *con; TAILQ_FOREACH(rlay, &env->relays, entry) - TAILQ_FOREACH(con, &rlay->sessions, entry) + SPLAY_FOREACH(con, session_tree, &rlay->sessions) if (con->id == id) return (con); return (NULL); |