Fix issue #109 and add regression test.
This commit is contained in:
1 parent
eb302094aa
commit
48e1003f42
5 files changed
+70
-12
No files matched your search
@@ -352,6 +352,8 @@ class Connection(object):
|
||||
self.socket = socket.socket(ai_faml, ai_type, ai_prot)
|
||||
self.socket.connect(ai_addr)
|
||||
self.file_object = self.socket.makefile("rb", 0)
|
||||
self.options.compression_enabled = False
|
||||
self.options.compression_threshold = -1
|
||||
self.connected = True
|
||||
|
||||
def disconnect(self, immediate=False):
|
||||
@@ -500,7 +502,7 @@ class NetworkingThread(threading.Thread):
|
||||
|
||||
# Ignore the earlier exception if a disconnect packet is
|
||||
# received, as it may have been caused by trying to write to
|
||||
# thw closed socket, which does not represent a program error.
|
||||
# the closed socket, which does not represent a program error.
|
||||
if exc_info is not None and packet.packet_name == "disconnect":
|
||||
exc_info = None
|
||||
|
||||
|
||||
@@ -119,6 +119,8 @@ class Packet(object):
|
||||
@property
|
||||
def fields(self):
|
||||
""" An iterable of the names of the packet's fields, or None. """
|
||||
if self.definition is None:
|
||||
return None
|
||||
return (field for defn in self.definition for field in defn)
|
||||
|
||||
def field_string(self, field):
|
||||
|
||||
Reference in new issue
Block a user