Corrects the received STUN packet address logged in pcap file.
This commit is contained in:
parent
632d53ac67
commit
d5441d45f3
@ -530,9 +530,25 @@ public class DelegatingDatagramSocket
|
|||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
if (delegate == null)
|
if (delegate == null)
|
||||||
|
{
|
||||||
super.receive(p);
|
super.receive(p);
|
||||||
|
|
||||||
|
// no exception packet is successfully received, log it
|
||||||
|
if(StunStack.isPacketLoggerEnabled())
|
||||||
|
{
|
||||||
|
StunStack.getPacketLogger().logPacket(
|
||||||
|
p.getAddress().getAddress(),
|
||||||
|
p.getPort(),
|
||||||
|
super.getLocalAddress().getAddress(),
|
||||||
|
super.getLocalPort(),
|
||||||
|
p.getData(),
|
||||||
|
false);
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
delegate.receive(p);
|
delegate.receive(p);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -152,27 +152,11 @@ class MessageProcessor
|
|||||||
|
|
||||||
logger.finest("Dispatching a StunMessageEvent.");
|
logger.finest("Dispatching a StunMessageEvent.");
|
||||||
|
|
||||||
try
|
StunMessageEvent stunMessageEvent
|
||||||
{
|
= new StunMessageEvent(stunStack, rawMessage,
|
||||||
StunMessageEvent stunMessageEvent
|
stunMessage);
|
||||||
= new StunMessageEvent(stunStack, rawMessage,
|
|
||||||
stunMessage);
|
|
||||||
|
|
||||||
messageEventHandler.handleMessageEvent(stunMessageEvent);
|
messageEventHandler.handleMessageEvent(stunMessageEvent);
|
||||||
}
|
|
||||||
finally // make sure we log the packet in case of exception
|
|
||||||
{
|
|
||||||
if(StunStack.isPacketLoggerEnabled())
|
|
||||||
{
|
|
||||||
StunStack.getPacketLogger().logPacket(
|
|
||||||
rawMessage.getRemoteAddress().getAddressBytes(),
|
|
||||||
rawMessage.getRemoteAddress().getPort(),
|
|
||||||
rawMessage.getLocalAddress().getAddressBytes(),
|
|
||||||
rawMessage.getLocalAddress().getPort(),
|
|
||||||
rawMessage.getBytes(),
|
|
||||||
false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(Throwable err)
|
catch(Throwable err)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user