Skip to content

static unsigned int ketama_hashi( const char* inString ) not correct #6

@GoogleCodeExporter

Description

@GoogleCodeExporter
ketama_hashi return unsigned int ,but in this function you made the ret 
unsigned char.
so the return just are the lower 4 bits of the (int) ret;
static unsigned int ketama_hashi( const char* inString )
{
    unsigned char digest[16], ret;
    ketama_md5_digest( inString, digest );
    ret = ( digest[3] << 24 )
                        | ( digest[2] << 16 )
                        | ( digest[1] <<  8 )
                        |   digest[0];

    return ret;
}
in file ketama.c 355 line.
---------------------------------------------------------
so this make the balance of memcaches fail.

Original issue reported on code.google.com by wangmh....@gmail.com on 28 Feb 2011 at 3:02

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions