Mercurial > hg > Database > Alice
changeset 642:cbfdcecf7e3c
fix udp also
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 31 Dec 2017 08:51:07 +0900 |
parents | 646f705e65b1 |
children | 74dbb8809c73 |
files | src/main/java/alice/daemon/IncomingUdpConnection.java |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/alice/daemon/IncomingUdpConnection.java Sun Dec 31 01:08:52 2017 +0900 +++ b/src/main/java/alice/daemon/IncomingUdpConnection.java Sun Dec 31 08:51:07 2017 +0900 @@ -44,11 +44,11 @@ receive.flip(); CommandMessage msg = unpacker.read(CommandMessage.class); CommandType type = CommandType.getCommandTypeFromId(msg.type); - int dataSize = unpacker.readInt(); - byte [] data = new byte[dataSize]; switch (type) { case UPDATE: case PUT: + int dataSize = unpacker.readInt(); + byte [] data = new byte[dataSize]; receive.get(data); rData = new ReceiveData(data); cmd = new Command(type, null, null, rData, 0, 0, null, null, reverseKey); @@ -76,9 +76,11 @@ getLocalDataSegmentManager().getDataSegmentKey(msg.key).runCommand(cmd); break; case REPLY: + int dataSize1 = unpacker.readInt(); + byte [] data1 = new byte[dataSize1]; cmd = manager.getAndRemoveCmd(msg.seq); - receive.get(data); - rData = new ReceiveData(data); + receive.get(data1); + rData = new ReceiveData(data1); Command rCmd = new Command(type, null, null, rData, msg.index, msg.seq, null, null, ""); cmd.cs.ids.reply(cmd.receiver, rCmd);