Skip to content

Commit 416c575

Browse files
CrazyHZMbeiwei30
authored andcommitted
wrong event setting (#3043)
* wrong event setting * modify event seeting * modify
1 parent 66afe96 commit 416c575

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,12 @@ public boolean isEvent() {
9595
}
9696

9797
public void setEvent(String event) {
98-
mEvent = true;
99-
mData = event;
98+
this.mEvent = true;
99+
this.mData = event;
100+
}
101+
102+
public void setEvent(boolean mEvent) {
103+
this.mEvent = mEvent;
100104
}
101105

102106
public boolean isBroken() {

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@
4343

4444
/**
4545
* ExchangeCodec.
46-
*
47-
*
48-
*
4946
*/
5047
public class ExchangeCodec extends TelnetCodec {
5148

@@ -176,7 +173,7 @@ protected Object decodeBody(Channel channel, InputStream is, byte[] header) thro
176173
req.setVersion(Version.getProtocolVersion());
177174
req.setTwoWay((flag & FLAG_TWOWAY) != 0);
178175
if ((flag & FLAG_EVENT) != 0) {
179-
req.setEvent(Request.HEARTBEAT_EVENT);
176+
req.setEvent(true);
180177
}
181178
try {
182179
ObjectInput in = CodecSupport.deserialize(channel.getUrl(), is, proto);

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public static void sent(Channel channel, Request request) {
126126
* @param channel channel to close
127127
*/
128128
public static void closeChannel(Channel channel) {
129-
for (Map.Entry<Long, Channel> entry: CHANNELS.entrySet()) {
129+
for (Map.Entry<Long, Channel> entry : CHANNELS.entrySet()) {
130130
if (channel.equals(entry.getValue())) {
131131
DefaultFuture future = getFuture(entry.getKey());
132132
if (future != null && !future.isDone()) {
@@ -255,7 +255,6 @@ private void invokeCallback(ResponseCallback c) {
255255
if (callbackCopy == null) {
256256
throw new NullPointerException("callback cannot be null.");
257257
}
258-
c = null;
259258
Response res = response;
260259
if (res == null) {
261260
throw new IllegalStateException("response cannot be null. url:" + channel.getUrl());

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
@@ -167,7 +167,7 @@ protected Object decodeBody(Channel channel, InputStream is, byte[] header) thro
167167
req.setVersion(Version.getProtocolVersion());
168168
req.setTwoWay((flag & FLAG_TWOWAY) != 0);
169169
if ((flag & FLAG_EVENT) != 0) {
170-
req.setEvent(Request.HEARTBEAT_EVENT);
170+
req.setEvent(true);
171171
}
172172
try {
173173
ObjectInput in = CodecSupport.deserialize(channel.getUrl(), is, proto);

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ protected Object decodeBody(Channel channel, InputStream is, byte[] header) thro
114114
req.setVersion(Version.getProtocolVersion());
115115
req.setTwoWay((flag & FLAG_TWOWAY) != 0);
116116
if ((flag & FLAG_EVENT) != 0) {
117-
req.setEvent(Request.HEARTBEAT_EVENT);
117+
req.setEvent(true);
118118
}
119119
try {
120120
Object data;
@@ -145,6 +145,7 @@ protected Object decodeBody(Channel channel, InputStream is, byte[] header) thro
145145
req.setBroken(true);
146146
req.setData(t);
147147
}
148+
148149
return req;
149150
}
150151
}

0 commit comments

Comments
 (0)