OSDN Git Service

Do not send JDWP data in case of error.
authorSebastien Hertz <shertz@google.com>
Tue, 18 Mar 2014 11:19:52 +0000 (12:19 +0100)
committerSebastien Hertz <shertz@google.com>
Tue, 18 Mar 2014 15:56:07 +0000 (16:56 +0100)
commit43c8d729556844d1a74449a8a300c795d6a5406a
treed163695ff0efc74429653587c116d179228fd26d
parent341a84af890a328a6c8f719beb3f670dd1a369b4
Do not send JDWP data in case of error.

When sending JDWP reply packet with an error, we want to ignore any data in the
buffer. While we reflect that in the packet's length (first 4 bytes), we used
to send all data in the buffer. This causes the receiver to read malformed JDWP
packet.

This CL adds "length" argument to JdwpNetStateBase::WritePacket so we control
the amount of data we send. If the reply has no error, it is set to the length
of the buffer. Otherwise it is the length of JDWP packet header indicating no
data is available.

Bug: 13366758
Change-Id: Ib72c10d5faf065fb44901c34b2732496b6667efa
runtime/jdwp/jdwp.h
runtime/jdwp/jdwp_handler.cc
runtime/jdwp/jdwp_main.cc
runtime/jdwp/jdwp_priv.h