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

Comparing:
ircd-hybrid/src/client.c (file contents), Revision 31 by knight, Sun Oct 2 20:34:05 2005 UTC vs.
ircd-hybrid-7.2/src/client.c (file contents), Revision 759 by michael, Fri Aug 18 14:29:45 2006 UTC

# Line 122 | Line 122 | make_client(struct Client *from)
122      client_p->since = client_p->lasttime = client_p->firsttime = CurrentTime;
123  
124      client_p->localClient = BlockHeapAlloc(lclient_heap);
125 +    client_p->localClient->registration = REG_INIT;
126      /* as good a place as any... */
127      dlinkAdd(client_p, make_dlink_node(), &unknown_list);
128    }
# Line 148 | Line 149 | free_client(struct Client *client_p)
149    assert(client_p != NULL);
150    assert(client_p != &me);
151    assert(client_p->hnext == client_p);
151  assert(client_p->invited.head == NULL);
152    assert(client_p->channel.head == NULL);
153  assert(dlink_list_length(&client_p->invited) == 0);
153    assert(dlink_list_length(&client_p->channel) == 0);
154  
155    MyFree(client_p->away);
# Line 158 | Line 157 | free_client(struct Client *client_p)
157  
158    if (MyConnect(client_p))
159    {
160 +    assert(client_p->localClient->invited.head == NULL);
161 +    assert(dlink_list_length(&client_p->localClient->invited) == 0);
162      assert(IsClosing(client_p) && IsDead(client_p));
163  
164      MyFree(client_p->localClient->response);
# Line 316 | Line 317 | check_pings_list(dlink_list *list)
317              ilog(L_NOTICE, "No response from %s, closing link",
318                   get_client_name(client_p, HIDE_IP));
319            }
320 +
321            ircsprintf(scratch, "Ping timeout: %d seconds",
322                       (int)(CurrentTime - client_p->lasttime));
321
323            exit_client(client_p, &me, scratch);
324          }
325          else if (!IsPingWarning(client_p) && pingwarn > 0 &&
# Line 362 | Line 363 | check_unknowns_list(void)
363      if (client_p->localClient->reject_delay > 0)
364      {
365        if (client_p->localClient->reject_delay <= CurrentTime)
366 <        exit_client(client_p, &me, "Rejected");
366 >        exit_client(client_p, &me, "Rejected");
367        continue;
368      }
369  
370 <    /* Check UNKNOWN connections - if they have been in this state
370 >    /*
371 >     * Check UNKNOWN connections - if they have been in this state
372       * for > 30s, close them.
373       */
374 <    if (client_p->firsttime ? ((CurrentTime - client_p->firsttime) > 30) : 0)
375 <      exit_client(client_p, &me, "Connection timed out");
374 >    if (IsAuthFinished(client_p) && (CurrentTime - client_p->firsttime) > 30)
375 >      exit_client(client_p, &me, "Registration timed out");
376    }
377   }
378  
# Line 758 | Line 760 | exit_one_client(struct Client *source_p,
760      DLINK_FOREACH_SAFE(lp, next_lp, source_p->channel.head)
761        remove_user_from_channel(lp->data);
762  
761    /* Clean up invitefield */
762    DLINK_FOREACH_SAFE(lp, next_lp, source_p->invited.head)
763      del_invite(lp->data, source_p);
764
763      /* Clean up allow lists */
764      del_all_accepts(source_p);
765      add_history(source_p, 0);
# Line 772 | Line 770 | exit_one_client(struct Client *source_p,
770        source_p->from->serv->dep_users--;
771        assert(source_p->from->serv->dep_users >= 0);
772      }
773 +    else
774 +    {
775 +      /* Clean up invitefield */
776 +      DLINK_FOREACH_SAFE(lp, next_lp, source_p->localClient->invited.head)
777 +        del_invite(lp->data, source_p);
778 +    }
779    }
780  
781    /* Remove source_p from the client lists */
# Line 1053 | Line 1057 | exit_client(struct Client *source_p, str
1057    }
1058    else if (IsClient(source_p) && !IsKilled(source_p))
1059    {
1060 <    sendto_server(NULL, source_p, NULL, CAP_TS6, NOCAPS, NOFLAGS,
1060 >    sendto_server(from->from, source_p, NULL, CAP_TS6, NOCAPS, NOFLAGS,
1061                    ":%s QUIT :%s", ID(source_p), comment);
1062 <    sendto_server(NULL, source_p, NULL, NOCAPS, CAP_TS6, NOFLAGS,
1062 >    sendto_server(from->from, source_p, NULL, NOCAPS, CAP_TS6, NOFLAGS,
1063                    ":%s QUIT :%s", source_p->name, comment);
1064    }
1065  
# Line 1133 | Line 1137 | dead_link_on_read(struct Client *client_
1137      }
1138      else
1139      {
1140 <      report_error(L_ADMIN, "Lost connection to %s: %d",
1140 >      report_error(L_ADMIN, "Lost connection to %s: %s",
1141                     get_client_name(client_p, SHOW_IP), current_error);
1142 <      report_error(L_OPER, "Lost connection to %s: %d",
1142 >      report_error(L_OPER, "Lost connection to %s: %s",
1143                     get_client_name(client_p, MASK_IP), current_error);
1144      }
1145  
# Line 1231 | Line 1235 | accept_message(struct Client *source, st
1235    if (IsSoftCallerId(target))
1236    {
1237      DLINK_FOREACH(ptr, target->channel.head)
1238 <      if (IsMember(source, ptr->data))
1238 >      if (IsMember(source, ((struct Membership *)ptr->data)->chptr))
1239          return (1);
1240    }
1241  
# Line 1335 | Line 1339 | set_initial_nick(struct Client *client_p
1339    
1340    /* This had to be copied here to avoid problems.. */
1341    source_p->tsinfo = CurrentTime;
1342 +  source_p->localClient->registration &= ~REG_NEED_NICK;
1343  
1344    if (source_p->name[0])
1345      hash_del_client(source_p);
# Line 1348 | Line 1353 | set_initial_nick(struct Client *client_p
1353    /* They have the nick they want now.. */
1354    client_p->llname[0] = '\0';
1355  
1356 <  if (source_p->flags & FLAGS_GOTUSER)
1356 >  if (!source_p->localClient->registration)
1357    {
1358      strlcpy(buf, source_p->username, sizeof(buf));
1359  
# Line 1393 | Line 1398 | change_local_nick(struct Client *client_
1398       (IsOper(source_p) && ConfigFileEntry.no_oper_flood))
1399    {
1400      if (irccmp(source_p->name, nick))
1401 +    {
1402 +      /*
1403 +       * Make sure everyone that has this client on its accept list
1404 +       * loses that reference.
1405 +       */
1406 +      del_all_their_accepts(source_p);
1407        source_p->tsinfo = CurrentTime;
1408 +      clear_ban_cache_client(source_p);
1409 +    }
1410  
1411      /* XXX - the format of this notice should eventually be changed
1412       * to either %s[%s@%s], or even better would be get_client_name() -bill
# Line 1403 | Line 1416 | change_local_nick(struct Client *client_
1416      sendto_common_channels_local(source_p, 1, ":%s!%s@%s NICK :%s",
1417                                   source_p->name, source_p->username,
1418                                   source_p->host, nick);
1406
1419      add_history(source_p, 1);
1420 <          
1421 <         /* Only hubs care about lazy link nicks not being sent on yet
1422 <           * lazylink leafs/leafs always send their nicks up to hub,
1423 <           * hence must always propagate nick changes.
1424 <           * hubs might not propagate a nick change, if the leaf
1425 <           * does not know about that client yet.
1426 <           */
1420 >
1421 >    /*
1422 >     * Only hubs care about lazy link nicks not being sent on yet
1423 >     * lazylink leafs/leafs always send their nicks up to hub,
1424 >     * hence must always propagate nick changes.
1425 >     * hubs might not propagate a nick change, if the leaf
1426 >     * does not know about that client yet.
1427 >     */
1428      sendto_server(client_p, source_p, NULL, CAP_TS6, NOCAPS, NOFLAGS,
1429                    ":%s NICK %s :%lu",
1430                    ID(source_p), nick, (unsigned long)source_p->tsinfo);
# Line 1434 | Line 1447 | change_local_nick(struct Client *client_
1447    strcpy(source_p->name, nick);
1448    hash_add_client(source_p);
1449  
1437  /* Make sure everyone that has this client on its accept list
1438   * loses that reference.
1439   */
1440  del_all_their_accepts(source_p);
1441
1450    /* fd_desc is long enough */
1451    fd_note(&client_p->localClient->fd, "Nick: %s", nick);
1452   }

Comparing:
ircd-hybrid/src/client.c (property svn:keywords), Revision 31 by knight, Sun Oct 2 20:34:05 2005 UTC vs.
ircd-hybrid-7.2/src/client.c (property svn:keywords), Revision 759 by michael, Fri Aug 18 14:29:45 2006 UTC

# Line 1 | Line 1
1 < "Id Revision"
1 > Id Revision

Diff Legend

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