From e63260bd062cc49ac3ef41c38286ce412543bc11 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sun, 27 Oct 2002 10:24:14 +0000 Subject: [PATCH] Fixed the heartbeat sending. Move silc_client_packet_send to be public function. --- apps/irssi/src/silc/core/silc-servers.c | 5 ++-- lib/silcclient/client.c | 2 +- lib/silcclient/client_internal.h | 10 ------- lib/silcclient/silcclient.h | 39 +++++++++++++++++++++++++ 4 files changed, 42 insertions(+), 14 deletions(-) diff --git a/apps/irssi/src/silc/core/silc-servers.c b/apps/irssi/src/silc/core/silc-servers.c index 78298e53..c7270588 100644 --- a/apps/irssi/src/silc/core/silc-servers.c +++ b/apps/irssi/src/silc/core/silc-servers.c @@ -266,9 +266,8 @@ void silc_send_heartbeat(SilcSocketConnection sock, if (server == NULL) return; - silc_client_packet_send(silc_client, sock, SILC_PACKET_HEARTBEAT, 0, - NULL, 0, FALSE); - + silc_client_packet_send(silc_client, sock, SILC_PACKET_HEARTBEAT, + NULL, 0, NULL, NULL, NULL, 0, FALSE); } static void sig_connected(SILC_SERVER_REC *server) diff --git a/lib/silcclient/client.c b/lib/silcclient/client.c index d8f7dbde..06a1ffbb 100644 --- a/lib/silcclient/client.c +++ b/lib/silcclient/client.c @@ -1282,7 +1282,7 @@ void silc_client_packet_send(SilcClient client, SilcHmac hmac, unsigned char *data, SilcUInt32 data_len, - int force_send) + bool force_send) { SilcPacketContext packetdata; const SilcBufferStruct packet; diff --git a/lib/silcclient/client_internal.h b/lib/silcclient/client_internal.h index 40714fb8..8d4c4f21 100644 --- a/lib/silcclient/client_internal.h +++ b/lib/silcclient/client_internal.h @@ -149,16 +149,6 @@ void silc_client_ftp_free_sessions(SilcClient client, void silc_client_ftp_session_free(SilcClientFtpSession session); void silc_client_ftp_session_free_client(SilcClientConnection conn, SilcClientEntry client_entry); -void silc_client_packet_send(SilcClient client, - SilcSocketConnection sock, - SilcPacketType type, - void *dst_id, - SilcIdType dst_id_type, - SilcCipher cipher, - SilcHmac hmac, - unsigned char *data, - SilcUInt32 data_len, - int force_send); void silc_client_close_connection_real(SilcClient client, SilcSocketConnection sock, SilcClientConnection conn); diff --git a/lib/silcclient/silcclient.h b/lib/silcclient/silcclient.h index bf46038c..2d578ef1 100644 --- a/lib/silcclient/silcclient.h +++ b/lib/silcclient/silcclient.h @@ -2281,6 +2281,45 @@ const SilcHashTable silc_client_attributes_get(SilcClient client, ***/ SilcBuffer silc_client_attributes_request(SilcAttribute attribute, ...); +/* Low level packet sending functions */ + +/****f* silcclient/SilcClientAPI/silc_client_packet_send + * + * SYNOPSIS + * + * void silc_client_packet_send(SilcClient client, + * SilcSocketConnection sock, + * SilcPacketType type, + * void *dst_id, + * SilcIdType dst_id_type, + * SilcCipher cipher, + * SilcHmac hmac, + * unsigned char *data, + * SilcUInt32 data_len, + * bool force_send); + * + * DESCRIPTION + * + * Constructs a Requested Attributes buffer. If the `attribute' is zero (0) + * then all attributes are requested. Alternatively, `attribute' and + * all variable arguments can each be requested attribute. In this case + * the last must be set to zero (0) to complete the variable list of + * requested attributes. See SilcAttribute for all attributes. + * You can give the returned buffer as argument to for example + * silc_client_get_client_by_id_resolve function. + * + ***/ +void silc_client_packet_send(SilcClient client, + SilcSocketConnection sock, + SilcPacketType type, + void *dst_id, + SilcIdType dst_id_type, + SilcCipher cipher, + SilcHmac hmac, + unsigned char *data, + SilcUInt32 data_len, + bool force_send); + #include "client.h" #include "command.h" #include "command_reply.h" -- 2.24.0