projects
/
silc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge commit 'origin/silc.1.1.branch'
[silc.git]
/
lib
/
silcclient
/
client_entry.c
diff --git
a/lib/silcclient/client_entry.c
b/lib/silcclient/client_entry.c
index 4664dbaa75f770446b457b8b7d830b67cab2d524..017f8f8a7aebed168f14779bff0149df5d0b944b 100644
(file)
--- a/
lib/silcclient/client_entry.c
+++ b/
lib/silcclient/client_entry.c
@@
-85,13
+85,8
@@
SilcDList silc_client_get_clients_local_ext(SilcClient client,
if (!silc_client_nickname_parse(client, conn, (char *)nick, &parsed))
return NULL;
if (!silc_client_nickname_parse(client, conn, (char *)nick, &parsed))
return NULL;
- if (!get_all
&& parsed
)
+ if (!get_all)
format = (char *)nick;
format = (char *)nick;
- if (!parsed) {
- parsed = silc_memdup(nick, strlen(nick));
- if (!parsed)
- return NULL;
- }
SILC_LOG_DEBUG(("Find clients by nickname %s", parsed));
SILC_LOG_DEBUG(("Find clients by nickname %s", parsed));
@@
-124,7
+119,7
@@
SilcDList silc_client_get_clients_local_ext(SilcClient client,
}
silc_list_start(list);
}
silc_list_start(list);
- if (
!format &&
get_all) {
+ if (get_all) {
/* Take all without any further checking */
while ((id_cache = silc_list_get(list))) {
entry = id_cache->context;
/* Take all without any further checking */
while ((id_cache = silc_list_get(list))) {
entry = id_cache->context;
@@
-517,7
+512,6
@@
SilcUInt16 silc_client_get_clients_by_list(SilcClient client,
SilcUInt32 *res_argv_lens = NULL, *res_argv_types = NULL, res_argc = 0;
SilcUInt16 idp_len, cmd_ident;
SilcID id;
SilcUInt32 *res_argv_lens = NULL, *res_argv_types = NULL, res_argc = 0;
SilcUInt16 idp_len, cmd_ident;
SilcID id;
- va_list tmp;
int i;
SILC_LOG_DEBUG(("Resolve clients from Client ID list"));
int i;
SILC_LOG_DEBUG(("Resolve clients from Client ID list"));
@@
-585,7
+579,7
@@
SilcUInt16 silc_client_get_clients_by_list(SilcClient client,
/* We have the clients in cache, get them and call the completion */
silc_client_get_clients_list_cb(client, conn, SILC_COMMAND_WHOIS,
/* We have the clients in cache, get them and call the completion */
silc_client_get_clients_list_cb(client, conn, SILC_COMMAND_WHOIS,
- SILC_STATUS_OK, SILC_STATUS_OK, in,
tmp
);
+ SILC_STATUS_OK, SILC_STATUS_OK, in,
NULL
);
return 0;
err:
return 0;
err:
@@
-811,8
+805,8
@@
SilcClientEntry silc_client_add_client(SilcClient client,
client_entry->hostname,
sizeof(client_entry->hostname));
client_entry->hostname,
sizeof(client_entry->hostname));
- client_entry->channels = silc_hash_table_alloc(
1, silc_hash_ptr, NULL
, NULL,
- NULL, NULL, NULL, TRUE);
+ client_entry->channels = silc_hash_table_alloc(
NULL, 1, silc_hash_ptr
, NULL,
+ NULL, NULL, NULL,
NULL,
TRUE);
if (!client_entry->channels) {
silc_free(client_entry->realname);
silc_free(client_entry);
if (!client_entry->channels) {
silc_free(client_entry->realname);
silc_free(client_entry);
@@
-1311,7
+1305,7
@@
SilcBool silc_client_nickname_parse(SilcClient client,
int len;
if (!client->internal->params->nickname_format[0]) {
int len;
if (!client->internal->params->nickname_format[0]) {
- *ret_nick =
NULL
;
+ *ret_nick =
silc_strdup(nickname)
;
return TRUE;
}
return TRUE;
}
@@
-1656,7
+1650,7
@@
SilcChannelEntry silc_client_add_channel(SilcClient client,
return NULL;
}
return NULL;
}
- channel->user_list = silc_hash_table_alloc(1, silc_hash_ptr, NULL, NULL,
+ channel->user_list = silc_hash_table_alloc(
NULL,
1, silc_hash_ptr, NULL, NULL,
NULL, NULL, NULL, TRUE);
if (!channel->user_list) {
silc_rwlock_free(channel->internal.lock);
NULL, NULL, NULL, TRUE);
if (!channel->user_list) {
silc_rwlock_free(channel->internal.lock);
@@
-1706,14
+1700,17
@@
SilcChannelEntry silc_client_add_channel(SilcClient client,
SilcBool silc_client_del_channel(SilcClient client, SilcClientConnection conn,
SilcChannelEntry channel)
{
SilcBool silc_client_del_channel(SilcClient client, SilcClientConnection conn,
SilcChannelEntry channel)
{
+
if (!channel)
return FALSE;
SILC_LOG_DEBUG(("Marking channel entry %p deleted"));
if (!channel)
return FALSE;
SILC_LOG_DEBUG(("Marking channel entry %p deleted"));
+
if (silc_atomic_sub_int32(&channel->internal.deleted, 1) != 0) {
SILC_LOG_DEBUG(("Channel entry %p already marked deleted"));
return FALSE;
if (silc_atomic_sub_int32(&channel->internal.deleted, 1) != 0) {
SILC_LOG_DEBUG(("Channel entry %p already marked deleted"));
return FALSE;
+ silc_client_del_channel_private_keys(client, conn, channel);
}
silc_client_unref_channel(client, conn, channel);
}
silc_client_unref_channel(client, conn, channel);