use strcasecmp rather than strcmp on cookies (room names) to make

rooms case insensitive.
This commit is contained in:
eehouse 2010-05-01 02:49:19 +00:00
parent d143c47aa1
commit 3e83f50c84
3 changed files with 5 additions and 4 deletions

View file

@ -288,7 +288,7 @@ CookieRef::GameOpen( const char* cookie, bool isNew,
}
/* Error to connect if cookie doesn't match. */
if ( accept && !!cookie && 0 != strcmp( cookie, Cookie() ) ) {
if ( accept && !!cookie && 0 != strcasecmp( cookie, Cookie() ) ) {
logf( XW_LOGERROR, "%s: not accepting b/c cookie mismatch: %s vs %s",
__func__, cookie, Cookie() );
accept = false;

View file

@ -148,7 +148,8 @@ CRefMgr::FindOpenGameFor( const char* cookie, const char* connName,
if ( !!connName ) {
if ( 0 == strcmp( cref->ConnName(), connName ) ) {
if ( cref->Lock() ) {
assert( !cookie || 0 == strcmp( cookie, cref->Cookie() ) );
assert( !cookie ||
0 == strcasecmp( cookie, cref->Cookie() ) );
if ( cref->SeedBelongs( gameSeed ) ) {
logf( XW_LOGINFO, "%s: SeedBelongs: dup packet?",
__func__ );
@ -168,7 +169,7 @@ CRefMgr::FindOpenGameFor( const char* cookie, const char* connName,
}
if ( !found && !!cookie ) {
if ( 0 == strcmp( cref->Cookie(), cookie ) ) {
if ( 0 == strcasecmp( cref->Cookie(), cookie ) ) {
if ( cref->Lock() ) {
if ( cref->ConnName()[0] ) {
/* if has a connName, we can tell if belongs */

View file

@ -420,7 +420,7 @@ print_cookies( int socket, const char* cookie, const char* connName )
for ( id = iter.Next(); id != 0; id = iter.Next() ) {
SafeCref scr( id );
if ( cookie != NULL && 0 == strcmp( scr.Cookie(), cookie ) ) {
if ( cookie != NULL && 0 == strcasecmp( scr.Cookie(), cookie ) ) {
/* print this one */
} else if ( connName != NULL &&
0 == strcmp( scr.ConnName(), connName ) ) {