diff --git a/src/main/java/org/jboss/netty/channel/DownstreamMessageEvent.java b/src/main/java/org/jboss/netty/channel/DownstreamMessageEvent.java index 8b9464db45..9234cbaeab 100644 --- a/src/main/java/org/jboss/netty/channel/DownstreamMessageEvent.java +++ b/src/main/java/org/jboss/netty/channel/DownstreamMessageEvent.java @@ -86,7 +86,7 @@ public class DownstreamMessageEvent implements MessageEvent { @Override public String toString() { - if (getRemoteAddress() == null) { + if (getRemoteAddress() == getChannel().getRemoteAddress()) { return getChannel().toString() + " WRITE: " + StringUtil.stripControlCharacters(getMessage()); } else { diff --git a/src/main/java/org/jboss/netty/channel/UpstreamMessageEvent.java b/src/main/java/org/jboss/netty/channel/UpstreamMessageEvent.java index 5e64b1ccc7..4d11b67bc2 100644 --- a/src/main/java/org/jboss/netty/channel/UpstreamMessageEvent.java +++ b/src/main/java/org/jboss/netty/channel/UpstreamMessageEvent.java @@ -82,7 +82,7 @@ public class UpstreamMessageEvent implements MessageEvent { @Override public String toString() { - if (getRemoteAddress() == null) { + if (getRemoteAddress() == getChannel().getRemoteAddress()) { return getChannel().toString() + " RECEIVED: " + StringUtil.stripControlCharacters(getMessage()); } else {