if (!cache)
return FALSE;
- if (!silc_hash_table_find(cache->id_table, id, NULL, (void **)&c))
+ if (!silc_hash_table_find(cache->id_table, id, NULL, (void *)&c))
return FALSE;
return silc_idcache_del(cache, c, app_context);
if (!cache)
return FALSE;
- if (!silc_hash_table_find(cache->context_table, context, NULL, (void **)&c))
+ if (!silc_hash_table_find(cache->context_table, context, NULL, (void *)&c))
return FALSE;
return silc_idcache_del(cache, c, app_context);
if (!cache)
return FALSE;
- if (!silc_hash_table_find(cache->context_table, context, NULL, (void **)&c))
+ if (!silc_hash_table_find(cache->context_table, context, NULL, (void *)&c))
return FALSE;
return silc_idcache_update(cache, c, new_id, new_name, free_old_name);
session->monitor = NULL;
}
+ silc_schedule_task_del_by_context(client->schedule, session);
+
session->closed = TRUE;
/* Destroy via timeout */
}
/* Get channel mode */
- tmp = silc_argument_get_arg_type(args, 5, NULL);
- if (tmp)
+ tmp = silc_argument_get_arg_type(args, 5, &len);
+ if (tmp && len == 4)
SILC_GET32_MSB(mode, tmp);
channel->mode = mode;
goto out;
}
+ /* Get founder public key */
+ tmp = silc_argument_get_arg_type(args, 4, &len);
+ if (tmp)
+ silc_public_key_payload_decode(tmp, len, &public_key);
+
/* Get channel mode */
tmp = silc_argument_get_arg_type(args, 3, &len);
if (!tmp || len != 4) {
goto out;
}
- /* Get founder public key */
- tmp = silc_argument_get_arg_type(args, 4, &len);
- if (tmp)
- silc_public_key_payload_decode(tmp, len, &public_key);
-
silc_rwlock_wrlock(channel->internal.lock);
/* Save the mode */
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2005 - 2006 Pekka Riikonen
+ Copyright (C) 2005 - 2007 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
/* Encode the headers. Order doesn't matter */
i = 0;
silc_hash_table_list(mime->fields, &htl);
- while (silc_hash_table_get(&htl, (void **)&field, (void **)&value)) {
+ while (silc_hash_table_get(&htl, (void *)&field, (void *)&value)) {
memset(tmp, 0, sizeof(tmp));
SILC_LOG_DEBUG(("Header %s: %s", field, value));
silc_snprintf(tmp, sizeof(tmp) - 1, "%s: %s\r\n", field, value);
/* Find fragments with this ID. */
if (!silc_hash_table_find(assembler->fragments, (void *)id,
- NULL, (void **)&f)) {
+ NULL, (void *)&f)) {
/* This is new fragment to new message. Add to hash table and return. */
f = silc_hash_table_alloc(0, silc_hash_uint, NULL, NULL, NULL,
silc_mime_assemble_dest, NULL, TRUE);
/* Assemble the complete MIME message now. We get them in order from
the hash table. */
for (i = 1; i <= total; i++) {
- if (!silc_hash_table_find(f, SILC_32_TO_PTR(i), NULL, (void **)&p))
+ if (!silc_hash_table_find(f, SILC_32_TO_PTR(i), NULL, (void *)&p))
goto err;
/* The fragment is in the data portion of the partial message */
return NULL;
if (!silc_hash_table_find(mime->fields, (void *)field,
- NULL, (void **)&value))
+ NULL, (void *)&value))
return NULL;
return (const char *)value;
/* Delete from fd queue */
silc_hash_table_list(schedule->fd_queue, &htl);
- while (silc_hash_table_get(&htl, (void **)&fd, (void **)&task))
+ while (silc_hash_table_get(&htl, (void *)&fd, (void *)&task))
silc_hash_table_del(schedule->fd_queue, SILC_32_TO_PTR(fd));
silc_hash_table_list_reset(&htl);
/* Check if fd is already added */
if (silc_unlikely(silc_hash_table_find(schedule->fd_queue,
SILC_32_TO_PTR(fd),
- NULL, (void **)&task))) {
+ NULL, (void *)&task))) {
if (task->valid)
goto out;
/* Delete from fd queue */
silc_hash_table_list(schedule->fd_queue, &htl);
- while (silc_hash_table_get(&htl, NULL, (void **)&task))
+ while (silc_hash_table_get(&htl, NULL, (void *)&task))
task->valid = FALSE;
silc_hash_table_list_reset(&htl);
/* fd is unique, so there is only one task with this fd in the table */
if (silc_likely(silc_hash_table_find(schedule->fd_queue,
SILC_32_TO_PTR(fd), NULL,
- (void **)&task))) {
+ (void *)&task))) {
SILC_LOG_DEBUG(("Deleting task %p", task));
task->valid = FALSE;
ret = TRUE;
/* Delete from fd queue */
silc_hash_table_list(schedule->fd_queue, &htl);
- while (silc_hash_table_get(&htl, NULL, (void **)&task)) {
+ while (silc_hash_table_get(&htl, NULL, (void *)&task)) {
if (task->callback == callback) {
task->valid = FALSE;
ret = TRUE;
/* Delete from fd queue */
silc_hash_table_list(schedule->fd_queue, &htl);
- while (silc_hash_table_get(&htl, NULL, (void **)&task)) {
+ while (silc_hash_table_get(&htl, NULL, (void *)&task)) {
if (task->context == context) {
task->valid = FALSE;
ret = TRUE;
SILC_SCHEDULE_LOCK(schedule);
if (silc_hash_table_find(schedule->fd_queue, SILC_32_TO_PTR(fd),
- NULL, (void **)&task)) {
+ NULL, (void *)&task)) {
if (!schedule_ops.schedule_fd(schedule, schedule->internal, task, mask)) {
SILC_SCHEDULE_UNLOCK(schedule);
return FALSE;
SILC_SCHEDULE_LOCK(schedule);
if (silc_hash_table_find(schedule->fd_queue, SILC_32_TO_PTR(fd),
- NULL, (void **)&task))
+ NULL, (void *)&task))
event = task->events;
SILC_SCHEDULE_UNLOCK(schedule);
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2003 - 2006 Pekka Riikonen
+ Copyright (C) 2003 - 2007 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
{
struct tm *time;
unsigned int msec = 0;
+ time_t timeval;
if (!ret_time)
return TRUE;
msec = time_val % 1000;
time_val /= 1000;
- time = localtime((time_t *)&time_val);
+ time = localtime(&timeval);
if (!time)
return FALSE;
+ time_val = timeval;
memset(ret_time, 0, sizeof(*ret_time));
if (!silc_time_fill(ret_time, time->tm_year + 1900, time->tm_mon + 1,