diff --git a/confluent_common/confluent/tlvdata.py b/confluent_common/confluent/tlvdata.py index eaf212b3..74582c27 100644 --- a/confluent_common/confluent/tlvdata.py +++ b/confluent_common/confluent/tlvdata.py @@ -44,8 +44,13 @@ def send(handle, data): def recv(handle): tl = handle.recv(4) + if not tl: + return None while len(tl) < 4: - tl += handle.recv(4 - len(tl)) + ndata = handle.recv(4 - len(tl)) + if not ndata: + raise Exception("Error reading data") + tl += ndata if len(tl) == 0: return None tl = struct.unpack("!I", tl)[0] diff --git a/confluent_common/setup.py b/confluent_common/setup.py index dbaabb69..ab85f1ed 100644 --- a/confluent_common/setup.py +++ b/confluent_common/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( name='confluent_common', - version='0.1.0', + version='0.1.2', author='Jarrod Johnson', author_email='jbjohnso@us.ibm.com', description='common content for confluent client and server', diff --git a/confluent_server/confluent/sockapi.py b/confluent_server/confluent/sockapi.py index 55cdec44..3e29ba49 100644 --- a/confluent_server/confluent/sockapi.py +++ b/confluent_server/confluent/sockapi.py @@ -194,7 +194,7 @@ def process_request(connection, request, cfm, authdata, authname, skipauth): def _tlshandler(): - plainsocket = socket.socket(AF_INET6) + plainsocket = socket.socket(socket.AF_INET6) plainsocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) plainsocket.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) srv = ssl.wrap_socket(plainsocket, keyfile="/etc/confluent/privkey.pem", diff --git a/confluent_server/setup.py b/confluent_server/setup.py index 8ae90f97..5cbc310a 100644 --- a/confluent_server/setup.py +++ b/confluent_server/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( name='confluent_server', - version='0.1.7', + version='0.1.8', author='Jarrod Johnson', author_email='jbjohnso@us.ibm.com', url='http://xcat.sf.net/',