/[svn]/ircd-hybrid-7.2/src/s_serv.c
ViewVC logotype

Diff of /ircd-hybrid-7.2/src/s_serv.c

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

revision 328 by michael, Sat Dec 24 15:06:49 2005 UTC revision 329 by michael, Sun Dec 25 10:45:42 2005 UTC
# Line 677  check_server(const char *name, struct Cl Line 677  check_server(const char *name, struct Cl
677    if (!IsConfCryptLink(server_aconf))    if (!IsConfCryptLink(server_aconf))
678      ClearCap(client_p, CAP_ENC);      ClearCap(client_p, CAP_ENC);
679    if (!IsConfTopicBurst(server_aconf))    if (!IsConfTopicBurst(server_aconf))
680      {
681      ClearCap(client_p, CAP_TB);      ClearCap(client_p, CAP_TB);
682        ClearCap(client_p, CAP_TBURST);
683      }
684    
685    /* Don't unset CAP_HUB here even if the server isn't a hub,    /* Don't unset CAP_HUB here even if the server isn't a hub,
686     * it only indicates if the server thinks it's lazylinks are     * it only indicates if the server thinks it's lazylinks are
# Line 1064  server_estab(struct Client *client_p) Line 1067  server_estab(struct Client *client_p)
1067       * - Dianora       * - Dianora
1068       */       */
1069    
1070       send_capabilities(client_p, aconf,      send_capabilities(client_p, aconf, (ServerInfo.hub ? CAP_HUB : 0)
1071         (IsConfLazyLink(aconf) ? find_capability("LL") : 0)        | (IsConfLazyLink(aconf) ? CAP_LL : 0)
1072         | (IsConfCompressed(aconf) ? find_capability("ZIP") : 0)        | (IsConfCompressed(aconf) ? CAP_ZIP : 0)
1073         | (IsConfTopicBurst(aconf) ? find_capability("TB") : 0)        | (IsConfTopicBurst(aconf) ? CAP_TBURST|CAP_TB : 0), 0);
        , 0);  
