From de39c9b10f01e3bd7822c403c17f29589e77fe57 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 10 Aug 2015 19:17:10 +0200 Subject: [PATCH] CLEANUP: appsession: remove the last include files These ones were include/common/appsession.h and include/common/sessionhash.h. --- include/common/appsession.h | 52 ------------------------------ include/common/sessionhash.h | 62 ------------------------------------ 2 files changed, 114 deletions(-) delete mode 100644 include/common/appsession.h delete mode 100644 include/common/sessionhash.h diff --git a/include/common/appsession.h b/include/common/appsession.h deleted file mode 100644 index 6c2494d95..000000000 --- a/include/common/appsession.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef _COMMON_APPSESS_H -#define _COMMON_APPSESS_H - -/* - * The time between two calls of appsession_refresh in ms. - */ -#define TBLCHKINT 5000 - -#include - -#include -#include - -#include - -typedef struct appsessions { - char *sessid; - char *serverid; - int expire; /* next expiration time for this application session (in tick) */ - unsigned long int request_count; - struct list hash_list; -} appsess; - -extern struct pool_head *pool2_appsess; - -struct app_pool { - struct pool_head *sessid; - struct pool_head *serverid; -}; - -extern struct app_pool apools; -extern int have_appsession; - - -/* Callback for hash_lookup */ -int match_str(const void *key1, const void *key2); - -/* Callback for destroy */ -void destroy(appsess *data); - -int appsession_task_init(void); -int appsession_init(void); -void appsession_cleanup(void); - -#endif /* _COMMON_APPSESS_H */ - -/* - * Local variables: - * c-indent-level: 8 - * c-basic-offset: 8 - * End: - */ diff --git a/include/common/sessionhash.h b/include/common/sessionhash.h deleted file mode 100644 index da5fde0f5..000000000 --- a/include/common/sessionhash.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef SESSION_HASH_H -#define SESSION_HASH_H - -/* - * HashTable functions. - * - * Copyright 2007 Arnaud Cornet - * - * This file is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License, version 2.1 as published by the Free Software Foundation. - * - */ - -#include - -#ifndef TABLESHIFT -#define TABLESHIFT 11 -#endif -#define TABLESIZE (1UL << TABLESHIFT) -#define TABLEMASK (TABLESIZE - 1) - -/* - * quick and dirty AppSession hash table, using sessid as key - */ - -struct appsession_hash -{ - struct list *table; - void (*destroy)(appsess *); -}; - -unsigned int appsession_hash_f(char *); -int appsession_hash_init(struct appsession_hash *hash, - void(*destroy)(appsess*)); -void appsession_hash_insert(struct appsession_hash *hash, - struct appsessions *session); -struct appsessions *appsession_hash_lookup(struct appsession_hash *hash, - char *key); -void appsession_hash_remove(struct appsession_hash *hash, - struct appsessions *session); - -void appsession_hash_destroy(struct appsession_hash *hash); -#if defined(DEBUG_HASH) -void appsession_hash_dump(struct appsession_hash *hash); -#endif - -/* - * Iterates through a hashtable of items of type "typeof(*item)" - * A pointer to the appsession_hash is passed in . The hash table - * internaly uses member of the struct. A temporary variable - * of same type as is needed so that may safely be deleted if - * needed. is a variable containing 's current bucket index in the - * hash table. - * Example: as_hash_for_each_entry_safe(idx, item, tmp, &hash, hash_list) - * { ... } - */ -#define as_hash_for_each_entry_safe(idx, item, back, hash, member) \ - for (idx = 0; idx < TABLESIZE; idx++) \ - list_for_each_entry_safe(item, back, &((hash)->table[idx]), member) - -#endif /* SESSION_HASH_H */