~mordred/libmemcached/pandora-build

« back to all changes in this revision

Viewing changes to libmemcached/hosts.c

  • Committer: Brian Aker
  • Date: 2010-01-21 02:51:52 UTC
  • Revision ID: brian@gaz-20100121025152-0twtkpef3yev2u8u
Cleanup dead files in libmemcached.

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
  return MEMCACHED_SUCCESS;
64
64
}
65
65
 
66
 
static uint32_t ketama_server_hash(const char *key, unsigned int key_length, int alignment)
 
66
static uint32_t ketama_server_hash(const char *key, unsigned int key_length, uint32_t alignment)
67
67
{
68
68
  unsigned char results[16];
69
69
 
70
 
  md5_signature((unsigned char*)key, key_length, results);
 
70
  libhashkit_md5_signature((unsigned char*)key, key_length, results);
 
71
 
71
72
  return ((uint32_t) (results[3 + alignment * 4] & 0xFF) << 24)
72
73
    | ((uint32_t) (results[2 + alignment * 4] & 0xFF) << 16)
73
74
    | ((uint32_t) (results[1 + alignment * 4] & 0xFF) << 8)
215
216
        {
216
217
          for (uint32_t x = 0; x < pointer_per_hash; x++)
217
218
          {
218
 
             value= ketama_server_hash(sort_host, (uint32_t) sort_host_length, (int) x);
 
219
             value= ketama_server_hash(sort_host, (uint32_t) sort_host_length, x);
219
220
             ptr->continuum[continuum_index].index= host_index;
220
221
             ptr->continuum[continuum_index++].value= value;
221
222
          }