Commit de952a80 authored by Jim Fulton's avatar Jim Fulton

Got rid of some debugging code that didn't actually do anything.

Cleaned up trailing whitespace.
parent 6e1be99a
...@@ -75,12 +75,8 @@ class SizedMessageAsyncConnection(asyncore.dispatcher): ...@@ -75,12 +75,8 @@ class SizedMessageAsyncConnection(asyncore.dispatcher):
socket = None # to outwit Sam's getattr socket = None # to outwit Sam's getattr
def __init__(self, sock, addr, map=None, debug=None): def __init__(self, sock, addr, map=None):
self.addr = addr self.addr = addr
if debug is not None:
self._debug = debug
elif not hasattr(self, '_debug'):
self._debug = __debug__
# __input_lock protects __inp, __input_len, __state, __msg_size # __input_lock protects __inp, __input_len, __state, __msg_size
self.__input_lock = threading.Lock() self.__input_lock = threading.Lock()
self.__inp = None # None, a single String, or a list self.__inp = None # None, a single String, or a list
...@@ -150,7 +146,7 @@ class SizedMessageAsyncConnection(asyncore.dispatcher): ...@@ -150,7 +146,7 @@ class SizedMessageAsyncConnection(asyncore.dispatcher):
yield '' yield ''
self.message_output(hack()) self.message_output(hack())
def get_addr(self): def get_addr(self):
return self.addr return self.addr
...@@ -309,7 +305,7 @@ class SizedMessageAsyncConnection(asyncore.dispatcher): ...@@ -309,7 +305,7 @@ class SizedMessageAsyncConnection(asyncore.dispatcher):
if err[0] in expected_socket_write_errors: if err[0] in expected_socket_write_errors:
break # we couldn't write anything break # we couldn't write anything
raise raise
if n < l: if n < l:
output.insert(0, v[n:]) output.insert(0, v[n:])
break # we can't write any more break # we can't write any more
...@@ -325,7 +321,7 @@ class SizedMessageAsyncConnection(asyncore.dispatcher): ...@@ -325,7 +321,7 @@ class SizedMessageAsyncConnection(asyncore.dispatcher):
def __message_output(self, message, output): def __message_output(self, message, output):
# do two separate appends to avoid copying the message string # do two separate appends to avoid copying the message string
size = 4 size = 4
if self.__hmac_send: if self.__hmac_send:
output.append(struct.pack(">I", len(message) | MAC_BIT)) output.append(struct.pack(">I", len(message) | MAC_BIT))
self.__hmac_send.update(message) self.__hmac_send.update(message)
......
Markdown is supported
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