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

Comparing ircd-hybrid-7.2/src/s_serv.c (file contents):
Revision 34 by lusky, Sun Oct 2 21:05:51 2005 UTC vs.
Revision 889 by michael, Thu Nov 1 12:59:05 2007 UTC

# Line 58 | Line 58
58  
59   #define MIN_CONN_FREQ 300
60  
61 struct Client *uplink  = NULL;
62
63
61   static dlink_list cap_list = { NULL, NULL, 0 };
65 static unsigned long freeMask;
62   static void server_burst(struct Client *);
63   static int fork_server(struct Client *);
64   static void burst_all(struct Client *);
69 static void cjoin_all(struct Client *);
65   static void send_tb(struct Client *client_p, struct Channel *chptr);
66  
67   static CNCB serv_connect_callback;
68  
69   static void start_io(struct Client *);
70   static void burst_members(struct Client *, struct Channel *);
76 static void burst_ll_members(struct Client *, struct Channel *);
77 static void add_lazylinkchannel(struct Client *, struct Channel *);
71  
72   static SlinkRplHnd slink_error;
73   static SlinkRplHnd slink_zipstats;
# Line 227 | Line 220 | collect_zipstats(void *unused)
220   struct EncCapability *
221   check_cipher(struct Client *client_p, struct AccessItem *aconf)
222   {
223 <  struct EncCapability *epref;
223 >  struct EncCapability *epref = NULL;
224  
225    /* Use connect{} specific info if available */
226    if (aconf->cipher_preference)
227      epref = aconf->cipher_preference;
228 <  else
228 >  else if (ConfigFileEntry.default_cipher_preference)
229      epref = ConfigFileEntry.default_cipher_preference;
230  
231 <  /* If the server supports the capability in hand, return the matching
231 >  /*
232 >   * If the server supports the capability in hand, return the matching
233     * conf struct.  Otherwise, return NULL (an error).
234     */
235 <  if (IsCapableEnc(client_p, epref->cap))
236 <    return(epref);
235 >  if (epref && IsCapableEnc(client_p, epref->cap))
236 >    return epref;
237  
238 <  return(NULL);
238 >  return NULL;
239   }
240   #endif /* HAVE_LIBCRYPTO */
241  
# Line 256 | Line 250 | my_name_for_link(struct ConfItem *conf)
250  
251    aconf = (struct AccessItem *)map_to_conf(conf);
252    if (aconf->fakename != NULL)
253 <    return(aconf->fakename);
253 >    return aconf->fakename;
254    else
255 <    return(me.name);
255 >    return me.name;
256   }
257  
258   /*
# Line 457 | Line 451 | hunt_server(struct Client *client_p, str
451      if (!match(target_p->name, parv[server]))
452        parv[server] = target_p->name;
453  
460    /* Deal with lazylinks */
461    client_burst_if_needed(target_p, source_p);
462
454      /* This is a little kludgy but should work... */
455      if (IsClient(source_p) &&
456          ((MyConnect(target_p) && IsCapable(target_p, CAP_TS6)) ||
# Line 665 | Line 656 | check_server(const char *name, struct Cl
656      attach_conf(client_p, conf);
657    }
658  
659 <  server_aconf = (struct AccessItem *)map_to_conf(server_conf);
659 >  server_aconf = map_to_conf(server_conf);
660  
670  if (!IsConfLazyLink(server_aconf))
671    ClearCap(client_p, CAP_LL);
661   #ifdef HAVE_LIBZ /* otherwise, clear it unconditionally */
662    if (!IsConfCompressed(server_aconf))
663   #endif
# Line 676 | Line 665 | check_server(const char *name, struct Cl
665    if (!IsConfCryptLink(server_aconf))
666      ClearCap(client_p, CAP_ENC);
667    if (!IsConfTopicBurst(server_aconf))
668 +  {
669      ClearCap(client_p, CAP_TB);
670 +    ClearCap(client_p, CAP_TBURST);
671 +  }
672  
673    /* Don't unset CAP_HUB here even if the server isn't a hub,
674     * it only indicates if the server thinks it's lazylinks are
# Line 722 | Line 714 | check_server(const char *name, struct Cl
714   void
715   add_capability(const char *capab_name, int cap_flag, int add_to_default)
716   {
717 <  struct Capability *cap;
717 >  struct Capability *cap = MyMalloc(sizeof(*cap));
718  
727  cap = (struct Capability *)MyMalloc(sizeof(*cap));
719    DupString(cap->name, capab_name);
720    cap->cap = cap_flag;
721    dlinkAdd(cap, &cap->node, &cap_list);
722 +
723    if (add_to_default)
724      default_server_capabs |= cap_flag;
725   }
# Line 811 | Line 803 | send_capabilities(struct Client *client_
803    int tl;
804    dlink_node *ptr;
805   #ifdef HAVE_LIBCRYPTO
806 <  struct EncCapability *epref;
806 >  const struct EncCapability *epref = NULL;
807    char *capend;
808    int sent_cipher = 0;
809   #endif
# Line 838 | Line 830 | send_capabilities(struct Client *client_
830      /* use connect{} specific info if available */
831      if (aconf->cipher_preference)
832        epref = aconf->cipher_preference;
833 <    else
833 >    else if (ConfigFileEntry.default_cipher_preference)
834        epref = ConfigFileEntry.default_cipher_preference;
835  
836 <    if ((epref->cap & enc_can_send))
836 >    if (epref && (epref->cap & enc_can_send))
837      {
838        /* Leave the space -- it is removed later. */
839        tl = ircsprintf(t, "%s ", epref->name);
# Line 853 | Line 845 | send_capabilities(struct Client *client_
845        t = capend; /* truncate string before ENC:, below */
846    }
847   #endif
848 <  *(t-1) = '\0';
848 >  *(t - 1) = '\0';
849    sendto_one(client_p, "CAPAB :%s", msgbuf);
850   }
851  
852   /* sendnick_TS()
853   *
854   * inputs       - client (server) to send nick towards
855 < *              - client to send nick for
855 > *          - client to send nick for
856   * output       - NONE
857   * side effects - NICK message is sent towards given client_p
858   */
# Line 885 | Line 877 | sendnick_TS(struct Client *client_p, str
877    if (HasID(target_p) && IsCapable(client_p, CAP_TS6))
878      sendto_one(client_p, ":%s UID %s %d %lu %s %s %s %s %s :%s",
879                 target_p->servptr->id,
880 <               target_p->name, target_p->hopcount + 1,
881 <               (unsigned long) target_p->tsinfo,
882 <               ubuf, target_p->username, target_p->host,
883 <           ((MyClient(target_p)&&!IsIPSpoof(target_p))?target_p->sockhost:"0"),
884 <           target_p->id, target_p->info);
880 >               target_p->name, target_p->hopcount + 1,
881 >               (unsigned long) target_p->tsinfo,
882 >               ubuf, target_p->username, target_p->host,
883 >               (MyClient(target_p) && IsIPSpoof(target_p)) ?
884 >               "0" : target_p->sockhost, target_p->id, target_p->info);
885    else
886      sendto_one(client_p, "NICK %s %d %lu %s %s %s %s :%s",
887                 target_p->name, target_p->hopcount + 1,
888                 (unsigned long) target_p->tsinfo,
889                 ubuf, target_p->username, target_p->host,
890                 target_p->servptr->name, target_p->info);
891 +
892    if (IsConfAwayBurst((struct AccessItem *)map_to_conf(client_p->serv->sconf)))
893      if (!EmptyString(target_p->away))
894        sendto_one(client_p, ":%s AWAY :%s", target_p->name,
# Line 903 | Line 896 | sendnick_TS(struct Client *client_p, str
896  
897   }
898  
906 /* client_burst_if_needed()
907 *
908 * inputs       - pointer to server
909 *              - pointer to client to add
910 * output       - NONE
911 * side effects - If this client is not known by this lazyleaf, send it
912 */
913 void
914 client_burst_if_needed(struct Client *client_p, struct Client *target_p)
915 {
916  if (!ServerInfo.hub)
917    return;
918  if (!MyConnect(client_p))
919    return;
920  if (!IsCapable(client_p,CAP_LL))
921    return;
922
923  if ((target_p->lazyLinkClientExists & client_p->localClient->serverMask) == 0)
924  {
925    sendnick_TS(client_p, target_p);
926    add_lazylinkclient(client_p,target_p);
927  }
928 }
929
899   /*
900   * show_capabilities - show current server capabilities
901   *
# Line 973 | Line 942 | struct Server *
942   make_server(struct Client *client_p)
943   {
944    if (client_p->serv == NULL)
976  {
945      client_p->serv = MyMalloc(sizeof(struct Server));
978    client_p->serv->dep_servers = 1;
979  }
946  
947    return client_p->serv;
948   }
# Line 1056 | Line 1022 | server_estab(struct Client *client_p)
1022  
1023      /* Pass my info to the new server
1024       *
1059     * If trying to negotiate LazyLinks, pass on CAP_LL
1025       * If this is a HUB, pass on CAP_HUB
1026       * Pass on ZIP if supported
1027       * Pass on TB if supported.
1028       * - Dianora
1029       */
1030  
1031 <     send_capabilities(client_p, aconf,
1032 <       (IsConfLazyLink(aconf) ? find_capability("LL") : 0)
1033 <       | (IsConfCompressed(aconf) ? find_capability("ZIP") : 0)
1069 <       | (IsConfTopicBurst(aconf) ? find_capability("TB") : 0)
1070 <       , 0);
1031 >    send_capabilities(client_p, aconf, (ServerInfo.hub ? CAP_HUB : 0)
1032 >      | (IsConfCompressed(aconf) ? CAP_ZIP : 0)
1033 >      | (IsConfTopicBurst(aconf) ? CAP_TBURST|CAP_TB : 0), 0);
1034  
1035      /* SERVER is the last command sent before switching to ziplinks.
1036       * We set TCPNODELAY on the socket to make sure it gets sent out
# Line 1140 | Line 1103 | server_estab(struct Client *client_p)
1103    set_chcap_usage_counts(client_p);
1104  
1105    /* Some day, all these lists will be consolidated *sigh* */
1106 <  dlinkAdd(client_p, &client_p->lnode, &me.serv->servers);
1106 >  dlinkAdd(client_p, &client_p->lnode, &me.serv->server_list);
1107  
1108    m = dlinkFind(&unknown_list, client_p);
1109    assert(NULL != m);
# Line 1259 | Line 1222 | server_estab(struct Client *client_p)
1222                   IsHidden(target_p) ? "(H) " : "", target_p->info);
1223    }
1224  
1262  if ((ServerInfo.hub == 0) && MyConnect(client_p))
1263    uplink = client_p;
1264
1225    server_burst(client_p);
1226   }
1227  
# Line 1339 | Line 1299 | start_io(struct Client *server)
1299      memcpy(buf, &block->data[0], block->size);
1300      buf += block->size;
1301    }
1302 +
1303    dbuf_clear(&lserver->buf_recvq);
1304  
1305    /* pass the whole sendq to servlink */
# Line 1351 | Line 1312 | start_io(struct Client *server)
1312      memcpy(buf, &block->data[0], block->size);
1313      buf += block->size;
1314    }
1315 +
1316    dbuf_clear(&lserver->buf_sendq);
1317  
1318    /* start io */
# Line 1457 | Line 1419 | server_burst(struct Client *client_p)
1419    ** -orabidoo
1420    */
1421  
1422 <  /* On a "lazy link" hubs send nothing.
1461 <   * Leafs always have to send nicks plus channels
1462 <   */
1463 <  if (IsCapable(client_p, CAP_LL))
1464 <  {
1465 <    if (!ServerInfo.hub)
1466 <    {
1467 <      /* burst all our info */
1468 <      burst_all(client_p);
1469 <
1470 <      /* Now, ask for channel info on all our current channels */
1471 <      cjoin_all(client_p);
1472 <    }
1473 <  }
1474 <  else
1475 <  {
1476 <    burst_all(client_p);
1477 <  }
1422 >  burst_all(client_p);
1423  
1424    /* EOB stuff is now in burst_all */
1425    /* Always send a PING after connect burst is done */
# Line 1490 | Line 1435 | server_burst(struct Client *client_p)
1435   static void
1436   burst_all(struct Client *client_p)
1437   {
1438 <  struct Client *target_p;
1494 <  struct Channel *chptr;
1495 <  dlink_node *gptr;
1496 <  dlink_node *ptr;
1438 >  dlink_node *ptr = NULL;
1439  
1440 <  DLINK_FOREACH(gptr, global_channel_list.head)
1440 >  DLINK_FOREACH(ptr, global_channel_list.head)
1441    {
1442 <    chptr = gptr->data;
1442 >    struct Channel *chptr = ptr->data;
1443  
1444      if (dlink_list_length(&chptr->members) != 0)
1445      {
1446        burst_members(client_p, chptr);
1447        send_channel_modes(client_p, chptr);
1448 <      if (IsCapable(client_p, CAP_TB))
1448 >
1449 >      if (IsCapable(client_p, CAP_TBURST) ||
1450 >          IsCapable(client_p, CAP_TB))
1451          send_tb(client_p, chptr);
1452      }
1453    }
# Line 1512 | Line 1456 | burst_all(struct Client *client_p)
1456     */
1457    DLINK_FOREACH(ptr, global_client_list.head)
1458    {
1459 <    target_p = ptr->data;
1459 >    struct Client *target_p = ptr->data;
1460  
1461      if (!IsBursted(target_p) && target_p->from != client_p)
1462        sendnick_TS(client_p, target_p);
# Line 1531 | Line 1475 | burst_all(struct Client *client_p)
1475   /*
1476   * send_tb
1477   *
1478 < * inputs       - pointer to Client
1479 < *              - pointer to channel
1536 < * output       - NONE
1537 < * side effects - Called on a server burst when
1538 < *                server is CAP_TB capable
1539 < */
1540 < static void
1541 < send_tb(struct Client *client_p, struct Channel *chptr)
1542 < {
1543 <  if (chptr->topic != NULL && IsCapable(client_p, CAP_TB))
1544 <  {
1545 <    if (ConfigChannel.burst_topicwho)
1546 <    {
1547 <      sendto_one(client_p, ":%s TB %s %lu %s :%s",
1548 <                 me.name, chptr->chname,
1549 <                 (unsigned long)chptr->topic_time,
1550 <                 chptr->topic_info, chptr->topic);
1551 <    }
1552 <    else
1553 <    {
1554 <      sendto_one(client_p, ":%s TB %s %lu :%s",
1555 <                 me.name, chptr->chname,
1556 <                 (unsigned long)chptr->topic_time, chptr->topic);
1557 <    }
1558 <  }
1559 < }
1560 <
1561 < /* cjoin_all()
1562 < *
1563 < * inputs       - server to ask for channel info from
1478 > * inputs       - pointer to Client
1479 > *              - pointer to channel
1480   * output       - NONE
1481 < * side effects - CJOINS for all the leafs known channels is sent
1482 < */
1567 < static void
1568 < cjoin_all(struct Client *client_p)
1569 < {
1570 <  const dlink_node *gptr = NULL;
1571 <
1572 <  DLINK_FOREACH(gptr, global_channel_list.head)
1573 <  {
1574 <    const struct Channel *chptr = gptr->data;
1575 <    sendto_one(client_p, ":%s CBURST %s",
1576 <               me.name, chptr->chname);
1577 <  }
1578 < }
1579 <
1580 < /* burst_channel()
1581 < *
1582 < * inputs       - pointer to server to send sjoins to
1583 < *              - channel pointer
1584 < * output       - none
1585 < * side effects - All sjoins for channel(s) given by chptr are sent
1586 < *                for all channel members. ONLY called by hub on
1587 < *                behalf of a lazylink so client_p is always guarunteed
1588 < *                to be a LL leaf.
1589 < */
1590 < void
1591 < burst_channel(struct Client *client_p, struct Channel *chptr)
1592 < {
1593 <  burst_ll_members(client_p, chptr);
1594 <
1595 <  send_channel_modes(client_p, chptr);
1596 <  add_lazylinkchannel(client_p,chptr);
1597 <
1598 <  if (chptr->topic != NULL && chptr->topic_info != NULL)
1599 <  {
1600 <    sendto_one(client_p, ":%s TOPIC %s %s %lu :%s",
1601 <               me.name, chptr->chname, chptr->topic_info,
1602 <               (unsigned long)chptr->topic_time, chptr->topic);
1603 <  }
1604 < }
1605 <
1606 < /* add_lazlinkchannel()
1607 < *
1608 < * inputs       - pointer to directly connected leaf server
1609 < *                being introduced to this hub
1610 < *              - pointer to channel structure being introduced
1611 < * output       - NONE
1612 < * side effects - The channel pointed to by chptr is now known
1613 < *                to be on lazyleaf server given by local_server_p.
1614 < *                mark that in the bit map and add to the list
1615 < *                of channels to examine after this newly introduced
1616 < *                server is squit off.
1481 > * side effects - Called on a server burst when
1482 > *                server is CAP_TB|CAP_TBURST capable
1483   */
1484   static void
1485 < add_lazylinkchannel(struct Client *local_server_p, struct Channel *chptr)
1620 < {
1621 <  assert(MyConnect(local_server_p));
1622 <
1623 <  chptr->lazyLinkChannelExists |= local_server_p->localClient->serverMask;
1624 <  dlinkAdd(chptr, make_dlink_node(), &lazylink_channels);
1625 < }
1626 <
1627 < /* add_lazylinkclient()
1628 < *
1629 < * inputs       - pointer to directly connected leaf server
1630 < *                being introduced to this hub
1631 < *              - pointer to client being introduced
1632 < * output       - NONE
1633 < * side effects - The client pointed to by client_p is now known
1634 < *                to be on lazyleaf server given by local_server_p.
1635 < *                mark that in the bit map and add to the list
1636 < *                of clients to examine after this newly introduced
1637 < *                server is squit off.
1638 < */
1639 < void
1640 < add_lazylinkclient(struct Client *local_server_p, struct Client *client_p)
1641 < {
1642 <  assert(MyConnect(local_server_p));
1643 <  client_p->lazyLinkClientExists |= local_server_p->localClient->serverMask;
1644 < }
1645 <
1646 < /* remove_lazylink_flags()
1647 < *
1648 < * inputs       - pointer to server quitting
1649 < * output       - NONE
1650 < * side effects - All the channels on the lazylink channel list are examined
1651 < *                If they hold a bit corresponding to the servermask
1652 < *                attached to client_p, clear that bit. If this bitmask
1653 < *                goes to 0, then the channel is no longer known to
1654 < *                be on any lazylink server, and can be removed from the
1655 < *                link list.
1656 < *
1657 < *                Similar is done for lazylink clients
1658 < *
1659 < *                This function must be run by the HUB on any exiting
1660 < *                lazylink leaf server, while the pointer is still valid.
1661 < *                Hence must be run from client.c in exit_one_client()
1662 < *
1663 < *                The old code scanned all channels, this code only
1664 < *                scans channels/clients on the lazylink_channels
1665 < *                lazylink_clients lists.
1666 < */
1667 < void
1668 < remove_lazylink_flags(unsigned long mask)
1485 > send_tb(struct Client *client_p, struct Channel *chptr)
1486   {
1487 <  dlink_node *ptr;
1488 <  dlink_node *next_ptr;
1489 <  struct Channel *chptr;
1490 <  struct Client *target_p;
1491 <  unsigned long clear_mask;
1492 <
1493 <  if (!mask) /* On 0 mask, don't do anything */
1494 <   return;
1495 <
1496 <  clear_mask = ~mask;
1497 <  freeMask |= mask;
1498 <
1499 <  DLINK_FOREACH_SAFE(ptr, next_ptr, lazylink_channels.head)
1487 >  /*
1488 >   * We may also send an empty topic here, but only if topic_time isn't 0,
1489 >   * i.e. if we had a topic that got unset.  This is required for syncing
1490 >   * topics properly.
1491 >   *
1492 >   * Imagine the following scenario: Our downlink introduces a channel
1493 >   * to us with a TS that is equal to ours, but the channel topic on
1494 >   * their side got unset while the servers were in splitmode, which means
1495 >   * their 'topic' is newer.  They simply wanted to unset it, so we have to
1496 >   * deal with it in a more sophisticated fashion instead of just resetting
1497 >   * it to their old topic they had before.  Read m_tburst.c:ms_tburst
1498 >   * for further information   -Michael
1499 >   */
1500 >  if (chptr->topic_time != 0)
1501    {
1502 <    chptr = ptr->data;
1503 <
1504 <    chptr->lazyLinkChannelExists &= clear_mask;
1505 <
1506 <    if (chptr->lazyLinkChannelExists == 0)
1502 >    if (IsCapable(client_p, CAP_TBURST))
1503 >      sendto_one(client_p, ":%s TBURST %lu %s %lu %s :%s",
1504 >                 me.name, (unsigned long)chptr->channelts, chptr->chname,
1505 >                 (unsigned long)chptr->topic_time,
1506 >                 chptr->topic_info ? chptr->topic_info : "",
1507 >                 chptr->topic ? chptr->topic : "");
1508 >    else if (IsCapable(client_p, CAP_TB))
1509      {
1510 <      dlinkDelete(ptr, &lazylink_channels);
1511 <      free_dlink_node(ptr);
1510 >      if (ConfigChannel.burst_topicwho)
1511 >      {
1512 >        sendto_one(client_p, ":%s TB %s %lu %s :%s",
1513 >                   me.name, chptr->chname,
1514 >                   (unsigned long)chptr->topic_time,
1515 >                   chptr->topic_info, chptr->topic ? chptr->topic : "");
1516 >      }
1517 >      else
1518 >      {
1519 >        sendto_one(client_p, ":%s TB %s %lu :%s",
1520 >                   me.name, chptr->chname,
1521 >                   (unsigned long)chptr->topic_time,
1522 >                   chptr->topic ? chptr->topic : "");
1523 >      }
1524      }
1525    }
1694
1695  DLINK_FOREACH(ptr, global_client_list.head)
1696  {
1697    target_p = ptr->data;
1698    target_p->lazyLinkClientExists &= clear_mask;
1699  }
1526   }
1527  
1528   /* burst_members()
# Line 1728 | Line 1554 | burst_members(struct Client *client_p, s
1554    }
1555   }
1556  
1731 /* burst_ll_members()
1732 *
1733 * inputs       - pointer to server to send members to
1734 *              - dlink_list pointer to membership list to send
1735 * output       - NONE
1736 * side effects - This version also has to check the bitmap for lazylink
1737 */
1738 static void
1739 burst_ll_members(struct Client *client_p, struct Channel *chptr)
1740 {
1741  struct Client *target_p;
1742  struct Membership *ms;
1743  dlink_node *ptr;
1744
1745  DLINK_FOREACH(ptr, chptr->members.head)
1746  {
1747    ms       = ptr->data;
1748    target_p = ms->client_p;
1749
1750    if ((target_p->lazyLinkClientExists & client_p->localClient->serverMask) == 0)
1751    {
1752      if (target_p->from != client_p)
1753      {
1754        add_lazylinkclient(client_p,target_p);
1755        sendnick_TS(client_p, target_p);
1756      }
1757    }
1758  }
1759 }
1760
1557   /* set_autoconn()
1558   *
1559   * inputs       - struct Client pointer to oper requesting change
# Line 1801 | Line 1597 | set_autoconn(struct Client *source_p, co
1597    }
1598   }
1599  
1804 void
1805 initServerMask(void)
1806 {
1807  freeMask = 0xFFFFFFFFUL;
1808 }
1809
1810 /* nextFreeMask()
1811 *
1812 * inputs       - NONE
1813 * output       - unsigned long next unused mask for use in LL
1814 * side effects -
1815 */
1816 unsigned long
1817 nextFreeMask(void)
1818 {
1819  int i;
1820  unsigned long mask = 1;
1821
1822  for (i = 0; i < 32; i++)
1823  {
1824    if (mask & freeMask)
1825    {
1826      freeMask &= ~mask;
1827      return(mask);
1828    }
1829
1830    mask <<= 1;
1831  }
1832
1833  return(0L); /* watch this special case ... */
1834 }
1835
1600   /* New server connection code
1601   * Based upon the stuff floating about in s_bsd.c
1602   *   -- adrian
# Line 2132 | Line 1896 | serv_connect_callback(fde_t *fd, int sta
1896  
1897    /* Pass my info to the new server
1898     *
2135   * If trying to negotiate LazyLinks, pass on CAP_LL
1899     * If this is a HUB, pass on CAP_HUB
1900     * Pass on ZIP if supported
1901     * Pass on TB if supported.
1902     * - Dianora
1903     */
1904 <  send_capabilities(client_p, aconf,
1905 <                    (IsConfLazyLink(aconf) ? find_capability("LL") : 0)
1906 <                    | (IsConfCompressed(aconf) ? find_capability("ZIP") : 0)
2144 <                    | (IsConfTopicBurst(aconf) ? find_capability("TB") : 0)
2145 <                    , 0);
1904 >  send_capabilities(client_p, aconf, (ServerInfo.hub ? CAP_HUB : 0)
1905 >                    | (IsConfCompressed(aconf) ? CAP_ZIP : 0)
1906 >                    | (IsConfTopicBurst(aconf) ? CAP_TBURST|CAP_TB : 0), 0);
1907  
1908    sendto_one(client_p, "SERVER %s 1 :%s%s",
1909               my_name_for_link(conf),
# Line 2250 | Line 2011 | cryptlink_init(struct Client *client_p,
2011      return;
2012    }
2013  
2014 <  send_capabilities(client_p, aconf,
2015 <                    (IsConfLazyLink(aconf) ? find_capability("LL") : 0)
2016 <                    | (IsConfCompressed(aconf) ? find_capability("ZIP") : 0)
2017 <                    | (IsConfTopicBurst(aconf) ? find_capability("TB") : 0)
2018 <                    , CAP_ENC_MASK);
2014 >  send_capabilities(client_p, aconf, (ServerInfo.hub ? CAP_HUB : 0)
2015 >                    | (IsConfCompressed(aconf) ? CAP_ZIP : 0)
2016 >                    | (IsConfTopicBurst(aconf) ? CAP_TBURST|CAP_TB : 0), CAP_ENC_MASK);
2017 >
2018 >  if (me.id[0])
2019 >    sendto_one(client_p, "PASS . TS %d %s", TS_CURRENT, me.id);
2020  
2021    sendto_one(client_p, "CRYPTLINK SERV %s %s :%s%s",
2022               my_name_for_link(conf), key_to_send,

Diff Legend

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