diff --git a/plotly/plotly/chunked_requests/chunked_request.py b/plotly/plotly/chunked_requests/chunked_request.py index ac8375b4a05..3cf74c45822 100644 --- a/plotly/plotly/chunked_requests/chunked_request.py +++ b/plotly/plotly/chunked_requests/chunked_request.py @@ -4,7 +4,7 @@ class Stream: - def __init__(self, server, port=80, headers={}): + def __init__(self, server, port=80, headers={}, url='/'): ''' Initialize a stream object and an HTTP Connection with chunked Transfer-Encoding to server:port with optional headers. ''' @@ -15,6 +15,7 @@ def __init__(self, server, port=80, headers={}): self._server = server self._port = port self._headers = headers + self._url = url self._connect() def write(self, data, reconnect_on=('', 200, )): @@ -60,8 +61,10 @@ def write(self, data, reconnect_on=('', 200, )): msg = data msglen = format(len(msg), 'x') # msg length in hex # Send the message in chunk-encoded form + self._conn.sock.setblocking(1) self._conn.send('{msglen}\r\n{msg}\r\n' .format(msglen=msglen, msg=msg).encode('utf-8')) + self._conn.sock.setblocking(0) except http_client.socket.error: self._reconnect() self.write(data) @@ -75,7 +78,7 @@ def _connect(self): headers = self._headers self._conn = http_client.HTTPConnection(server, port) - self._conn.putrequest('POST', '/') + self._conn.putrequest('POST', self._url) self._conn.putheader('Transfer-Encoding', 'chunked') for header in headers: self._conn.putheader(header, headers[header]) diff --git a/plotly/version.py b/plotly/version.py index a3145652457..14895e4f956 100644 --- a/plotly/version.py +++ b/plotly/version.py @@ -1 +1 @@ -__version__ = '1.4.11' +__version__ = '1.4.12' diff --git a/submodules/chunked_requests b/submodules/chunked_requests index 6595c0aff56..14a6b3fa789 160000 --- a/submodules/chunked_requests +++ b/submodules/chunked_requests @@ -1 +1 @@ -Subproject commit 6595c0aff56a79ffae062d08620365373c9b92ab +Subproject commit 14a6b3fa789ce5ee6c32d80d6ebbba1a6aa689f1