[FIX] Возможный фикс ipForwarding

This commit is contained in:
Gravit 2019-05-09 21:11:15 +07:00
parent 798a5ddc7e
commit 77566cbd30
No known key found for this signature in database
GPG key ID: 061981E1E85D3216

View file

@ -17,7 +17,7 @@ public NettyIpForwardHandler(NettyConnectContext context) {
@Override @Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
super.channelRead(ctx, msg); //super.channelRead(ctx, msg);
if(context.ip != null) return; if(context.ip != null) return;
if(msg instanceof DefaultHttpRequest) if(msg instanceof DefaultHttpRequest)
{ {
@ -36,6 +36,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
LogHelper.dev("Real IP address %s", realIP); LogHelper.dev("Real IP address %s", realIP);
context.ip = realIP; context.ip = realIP;
} }
else LogHelper.error("IpForwarding error. Headers not found");
} }
else LogHelper.error("IpForwarding error. Real message class %s", msg.getClass().getName()); else LogHelper.error("IpForwarding error. Real message class %s", msg.getClass().getName());
} }