From e869176486091c681fe8c6a33f3c2182f9a91189 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Fri, 24 Jun 2011 14:49:57 +0900 Subject: [PATCH] [MINOR] Make appsess{,ion}_refresh static apsession_refresh() and apsess_refressh are only used inside apsession.c and thus can be made static. The only use of apsession_refresh() is appsession_task_init(). These functions have been re-ordered to avoid the need for a forward-declaration of apsession_refresh(). --- include/common/appsession.h | 1 - src/appsession.c | 34 +++++++++++++++++----------------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/include/common/appsession.h b/include/common/appsession.h index 6c129261ca..6c2494d95b 100644 --- a/include/common/appsession.h +++ b/include/common/appsession.h @@ -38,7 +38,6 @@ int match_str(const void *key1, const void *key2); /* Callback for destroy */ void destroy(appsess *data); -struct task *appsession_refresh(struct task *t); int appsession_task_init(void); int appsession_init(void); void appsession_cleanup(void); diff --git a/src/appsession.c b/src/appsession.c index 754e261601..1d442ca2f2 100644 --- a/src/appsession.c +++ b/src/appsession.c @@ -83,23 +83,7 @@ int appsession_init(void) return 0; } -int appsession_task_init(void) -{ - static int initialized = 0; - if (!initialized) { - if ((appsess_refresh = task_new()) == NULL) - return -1; - - appsess_refresh->context = NULL; - appsess_refresh->expire = tick_add(now_ms, MS_TO_TICKS(TBLCHKINT)); - appsess_refresh->process = appsession_refresh; - task_queue(appsess_refresh); - initialized ++; - } - return 0; -} - -struct task *appsession_refresh(struct task *t) +static struct task *appsession_refresh(struct task *t) { struct proxy *p = proxy; struct appsession_hash *htbl; @@ -133,6 +117,22 @@ struct task *appsession_refresh(struct task *t) return t; } /* end appsession_refresh */ +int appsession_task_init(void) +{ + static int initialized = 0; + if (!initialized) { + if ((appsess_refresh = task_new()) == NULL) + return -1; + + appsess_refresh->context = NULL; + appsess_refresh->expire = tick_add(now_ms, MS_TO_TICKS(TBLCHKINT)); + appsess_refresh->process = appsession_refresh; + task_queue(appsess_refresh); + initialized ++; + } + return 0; +} + int match_str(const void *key1, const void *key2) { appsess *temp1,*temp2;