projects
/
silc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updates.
[silc.git]
/
lib
/
silcserver
/
server_entry.c
diff --git
a/lib/silcserver/server_entry.c
b/lib/silcserver/server_entry.c
index 6effe759113a58506073f0a7ec91e12f76fa6169..da415ffb89cda9d022531e6e7d69252656974888 100644
(file)
--- a/
lib/silcserver/server_entry.c
+++ b/
lib/silcserver/server_entry.c
@@
-4,7
+4,7
@@
Author: Pekka Riikonen <priikone@silcnet.org>
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 200
5
Pekka Riikonen
+ Copyright (C) 1997 - 200
6
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
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
@@
-23,6
+23,8
@@
#include "silcserver.h"
#include "server_internal.h"
#include "silcserver.h"
#include "server_internal.h"
+/* XXX locking missing from routines! */
+
/************************ Static utility functions **************************/
/* Foreach callbcak to free all users from the channel when deleting a
/************************ Static utility functions **************************/
/* Foreach callbcak to free all users from the channel when deleting a
@@
-241,7
+243,6
@@
silc_server_replace_server_id(SilcServer server, SilcServerID *old_id,
SilcServerID *new_id)
{
SilcIDCacheEntry id_cache = NULL;
SilcServerID *new_id)
{
SilcIDCacheEntry id_cache = NULL;
- SilcServerEntry entry;
if (!old_id || !new_id)
return NULL;
if (!old_id || !new_id)
return NULL;
@@
-251,14
+252,9
@@
silc_server_replace_server_id(SilcServer server, SilcServerID *old_id,
SILC_LOG_DEBUG(("New Server ID %s",
silc_id_render(new_id, SILC_ID_SERVER)));
SILC_LOG_DEBUG(("New Server ID %s",
silc_id_render(new_id, SILC_ID_SERVER)));
- if (!silc_idcache_find_by_id_one(server->servers, (void *)old_id,
- &id_cache))
+ if (!silc_idcache_find_by_id_one(server->servers, old_id, &id_cache))
return NULL;
return NULL;
-
- entry = id_cache->context;
- entry->id = *new_id;
-
- if (!silc_idcache_update(server->servers, id_cache, old_id, &entry->id,
+ if (!silc_idcache_update(server->servers, id_cache, old_id, new_id,
NULL, NULL)) {
SILC_LOG_ERROR(("Error updating Server ID"));
return NULL;
NULL, NULL)) {
SILC_LOG_ERROR(("Error updating Server ID"));
return NULL;
@@
-266,7
+262,7
@@
silc_server_replace_server_id(SilcServer server, SilcServerID *old_id,
SILC_LOG_DEBUG(("Replaced"));
SILC_LOG_DEBUG(("Replaced"));
- return
entry
;
+ return
id_cache->context
;
}
}
@@
-450,9
+446,9
@@
silc_server_replace_client_id(SilcServer server, SilcClientID *old_id,
return NULL;
SILC_LOG_DEBUG(("Replacing Client ID %s",
return NULL;
SILC_LOG_DEBUG(("Replacing Client ID %s",
- silc_id_render(old_id, SILC_ID_
SERVER
)));
+ silc_id_render(old_id, SILC_ID_
CLIENT
)));
SILC_LOG_DEBUG(("New Client ID %s",
SILC_LOG_DEBUG(("New Client ID %s",
- silc_id_render(new_id, SILC_ID_
SERVER
)));
+ silc_id_render(new_id, SILC_ID_
CLIENT
)));
/* Normalize name. This is cached, original is in client context. */
if (nickname) {
/* Normalize name. This is cached, original is in client context. */
if (nickname) {
@@
-462,15
+458,11
@@
silc_server_replace_client_id(SilcServer server, SilcClientID *old_id,
return NULL;
}
return NULL;
}
- if (!silc_idcache_find_by_id_one(server->clients, (void *)old_id,
- &id_cache))
+ if (!silc_idcache_find_by_id_one(server->clients, old_id, &id_cache))
return NULL;
return NULL;
-
entry = id_cache->context;
entry = id_cache->context;
- entry->id = *new_id;
-
name = id_cache->name;
name = id_cache->name;
- if (!silc_idcache_update(server->clients, id_cache, old_id,
&entry->
id,
+ if (!silc_idcache_update(server->clients, id_cache, old_id,
new_
id,
name, nicknamec)) {
SILC_LOG_ERROR(("Error updating Client ID"));
return NULL;
name, nicknamec)) {
SILC_LOG_ERROR(("Error updating Client ID"));
return NULL;
@@
-651,7
+643,6
@@
SilcChannelEntry silc_server_replace_channel_id(SilcServer server,
SilcChannelID *new_id)
{
SilcIDCacheEntry id_cache = NULL;
SilcChannelID *new_id)
{
SilcIDCacheEntry id_cache = NULL;
- SilcChannelEntry entry;
if (!old_id || !new_id)
return NULL;
if (!old_id || !new_id)
return NULL;
@@
-661,14
+652,9
@@
SilcChannelEntry silc_server_replace_channel_id(SilcServer server,
SILC_LOG_DEBUG(("New Channel ID %s",
silc_id_render(new_id, SILC_ID_CHANNEL)));
SILC_LOG_DEBUG(("New Channel ID %s",
silc_id_render(new_id, SILC_ID_CHANNEL)));
- if (!silc_idcache_find_by_id_one(server->channels, (void *)old_id,
- &id_cache))
+ if (!silc_idcache_find_by_id_one(server->channels, old_id, &id_cache))
return NULL;
return NULL;
-
- entry = id_cache->context;
- entry->id = *new_id;
-
- if (!silc_idcache_update(server->channels, id_cache, old_id, &entry->id,
+ if (!silc_idcache_update(server->channels, id_cache, old_id, new_id,
NULL, NULL)) {
SILC_LOG_ERROR(("Error updating Channel ID"));
return NULL;
NULL, NULL)) {
SILC_LOG_ERROR(("Error updating Channel ID"));
return NULL;
@@
-676,7
+662,7
@@
SilcChannelEntry silc_server_replace_channel_id(SilcServer server,
SILC_LOG_DEBUG(("Replaced"));
SILC_LOG_DEBUG(("Replaced"));
- return
entry
;
+ return
id_cache->context
;
}
/* Returns channels from the ID list. If the `channel_id' is NULL then
}
/* Returns channels from the ID list. If the `channel_id' is NULL then