[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] only pick a default nickname if you"re a server



Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	config.c 
Log Message:
only pick a default nickname if you're a server


Index: config.c
===================================================================
RCS file: /home/or/cvsroot/src/or/config.c,v
retrieving revision 1.129
retrieving revision 1.130
diff -u -d -r1.129 -r1.130
--- config.c	22 Jul 2004 00:13:42 -0000	1.129
+++ config.c	4 Aug 2004 02:15:22 -0000	1.130
@@ -680,9 +680,11 @@
   }
 
   if (options->Nickname == NULL) {
-    if (!(options->Nickname = get_default_nickname()))
-      return -1;
-    log_fn(LOG_INFO, "Choosing default nickname %s", options->Nickname);
+    if(server_mode()) {
+      if (!(options->Nickname = get_default_nickname()))
+        return -1;
+      log_fn(LOG_NOTICE, "Choosing default nickname %s", options->Nickname);
+    }
   } else {
     if (strspn(options->Nickname, LEGAL_NICKNAME_CHARACTERS) !=
         strlen(options->Nickname)) {
@@ -696,7 +698,7 @@
     }
   }
 
-  if(options->ORPort) { /* get an IP for ourselves */
+  if(server_mode()) { /* get an IP for ourselves */
     if(resolve_my_address(options) < 0)
       result = -1;
   }