Commit d0cfbcf8 authored by Roger Dingledine's avatar Roger Dingledine
Browse files

only pick a default nickname if you're a server


svn:r2134
parent 6466233a
...@@ -680,9 +680,11 @@ int getconfig(int argc, char **argv, or_options_t *options) { ...@@ -680,9 +680,11 @@ int getconfig(int argc, char **argv, or_options_t *options) {
} }
if (options->Nickname == NULL) { if (options->Nickname == NULL) {
if (!(options->Nickname = get_default_nickname())) if(server_mode()) {
return -1; if (!(options->Nickname = get_default_nickname()))
log_fn(LOG_INFO, "Choosing default nickname %s", options->Nickname); return -1;
log_fn(LOG_NOTICE, "Choosing default nickname %s", options->Nickname);
}
} else { } else {
if (strspn(options->Nickname, LEGAL_NICKNAME_CHARACTERS) != if (strspn(options->Nickname, LEGAL_NICKNAME_CHARACTERS) !=
strlen(options->Nickname)) { strlen(options->Nickname)) {
...@@ -696,7 +698,7 @@ int getconfig(int argc, char **argv, or_options_t *options) { ...@@ -696,7 +698,7 @@ int getconfig(int argc, char **argv, or_options_t *options) {
} }
} }
if(options->ORPort) { /* get an IP for ourselves */ if(server_mode()) { /* get an IP for ourselves */
if(resolve_my_address(options) < 0) if(resolve_my_address(options) < 0)
result = -1; result = -1;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment