提交 36b6734e 编写于 作者: W william.liangf

DUBBO-292 修改monitorfilter提供者判断逻辑

git-svn-id: http://code.alibabatech.com/svn/dubbo/trunk@1292 1a56cb94-b969-4eaa-88fa-be21384802f2
上级 02837a86
......@@ -104,7 +104,26 @@ public class RpcContext {
* @return provider side.
*/
public boolean isProviderSide() {
return ! isConsumerSide();
Invoker<?> invoker = getInvoker();
if (invoker == null) {
return false;
}
URL url = invoker.getUrl();
if (url == null) {
return false;
}
InetSocketAddress address = getRemoteAddress();
if (address == null) {
return false;
}
String host;
if (address.getAddress() == null) {
host = address.getHostName();
} else {
host = address.getAddress().getHostAddress();
}
return url.getPort() != address.getPort() ||
! NetUtils.filterLocalHost(url.getIp()).equals(NetUtils.filterLocalHost(host));
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册