Fix a goof. I ihad initialized nick_trial at the wrong place.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 2 Oct 2012 21:40:41 +0000 (17:40 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 2 Oct 2012 21:40:41 +0000 (17:40 -0400)
irkerd

diff --git a/irkerd b/irkerd
index bbd11a0a302eda14e2620dbc8e0a8e801213a73e..2b5e21ac7abc5c9da38923d43191f3f3cbbf6a80 100755 (executable)
--- a/irkerd
+++ b/irkerd
@@ -104,7 +104,7 @@ class Connection:
         self.irker = irkerd
         self.servername = servername
         self.port = port
-        self.nick_trial = random.randint(1, 990)
+        self.nick_trial = None
         self.connection = None
         self.status = "unseen"
         self.last_xmit = time.time()
@@ -165,7 +165,8 @@ class Connection:
             if not self.connection:
                 self.connection = self.irker.irc.server()
                 self.connection.context = self
-                self.nick_trial = 1
+                # Try to avoid colliding with other instances
+                self.nick_trial = random.randint(1, 990)
                 self.channels_joined = []
                 # This will throw irc.client.ServerConnectionError on failure
                 try: