# HG changeset patch # User nozomi # Date 1505383278 -32400 # Node ID 71dfb0051be098ae9b81645ca97c4040b88fe00f # Parent f5365a5e6672228194a326e2052dbe462c277788 don't use unpack in REPRY diff -r f5365a5e6672 -r 71dfb0051be0 src/main/java/alice/daemon/IncomingTcpConnection.java --- a/src/main/java/alice/daemon/IncomingTcpConnection.java Thu Sep 14 18:00:15 2017 +0900 +++ b/src/main/java/alice/daemon/IncomingTcpConnection.java Thu Sep 14 19:01:18 2017 +0900 @@ -56,12 +56,11 @@ ReceiveData rData = null; CommandMessage msg = unpacker.read(CommandMessage.class);///read header 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 = unpacker.getSerializedByteArray(dataSize); - byte[] data = new byte[dataSize]; connection.socket.getInputStream().read(data); rData = new ReceiveData(data, msg.compressed, msg.dataSize); @@ -111,7 +110,8 @@ case REPLY: cmd = manager.getAndRemoveCmd(msg.seq); - rData = new ReceiveData(unpacker.getSerializedByteArray(unpacker.readInt()), msg.compressed, msg.dataSize); + connection.socket.getInputStream().read(data); + rData = new ReceiveData(data, msg.compressed, msg.dataSize); Command rCmd = new Command(type, null, null, rData, msg.index, msg.seq, null, null, ""); cmd.setCompressFlag(msg.compressed);