Skip to content

Commit 1ecf2dd

Browse files
CrazyHZMbeiwei30
authored andcommitted
event of response fix#3244 (#3247)
1 parent e692d8a commit 1ecf2dd

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/Response.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ public void setEvent(String event) {
137137
mResult = event;
138138
}
139139

140+
public void setEvent(boolean mEvent) {
141+
this.mEvent = mEvent;
142+
}
143+
140144
public boolean isHeartbeat() {
141145
return mEvent && HEARTBEAT_EVENT == mResult;
142146
}

dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/codec/ExchangeCodec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ protected Object decodeBody(Channel channel, InputStream is, byte[] header) thro
142142
// decode response.
143143
Response res = new Response(id);
144144
if ((flag & FLAG_EVENT) != 0) {
145-
res.setEvent(Response.HEARTBEAT_EVENT);
145+
res.setEvent(true);
146146
}
147147
// get status.
148148
byte status = header[3];

dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/transport/codec/DeprecatedExchangeCodec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ protected Object decodeBody(Channel channel, InputStream is, byte[] header) thro
136136
// decode response.
137137
Response res = new Response(id);
138138
if ((flag & FLAG_EVENT) != 0) {
139-
res.setEvent(Response.HEARTBEAT_EVENT);
139+
res.setEvent(true);
140140
}
141141
// get status.
142142
byte status = header[3];

dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboCodec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ protected Object decodeBody(Channel channel, InputStream is, byte[] header) thro
6868
// decode response.
6969
Response res = new Response(id);
7070
if ((flag & FLAG_EVENT) != 0) {
71-
res.setEvent(Response.HEARTBEAT_EVENT);
71+
res.setEvent(true);
7272
}
7373
// get status.
7474
byte status = header[3];

0 commit comments

Comments
 (0)