updated.
authorPekka Riikonen <priikone@silcnet.org>
Sat, 26 Jan 2002 14:38:56 +0000 (14:38 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sat, 26 Jan 2002 14:38:56 +0000 (14:38 +0000)
TODO
apps/silcd/packet_receive.c
lib/silcutil/silcbuffer.h

diff --git a/TODO b/TODO
index 2a2da686b2d6f715cecb91b76c2e4926be50fb6f..86912a7815949a08541bdaf0d82fb46c1f28ea1c 100644 (file)
--- a/TODO
+++ b/TODO
@@ -264,6 +264,22 @@ least could be done.
          and thus not require any memory allocation.  Same will happen
          with silc_id_payload_* functions.
 
+       o Remove the `truelen' field from SilcBuffer as it is entirely
+         redundant since we can get the true length of the buffer by
+         doing buffer->end - buffer->header.  Add SILC_BUFFER_TRUELEN
+         macro instead.  Consider also removing `len' field too since
+         it effectively is buffer->tail - buffer->data, and adding
+         SILC_BUFFER_LEN macro can do the same.  These would save
+         totally 8 bytes of memory per buffer.
+
+         Add also perhaps function silc_buffer_alloc_size that would
+         effectively do: 
+
+               return silc_buffer_pull_tail(silc_buffer_alloc(size),
+                                            size);
+
+         to not require the user to give the pull_tail anymore.
+
  o Optimizations in Server
 
        o Remove the big switch statement from the function 
@@ -283,6 +299,13 @@ least could be done.
          should be analyzed too how slow the task registering process
          actually is, and find out ways to optimize it.
 
+       o The SERVER_SIGNOFF notify handing is not optimal, because it'll
+         cause sending of multiple SIGNOFF notify's instead of the one
+         SERVER_SIGNOFF notify that the server received.  This should be
+         optimized so that the only SERVER_SIGNOFF is sent and not
+         SIGNOFF of notify at all (using SIGNOFF takes the idea about
+         SERVER_SIGNOFF away entirely).
+
  o Add SilcAsyncOperation to utility library.
 
  o Cipher optimizations (asm, that this) at least for i386 would be nice.
index 85b1a1b20444afc59ec5584ba53d8aa24a87b245..f497dcdf422b622c6a547d36d5331fd75021b711 100644 (file)
@@ -49,6 +49,7 @@ void silc_server_notify(SilcServer server,
   uint32 mode;
   unsigned char *tmp;
   uint32 tmp_len;
+  bool local;
 
   SILC_LOG_DEBUG(("Start"));
 
@@ -842,9 +843,11 @@ void silc_server_notify(SilcServer server,
     /* Get server entry */
     server_entry = silc_idlist_find_server_by_id(server->global_list, 
                                                 server_id, TRUE, NULL);
+    local = TRUE;
     if (!server_entry) {
       server_entry = silc_idlist_find_server_by_id(server->local_list, 
                                                   server_id, TRUE, NULL);
+      global = TRUE;
       if (!server_entry) {
        /* If we are normal server then we might not have the server. Check
           whether router was kind enough to send the list of all clients
@@ -853,7 +856,6 @@ void silc_server_notify(SilcServer server,
        if (server->server_type != SILC_ROUTER &&
            silc_argument_get_arg_num(args) > 1) {
          int i;
-         bool local;
 
          for (i = 1; i < silc_argument_get_arg_num(args); i++) {
            /* Get Client ID */
@@ -907,8 +909,8 @@ void silc_server_notify(SilcServer server,
     silc_server_remove_clients_by_server(server, server_entry, TRUE);
 
     /* Remove the server entry */
-    if (!silc_idlist_del_server(server->global_list, server_entry))
-      silc_idlist_del_server(server->local_list, server_entry);
+    silc_idlist_del_server(local ? server->local_list :
+                          server->global_list, server_entry);
 
     /* XXX update statistics */
 
index 9d6f2e2aa3bf3c134fc16d5a3c8ae48a229bc2fd..8c822cd7354310842d4aea8e923a321d007c753d 100644 (file)
     Currently valid data area is considered to be the main data area in
     the buffer. However, the entire buffer is of course valid data and can
     be used as such. Usually head section of the buffer includes different
-    kind of headers or similiar. Data section includes the main data of
+    kind of headers or similar. Data section includes the main data of
     the buffer. Tail section can be seen as a reserve space of the data
     section. Tail section can be pulled towards end thus the data section
     becomes larger.