/[svn]/ircd-hybrid/trunk/src/client.c
ViewVC logotype

Diff of /ircd-hybrid/trunk/src/client.c

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

revision 9889 by michael, Sun Jan 3 08:13:10 2021 UTC revision 9890 by michael, Sat Jan 16 17:04:04 2021 UTC
# Line 787  exit_client(struct Client *client, const Line 787  exit_client(struct Client *client, const
787          free_list_task(client);          free_list_task(client);
788    
789        invite_clear_list(&client->connection->invited);        invite_clear_list(&client->connection->invited);
790        del_all_accepts(client);  
791          accept_clear_list(&client->connection->acceptlist);
792    
793        monitor_clear_list(client);        monitor_clear_list(client);
794    
795        sendto_realops_flags(UMODE_CCONN, L_ALL, SEND_NOTICE,        sendto_realops_flags(UMODE_CCONN, L_ALL, SEND_NOTICE,
# Line 1004  exit_aborted_clients(void) Line 1006  exit_aborted_clients(void)
1006   */   */
1007    
1008  void  void
1009  del_accept(struct split_nuh_item *accept_p, struct Client *client)  accept_del(struct AcceptItem *accept, dlink_list *list)
1010  {  {
1011    dlinkDelete(&accept_p->node, &client->connection->acceptlist);    dlinkDelete(&accept->node, list);
1012    
1013    xfree(accept_p->nickptr);    xfree(accept->nick);
1014    xfree(accept_p->userptr);    xfree(accept->user);
1015    xfree(accept_p->hostptr);    xfree(accept->host);
1016    xfree(accept_p);    xfree(accept);
1017  }  }
1018    
1019  struct split_nuh_item *  struct AcceptItem *
1020  find_accept(const char *nick, const char *user,  accept_find(const char *nick,
1021              const char *host, struct Client *client,              const char *user,
1022                const char *host, dlink_list *list,
1023              int (*compare)(const char *, const char *))              int (*compare)(const char *, const char *))
1024  {  {
1025    dlink_node *node;    dlink_node *node;
1026    
1027    DLINK_FOREACH(node, client->connection->acceptlist.head)    DLINK_FOREACH(node, list->head)
1028    {    {
1029      struct split_nuh_item *accept_p = node->data;      struct AcceptItem *accept = node->data;
1030    
1031      if (compare(accept_p->nickptr, nick) == 0 &&      if (compare(accept->nick, nick) == 0 &&
1032          compare(accept_p->userptr, user) == 0 &&          compare(accept->user, user) == 0 &&
1033          compare(accept_p->hostptr, host) == 0)          compare(accept->host, host) == 0)
1034        return accept_p;        return accept;
1035    }    }
1036    
1037    return NULL;    return NULL;
# Line 1051  accept_message(struct Client *source, Line 1054  accept_message(struct Client *source,
1054        (HasUMode(source, UMODE_OPER) && ConfigGeneral.opers_bypass_callerid))        (HasUMode(source, UMODE_OPER) && ConfigGeneral.opers_bypass_callerid))
1055      return true;      return true;
1056    
1057    if (source == target || find_accept(source->name, source->username,    if (source == target || accept_find(source->name, source->username, source->host,
1058                                        source->host, target, match))                                        &target->connection->acceptlist, match))
1059      return true;      return true;
1060    
1061    if (!HasUMode(target, UMODE_CALLERID) && HasUMode(target, UMODE_SOFTCALLERID))    if (!HasUMode(target, UMODE_CALLERID) && HasUMode(target, UMODE_SOFTCALLERID))
# Line 1070  accept_message(struct Client *source, Line 1073  accept_message(struct Client *source,
1073   * side effects - Walk through given clients acceptlist and remove all entries   * side effects - Walk through given clients acceptlist and remove all entries
1074   */   */
1075  void  void
1076  del_all_accepts(struct Client *client)  accept_clear_list(dlink_list *list)
1077  {  {
1078    dlink_node *node, *node_next;    while (list->head)
1079        accept_del(list->head->data, list);
   DLINK_FOREACH_SAFE(node, node_next, client->connection->acceptlist.head)  
     del_accept(node->data, client);  
1080  }  }
1081    
1082  unsigned int  unsigned int

Legend:
Removed from v.9889  
changed lines
  Added in v.9890

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