1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-07 14:23:12 +02:00

split all the local client stuff to acptr->local. makes it a lot easier to catch bugs.

If the IRCd crashes then it's likely not by this change but rather an existing issue that was previously gone unnoticed.
This commit is contained in:
Bram Matthys
2015-07-19 12:48:18 +02:00
parent 19ad342a73
commit 13fffa4e1a
47 changed files with 580 additions and 587 deletions
+9 -9
View File
@@ -479,11 +479,11 @@ int add_to_watch_hash_table(char *nick, aClient *cptr, int awaynotify)
anptr->watch->next = lp;
lp = make_link();
lp->next = cptr->watch;
lp->next = cptr->local->watch;
lp->value.wptr = anptr;
lp->flags = awaynotify;
cptr->watch = lp;
cptr->watches++;
cptr->local->watch = lp;
cptr->local->watches++;
}
return 0;
@@ -612,7 +612,7 @@ int del_from_watch_hash_table(char *nick, aClient *cptr)
/* Do the same regarding the links in client-record... */
last = NULL;
if ((lp = cptr->watch))
if ((lp = cptr->local->watch))
while (lp && (lp->value.wptr != anptr)) {
last = lp;
lp = lp->next;
@@ -629,7 +629,7 @@ int del_from_watch_hash_table(char *nick, aClient *cptr)
nick, cptr->user);
else {
if (!last) /* First one matched */
cptr->watch = lp->next;
cptr->local->watch = lp->next;
else
last->next = lp->next;
free_link(lp);
@@ -644,7 +644,7 @@ int del_from_watch_hash_table(char *nick, aClient *cptr)
}
/* Update count of notifies on nick */
cptr->watches--;
cptr->local->watches--;
return 0;
}
@@ -659,10 +659,10 @@ int hash_del_watch_list(aClient *cptr)
Link *np, *lp, *last;
if (!(np = cptr->watch))
if (!(np = cptr->local->watch))
return 0; /* Nothing to do */
cptr->watch = NULL; /* Break the watch-list for client */
cptr->local->watch = NULL; /* Break the watch-list for client */
while (np) {
/* Find the watch-record from hash-table... */
anptr = np->value.wptr;
@@ -714,7 +714,7 @@ int hash_del_watch_list(aClient *cptr)
free_link(lp); /* Free the previous */
}
cptr->watches = 0;
cptr->local->watches = 0;
return 0;
}