From: Pekka Riikonen Date: Sat, 26 Jan 2002 14:38:56 +0000 (+0000) Subject: updated. X-Git-Tag: silc.server.0.7.7~4 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=b72807680a98f6ef93580c20dcb8cb1fb525b068 updated. --- diff --git a/TODO b/TODO index 2a2da686..86912a78 100644 --- 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. diff --git a/apps/silcd/packet_receive.c b/apps/silcd/packet_receive.c index 85b1a1b2..f497dcdf 100644 --- a/apps/silcd/packet_receive.c +++ b/apps/silcd/packet_receive.c @@ -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 */ diff --git a/lib/silcutil/silcbuffer.h b/lib/silcutil/silcbuffer.h index 9d6f2e2a..8c822cd7 100644 --- a/lib/silcutil/silcbuffer.h +++ b/lib/silcutil/silcbuffer.h @@ -101,7 +101,7 @@ 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.