Skip to content

Commit

Permalink
wrong event setting (#3043)
Browse files Browse the repository at this point in the history
* wrong event setting

* modify event seeting

* modify
  • Loading branch information
CrazyHZM authored and beiwei30 committed Jan 16, 2019
1 parent 66afe96 commit 416c575
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,12 @@ public boolean isEvent() {
}

public void setEvent(String event) {
mEvent = true;
mData = event;
this.mEvent = true;
this.mData = event;
}

public void setEvent(boolean mEvent) {
this.mEvent = mEvent;
}

public boolean isBroken() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@

/**
* ExchangeCodec.
*
*
*
*/
public class ExchangeCodec extends TelnetCodec {

Expand Down Expand Up @@ -176,7 +173,7 @@ protected Object decodeBody(Channel channel, InputStream is, byte[] header) thro
req.setVersion(Version.getProtocolVersion());
req.setTwoWay((flag & FLAG_TWOWAY) != 0);
if ((flag & FLAG_EVENT) != 0) {
req.setEvent(Request.HEARTBEAT_EVENT);
req.setEvent(true);
}
try {
ObjectInput in = CodecSupport.deserialize(channel.getUrl(), is, proto);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public static void sent(Channel channel, Request request) {
* @param channel channel to close
*/
public static void closeChannel(Channel channel) {
for (Map.Entry<Long, Channel> entry: CHANNELS.entrySet()) {
for (Map.Entry<Long, Channel> entry : CHANNELS.entrySet()) {
if (channel.equals(entry.getValue())) {
DefaultFuture future = getFuture(entry.getKey());
if (future != null && !future.isDone()) {
Expand Down Expand Up @@ -255,7 +255,6 @@ private void invokeCallback(ResponseCallback c) {
if (callbackCopy == null) {
throw new NullPointerException("callback cannot be null.");
}
c = null;
Response res = response;
if (res == null) {
throw new IllegalStateException("response cannot be null. url:" + channel.getUrl());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ protected Object decodeBody(Channel channel, InputStream is, byte[] header) thro
req.setVersion(Version.getProtocolVersion());
req.setTwoWay((flag & FLAG_TWOWAY) != 0);
if ((flag & FLAG_EVENT) != 0) {
req.setEvent(Request.HEARTBEAT_EVENT);
req.setEvent(true);
}
try {
ObjectInput in = CodecSupport.deserialize(channel.getUrl(), is, proto);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ protected Object decodeBody(Channel channel, InputStream is, byte[] header) thro
req.setVersion(Version.getProtocolVersion());
req.setTwoWay((flag & FLAG_TWOWAY) != 0);
if ((flag & FLAG_EVENT) != 0) {
req.setEvent(Request.HEARTBEAT_EVENT);
req.setEvent(true);
}
try {
Object data;
Expand Down Expand Up @@ -145,6 +145,7 @@ protected Object decodeBody(Channel channel, InputStream is, byte[] header) thro
req.setBroken(true);
req.setData(t);
}

return req;
}
}
Expand Down

0 comments on commit 416c575

Please sign in to comment.