From 52952df1007b94a421186ae0e3a6347f39daed5a Mon Sep 17 00:00:00 2001 From: "simon.kagstrom" Date: Sat, 20 Feb 2010 12:46:46 +0000 Subject: [PATCH] Correct register data size --- network-broker/network-broker | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/network-broker/network-broker b/network-broker/network-broker index 97f5805..00fab27 100755 --- a/network-broker/network-broker +++ b/network-broker/network-broker @@ -119,9 +119,6 @@ class StopPacket(Packet): Packet.__init__(self) self.type = STOP - def marshal(self): - return struct.pack(">HHL", self.magic, self.type, self.size) - class RegisterDataPacket(Packet): def __init__(self, key = -1, metadata = 0, data = ""): @@ -130,7 +127,7 @@ class RegisterDataPacket(Packet): self.key = key self.metadata = metadata self.data = data - self.size = self.size + 8 + self.size = self.size + 8 + len(data) def get_key(self): return self.key @@ -418,7 +415,6 @@ class BrokerPacketHandler(SocketServer.DatagramRequestHandler): type = struct.unpack(">H", data[off + 2:off + 4])[0] size = struct.unpack(">L", data[off + 4:off + 8])[0] - print " Pkt", type if type == STOP: break