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

Comparing:
ircd-hybrid-7.3/src/s_serv.c (file contents), Revision 1126 by michael, Sun Feb 20 14:30:12 2011 UTC vs.
ircd-hybrid-8/src/s_serv.c (file contents), Revision 1247 by michael, Sat Oct 1 07:54:24 2011 UTC

# Line 31 | Line 31
31   #include "channel.h"
32   #include "channel_mode.h"
33   #include "client.h"
34 #include "common.h"
34   #include "dbuf.h"
35   #include "event.h"
36   #include "fdlist.h"
# Line 51 | Line 50
50   #include "send.h"
51   #include "memory.h"
52   #include "channel.h" /* chcap_usage_counts stuff...*/
53 + #include "parse.h"
54  
55   #define MIN_CONN_FREQ 300
56  
# Line 367 | Line 367 | hunt_server(struct Client *client_p, str
367     * non-matching lookups.
368     */
369    if (MyClient(source_p))
370 <    target_p = find_client(parv[server]);
370 >    target_p = hash_find_client(parv[server]);
371    else
372      target_p = find_person(client_p, parv[server]);
373  
# Line 375 | Line 375 | hunt_server(struct Client *client_p, str
375      if (target_p->from == source_p->from && !MyConnect(target_p))
376        target_p = NULL;
377  
378 <  if (target_p == NULL && (target_p = find_server(parv[server])))
378 >  if (target_p == NULL && (target_p = hash_find_server(parv[server])))
379      if (target_p->from == source_p->from && !MyConnect(target_p))
380        target_p = NULL;
381  
# Line 389 | Line 389 | hunt_server(struct Client *client_p, str
389    {
390      if (!wilds)
391      {
392 <      if (!(target_p = find_server(parv[server])))
392 >      if (!(target_p = hash_find_server(parv[server])))
393        {
394          sendto_one(source_p, form_str(ERR_NOSUCHSERVER),
395 <                   me.name, parv[0], parv[server]);
395 >                   me.name, source_p->name, parv[server]);
396          return(HUNTED_NOSUCH);
397        }
398      }
# Line 420 | Line 420 | hunt_server(struct Client *client_p, str
420      if(!IsRegistered(target_p))
421      {
422        sendto_one(source_p, form_str(ERR_NOSUCHSERVER),
423 <                 me.name, parv[0], parv[server]);
423 >                 me.name, source_p->name, parv[server]);
424        return HUNTED_NOSUCH;
425      }
426  
# Line 443 | Line 443 | hunt_server(struct Client *client_p, str
443    }
444  
445    sendto_one(source_p, form_str(ERR_NOSUCHSERVER),
446 <             me.name, parv[0], parv[server]);
446 >             me.name, source_p->name, parv[server]);
447    return(HUNTED_NOSUCH);
448   }
449  
# Line 506 | Line 506 | try_connections(void *unused)
506      /* Found a CONNECT config with port specified, scan clients
507       * and see if this server is already connected?
508       */
509 <    if (find_server(conf->name) != NULL)
509 >    if (hash_find_server(conf->name) != NULL)
510        continue;
511  
512      if (CurrUserCount(cltmp) < MaxTotal(cltmp))
# Line 857 | Line 857 | sendnick_TS(struct Client *client_p, str
857    if (!IsClient(target_p))
858      return;
859  
860 <  send_umode(NULL, target_p, 0, IsOperHiddenAdmin(target_p) ?
860 >  send_umode(NULL, target_p, 0, HasOFlag(target_p, OPER_FLAG_HIDDEN_ADMIN) ?
861      SEND_UMODES & ~UMODE_ADMIN : SEND_UMODES, ubuf);
862  
863    if (ubuf[0] == '\0')
# Line 867 | Line 867 | sendnick_TS(struct Client *client_p, str
867    }
868  
869    /* XXX Both of these need to have a :me.name or :mySID!?!?! */
870 <  if (HasID(target_p) && IsCapable(client_p, CAP_TS6))
871 <    sendto_one(client_p, ":%s UID %s %d %lu %s %s %s %s %s :%s",
872 <               target_p->servptr->id,
873 <               target_p->name, target_p->hopcount + 1,
874 <               (unsigned long) target_p->tsinfo,
875 <               ubuf, target_p->username, target_p->host,
876 <               (MyClient(target_p) && IsIPSpoof(target_p)) ?
877 <               "0" : target_p->sockhost, target_p->id, target_p->info);
870 >  if (IsCapable(client_p, CAP_SVS))
871 >  {
872 >    if (HasID(target_p) && IsCapable(client_p, CAP_TS6))
873 >      sendto_one(client_p, ":%s UID %s %d %lu %s %s %s %s %s %lu :%s",
874 >                 target_p->servptr->id,
875 >                 target_p->name, target_p->hopcount + 1,
876 >                 (unsigned long) target_p->tsinfo,
877 >                 ubuf, target_p->username, target_p->host,
878 >                 (MyClient(target_p) && IsIPSpoof(target_p)) ?
879 >                 "0" : target_p->sockhost, target_p->id,
880 >                 (unsigned long)target_p->servicestamp, target_p->info);
881 >    else
882 >      sendto_one(client_p, "NICK %s %d %lu %s %s %s %s %lu :%s",
883 >                 target_p->name, target_p->hopcount + 1,
884 >                 (unsigned long) target_p->tsinfo,
885 >                 ubuf, target_p->username, target_p->host,
886 >                 target_p->servptr->name, (unsigned long)target_p->servicestamp,
887 >                 target_p->info);
888 >  }
889    else
890 <    sendto_one(client_p, "NICK %s %d %lu %s %s %s %s :%s",
891 <               target_p->name, target_p->hopcount + 1,
892 <               (unsigned long) target_p->tsinfo,
893 <               ubuf, target_p->username, target_p->host,
894 <               target_p->servptr->name, target_p->info);
890 >  {
891 >    if (HasID(target_p) && IsCapable(client_p, CAP_TS6))
892 >      sendto_one(client_p, ":%s UID %s %d %lu %s %s %s %s %s :%s",
893 >                 target_p->servptr->id,
894 >                 target_p->name, target_p->hopcount + 1,
895 >                 (unsigned long) target_p->tsinfo,
896 >                 ubuf, target_p->username, target_p->host,
897 >                 (MyClient(target_p) && IsIPSpoof(target_p)) ?
898 >                 "0" : target_p->sockhost, target_p->id, target_p->info);
899 >    else
900 >      sendto_one(client_p, "NICK %s %d %lu %s %s %s %s :%s",
901 >                 target_p->name, target_p->hopcount + 1,
902 >                 (unsigned long) target_p->tsinfo,
903 >                 ubuf, target_p->username, target_p->host,
904 >                 target_p->servptr->name, target_p->info);
905 >  }
906  
907    if (IsConfAwayBurst((struct AccessItem *)map_to_conf(client_p->serv->sconf)))
908      if (!EmptyString(target_p->away))
# Line 1099 | Line 1121 | server_estab(struct Client *client_p)
1121    make_server(client_p);
1122  
1123    /* fixing eob timings.. -gnp */
1124 <  client_p->firsttime = CurrentTime;
1124 >  client_p->localClient->firsttime = CurrentTime;
1125 >
1126 >
1127 >  if (find_matching_name_conf(SERVICE_TYPE, client_p->name, NULL, NULL, 0))
1128 >    AddFlag(client_p, FLAGS_SERVICE);
1129  
1130    /* Show the real host/IP to admins */
1131    sendto_realops_flags(UMODE_ALL, L_ADMIN,
# Line 1109 | Line 1135 | server_estab(struct Client *client_p)
1135    sendto_realops_flags(UMODE_ALL, L_OPER,
1136                         "Link with %s established: (%s) link",
1137                         inpath,show_capabilities(client_p));
1138 <  ilog(L_NOTICE, "Link with %s established: (%s) link",
1138 >  ilog(LOG_TYPE_IRCD, "Link with %s established: (%s) link",
1139         inpath_ip, show_capabilities(client_p));
1140  
1141    client_p->serv->sconf = conf;
# Line 1428 | Line 1454 | burst_all(struct Client *client_p)
1454    {
1455      struct Client *target_p = ptr->data;
1456  
1457 <    if (!IsBursted(target_p) && target_p->from != client_p)
1457 >    if (!HasFlag(target_p, FLAGS_BURSTED) && target_p->from != client_p)
1458        sendnick_TS(client_p, target_p);
1459      
1460 <    ClearBursted(target_p);
1460 >    DelFlag(target_p, FLAGS_BURSTED);
1461    }
1462  
1463    /* We send the time we started the burst, and let the remote host determine an EOB time,
# Line 1473 | Line 1499 | send_tb(struct Client *client_p, struct
1499        sendto_one(client_p, ":%s TBURST %lu %s %lu %s :%s",
1500                   me.name, (unsigned long)chptr->channelts, chptr->chname,
1501                   (unsigned long)chptr->topic_time,
1502 <                 chptr->topic_info ? chptr->topic_info : "",
1503 <                 chptr->topic ? chptr->topic : "");
1502 >                 chptr->topic_info,
1503 >                 chptr->topic);
1504      else if (IsCapable(client_p, CAP_TB))
1505      {
1506        if (ConfigChannel.burst_topicwho)
# Line 1482 | Line 1508 | send_tb(struct Client *client_p, struct
1508          sendto_one(client_p, ":%s TB %s %lu %s :%s",
1509                     me.name, chptr->chname,
1510                     (unsigned long)chptr->topic_time,
1511 <                   chptr->topic_info, chptr->topic ? chptr->topic : "");
1511 >                   chptr->topic_info, chptr->topic);
1512        }
1513        else
1514        {
1515          sendto_one(client_p, ":%s TB %s %lu :%s",
1516                     me.name, chptr->chname,
1517                     (unsigned long)chptr->topic_time,
1518 <                   chptr->topic ? chptr->topic : "");
1518 >                   chptr->topic);
1519        }
1520      }
1521    }
# Line 1514 | Line 1540 | burst_members(struct Client *client_p, s
1540      ms       = ptr->data;
1541      target_p = ms->client_p;
1542  
1543 <    if (!IsBursted(target_p))
1543 >    if (!HasFlag(target_p, FLAGS_BURSTED))
1544      {
1545 <      SetBursted(target_p);
1545 >      AddFlag(target_p, FLAGS_BURSTED);
1546  
1547        if (target_p->from != client_p)
1548          sendnick_TS(client_p, target_p);
# Line 1566 | Line 1592 | serv_connect(struct AccessItem *aconf, s
1592    /* log */
1593    getnameinfo((struct sockaddr *)&aconf->ipnum, aconf->ipnum.ss_len,
1594                buf, sizeof(buf), NULL, 0, NI_NUMERICHOST);
1595 <  ilog(L_NOTICE, "Connect to %s[%s] @%s", aconf->user, aconf->host,
1595 >  ilog(LOG_TYPE_IRCD, "Connect to %s[%s] @%s", aconf->user, aconf->host,
1596         buf);
1597  
1598    /* Still processing a DNS lookup? -> exit */
# Line 1589 | Line 1615 | serv_connect(struct AccessItem *aconf, s
1615    /* Make sure this server isn't already connected
1616     * Note: aconf should ALWAYS be a valid C: line
1617     */
1618 <  if ((client_p = find_server(conf->name)) != NULL)
1618 >  if ((client_p = hash_find_server(conf->name)) != NULL)
1619    {
1620      sendto_realops_flags(UMODE_ALL, L_ADMIN,
1621                           "Server %s already present from %s",
# Line 1973 | Line 1999 | cryptlink_error(struct Client *client_p,
1999                         get_client_name(client_p, SHOW_IP), type, reason);
2000    sendto_realops_flags(UMODE_ALL, L_OPER,  "%s: CRYPTLINK %s error - %s",
2001                         get_client_name(client_p, MASK_IP), type, reason);
2002 <  ilog(L_ERROR, "%s: CRYPTLINK %s error - %s",
2002 >  ilog(LOG_TYPE_IRCD, "%s: CRYPTLINK %s error - %s",
2003         get_client_name(client_p, SHOW_IP), type, reason);
2004  
2005    /* If client_reason isn't NULL, then exit the client with the message

Diff Legend

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