/* Heartbeat context */
struct SilcSocketConnectionHBStruct {
- uint32 heartbeat;
+ SilcUInt32 heartbeat;
SilcSocketConnectionHBCb hb_callback;
void *hb_context;
SilcSchedule schedule;
silc_buffer_free(sock->outbuf);
if (sock->hb) {
silc_schedule_task_del(sock->hb->schedule, sock->hb->hb_task);
- silc_free(sock->hb->hb_context);
silc_free(sock->hb);
}
`schedule' is the application's scheduler. */
void silc_socket_set_heartbeat(SilcSocketConnection sock,
- uint32 heartbeat,
+ SilcUInt32 heartbeat,
void *hb_context,
SilcSocketConnectionHBCb hb_callback,
SilcSchedule schedule)
{
if (sock->hb) {
silc_schedule_task_del(schedule, sock->hb->hb_task);
- silc_free(sock->hb->hb_context);
silc_free(sock->hb);
}
{
SilcSocketHostLookup lookup = (SilcSocketHostLookup)context;
SilcSocketConnection sock = lookup->sock;
+ SilcSchedule schedule = lookup->schedule;
if (lookup->port)
sock->port = silc_net_get_remote_port(sock->sock);
if (!sock->hostname && sock->ip)
sock->hostname = strdup(sock->ip);
- silc_schedule_task_add(lookup->schedule, sock->sock,
+ silc_schedule_task_add(schedule, sock->sock,
silc_socket_host_lookup_finish, lookup, 0, 1,
SILC_TASK_TIMEOUT, SILC_TASK_PRI_NORMAL);
- silc_schedule_wakeup(lookup->schedule);
+ silc_schedule_wakeup(schedule);
return NULL;
}