Skip to content

Commit

Permalink
removed some unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
jlusiardi committed Feb 11, 2019
1 parent bddab36 commit 3ddb3a6
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions homekit/http_impl/secure_http.py
Expand Up @@ -30,23 +30,6 @@ class SecureHttp:
the HAP specification.
"""

class Wrapper:
# TODO not used anymore?
def __init__(self, data):
self.data = data

def makefile(self, arg):
return io.BytesIO(self.data)

class HTTPResponseWrapper:
# TODO not used anymore?
def __init__(self, data):
self.data = data
self.status = 200

def read(self):
return self.data

def __init__(self, session, timeout=10):
"""
Initializes the secure HTTP class. The required keys can be obtained with get_session_keys
Expand Down Expand Up @@ -96,19 +79,6 @@ def _handle_request(self, data):
except OSError as e:
raise exceptions.AccessoryDisconnectedError(str(e))

@staticmethod
def _parse(chunked_data):
# TODO not used anymore?
splitter = b'\r\n'
tmp = chunked_data.split(splitter, 1)
length = int(tmp[0].decode(), 16)
if length == 0:
return bytearray()

chunk = tmp[1][:length]
tmp[1] = tmp[1][length + 2:]
return chunk + SecureHttp._parse(tmp[1])

def _read_response(self, timeout=10):
# following the information from page 71 about HTTP Message splitting:
# The blocks start with 2 byte little endian defining the length of the encrypted data (max 1024 bytes)
Expand Down

0 comments on commit 3ddb3a6

Please sign in to comment.