| 677 |
|
if (!IsConfCryptLink(server_aconf)) |
| 678 |
|
ClearCap(client_p, CAP_ENC); |
| 679 |
|
if (!IsConfTopicBurst(server_aconf)) |
| 680 |
+ |
{ |
| 681 |
|
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, |
| 686 |
|
* it only indicates if the server thinks it's lazylinks are |
| 1067 |
|
* - Dianora |
| 1068 |
|
*/ |
| 1069 |
|
|
| 1070 |
< |
send_capabilities(client_p, aconf, |
| 1071 |
< |
(IsConfLazyLink(aconf) ? find_capability("LL") : 0) |
| 1072 |
< |
| (IsConfCompressed(aconf) ? find_capability("ZIP") : 0) |
| 1073 |
< |
| (IsConfTopicBurst(aconf) ? find_capability("TB") : 0) |
| 1071 |
< |
, 0); |
| 1070 |
> |
send_capabilities(client_p, aconf, (ServerInfo.hub ? CAP_HUB : 0) |
| 1071 |
> |
| (IsConfLazyLink(aconf) ? CAP_LL : 0) |
| 1072 |
> |
| (IsConfCompressed(aconf) ? CAP_ZIP : 0) |
| 1073 |
> |
| (IsConfTopicBurst(aconf) ? CAP_TBURST|CAP_TB : 0), 0); |
| 1074 |
|
|
| 1075 |
|
/* SERVER is the last command sent before switching to ziplinks. |
| 1076 |
|
* We set TCPNODELAY on the socket to make sure it gets sent out |
| 1342 |
|
memcpy(buf, &block->data[0], block->size); |
| 1343 |
|
buf += block->size; |
| 1344 |
|
} |
| 1345 |
+ |
|
| 1346 |
|
dbuf_clear(&lserver->buf_recvq); |
| 1347 |
|
|
| 1348 |
|
/* pass the whole sendq to servlink */ |
| 1355 |
|
memcpy(buf, &block->data[0], block->size); |
| 1356 |
|
buf += block->size; |
| 1357 |
|
} |
| 1358 |
+ |
|
| 1359 |
|
dbuf_clear(&lserver->buf_sendq); |
| 1360 |
|
|
| 1361 |
|
/* start io */ |
| 1495 |
|
static void |
| 1496 |
|
burst_all(struct Client *client_p) |
| 1497 |
|
{ |
| 1498 |
< |
struct Client *target_p; |
| 1495 |
< |
struct Channel *chptr; |
| 1496 |
< |
dlink_node *gptr; |
| 1497 |
< |
dlink_node *ptr; |
| 1498 |
> |
dlink_node *ptr = NULL; |
| 1499 |
|
|
| 1500 |
< |
DLINK_FOREACH(gptr, global_channel_list.head) |
| 1500 |
> |
DLINK_FOREACH(ptr, global_channel_list.head) |
| 1501 |
|
{ |
| 1502 |
< |
chptr = gptr->data; |
| 1502 |
> |
struct Channel *chptr = ptr->data; |
| 1503 |
|
|
| 1504 |
|
if (dlink_list_length(&chptr->members) != 0) |
| 1505 |
|
{ |
| 1506 |
|
burst_members(client_p, chptr); |
| 1507 |
|
send_channel_modes(client_p, chptr); |
| 1508 |
< |
if (IsCapable(client_p, CAP_TB)) |
| 1508 |
> |
|
| 1509 |
> |
if (IsCapable(client_p, CAP_TBURST) || |
| 1510 |
> |
IsCapable(client_p, CAP_TB)) |
| 1511 |
|
send_tb(client_p, chptr); |
| 1512 |
|
} |
| 1513 |
|
} |
| 1516 |
|
*/ |
| 1517 |
|
DLINK_FOREACH(ptr, global_client_list.head) |
| 1518 |
|
{ |
| 1519 |
< |
target_p = ptr->data; |
| 1519 |
> |
struct Client *target_p = ptr->data; |
| 1520 |
|
|
| 1521 |
|
if (!IsBursted(target_p) && target_p->from != client_p) |
| 1522 |
|
sendnick_TS(client_p, target_p); |
| 1535 |
|
/* |
| 1536 |
|
* send_tb |
| 1537 |
|
* |
| 1538 |
< |
* inputs - pointer to Client |
| 1539 |
< |
* - pointer to channel |
| 1540 |
< |
* output - NONE |
| 1541 |
< |
* side effects - Called on a server burst when |
| 1542 |
< |
* server is CAP_TB capable |
| 1538 |
> |
* inputs - pointer to Client |
| 1539 |
> |
* - pointer to channel |
| 1540 |
> |
* output - NONE |
| 1541 |
> |
* side effects - Called on a server burst when |
| 1542 |
> |
* server is CAP_TB|CAP_TBURST capable |
| 1543 |
|
*/ |
| 1544 |
|
static void |
| 1545 |
|
send_tb(struct Client *client_p, struct Channel *chptr) |
| 1546 |
|
{ |
| 1547 |
< |
if (chptr->topic != NULL && IsCapable(client_p, CAP_TB)) |
| 1547 |
> |
/* |
| 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) |
| 1555 |
< |
{ |
| 1556 |
< |
sendto_one(client_p, ":%s TB %s %lu %s :%s", |
| 1557 |
< |
me.name, chptr->chname, |
| 1558 |
< |
(unsigned long)chptr->topic_time, |
| 1559 |
< |
chptr->topic_info, chptr->topic); |
| 1552 |
< |
} |
| 1553 |
< |
else |
| 1554 |
> |
if (IsCapable(client_p, CAP_TBURST)) |
| 1555 |
> |
sendto_one(client_p, ":%s TBURST %lu %s %lu %s :%s", |
| 1556 |
> |
me.name, (unsigned long)chptr->channelts, chptr->chname, |
| 1557 |
> |
(unsigned long)chptr->topic_time, chptr->topic_info, |
| 1558 |
> |
chptr->topic); |
| 1559 |
> |
else if (IsCapable(client_p, CAP_TB)) |
| 1560 |
|
{ |
| 1561 |
< |
sendto_one(client_p, ":%s TB %s %lu :%s", |
| 1562 |
< |
me.name, chptr->chname, |
| 1563 |
< |
(unsigned long)chptr->topic_time, chptr->topic); |
| 1561 |
> |
if (ConfigChannel.burst_topicwho) |
| 1562 |
> |
{ |
| 1563 |
> |
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 |
|
} |
| 2155 |
|
* Pass on TB if supported. |
| 2156 |
|
* - Dianora |
| 2157 |
|
*/ |
| 2158 |
< |
send_capabilities(client_p, aconf, |
| 2159 |
< |
(IsConfLazyLink(aconf) ? find_capability("LL") : 0) |
| 2160 |
< |
| (IsConfCompressed(aconf) ? find_capability("ZIP") : 0) |
| 2161 |
< |
| (IsConfTopicBurst(aconf) ? find_capability("TB") : 0) |
| 2146 |
< |
, 0); |
| 2158 |
> |
send_capabilities(client_p, aconf, (ServerInfo.hub ? CAP_HUB : 0) |
| 2159 |
> |
| (IsConfLazyLink(aconf) ? CAP_LL : 0) |
| 2160 |
> |
| (IsConfCompressed(aconf) ? CAP_ZIP : 0) |
| 2161 |
> |
| (IsConfTopicBurst(aconf) ? CAP_TBURST|CAP_TB : 0), 0); |
| 2162 |
|
|
| 2163 |
|
sendto_one(client_p, "SERVER %s 1 :%s%s", |
| 2164 |
|
my_name_for_link(conf), |
| 2266 |
|
return; |
| 2267 |
|
} |
| 2268 |
|
|
| 2269 |
< |
send_capabilities(client_p, aconf, |
| 2270 |
< |
(IsConfLazyLink(aconf) ? find_capability("LL") : 0) |
| 2271 |
< |
| (IsConfCompressed(aconf) ? find_capability("ZIP") : 0) |
| 2272 |
< |
| (IsConfTopicBurst(aconf) ? find_capability("TB") : 0) |
| 2258 |
< |
, CAP_ENC_MASK); |
| 2269 |
> |
send_capabilities(client_p, aconf, (ServerInfo.hub ? CAP_HUB : 0) |
| 2270 |
> |
| (IsConfLazyLink(aconf) ? CAP_LL : 0) |
| 2271 |
> |
| (IsConfCompressed(aconf) ? CAP_ZIP : 0) |
| 2272 |
> |
| (IsConfTopicBurst(aconf) ? CAP_TBURST|CAP_TB : 0), CAP_ENC_MASK); |
| 2273 |
|
|
| 2274 |
|
if (me.id[0]) |
| 2275 |
|
sendto_one(client_p, "PASS . TS %d %s", TS_CURRENT, me.id); |