Log message:
Bug Fix. This fixes a bug which was causing stale entries to be left in
the client hash table when names were changed.
From Isomer:
I believe that it doesn't actually /do/ anything if your at the head of
the bucket. It should remove you from the bucket and place you in the new
one. Patch should be trivial for someone with cvs access to apply.
int hChangeClient(aClient *cptr, char *newname)
{
register HASHREGS oldhash = strhash(cptr->name);
register HASHREGS newhash = strhash(newname);
register aClient *tmp;
tmp = clientTable[oldhash];
if (tmp == cptr)
return 0;
/* ^^^^^^^^ shouldn't we do something here? */
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@11
c9e4aea6-c8fd-4c43-8297-
357d70d61c8c
-ircu2.10.07+.03
+ircu2.10.07+.04
#
-# $Id: BUGS,v 1.1.1.1 1999-11-16 05:13:14 codercom Exp $
+# $Id: BUGS,v 1.2 1999-12-11 08:54:13 bleep Exp $
#
# Undernet ircu BUGS File
# Please put information about known bugs here, if the bug has been resolved
# please comment the entry with "(fixed)"
#
+
#
# ChangeLog for Undernet ircu Servers
#
-# $Id: ChangeLog,v 1.4 1999-11-29 00:26:41 bleep Exp $
+# $Id: ChangeLog,v 1.5 1999-12-11 08:54:13 bleep Exp $
#
# Please insert new entries on the top of the list, a one or two line comment
# is sufficient. Please include your name on the entries we know who to blame.
# Please keep lines < 80 chars.
#-------------------------------------------------------------------------------
+* hash.c (hChangeClient): bug fix. If the client pointer matched the first
+ pointer in the bucket, the change was ignored (returned 0), leaving stale
+ values in the hash table, eventually causing the server to die for mysterious
+ reasons. Bug discovered by Quant and Isomer --Bleep
* config-sh.in, channel.h, numeric.h, channel.c, s_debug.c, s_err.c:
add lchanmode patch by CaptJay, add symbols to incredibly long
feature string. Bump patchlevel to .03 --Bleep
{
clientTable[hashv] = cptr->hnext;
return 0;
- };
-
+ }
while (tmp)
{
if (tmp->hnext == cptr)
{
tmp->hnext = tmp->hnext->hnext;
return 0;
- };
+ }
tmp = tmp->hnext;
- };
-
+ }
return -1;
-
}
/*
*/
int hChangeClient(aClient *cptr, char *newname)
{
- register HASHREGS oldhash = strhash(cptr->name);
register HASHREGS newhash = strhash(newname);
- register aClient *tmp;
- tmp = clientTable[oldhash];
-
- if (tmp == cptr)
- return 0;
+ hRemClient(cptr);
- while (tmp)
- {
- if (tmp->hnext == cptr)
- {
- tmp->hnext = cptr->hnext;
- cptr->hnext = clientTable[newhash];
- clientTable[newhash] = cptr;
- return 0;
- };
- tmp = tmp->hnext;
- };
-
- /* Well... do our best anyway... link it to the correct list,
- and then... Fail (and core if we are debugging) ! */
cptr->hnext = clientTable[newhash];
clientTable[newhash] = cptr;
- return -1;
+ return 0;
}
/*