]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - run.py
Fix XSS issue where external pages could alter DOM.
[irc/quakenet/qwebirc.git] / run.py
diff --git a/run.py b/run.py
index 9c104be8d5c8c162d77306cbda42666598c0375a..4a00ad051c446dcc93590eafccde1f7fa63b723d 100755 (executable)
--- a/run.py
+++ b/run.py
@@ -23,7 +23,19 @@ def help_reactors(*args):
   run_twistd(["--help-reactors"])
   sys.exit(1)
 
-DEFAULT_REACTOR = "select" if os.name == "nt" else "poll"  
+try:
+  from select import epoll
+  DEFAULT_REACTOR = "epoll"
+except ImportError:
+  try:
+    from select import kqueue
+    DEFAULT_REACTOR = "kqueue"
+  except ImportError:
+    try:
+      from select import poll
+      DEFAULT_REACTOR = "poll"
+    except ImportError:
+      DEFAULT_REACTOR = "select"
 
 parser = OptionParser()
 parser.add_option("-n", "--no-daemon", help="Don't run in the background.", action="store_false", dest="daemonise", default=True)