irlerd can sharte the library mutex introduced in irclib 3.2.
authorEric S. Raymond <esr@thyrsus.com>
Wed, 10 Oct 2012 23:35:09 +0000 (19:35 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Wed, 10 Oct 2012 23:35:09 +0000 (19:35 -0400)
NEWS
install.txt
irkerd

diff --git a/NEWS b/NEWS
index 4fa8900981976e80094eb68ecaebcecd87b586ed..b6c9fc4d8b5d771899970d790b5b83a9e6711434 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
                        irker history 
 
+1.12 @
+  The IRC library at version 3.2 or later is required for this version!
+
 1.11 @ 2012-10-10
   Code is now fully Unicode-safe.
   A 'cialike' option emulates the file-summary behavior on the old CIA service.
index 3164f988ae2f5b0e375f39966bb464cbf8219325..d98fa4e2fb5d50aa4b0e1d2f43f431a54f24fd8e 100644 (file)
@@ -28,8 +28,8 @@ You should *not* make irker visible from outside the site firewall, as
 it can be used to spam IRC channels while masking the source address.
 
 You will need to have Jason Coombs's irc library where Python can see
-it.  See <http://pypi.python.org/pypi/irc/>; use version 3.0 or later,
-not the older code from SourceForge.
+it.  See <http://pypi.python.org/pypi/irc/>; use version 3.2 or later,
+not 3.0 or the even older code from SourceForge.
 
 The file org.catb.irkerd.plist is a Mac OS/X plist that can be
 installed to launch irkerd as a boot-time service on that system.
diff --git a/irkerd b/irkerd
index 6d85a6b93b12ea3fa2e0ae6e874862e9f91e5356..a78a1fed842cced20ff2e5bae2a241ff6370a31a 100755 (executable)
--- a/irkerd
+++ b/irkerd
@@ -19,7 +19,7 @@ Design and code by Eric S. Raymond <esr@thyrsus.com>. See the project
 resource page at <http://www.catb.org/~esr/irker/>.
 
 Requires Python 2.6 or 2.5 with the simplejson library installed, and
-the irc client library at version >= 2.0.2: see
+the irc client library at version >= 3.2: see
 
 http://pypi.python.org/pypi/irc/
 """
@@ -179,7 +179,7 @@ class Connection:
                         break
                     elif xmit_timeout or ping_timeout:
                         self.irker.debug(1, "timing out connection to %s at %s (ping_timeout=%s, xmit_timeout=%s)" % (self.servername, time.asctime(), ping_timeout, xmit_timeout))
-                        with self.irker.library_lock:
+                        with self.irker.irc.mutex:
                             self.connection.context = None
                             self.connection.quit("transmission timeout")
                             self.connection = None
@@ -200,7 +200,7 @@ class Connection:
                     break
                 elif not self.connection:
                     # Queue is nonempty but server isn't connected.
-                    with self.irker.library_lock:
+                    with self.irker.irc.mutex:
                         self.connection = self.irker.irc.server()
                         self.connection.context = self
                         # Try to avoid colliding with other instances
@@ -238,7 +238,7 @@ class Connection:
                     self.status = "expired"
                     break
                 elif self.status == "ready":
-                    with self.irker.library_lock:
+                    with self.irker.irc.mutex:
                         (channel, message) = self.queue.get()
                         if channel not in self.channels_joined:
                             self.connection.join(channel)
@@ -364,8 +364,7 @@ class Irker:
         self.irc.add_global_handler("featurelist", self._handle_features)
         self.irc.add_global_handler("disconnect", self._handle_disconnect)
         self.irc.add_global_handler("kick", self._handle_kick)
-        self.library_lock = threading.Lock()
-        thread = threading.Thread(target=self._process_forever)
+        thread = threading.Thread(target=self.irc.process_forever)
         thread.setDaemon(True)
         self.irc._thread = thread
         thread.start()
@@ -377,12 +376,6 @@ class Irker:
         "Debugging information."
         if self.debuglevel >= level:
             sys.stderr.write("irkerd: %s\n" % errmsg)
-    def _process_forever(self):
-        "IRC library process_forever with mutex."
-        self.debug(1, "process_forever()")
-        while True:
-            with self.library_lock:
-                self.irc.process_once(ANTI_BUZZ_DELAY)
     def _handle_ping(self, connection, _event):
         "PING arrived, bump the last-received time for the connection."
         if connection.context: