Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Adam Osuchowski
Kea
Commits
66ebc54e
Commit
66ebc54e
authored
Jul 16, 2011
by
Michal 'vorner' Vaner
Browse files
[772] Small cleanups
parent
3912ef9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/bin/xfrout/tests/xfrout_test.py.in
View file @
66ebc54e
...
...
@@ -555,16 +555,21 @@ class TestUnixSockServer(unittest.TestCase):
sock.connect(('127.0.0.1', 12345))
self.assertEqual(('127.0.0.1', 12345),
self.unix._guess_remote(sock.fileno()))
sock = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
sock.connect(('::1', 12345))
self.assertEqual(('::1', 12345, 0, 0),
self.unix._guess_remote(sock.fileno()))
# Try when pretending there's no IPv6 support
xfrout.socket.has_ipv6 = False
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.connect(('127.0.0.1', 12345))
self.assertEqual(('127.0.0.1', 12345),
self.unix._guess_remote(sock.fileno()))
if socket.has_ipv6:
# Don't check IPv6 address on hosts not supporting them
sock = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
sock.connect(('::1', 12345))
self.assertEqual(('::1', 12345, 0, 0),
self.unix._guess_remote(sock.fileno()))
# Try when pretending there's no IPv6 support
# (No need to pretend when there's really no IPv6)
xfrout.socket.has_ipv6 = False
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.connect(('127.0.0.1', 12345))
self.assertEqual(('127.0.0.1', 12345),
self.unix._guess_remote(sock.fileno()))
# Return it back
xfrout.socket.has_ipv6 = True
def test_receive_query_message(self):
send_msg = b"\xd6=\x00\x00\x00\x01\x00"
...
...
src/bin/xfrout/xfrout.py.in
View file @
66ebc54e
...
...
@@ -400,6 +400,9 @@ class UnixSockServer(socketserver_mixin.NoPollMixIn, ThreadingUnixStreamServer):
def _common_init(self):
self._lock = threading.Lock()
self._transfers_counter = 0
# This default value will probably get overwritten by the (same)
# default value from the spec file. This is here just to make
# sure and to make the default value in tests consistent.
self._acl = REQUEST_LOADER.load('[{"action": "ACCEPT"}]')
def _receive_query_message(self, sock):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment