Merge "Flush netcat socket buffer when proxying HTTP connections"

This commit is contained in:
Jenkins 2014-10-23 16:32:39 +00:00 committed by Gerrit Code Review
commit f86926352e

View File

@ -141,7 +141,7 @@ class NeutronHttpAdapter(adapters.HTTPAdapter):
if http_conn.sock is None: if http_conn.sock is None:
if hasattr(http_conn, 'connect'): if hasattr(http_conn, 'connect'):
sock = self._connect() sock = self._connect()
LOG.debug('HTTP connecction {0} getting new ' LOG.debug('HTTP connection {0} getting new '
'netcat socket {1}'.format(http_conn, sock)) 'netcat socket {1}'.format(http_conn, sock))
http_conn.sock = sock http_conn.sock = sock
else: else:
@ -181,6 +181,7 @@ class NetcatSocket(object):
def send(self, content): def send(self, content):
try: try:
self.process.stdin.write(content) self.process.stdin.write(content)
self.process.stdin.flush()
except IOError as e: except IOError as e:
raise ex.SystemError(e) raise ex.SystemError(e)
return len(content) return len(content)