diff -r 2eaf235270f8 -r e927c101ce6d connectors/PYRO/PSK_Adapter.py --- a/connectors/PYRO/PSK_Adapter.py Thu Oct 18 11:01:14 2018 +0200 +++ b/connectors/PYRO/PSK_Adapter.py Thu Oct 18 13:17:48 2018 +0200 @@ -2,8 +2,10 @@ from __future__ import print_function import socket +import re import sslpsk import Pyro +from Pyro.core import PyroURI from Pyro.protocol import _connect_socket,TCPConnection,PYROAdapter from Pyro.errors import ConnectionDeniedError, ProtocolError from Pyro.util import Log @@ -45,8 +47,8 @@ self.conn=conn self.conn.connected=1 Log.msg('PYROAdapter','connected to',str(URI)) - if URI.protocol=='PYROLOC': - self.resolvePYROLOC_URI("PYRO") # updates self.URI + if URI.protocol=='PYROLOCPSK': + self.resolvePYROLOC_URI("PYROPSK") # updates self.URI elif msg[:len(self.denyMSG)]==self.denyMSG: try: raise ConnectionDeniedError(Pyro.constants.deniedReasons[int(msg[-1])]) @@ -64,3 +66,18 @@ Pyro.protocol.getProtocolAdapter = getProtocolAdapter +_processStringURI = Pyro.core.processStringURI +def processStringURI(URI): + x=re.match(r'(?PPYROLOCPSK)://(?P[^\s:]+):?(?P\d+)?/(?P\S*)',URI) + if x: + protocol=x.group('protocol') + hostname=x.group('hostname') + port=x.group('port') + if port: + port=int(port) + else: + port=0 + name=x.group('name') + return PyroURI(hostname,name,port,protocol) + return _processStringURI(URI) +Pyro.core.processStringURI = processStringURI