This is an automated email from the ASF dual-hosted git repository.
iluo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git
The following commit(s) were added to refs/heads/master by this push:
new 1ecf2dd event of response fix#3244 (#3247)
1ecf2dd is described below
commit 1ecf2dda4195ff00b2dadd98a7c12df6f362a731
Author: huazhongming <[email protected]>
AuthorDate: Sat Feb 2 11:42:20 2019 +0800
event of response fix#3244 (#3247)
---
.../src/main/java/org/apache/dubbo/remoting/exchange/Response.java | 4 ++++
.../java/org/apache/dubbo/remoting/exchange/codec/ExchangeCodec.java | 2 +-
.../dubbo/remoting/transport/codec/DeprecatedExchangeCodec.java | 2 +-
.../src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboCodec.java | 2 +-
4 files changed, 7 insertions(+), 3 deletions(-)
diff --git
a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/Response.java
b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/Response.java
index d1ed88b..568ecf1 100644
---
a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/Response.java
+++
b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/Response.java
@@ -137,6 +137,10 @@ public class Response {
mResult = event;
}
+ public void setEvent(boolean mEvent) {
+ this.mEvent = mEvent;
+ }
+
public boolean isHeartbeat() {
return mEvent && HEARTBEAT_EVENT == mResult;
}
diff --git
a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/codec/ExchangeCodec.java
b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/codec/ExchangeCodec.java
index 7eb64a1..8f25250 100644
---
a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/codec/ExchangeCodec.java
+++
b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/codec/ExchangeCodec.java
@@ -142,7 +142,7 @@ public class ExchangeCodec extends TelnetCodec {
// decode response.
Response res = new Response(id);
if ((flag & FLAG_EVENT) != 0) {
- res.setEvent(Response.HEARTBEAT_EVENT);
+ res.setEvent(true);
}
// get status.
byte status = header[3];
diff --git
a/dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/transport/codec/DeprecatedExchangeCodec.java
b/dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/transport/codec/DeprecatedExchangeCodec.java
index 36b5831..552222d 100644
---
a/dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/transport/codec/DeprecatedExchangeCodec.java
+++
b/dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/transport/codec/DeprecatedExchangeCodec.java
@@ -136,7 +136,7 @@ final class DeprecatedExchangeCodec extends
DeprecatedTelnetCodec implements Cod
// decode response.
Response res = new Response(id);
if ((flag & FLAG_EVENT) != 0) {
- res.setEvent(Response.HEARTBEAT_EVENT);
+ res.setEvent(true);
}
// get status.
byte status = header[3];
diff --git
a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboCodec.java
b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboCodec.java
index 9c1e2fc..8a1b5ed 100644
---
a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboCodec.java
+++
b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboCodec.java
@@ -68,7 +68,7 @@ public class DubboCodec extends ExchangeCodec implements
Codec2 {
// decode response.
Response res = new Response(id);
if ((flag & FLAG_EVENT) != 0) {
- res.setEvent(Response.HEARTBEAT_EVENT);
+ res.setEvent(true);
}
// get status.
byte status = header[3];