Skip to content
Snippets Groups Projects
Commit a2075202 authored by Alexander Schlemmer's avatar Alexander Schlemmer Committed by Daniel
Browse files

FIX: bug that caused a remote end closed without response

Cherry-picked from 1bca2f60.
parent 82e0d6e9
No related branches found
No related tags found
No related merge requests found
...@@ -83,6 +83,11 @@ class _DefaultCaosDBServerConnection(CaosDBServerConnection): ...@@ -83,6 +83,11 @@ class _DefaultCaosDBServerConnection(CaosDBServerConnection):
if headers is None: if headers is None:
headers = {} headers = {}
try: try:
self._http_con = StreamingHTTPSConnection(
host=self.setup_fields["host"],
timeout=self.setup_fields["timeout"],
context=self.setup_fields["context"],
socket_proxy=self.setup_fields["socket_proxy"])
self._http_con.request(method=method, url=self._base_path + path, self._http_con.request(method=method, url=self._base_path + path,
headers=headers, body=body) headers=headers, body=body)
except SocketError as socket_err: except SocketError as socket_err:
...@@ -117,10 +122,16 @@ class _DefaultCaosDBServerConnection(CaosDBServerConnection): ...@@ -117,10 +122,16 @@ class _DefaultCaosDBServerConnection(CaosDBServerConnection):
"No connection url specified. Please " "No connection url specified. Please "
"do so via caosdb.configure_connection(...) or in a config " "do so via caosdb.configure_connection(...) or in a config "
"file.") "file.")
self._http_con = StreamingHTTPSConnection(
host=host, socket_proxy = None
timeout=int(config.get("timeout")), if "socket_proxy" in config:
context=context) socket_proxy = config["socket_proxy"]
self.setup_fields = {
"host": host,
"timeout": int(config.get("timeout")),
"context": context,
"socket_proxy": socket_proxy}
def _make_conf(*conf): def _make_conf(*conf):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment