diff options
author | Martin Poirier <theeth@yahoo.com> | 2012-01-30 05:17:06 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2012-01-30 05:17:06 +0400 |
commit | 8b56ce969db281579bf35000ef7b20a8d9590dbb (patch) | |
tree | e830df98ba261b4d4133036a653310a10c0afcfc /netrender/utils.py | |
parent | 88085b624c2c128710051e3ffc70dc3ab9d53acc (diff) |
netrender (features coded by Philippe van Hecke)
Support for secure connections between Master/client/slave using SSL/HTTPS
Fixed a bug with total job time on web interface (wrong value)
Diffstat (limited to 'netrender/utils.py')
-rw-r--r-- | netrender/utils.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/netrender/utils.py b/netrender/utils.py index 776f4db9..4e6c40bf 100644 --- a/netrender/utils.py +++ b/netrender/utils.py @@ -186,8 +186,12 @@ def clientScan(report = None): return ("", 8000) # return default values -def clientConnection(address, port, report = None, scan = True, timeout = 5): - if address == "[default]": +def clientConnection(netsettings, report = None, scan = True, timeout = 5): + address = netsettings.server_address + port = netsettings.server_port + use_ssl = netsettings.use_ssl + + if address== "[default]": # calling operator from python is fucked, scene isn't in context # if bpy: # bpy.ops.render.netclientscan() @@ -198,13 +202,14 @@ def clientConnection(address, port, report = None, scan = True, timeout = 5): address, port = clientScan() if address == "": return None - + conn = None try: + HTTPConnection = http.client.HTTPSConnection if use_ssl else http.client.HTTPConnection if platform.system() == "Darwin": with ConnectionContext(timeout): - conn = http.client.HTTPConnection(address, port) + conn = HTTPConnection(address, port) else: - conn = http.client.HTTPConnection(address, port, timeout = timeout) + conn = HTTPConnection(address, port, timeout = timeout) if conn: if clientVerifyVersion(conn): |