updates.
authorPekka Riikonen <priikone@silcnet.org>
Sun, 27 Jan 2002 15:13:24 +0000 (15:13 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sun, 27 Jan 2002 15:13:24 +0000 (15:13 +0000)
apps/silcd/packet_receive.c
apps/silcd/packet_send.c
apps/silcd/server.c

index f497dcdf422b622c6a547d36d5331fd75021b711..6e8bf99a12214381012f6cc0691be6926568ebf7 100644 (file)
@@ -847,7 +847,7 @@ void silc_server_notify(SilcServer server,
     if (!server_entry) {
       server_entry = silc_idlist_find_server_by_id(server->local_list, 
                                                   server_id, TRUE, NULL);
-      global = TRUE;
+      local = 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
@@ -1947,12 +1947,13 @@ static void silc_server_new_id_real(SilcServer server,
       router = silc_idlist_find_server_by_id(server->local_list,
                                             sender_id, TRUE, NULL);
     silc_free(sender_id);
-    if (!router)
-      goto out;
     router_sock = sock;
     id_list = server->global_list;
   }
 
+  if (!router)
+    goto out;
+
   switch(id_type) {
   case SILC_ID_CLIENT:
     {
index 303c06fcfbb9ce472b8971673ff1b076a6095a40..5cd6168e4ba4c11f72ac20bb4e45ec05e879be5d 100644 (file)
@@ -476,6 +476,10 @@ silc_server_packet_send_to_channel_real(SilcServer server,
                                        bool force_send)
 {
   int block_len;
+
+  if (!sock)
+    return;
+
   packet->truelen = data_len + SILC_PACKET_HEADER_LEN + 
     packet->src_id_len + packet->dst_id_len;
 
index e894d964ae17e06a933a14f55ab6310fbef332fe..8e5455ad2e5b6d1fc984808b426aa71e10c9af1a 100644 (file)
@@ -1299,7 +1299,7 @@ SILC_TASK_CALLBACK(silc_server_accept_new_connection_final)
   SilcSocketConnection sock = ctx->sock;
   SilcServerHBContext hb_context;
   SilcUnknownEntry entry = (SilcUnknownEntry)sock->user_data;
-  void *id_entry = NULL;
+  void *id_entry;
 
   SILC_LOG_DEBUG(("Start"));
 
@@ -1441,15 +1441,15 @@ SILC_TASK_CALLBACK(silc_server_accept_new_connection_final)
       break;
     }
   default:
+    goto out;
     break;
   }
 
   sock->type = ctx->conn_type;
 
   /* Add the common data structure to the ID entry. */
-  if (id_entry)
-    silc_idlist_add_data(id_entry, (SilcIDListData)sock->user_data);
-      
+  silc_idlist_add_data(id_entry, (SilcIDListData)sock->user_data);
+
   /* Add to sockets internal pointer for fast referencing */
   silc_free(sock->user_data);
   sock->user_data = id_entry;