Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2015-01-12 12:49:00 +0000
committerAnton Leherbauer2015-01-12 12:50:54 +0000
commit61b63104c70b4341b222f63041aef49bd6c7b2cb (patch)
tree90148f1925af30105448f1d0bf8d0552b972aa83
parent06c8b55af19854b4eae05ef20600fcc88f0621a0 (diff)
downloadorg.eclipse.tcf-61b63104c70b4341b222f63041aef49bd6c7b2cb.tar.gz
org.eclipse.tcf-61b63104c70b4341b222f63041aef49bd6c7b2cb.tar.xz
org.eclipse.tcf-61b63104c70b4341b222f63041aef49bd6c7b2cb.zip
TCF Python: Fix parsing/sending slave info in LocatorService
-rw-r--r--python/src/tcf/services/local/LocatorService.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/python/src/tcf/services/local/LocatorService.py b/python/src/tcf/services/local/LocatorService.py
index b5c232644..27f70733c 100644
--- a/python/src/tcf/services/local/LocatorService.py
+++ b/python/src/tcf/services/local/LocatorService.py
@@ -1,5 +1,5 @@
# *****************************************************************************
-# * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others.
+# * Copyright (c) 2011, 2015 Wind River Systems, Inc. and others.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
@@ -630,7 +630,7 @@ class LocatorService(locator.LocatorService):
"""
cnt = 0
attrs = {}
- s = data[8:].decode("UTF-8")
+ s = data[8:size].decode("UTF-8")
l = len(s)
i = 0
while i < l:
@@ -750,7 +750,7 @@ class LocatorService(locator.LocatorService):
if i > 8 and i + len(bt) >= PREF_PACKET_SIZE:
self.__sendDatagramPacket(subnet, i, addr, port)
i = 8
- self.out_buf[i:len(bt)] = bt
+ self.out_buf[i:i+len(bt)] = bt
i += len(bt)
self.out_buf[i] = 0
i += 1
@@ -783,14 +783,14 @@ class LocatorService(locator.LocatorService):
remote_port = p.getPort()
remote_address = p.getAddress()
if self.__isRemote(remote_address, remote_port):
- if buf[4] == locator.CONF_PEERS_REMOVED:
+ code = ord(buf[4])
+ if code == locator.CONF_PEERS_REMOVED:
self.__handlePeerRemovedPacket(p)
else:
sl = None
if remote_port != DISCOVEY_PORT:
sl = self.__addSlave(remote_address, remote_port, tm,
tm)
- code = ord(buf[4])
if code == locator.CONF_PEER_INFO:
self.__handlePeerInfoPacket(p)
elif code == locator.CONF_REQ_INFO:

Back to the top