Mercurial > hg > Database > Alice
changeset 628:71dfb0051be0 dispose
don't use unpack in REPRY
author | nozomi |
---|---|
date | Thu, 14 Sep 2017 19:01:18 +0900 |
parents | f5365a5e6672 |
children | d0d1cd3dfc11 |
files | src/main/java/alice/daemon/IncomingTcpConnection.java |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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);