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

Comparing ircd-hybrid-8/src/client.c (file contents):
Revision 1339 by michael, Fri Apr 6 10:22:36 2012 UTC vs.
Revision 1549 by michael, Mon Oct 1 18:11:11 2012 UTC

# Line 129 | Line 129 | make_client(struct Client *from)
129    else
130      client_p->from = from; /* 'from' of local client is self! */
131  
132 +  client_p->idhnext = client_p;
133    client_p->hnext  = client_p;
134    client_p->status = STAT_UNKNOWN;
135    strcpy(client_p->username, "unknown");
# Line 149 | Line 150 | free_client(struct Client *client_p)
150    assert(client_p != NULL);
151    assert(client_p != &me);
152    assert(client_p->hnext == client_p);
153 +  assert(client_p->idhnext == client_p);
154    assert(client_p->channel.head == NULL);
155    assert(dlink_list_length(&client_p->channel) == 0);
156 +  assert(dlink_list_length(&client_p->whowas) == 0);
157 +  assert(!IsServer(client_p) || IsServer(client_p) && client_p->serv);
158  
155  MyFree(client_p->away);
159    MyFree(client_p->serv);
160  
161    if (MyConnect(client_p))
162    {
163      assert(client_p->localClient->invited.head == NULL);
164      assert(dlink_list_length(&client_p->localClient->invited) == 0);
165 +    assert(dlink_list_length(&client_p->localClient->watches) == 0);
166      assert(IsClosing(client_p) && IsDead(client_p));
167  
168      MyFree(client_p->localClient->response);
# Line 246 | Line 250 | check_pings_list(dlink_list *list)
250        continue;
251      }
252  
249    if (client_p->localClient->reject_delay > 0)
250    {
251      if (client_p->localClient->reject_delay <= CurrentTime)
252        exit_client(client_p, &me, "Rejected");
253      continue;
254    }
255
253      if (!IsRegistered(client_p))
254        ping = CONNECTTIMEOUT, pingwarn = 0;
255      else
# Line 334 | Line 331 | check_unknowns_list(void)
331    {
332      struct Client *client_p = ptr->data;
333  
337    if (client_p->localClient->reject_delay > 0)
338    {
339      if (client_p->localClient->reject_delay <= CurrentTime)
340        exit_client(client_p, &me, "Rejected");
341      continue;
342    }
343
334      /*
335       * Check UNKNOWN connections - if they have been in this state
336       * for > 30s, close them.
# Line 459 | Line 449 | static void
449   ban_them(struct Client *client_p, struct ConfItem *conf)
450   {
451    const char *user_reason = NULL;       /* What is sent to user */
462  const char *channel_reason = NULL;    /* What is sent to channel */
452    struct AccessItem *aconf = NULL;
453    struct MatchItem *xconf = NULL;
454    const char *type_string = NULL;
# Line 494 | Line 483 | ban_them(struct Client *client_p, struct
483        break;
484    }
485  
486 <  if (ConfigFileEntry.kline_with_reason)
487 <  {
488 <    if (aconf != NULL)
489 <      user_reason = aconf->reason ? aconf->reason : type_string;
501 <    if (xconf != NULL)
502 <      user_reason = xconf->reason ? xconf->reason : type_string;
503 <  }
504 <  else
505 <    user_reason = type_string;
506 <
507 <  if (ConfigFileEntry.kline_reason != NULL)
508 <    channel_reason = ConfigFileEntry.kline_reason;
509 <  else
510 <    channel_reason = user_reason;
486 >  if (aconf != NULL)
487 >    user_reason = aconf->reason ? aconf->reason : type_string;
488 >  if (xconf != NULL)
489 >    user_reason = xconf->reason ? xconf->reason : type_string;
490  
491    sendto_realops_flags(UMODE_ALL, L_ALL, "%s active for %s",
492                         type_string, get_client_name(client_p, HIDE_IP));
# Line 516 | Line 495 | ban_them(struct Client *client_p, struct
495      sendto_one(client_p, form_str(ERR_YOUREBANNEDCREEP),
496                 me.name, client_p->name, user_reason);
497  
498 <  exit_client(client_p, &me, channel_reason);
498 >  exit_client(client_p, &me, user_reason);
499   }
500  
501   /* update_client_exit_stats()
# Line 551 | Line 530 | update_client_exit_stats(struct Client *
530   * output       - return client pointer
531   * side effects - find person by (nick)name
532   */
554 /* XXX - ugly wrapper */
533   struct Client *
534   find_person(const struct Client *client_p, const char *name)
535   {
# Line 632 | Line 610 | get_client_name(const struct Client *cli
610  
611    assert(client != NULL);
612  
613 <  if (!MyConnect(client) || !irccmp(client->name, client->host))
613 >  if (!MyConnect(client))
614      return client->name;
615  
616 <  if (ConfigServerHide.hide_server_ips)
617 <    if (IsServer(client) || IsConnecting(client) || IsHandshake(client))
616 >  if (IsServer(client) || IsConnecting(client) || IsHandshake(client))
617 >  {
618 >    if (!irccmp(client->name, client->host))
619 >      return client->name;
620 >    else if (ConfigServerHide.hide_server_ips)
621        type = MASK_IP;
622 +  }
623  
624    if (ConfigFileEntry.hide_spoof_ips)
625      if (type == SHOW_IP && IsIPSpoof(client))
# Line 775 | Line 757 | recurse_send_quits(struct Client *origin
757   {
758    dlink_node *ptr, *next;
759    struct Client *target_p;
778  int hidden = match(me.name, source_p->name); /* XXX */
760  
761    assert(to != source_p);  /* should be already removed from serv_list */
762  
763    /* If this server can handle quit storm (QS) removal
764     * of dependents, just send the SQUIT
784   *
785   * Always check *all* dependent servers if some of them are
786   * hidden behind fakename. If so, send out the QUITs -adx
765     */
766 <  if (hidden || !IsCapable(to, CAP_QS))
766 >  if (!IsCapable(to, CAP_QS))
767      DLINK_FOREACH_SAFE(ptr, next, source_p->serv->client_list.head)
768      {
769        target_p = ptr->data;
# Line 796 | Line 774 | recurse_send_quits(struct Client *origin
774      recurse_send_quits(original_source_p, ptr->data, from, to,
775                         comment, splitstr);
776  
777 <  if (!hidden && ((source_p == original_source_p && to != from) ||
778 <                  !IsCapable(to, CAP_QS)))
777 >  if ((source_p == original_source_p && to != from) ||
778 >                  !IsCapable(to, CAP_QS))
779    {
780      /* don't use a prefix here - we have to be 100% sure the message
781       * will be accepted without Unknown prefix etc.. */
# Line 1019 | Line 997 | exit_client(struct Client *source_p, str
997    }
998    else if (IsClient(source_p) && !HasFlag(source_p, FLAGS_KILLED))
999    {
1000 <    sendto_server(from->from, NULL, CAP_TS6, NOCAPS,
1000 >    sendto_server(from->from, CAP_TS6, NOCAPS,
1001                    ":%s QUIT :%s", ID(source_p), comment);
1002 <    sendto_server(from->from, NULL, NOCAPS, CAP_TS6,
1002 >    sendto_server(from->from, NOCAPS, CAP_TS6,
1003                    ":%s QUIT :%s", source_p->name, comment);
1004    }
1005  

Diff Legend

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