updates
authorPekka Riikonen <priikone@silcnet.org>
Wed, 30 Jan 2002 13:50:44 +0000 (13:50 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Wed, 30 Jan 2002 13:50:44 +0000 (13:50 +0000)
TODO
apps/silcd/command.c
lib/silcutil/silclog.c

diff --git a/TODO b/TODO
index d076aa66fb1a78779c3b997e9b4fd2388d9f4274..a7b0f3af946ff9e6bf70feffde57fcf4ea737615 100644 (file)
--- a/TODO
+++ b/TODO
@@ -310,7 +310,8 @@ least could be done.
          SIGNOFF of notify at all (using SIGNOFF takes the idea about
          SERVER_SIGNOFF away entirely).
 
- o Add SilcAsyncOperation to utility library.
+ o Add SilcAsyncOperation to utility library.  Any function that takes
+   callback as an argument must return SilcAsyncOperation.
 
  o Cipher optimizations (asm, that this) at least for i386 would be nice.
 
index efaa985c32aac98bd840c128d8780d370ee05393..7e08a6ef6fd6a7d03414f2f90271c442f00da3b7 100644 (file)
@@ -131,7 +131,6 @@ static int silc_server_is_registered(SilcServer server,
 
   silc_server_command_send_status_reply(cmd, command,
                                        SILC_STATUS_ERR_NOT_REGISTERED);
-  silc_server_command_free(cmd);
   return FALSE;
 }
 
@@ -159,6 +158,8 @@ SILC_TASK_CALLBACK(silc_server_command_process_timeout)
                                     timeout->ctx, 
                                     timeout->cmd->cmd))
     timeout->cmd->cb(timeout->ctx, NULL);
+  else
+    silc_server_command_free(timeout->ctx);
 
   silc_free(timeout);
 }
@@ -233,15 +234,12 @@ void silc_server_command_process(SilcServer server,
                         silc_server_command_process_timeout,
                         (void *)timeout, 
                         2 - (time(NULL) - client->last_command), 0,
-                        SILC_TASK_TIMEOUT,
-                        SILC_TASK_PRI_NORMAL);
+                        SILC_TASK_TIMEOUT, SILC_TASK_PRI_NORMAL);
     else
       silc_schedule_task_add(server->schedule, sock->sock, 
                         silc_server_command_process_timeout,
-                        (void *)timeout, 
-                        0, 1,
-                        SILC_TASK_TIMEOUT,
-                        SILC_TASK_PRI_NORMAL);
+                        (void *)timeout, 0, 1,
+                        SILC_TASK_TIMEOUT, SILC_TASK_PRI_NORMAL);
     return;
   }
 
@@ -251,6 +249,8 @@ void silc_server_command_process(SilcServer server,
     cmd->cb(ctx, NULL);
   else if (silc_server_is_registered(server, sock, ctx, cmd->cmd))
     cmd->cb(ctx, NULL);
+  else
+    silc_server_command_free(ctx);
 }
 
 /* Allocate Command Context */
@@ -3455,7 +3455,8 @@ SILC_SERVER_CMD_FUNC(join)
     if (silc_command_get(reply->payload) == SILC_COMMAND_JOIN) {
       tmp = silc_argument_get_arg_type(reply->args, 6, NULL);
       SILC_GET32_MSB(created, tmp);
-      create_key = FALSE;      /* Router returned the key already */
+      if (silc_argument_get_arg_type(reply->args, 7, NULL)
+        create_key = FALSE;    /* Router returned the key already */
     }
 
     if (silc_command_get(reply->payload) == SILC_COMMAND_WHOIS &&
index cf89958b1bfc783718d0185ad3a4f51f67bc6b96..8a358309446a0309c6c162b3ac49bfaeefdd3243 100644 (file)
@@ -59,7 +59,7 @@ bool silc_debug_hexdump = FALSE;
 long silc_log_flushdelay = 300;
 
 /* Regular pattern matching expression for the debug output */
-static char *silc_log_debug_string = NULL;
+char *silc_log_debug_string = NULL;
 
 /* Debug callbacks. If set these are used instead of default ones. */
 static SilcLogDebugCb silc_log_debug_cb = NULL;