projects
/
silc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updates. New data types.
[silc.git]
/
apps
/
silcd
/
server.c
diff --git
a/apps/silcd/server.c
b/apps/silcd/server.c
index 3003bbbff1fcf08e22671de803957248480f9081..3ef616134ee65a1d55860cbad94b33b55c2691e0 100644
(file)
--- a/
apps/silcd/server.c
+++ b/
apps/silcd/server.c
@@
-155,7
+155,7
@@
int silc_server_init(SilcServer server)
{
unsigned char *public_key;
unsigned char *private_key;
{
unsigned char *public_key;
unsigned char *private_key;
- u
nsigned int
pk_len, prv_len;
+ u
int32
pk_len, prv_len;
struct stat st;
if (stat("pubkey.pub", &st) < 0 && stat("privkey.prv", &st) < 0) {
struct stat st;
if (stat("pubkey.pub", &st) < 0 && stat("privkey.prv", &st) < 0) {
@@
-1912,7
+1912,7
@@
void silc_server_packet_parse_type(SilcServer server,
/* Creates connection to a remote router. */
void silc_server_create_connection(SilcServer server,
/* Creates connection to a remote router. */
void silc_server_create_connection(SilcServer server,
- char *remote_host, u
nsigned int
port)
+ char *remote_host, u
int32
port)
{
SilcServerConnection sconn;
{
SilcServerConnection sconn;
@@
-2136,9
+2136,9
@@
int silc_server_remove_clients_by_server(SilcServer server,
SilcClientEntry client = NULL;
SilcBuffer idp;
SilcClientEntry *clients = NULL;
SilcClientEntry client = NULL;
SilcBuffer idp;
SilcClientEntry *clients = NULL;
- u
nsigned int
clients_c = 0;
+ u
int32
clients_c = 0;
unsigned char **argv = NULL;
unsigned char **argv = NULL;
- u
nsigned int
*argv_lens = NULL, *argv_types = NULL, argc = 0;
+ u
int32
*argv_lens = NULL, *argv_types = NULL, argc = 0;
int i;
SILC_LOG_DEBUG(("Start"));
int i;
SILC_LOG_DEBUG(("Start"));
@@
-2161,7
+2161,13
@@
int silc_server_remove_clients_by_server(SilcServer server,
if (silc_idcache_list_first(list, &id_cache)) {
while (id_cache) {
client = (SilcClientEntry)id_cache->context;
if (silc_idcache_list_first(list, &id_cache)) {
while (id_cache) {
client = (SilcClientEntry)id_cache->context;
-
+ if (client->data.registered == FALSE) {
+ if (!silc_idcache_list_next(list, &id_cache))
+ break;
+ else
+ continue;
+ }
+
if (client->router != entry) {
if (server_signoff && client->connection) {
clients = silc_realloc(clients,
if (client->router != entry) {
if (server_signoff && client->connection) {
clients = silc_realloc(clients,
@@
-2209,6
+2215,12
@@
int silc_server_remove_clients_by_server(SilcServer server,
if (silc_idcache_list_first(list, &id_cache)) {
while (id_cache) {
client = (SilcClientEntry)id_cache->context;
if (silc_idcache_list_first(list, &id_cache)) {
while (id_cache) {
client = (SilcClientEntry)id_cache->context;
+ if (client->data.registered == FALSE) {
+ if (!silc_idcache_list_next(list, &id_cache))
+ break;
+ else
+ continue;
+ }
if (client->router != entry) {
if (server_signoff && client->connection) {
if (client->router != entry) {
if (server_signoff && client->connection) {
@@
-2742,11
+2754,11
@@
SILC_TASK_CALLBACK(silc_server_channel_key_rekey)
void silc_server_create_channel_key(SilcServer server,
SilcChannelEntry channel,
void silc_server_create_channel_key(SilcServer server,
SilcChannelEntry channel,
- u
nsigned int
key_len)
+ u
int32
key_len)
{
int i;
unsigned char channel_key[32], hash[32];
{
int i;
unsigned char channel_key[32], hash[32];
- u
nsigned int
len;
+ u
int32
len;
SILC_LOG_DEBUG(("Generating channel key"));
SILC_LOG_DEBUG(("Generating channel key"));
@@
-2819,7
+2831,7
@@
SilcChannelEntry silc_server_save_channel_key(SilcServer server,
SilcChannelKeyPayload payload = NULL;
SilcChannelID *id = NULL;
unsigned char *tmp, hash[32];
SilcChannelKeyPayload payload = NULL;
SilcChannelID *id = NULL;
unsigned char *tmp, hash[32];
- u
nsigned int
tmp_len;
+ u
int32
tmp_len;
char *cipher;
SILC_LOG_DEBUG(("Start"));
char *cipher;
SILC_LOG_DEBUG(("Start"));
@@
-3075,7
+3087,7
@@
void silc_server_announce_clients(SilcServer server)
}
static SilcBuffer
}
static SilcBuffer
-silc_server_announce_encode_join(u
nsigned int
argc, ...)
+silc_server_announce_encode_join(u
int32
argc, ...)
{
va_list ap;
{
va_list ap;
@@
-3133,7
+3145,7
@@
void silc_server_announce_get_channels(SilcServer server,
SilcIDCacheEntry id_cache;
SilcChannelEntry channel;
unsigned char *cid;
SilcIDCacheEntry id_cache;
SilcChannelEntry channel;
unsigned char *cid;
- u
nsigned short
name_len;
+ u
int16
name_len;
int len;
SILC_LOG_DEBUG(("Start"));
int len;
SILC_LOG_DEBUG(("Start"));
@@
-3250,13
+3262,13
@@
void silc_server_get_users_on_channel(SilcServer server,
SilcChannelEntry channel,
SilcBuffer *user_list,
SilcBuffer *mode_list,
SilcChannelEntry channel,
SilcBuffer *user_list,
SilcBuffer *mode_list,
- u
nsigned int
*user_count)
+ u
int32
*user_count)
{
SilcChannelClientEntry chl;
SilcBuffer client_id_list;
SilcBuffer client_mode_list;
SilcBuffer idp;
{
SilcChannelClientEntry chl;
SilcBuffer client_id_list;
SilcBuffer client_mode_list;
SilcBuffer idp;
- u
nsigned int
list_count = 0;
+ u
int32
list_count = 0;
client_id_list = silc_buffer_alloc((SILC_ID_CLIENT_LEN + 4) *
silc_list_count(channel->user_list));
client_id_list = silc_buffer_alloc((SILC_ID_CLIENT_LEN + 4) *
silc_list_count(channel->user_list));
@@
-3296,7
+3308,7
@@
void silc_server_save_users_on_channel(SilcServer server,
SilcClientID *noadd,
SilcBuffer user_list,
SilcBuffer mode_list,
SilcClientID *noadd,
SilcBuffer user_list,
SilcBuffer mode_list,
- u
nsigned int
user_count)
+ u
int32
user_count)
{
int i;
{
int i;
@@
-3304,8
+3316,8
@@
void silc_server_save_users_on_channel(SilcServer server,
whenever server sends notify message to channel. It means two things;
some user has joined or leaved the channel. XXX TODO! */
for (i = 0; i < user_count; i++) {
whenever server sends notify message to channel. It means two things;
some user has joined or leaved the channel. XXX TODO! */
for (i = 0; i < user_count; i++) {
- u
nsigned short
idp_len;
- u
nsigned int
mode;
+ u
int16
idp_len;
+ u
int32
mode;
SilcClientID *client_id;
SilcClientEntry client;
SilcClientID *client_id;
SilcClientEntry client;
@@
-3376,7
+3388,7
@@
void silc_server_save_users_on_channel(SilcServer server,
SilcSocketConnection silc_server_get_client_route(SilcServer server,
unsigned char *id_data,
SilcSocketConnection silc_server_get_client_route(SilcServer server,
unsigned char *id_data,
- u
nsigned int
id_len,
+ u
int32
id_len,
SilcClientID *client_id,
SilcIDListData *idata)
{
SilcClientID *client_id,
SilcIDListData *idata)
{
@@
-3458,7
+3470,7
@@
SilcBuffer silc_server_get_client_channel_list(SilcServer server,
SilcChannelEntry channel;
SilcChannelClientEntry chl;
unsigned char *cid;
SilcChannelEntry channel;
SilcChannelClientEntry chl;
unsigned char *cid;
- u
nsigned short
name_len;
+ u
int16
name_len;
int len;
silc_list_start(client->channels);
int len;
silc_list_start(client->channels);