ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/hash.c
(Generate patch)

Comparing ircd-hybrid-7.3/src/hash.c (file contents):
Revision 1029 by michael, Sun Nov 8 13:10:50 2009 UTC vs.
Revision 1118 by michael, Thu Jan 6 13:39:10 2011 UTC

# Line 418 | Line 418 | hash_find_id(const char *name)
418    return client_p;
419   }
420  
421 /*
422 * Whats happening in this next loop ? Well, it takes a name like
423 * foo.bar.edu and proceeds to earch for *.edu and then *.bar.edu.
424 * This is for checking full server names against masks although
425 * it isnt often done this way in lieu of using matches().
426 *
427 * Rewrote to do *.bar.edu first, which is the most likely case,
428 * also made const correct
429 * --Bleep
430 */
431 static struct Client *
432 hash_find_masked_server(const char *name)
433 {
434  char buf[HOSTLEN + 1];
435  char *p = buf;
436  char *s = NULL;
437  struct Client *server = NULL;
438
439  if (*name == '*' || *name == '.')
440    return NULL;
441
442  /*
443   * copy the damn thing and be done with it
444   */
445  strlcpy(buf, name, sizeof(buf));
446
447  while ((s = strchr(p, '.')) != NULL)
448  {
449    *--s = '*';
450
451    /* Dont need to check IsServer() here since nicknames cant
452     * have *'s in them anyway.
453     */
454    if ((server = find_client(s)) != NULL)
455      return server;
456    p = s + 2;
457  }
458
459  return NULL;
460 }
461
421   struct Client *
422   find_server(const char *name)
423   {
# Line 489 | Line 448 | find_server(const char *name)
448      }
449    }
450  
451 <  return (client_p != NULL) ? client_p : hash_find_masked_server(name);
451 >  return client_p;
452   }
453  
454   /* hash_find_channel()

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)