Skip to content

Commit

Permalink
port #3568 into main trunk (#3993)
Browse files Browse the repository at this point in the history
fixes #3991
  • Loading branch information
beiwei30 authored and chickenlj committed May 10, 2019
1 parent 09d8a6e commit d5c5176
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@ protected Object decodeBody(Channel channel, InputStream is, byte[] header) thro
byte status = header[3];
res.setStatus(status);
try {
ObjectInput in = CodecSupport.deserialize(channel.getUrl(), is, proto);
if (status == Response.OK) {
Object data;
if (res.isHeartbeat()) {
ObjectInput in = CodecSupport.deserialize(channel.getUrl(), is, proto);
data = decodeHeartbeatData(channel, in);
} else if (res.isEvent()) {
ObjectInput in = CodecSupport.deserialize(channel.getUrl(), is, proto);
data = decodeEventData(channel, in);
} else {
DecodeableRpcResult result;
Expand All @@ -97,6 +98,7 @@ protected Object decodeBody(Channel channel, InputStream is, byte[] header) thro
}
res.setResult(data);
} else {
ObjectInput in = CodecSupport.deserialize(channel.getUrl(), is, proto);
res.setErrorMessage(in.readUTF());
}
} catch (Throwable t) {
Expand Down

0 comments on commit d5c5176

Please sign in to comment.