1074    
1075      /* SERVER is the last command sent before switching to ziplinks.      /* SERVER is the last command sent before switching to ziplinks.
1076       * We set TCPNODELAY on the socket to make sure it gets sent out       * We set TCPNODELAY on the socket to make sure it gets sent out
# Line 1340  start_io(struct Client *server) Line 1342  start_io(struct Client *server)
1342      memcpy(buf, &block->data[0], block->size);      memcpy(buf, &block->data[0], block->size);
1343      buf += block->size;      buf += block->size;
1344    }    }
1345    
1346    dbuf_clear(&lserver->buf_recvq);    dbuf_clear(&lserver->buf_recvq);
1347    
1348    /* pass the whole sendq to servlink */    /* pass the whole sendq to servlink */
# Line 1352  start_io(struct Client *server) Line 1355  start_io(struct Client *server)
1355      memcpy(buf, &block->data[0], block->size);      memcpy(buf, &block->data[0], block->size);
1356      buf += block->size;      buf += block->size;
1357    }    }
1358    
1359    dbuf_clear(&lserver->buf_sendq);    dbuf_clear(&lserver->buf_sendq);
1360    
1361    /* start io */    /* start io */
# Line 1491  server_burst(struct Client *client_p) Line 1495  server_burst(struct Client *client_p)
1495  static void  static void
1496  burst_all(struct Client *client_p)  burst_all(struct Client *client_p)
1497  {  {
1498    struct Client *target_p;    dlink_node *ptr = NULL;
   struct Channel *chptr;  
   dlink_node *gptr;  
   dlink_node *ptr;  
1499    
1500    DLINK_FOREACH(gptr, global_channel_list.head)    DLINK_FOREACH(ptr, global_channel_list.head)
1501    {    {
1502      chptr = gptr->data;      struct Channel *chptr = ptr->data;
1503    
1504      if (dlink_list_length(&chptr->members) != 0)      if (dlink_list_length(&chptr->members) != 0)
1505      {      {
1506        burst_members(client_p, chptr);        burst_members(client_p, chptr);
1507        send_channel_modes(client_p, chptr);        send_channel_modes(client_p, chptr);
1508        if (IsCapable(client_p, CAP_TB))  
1509          if (IsCapable(client_p, CAP_TBURST) ||
1510              IsCapable(client_p, CAP_TB))
1511          send_tb(client_p, chptr);          send_tb(client_p, chptr);
1512      }      }
1513    }    }
# Line 1513  burst_all(struct Client *client_p) Line 1516  burst_all(struct Client *client_p)
1516     */     */
1517    DLINK_FOREACH(ptr, global_client_list.head)    DLINK_FOREACH(ptr, global_client_list.head)
1518    {    {
1519      target_p = ptr->data;      struct Client *target_p = ptr->data;
1520    
1521      if (!IsBursted(target_p) && target_p->from != client_p)      if (!IsBursted(target_p) && target_p->from != client_p)
1522        sendnick_TS(client_p, target_p);        sendnick_TS(client_p, target_p);
# Line 1532  burst_all(struct Client *client_p) Line 1535  burst_all(struct Client *client_p)
1535  /*  /*
1536   * send_tb   * send_tb
1537   *   *
1538   * inputs       - pointer to Client   * inputs       - pointer to Client
1539   *              - pointer to channel   *              - pointer to channel
1540   * output       - NONE   * output       - NONE
1541   * side effects - Called on a server burst when   * side effects - Called on a server burst when
1542   *                server is CAP_TB capable   *                server is CAP_TB|CAP_TBURST capable
1543   */   */
1544  static void  static void
1545  send_tb(struct Client *client_p, struct Channel *chptr)  send_tb(struct Client *client_p, struct Channel *chptr)
1546  {  {
1547    if (chptr->topic != NULL && IsCapable(client_p, CAP_TB))    /*
1548       * XXX - Logic here isn't right either.  What if the topic got unset?
1549       * We would need to send an empty TOPIC to reset the topic from the
1550       * other side
1551       */
1552      if (chptr->topic != NULL)
1553    {    {
1554      if (ConfigChannel.burst_topicwho)      if (IsCapable(client_p, CAP_TBURST))
1555      {        sendto_one(client_p, ":%s TBURST %lu %s %lu %s :%s",
1556        sendto_one(client_p, ":%s TB %s %lu %s :%s",                   me.name, (unsigned long)chptr->channelts, chptr->chname,
1557                   me.name, chptr->chname,                   (unsigned long)chptr->topic_time, chptr->topic_info,
1558                   (unsigned long)chptr->topic_time,                   chptr->topic);
1559                   chptr->topic_info, chptr->topic);      else if (IsCapable(client_p, CAP_TB))
     }  
     else  
1560      {      {
1561        sendto_one(client_p, ":%s TB %s %lu :%s",        if (ConfigChannel.burst_topicwho)
1562                   me.name, chptr->chname,        {
1563                   (unsigned long)chptr->topic_time, chptr->topic);          sendto_one(client_p, ":%s TB %s %lu %s :%s",
1564                       me.name, chptr->chname,
1565                       (unsigned long)chptr->topic_time,
1566                       chptr->topic_info, chptr->topic);
1567          }
1568          else
1569          {
1570            sendto_one(client_p, ":%s TB %s %lu :%s",
1571                       me.name, chptr->chname,
1572                       (unsigned long)chptr->topic_time, chptr->topic);
1573          }
1574      }      }
1575    }    }
1576  }  }
# Line 2139  serv_connect_callback(fde_t *fd, int sta Line 2155  serv_connect_callback(fde_t *fd, int sta
2155     * Pass on TB if supported.     * Pass on TB if supported.
2156     * - Dianora     * - Dianora
2157     */     */
2158    send_capabilities(client_p, aconf,    send_capabilities(client_p, aconf, (ServerInfo.hub ? CAP_HUB : 0)
2159                      (IsConfLazyLink(aconf) ? find_capability("LL") : 0)                      | (IsConfLazyLink(aconf) ? CAP_LL : 0)
2160                      | (IsConfCompressed(aconf) ? find_capability("ZIP") : 0)                      | (IsConfCompressed(aconf) ? CAP_ZIP : 0)
2161                      | (IsConfTopicBurst(aconf) ? find_capability("TB") : 0)                      | (IsConfTopicBurst(aconf) ? CAP_TBURST|CAP_TB : 0), 0);
                     , 0);  
2162    
2163    sendto_one(client_p, "SERVER %s 1 :%s%s",    sendto_one(client_p, "SERVER %s 1 :%s%s",
2164               my_name_for_link(conf),               my_name_for_link(conf),
# Line 2251  cryptlink_init(struct Client *client_p, Line 2266  cryptlink_init(struct Client *client_p,
2266      return;      return;
2267    }    }
2268    
2269    send_capabilities(client_p, aconf,    send_capabilities(client_p, aconf, (ServerInfo.hub ? CAP_HUB : 0)
2270                      (IsConfLazyLink(aconf) ? find_capability("LL") : 0)                      | (IsConfLazyLink(aconf) ? CAP_LL : 0)
2271                      | (IsConfCompressed(aconf) ? find_capability("ZIP") : 0)                      | (IsConfCompressed(aconf) ? CAP_ZIP : 0)
2272                      | (IsConfTopicBurst(aconf) ? find_capability("TB") : 0)                      | (IsConfTopicBurst(aconf) ? CAP_TBURST|CAP_TB : 0), CAP_ENC_MASK);
                     , CAP_ENC_MASK);  
2273    
2274    if (me.id[0])    if (me.id[0])
2275      sendto_one(client_p, "PASS . TS %d %s", TS_CURRENT, me.id);      sendto_one(client_p, "PASS . TS %d %s", TS_CURRENT, me.id);

Legend:
Removed from v.328  
changed lines
  Added in v.329

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