#ifndef _COMMON_HASH_H_
#define _COMMON_HASH_H_
-unsigned long hash_djb2(const char *key, int len);
-unsigned long hash_wt6(const char *key, int len);
-unsigned long hash_sdbm(const char *key, int len);
+unsigned int hash_djb2(const char *key, int len);
+unsigned int hash_wt6(const char *key, int len);
+unsigned int hash_sdbm(const char *key, int len);
#endif /* _COMMON_HASH_H_ */
}
/* helper function to invoke the correct hash method */
-static unsigned long gen_hash(const struct proxy* px, const char* key, unsigned long len)
+static unsigned int gen_hash(const struct proxy* px, const char* key, unsigned long len)
{
- unsigned long hash;
+ unsigned int hash;
switch (px->lbprm.algo & BE_LB_HASH_FUNC) {
case BE_LB_HFCN_DJB2:
*/
struct server *get_server_uh(struct proxy *px, char *uri, int uri_len)
{
- unsigned long hash = 0;
+ unsigned int hash = 0;
int c;
int slashes = 0;
const char *start, *end;
*/
struct server *get_server_ph(struct proxy *px, const char *uri, int uri_len)
{
- unsigned long hash = 0;
+ unsigned int hash = 0;
const char *start, *end;
const char *p;
const char *params;
*/
struct server *get_server_ph_post(struct session *s)
{
- unsigned long hash = 0;
+ unsigned int hash = 0;
struct http_txn *txn = &s->txn;
struct channel *req = s->req;
struct http_msg *msg = &txn->req;
*/
struct server *get_server_hh(struct session *s)
{
- unsigned long hash = 0;
+ unsigned int hash = 0;
struct http_txn *txn = &s->txn;
struct proxy *px = s->be;
unsigned int plen = px->hh_len;
/* RDP Cookie HASH. */
struct server *get_server_rch(struct session *s)
{
- unsigned long hash = 0;
+ unsigned int hash = 0;
struct proxy *px = s->be;
unsigned long len;
int ret;
#include <common/hash.h>
-unsigned long hash_wt6(const char *key, int len)
+unsigned int hash_wt6(const char *key, int len)
{
unsigned h0 = 0xa53c965aUL;
unsigned h1 = 0x5ca6953aUL;
return h0 ^ h1;
}
-unsigned long hash_djb2(const char *key, int len)
+unsigned int hash_djb2(const char *key, int len)
{
- unsigned long hash = 5381;
+ unsigned int hash = 5381;
/* the hash unrolled eight times */
for (; len >= 8; len -= 8) {
return hash;
}
-unsigned long hash_sdbm(const char *key, int len)
+unsigned int hash_sdbm(const char *key, int len)
{
- unsigned long hash = 0;
+ unsigned int hash = 0;
int c;
while (len--) {