Added anonymous client connections support.
[crypto.git] / apps / silcd / server.c
index 2d739f8a11e84870bed2edd40298efe1ec797a79..10c72d22b511a8148d188dd76fe7aecce0b385b6 100644 (file)
@@ -1369,6 +1369,7 @@ SILC_TASK_CALLBACK(silc_server_connect_to_router_final)
   if (!sconn->backup) {
     /* Mark this router our primary router if we're still standalone */
     if (server->standalone) {
+      SILC_LOG_DEBUG(("This connection is our primary router"));
       server->id_entry->router = id_entry;
       server->router = id_entry;
       server->standalone = FALSE;
@@ -1851,6 +1852,10 @@ SILC_TASK_CALLBACK(silc_server_accept_new_connection_final)
       if (conn->param) {
        if (conn->param->keepalive_secs)
          hearbeat_timeout = conn->param->keepalive_secs;
+
+       /* Check if to be anonymous connection */
+       if (conn->param->anonymous)
+         client->mode |= SILC_UMODE_ANONYMOUS;
       }
 
       id_entry = (void *)client;