fix crash after introduction of immediate mode
authorAntoine Beaupré <anarcat@koumbit.org>
Sun, 1 Dec 2013 06:07:19 +0000 (01:07 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 1 Dec 2013 11:36:21 +0000 (06:36 -0500)
this fixes the following backtrace:

Exception happened during processing of request from ('127.0.0.1', 41192)
Traceback (most recent call last):
  File /usr/lib/python2.7/SocketServer.py, line 295, in _handle_request_noblock
    self.process_request(request, client_address)
  File /usr/lib/python2.7/SocketServer.py, line 321, in process_request
    self.finish_request(request, client_address)
  File /usr/lib/python2.7/SocketServer.py, line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File /usr/lib/python2.7/SocketServer.py, line 649, in __init__
    self.handle()
  File ./irkerd, line 820, in handle
    irker.handle(line.strip())
  File ./irkerd, line 786, in handle
    self.servers[target.server()].dispatch(target.channel, message, target.key, quit_after=quit_after)
  File ./irkerd, line 641, in dispatch
    eligibles[0].enqueue(channel, message, key)
TypeError: enqueue() takes exactly 5 arguments (4 given)

when running: ./irk irker-test test

irkerd

diff --git a/irkerd b/irkerd
index 8dedeba7fcd4e88c541bdb1a2fd97fe5ad38736c..a107c5eddb6843aa25cccd4aa5be171cf6c86d8b 100755 (executable)
--- a/irkerd
+++ b/irkerd
@@ -428,7 +428,7 @@ class Connection:
         for (channel, message, key) in qcopy:
             self.queue.put((channel, message, key))
         self.status = "ready"
-    def enqueue(self, channel, message, key, quit_after):
+    def enqueue(self, channel, message, key, quit_after=False):
         "Enque a message for transmission."
         if self.thread is None or not self.thread.is_alive():
             self.status = "unseen"