Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
- Copyright (C) 1997 - 2000 Pekka Riikonen
+ Copyright (C) 1997 - 2001 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* If the packet is originated from our primary route we are
not allowed to send the packet. */
- id = silc_id_str2id(packet->src_id, packet->src_id_type);
+ id = silc_id_str2id(packet->src_id, packet->src_id_len, packet->src_id_type);
if (id && SILC_ID_SERVER_COMPARE(id, server->router->id)) {
idata = (SilcIDListData)sock->user_data;
/* Send the message to clients on the channel's client list. */
silc_list_start(channel->user_list);
while ((chl = silc_list_get(channel->user_list)) != SILC_LIST_END) {
- if (chl->client) {
+ if (chl->client && !chl->client->router) {
sock = (SilcSocketConnection)chl->client->connection;
/* Send the packet to the client */
SILC_STR_UI_XNSTRING(cid, channel_id_len),
SILC_STR_END);
+
silc_server_packet_send(server, sock, SILC_PACKET_NEW_CHANNEL,
broadcast ? SILC_PACKET_FLAG_BROADCAST : 0,
packet->data, packet->len, FALSE);
silc_buffer_free(packet);
}
+
+/* Send the heartbeat packet. */
+
+void silc_server_send_heartbeat(SilcServer server,
+ SilcSocketConnection sock)
+{
+ silc_server_packet_send(server, sock, SILC_PACKET_HEARTBEAT, 0,
+ NULL, 0, FALSE);
+}