Show More
@@ -84,7 +84,6 b' import errno' | |||
|
84 | 84 | import itertools |
|
85 | 85 | import select |
|
86 | 86 | import socket |
|
87 | import string | |
|
88 | 87 | import struct |
|
89 | 88 | import threading |
|
90 | 89 | import time |
@@ -106,7 +105,7 b" globals()['_GLOBAL_DONE'] = 0" | |||
|
106 | 105 | |
|
107 | 106 | # Some DNS constants |
|
108 | 107 | |
|
109 | _MDNS_ADDR = '224.0.0.251' | |
|
108 | _MDNS_ADDR = r'224.0.0.251' | |
|
110 | 109 | _MDNS_PORT = 5353 |
|
111 | 110 | _DNS_PORT = 53 |
|
112 | 111 | _DNS_TTL = 60 * 60 # one hour default TTL |
@@ -221,7 +220,7 b' class DNSEntry(object):' | |||
|
221 | 220 | """A DNS entry""" |
|
222 | 221 | |
|
223 | 222 | def __init__(self, name, type, clazz): |
|
224 |
self.key = |
|
|
223 | self.key = name.lower() | |
|
225 | 224 | self.name = name |
|
226 | 225 | self.type = type |
|
227 | 226 | self.clazz = clazz & _CLASS_MASK |
@@ -620,7 +619,7 b' class DNSIncoming(object):' | |||
|
620 | 619 | first = off |
|
621 | 620 | |
|
622 | 621 | while True: |
|
623 | len = ord(self.data[off]) | |
|
622 | len = ord(self.data[off:off + 1]) | |
|
624 | 623 | off += 1 |
|
625 | 624 | if len == 0: |
|
626 | 625 | break |
@@ -631,7 +630,7 b' class DNSIncoming(object):' | |||
|
631 | 630 | elif t == 0xC0: |
|
632 | 631 | if next < 0: |
|
633 | 632 | next = off + 1 |
|
634 | off = ((len & 0x3F) << 8) | ord(self.data[off]) | |
|
633 | off = ((len & 0x3F) << 8) | ord(self.data[off:off + 1]) | |
|
635 | 634 | if off >= first: |
|
636 | 635 | raise BadDomainNameCircular(off) |
|
637 | 636 | first = off |
@@ -1333,7 +1332,7 b' class Zeroconf(object):' | |||
|
1333 | 1332 | # SO_REUSEADDR and SO_REUSEPORT have been set, so ignore it |
|
1334 | 1333 | pass |
|
1335 | 1334 | self.socket.setsockopt(socket.SOL_IP, socket.IP_ADD_MEMBERSHIP, |
|
1336 | socket.inet_aton(_MDNS_ADDR) + socket.inet_aton('0.0.0.0')) | |
|
1335 | socket.inet_aton(_MDNS_ADDR) + socket.inet_aton(r'0.0.0.0')) | |
|
1337 | 1336 | |
|
1338 | 1337 | self.listeners = [] |
|
1339 | 1338 | self.browsers = [] |
@@ -1657,7 +1656,7 b' class Zeroconf(object):' | |||
|
1657 | 1656 | self.engine.notify() |
|
1658 | 1657 | self.unregisterAllServices() |
|
1659 | 1658 | self.socket.setsockopt(socket.SOL_IP, socket.IP_DROP_MEMBERSHIP, |
|
1660 | socket.inet_aton(_MDNS_ADDR) + socket.inet_aton('0.0.0.0')) | |
|
1659 | socket.inet_aton(_MDNS_ADDR) + socket.inet_aton(r'0.0.0.0')) | |
|
1661 | 1660 | self.socket.close() |
|
1662 | 1661 | |
|
1663 | 1662 | # Test a few module features, including service registration, service |
General Comments 0
You need to be logged in to leave comments.
Login now