25 |
static virthost *virthost_hashtable[VIRTHOST_HASHTABLE_SIZE]; |
static virthost *virthost_hashtable[VIRTHOST_HASHTABLE_SIZE]; |
26 |
|
|
27 |
/* |
/* |
|
* Name: get_host_hash_value |
|
|
* |
|
|
* Here we simply use the algorithm used in get_alias_hash_value(); |
|
|
*/ |
|
|
|
|
|
int get_host_hash_value(const char *file) |
|
|
{ |
|
|
unsigned int hash = 0; |
|
|
unsigned int index = 0; |
|
|
unsigned char c; |
|
|
|
|
|
hash = file[index++]; |
|
|
while ((c = file[index++]) && c != '/') |
|
|
hash += (unsigned int) c; |
|
|
|
|
|
return hash % VIRTHOST_HASHTABLE_SIZE; |
|
|
} |
|
|
|
|
|
/* |
|
28 |
* Name: add_virthost |
* Name: add_virthost |
29 |
* |
* |
30 |
* Description: add a virtual host to the virthost hash table. |
* Description: add a virtual host to the virthost hash table. |