mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-21 17:11:58 +00:00
Fix tlvdata socket infinite loop condition
A client could spin the confluent server endlessly by bailing out of connection at wrong time.
This commit is contained in:
parent
3a456ca45d
commit
b78830c403
@ -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]
|
||||
|
@ -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',
|
||||
|
@ -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",
|
||||
|
@ -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/',
|
||||
|
Loading…
Reference in New Issue
Block a user