]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] Make appsess{,ion}_refresh static
authorSimon Horman <horms@verge.net.au>
Fri, 24 Jun 2011 05:49:57 +0000 (14:49 +0900)
committerWilly Tarreau <w@1wt.eu>
Sat, 25 Jun 2011 19:07:01 +0000 (21:07 +0200)
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
src/appsession.c

index 6c129261cadde3c137baa8035c5fb7d2c5377ead..6c2494d95ba687c4e37fcfc9245b07e1cc14064e 100644 (file)
@@ -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);
index 754e261601f865075260b5cc781eacfa6e649923..1d442ca2f2eaadc080143bf20b08a8246f68d8fe 100644 (file)
@@ -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;