mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'master' of https://github.com/cbhaley/calibre
This commit is contained in:
commit
245050d593
@ -199,6 +199,9 @@ def address_type(address):
|
||||
|
||||
# Exceptions
|
||||
|
||||
class MalformedPacketException(Exception):
|
||||
pass
|
||||
|
||||
class NonLocalNameException(Exception):
|
||||
pass
|
||||
|
||||
@ -595,6 +598,7 @@ class DNSIncoming(object):
|
||||
first = off
|
||||
|
||||
while 1:
|
||||
try:
|
||||
len = ord(self.data[off])
|
||||
off += 1
|
||||
if len == 0:
|
||||
@ -612,6 +616,8 @@ class DNSIncoming(object):
|
||||
first = off
|
||||
else:
|
||||
raise BadDomainName(off)
|
||||
except IndexError:
|
||||
raise MalformedPacketException()
|
||||
|
||||
if next >= 0:
|
||||
self.offset = next
|
||||
@ -876,6 +882,8 @@ class Engine(threading.Thread):
|
||||
for sock in rr:
|
||||
try:
|
||||
self.readers[sock].handle_read()
|
||||
except MalformedPacketException:
|
||||
pass
|
||||
except:
|
||||
if DEBUG:
|
||||
traceback.print_exc()
|
||||
|
Loading…
x
Reference in New Issue
Block a user