Fixed forwarding scheme so it works with all platforms...

This commit is contained in:
Adolfo Gómez García 2015-04-13 13:55:18 +02:00
parent 250441056b
commit c3316a4745
2 changed files with 14 additions and 5 deletions

View File

@ -26,6 +26,9 @@ cd ../..
make DESTDIR=$RPM_BUILD_ROOT DISTRO=rh install
cd $curdir
%post
/usr/bin/update-desktop-database
%clean
rm -rf $RPM_BUILD_ROOT
curdir=`pwd`
@ -37,6 +40,7 @@ cd $curdir
%postun
# And, posibly, the .pyc leaved behind on /usr/share/UDSActor
rm -rf /usr/share/UDClient > /dev/null 2>&1
/usr/bin/update-desktop-database
%description
This package provides the required components to allow connection to services offered by UDS Broker.

View File

@ -23,7 +23,7 @@ class ForwardServer (SocketServer.ThreadingTCPServer):
class Handler (SocketServer.BaseRequestHandler):
def handle(self):
self.thread.alreadyConnected = True
self.thread.isConnected = True
try:
chan = self.ssh_transport.open_channel('direct-tcpip',
@ -66,7 +66,10 @@ class Handler (SocketServer.BaseRequestHandler):
except Exception:
pass
self.thread.stop()
if self.thread.stoppable is True:
self.thread.stop()
self.thread.isConnected = False
def verbose(s):
@ -96,12 +99,14 @@ class ForwardThread(threading.Thread):
self.stopEvent = threading.Event()
self.timer = None
self.alreadyConnected = False
self.isConnected = False
self.stoppable = False
def _timerFnc(self):
self.timer = None
verbose('Timer fnc: {}'.format(self.alreadyConnected))
if self.alreadyConnected is False:
verbose('Timer fnc: {}'.format(self.isConnected))
self.stoppable = True
if self.isConnected is False:
self.stop()
def run(self):