/[svn]/ircd-hybrid/branches/8.2.x/src/watch.c
ViewVC logotype

Diff of /ircd-hybrid/branches/8.2.x/src/watch.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 8590 by michael, Fri Apr 6 19:27:49 2018 UTC revision 8591 by michael, Sun Oct 21 15:44:22 2018 UTC
# Line 124  watch_add_to_hash_table(const char *name Line 124  watch_add_to_hash_table(const char *name
124    {    {
125      watch = xcalloc(sizeof(*watch));      watch = xcalloc(sizeof(*watch));
126    
     watch->lasttime = CurrentTime;  
127      strlcpy(watch->name, name, sizeof(watch->name));      strlcpy(watch->name, name, sizeof(watch->name));
128        watch->hash_value = strhash(watch->name);
129        watch->lasttime = CurrentTime;
130    
131      dlinkAdd(watch, &watch->node, &watchTable[strhash(watch->name)]);      dlinkAdd(watch, &watch->node, &watchTable[watch->hash_value]);
132    }    }
133    else    else
134    {    {
# Line 168  watch_del_from_hash_table(const char *na Line 169  watch_del_from_hash_table(const char *na
169    /* In case this header is now empty of notices, remove it */    /* In case this header is now empty of notices, remove it */
170    if (watch->watched_by.head == NULL)    if (watch->watched_by.head == NULL)
171    {    {
172      assert(dlinkFind(&watchTable[strhash(watch->name)], watch));      assert(dlinkFind(&watchTable[watch->hash_value], watch));
173      dlinkDelete(&watch->node, &watchTable[strhash(watch->name)]);      dlinkDelete(&watch->node, &watchTable[watch->hash_value]);
174      xfree(watch);      xfree(watch);
175    }    }
176  }  }
# Line 196  watch_del_watch_list(struct Client *clie Line 197  watch_del_watch_list(struct Client *clie
197      /* If this leaves a header without notifies, remove it. */      /* If this leaves a header without notifies, remove it. */
198      if (watch->watched_by.head == NULL)      if (watch->watched_by.head == NULL)
199      {      {
200        assert(dlinkFind(&watchTable[strhash(watch->name)], watch));        assert(dlinkFind(&watchTable[watch->hash_value], watch));
201        dlinkDelete(&watch->node, &watchTable[strhash(watch->name)]);        dlinkDelete(&watch->node, &watchTable[watch->hash_value]);
202    
203        xfree(watch);        xfree(watch);
204      }      }

Legend:
Removed from v.8590  
changed lines
  Added in v.8591

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28