Commit 39a38241 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Add tid to Invalidate Objects.

git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@167 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent f807dbfa
......@@ -204,7 +204,7 @@ class EventHandler(object):
def handleNotifyInformationLocked(self, conn, packet, tid):
self.handleUnexpectedPacket(conn, packet)
def handleInvalidateObjects(self, conn, packet, oid_list):
def handleInvalidateObjects(self, conn, packet, oid_list, tid):
self.handleUnexpectedPacket(conn, packet)
def handleUnlockInformation(self, conn, packet, tid):
......
......@@ -507,10 +507,12 @@ class ServiceEventHandler(MasterEventHandler):
node = app.nm.getNodeByUUID(uuid)
if isinstance(node, ClientNode):
if c is t.getConnection():
p.notifyTransactionFinished(t.getMessageId(), tid)
p.notifyTransactionFinished(t.getMessageId(),
tid)
c.addPacket(p)
else:
p.invalidateObjects(c.getNextId(), t.getOIDList())
p.invalidateObjects(c.getNextId(),
t.getOIDList(), tid)
c.addPacket(p)
elif isinstance(node, StorageNode):
if uuid in t.getUUIDSet():
......
......@@ -507,10 +507,10 @@ class Packet(object):
self._body = tid
return self
def invalidateObjects(self, msg_id, oid_list):
def invalidateObjects(self, msg_id, oid_list, tid):
self._id = msg_id
self._type = INVALIDATE_OBJECTS
body = [pack('!L', len(oid_list))]
body = [pack('!8sL', tid, len(oid_list))]
body.extend(oid_list)
self._body = ''.join(body)
return self
......@@ -927,14 +927,14 @@ class Packet(object):
def _decodeInvalidateObjects(self):
try:
n = unpack('!L', self._body[:4])[0]
tid, n = unpack('!8sL', self._body[:12])
oid_list = []
for i in xrange(n):
oid = unpack('8s', self._body[4+i*8:12+i*8])[0]
for i in xrange(12, 12 + n * 8, 8):
oid = unpack('8s', self._body[i:i+8])[0]
oid_list.append(oid)
except:
raise ProtocolError(self, 'invalid finish transaction')
return (oid_list,)
return oid_list, tid
decode_table[INVALIDATE_OBJECTS] = _decodeInvalidateObjects
def _decodeUnlockInformation(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment