#3147: HAProxyMessage.sourceAddress() can be null
.sourceAddress() is null when send-proxy-v2 & check option is used
This commit is contained in:
parent
c866619f56
commit
5db276eb52
@ -83,14 +83,17 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter
|
|||||||
HAProxyMessage proxy = (HAProxyMessage) msg;
|
HAProxyMessage proxy = (HAProxyMessage) msg;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
InetSocketAddress newAddress = new InetSocketAddress( proxy.sourceAddress(), proxy.sourcePort() );
|
if ( proxy.sourceAddress() != null )
|
||||||
|
|
||||||
ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[]
|
|
||||||
{
|
{
|
||||||
channel.getRemoteAddress(), newAddress
|
InetSocketAddress newAddress = new InetSocketAddress( proxy.sourceAddress(), proxy.sourcePort() );
|
||||||
} );
|
|
||||||
|
|
||||||
channel.setRemoteAddress( newAddress );
|
ProxyServer.getInstance().getLogger().log( Level.FINE, "Set remote address via PROXY {0} -> {1}", new Object[]
|
||||||
|
{
|
||||||
|
channel.getRemoteAddress(), newAddress
|
||||||
|
} );
|
||||||
|
|
||||||
|
channel.setRemoteAddress( newAddress );
|
||||||
|
}
|
||||||
} finally
|
} finally
|
||||||
{
|
{
|
||||||
proxy.release();
|
proxy.release();
|
||||||
|
Loading…
Reference in New Issue
Block a user