From: Eric S. Raymond Date: Tue, 2 Oct 2012 21:29:20 +0000 (-0400) Subject: Shorten nick negotiation by choosing a random start nick from a large range. X-Git-Tag: 1.5~19 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cce970f16cf5e3188c83d1ff5630a44c7d61f5c7;p=irker.git Shorten nick negotiation by choosing a random start nick from a large range. --- diff --git a/NEWS b/NEWS index ff46cd0..008cdf7 100644 --- a/NEWS +++ b/NEWS @@ -29,6 +29,7 @@ 1.5 @ Mercurial support. + Shorten nick negatiation by choosing a random bick base from a large range. diff --git a/irkerd b/irkerd index 98be5d8..9d98d5e 100755 --- a/irkerd +++ b/irkerd @@ -100,11 +100,11 @@ version = "1.4" # draft-brocklesby-irc-isupport-03 at . class Connection: - def __init__(self, irkerd, servername, port, nick_base=1): + def __init__(self, irkerd, servername, port): self.irker = irkerd self.servername = servername self.port = port - self.nick_trial = nick_base + self.nick_trial = random.randint(1, 990) self.connection = None self.status = "unseen" self.last_xmit = time.time() @@ -279,8 +279,7 @@ class Dispatcher: if not eligibles: newconn = Connection(self.irker, self.servername, - self.port, - len(self.connections)+1) + self.port) self.connections.append(newconn) eligibles = [newconn] eligibles[0].enqueue(channel, message)