Commit bba1a4f6 authored by Shane Kerr's avatar Shane Kerr
Browse files

Ctrl-C was causing xfrout to get an exception. This was serve_forever()

using select(), and getting EINTR on the system call.

This patch fixes that.

See Trac #146 for the full history:

git-svn-id: svn:// e5f2f494-b856-4b98-b285-d166d9295462
parent 6b6d6659
......@@ -28,6 +28,7 @@ import os
from isc.config.ccsession import *
from import SessionError
import socket
import select
import errno
from optparse import OptionParser, OptionValueError
......@@ -363,11 +364,22 @@ class UnixSockServer(ThreadingUnixStreamServer):
def listen_on_xfr_query(unix_socket_server):
'''Listen xfr query in one single thread. Polls for shutdown
every 0.1 seconds, is there a better time?
unix_socket_server.serve_forever(poll_interval = 0.1)
while True:
unix_socket_server.serve_forever(poll_interval = 0.1)
except select.error as err:
# serve_forever() calls, which can be
# interrupted.
# If it is interrupted, it raises select.error with the
# errno set to EINTR. We ignore this case, and let the
# normal program flow continue by trying serve_forever()
# again.
if err.args[0] != errno.EINTR: raise
class XfroutServer:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment