Author: toad
Date: 2007-11-27 13:54:55 +0000 (Tue, 27 Nov 2007)
New Revision: 15963

Modified:
   trunk/freenet/src/freenet/io/comm/UdpSocketHandler.java
Log:
Do not send any more packets after start closing.

Modified: trunk/freenet/src/freenet/io/comm/UdpSocketHandler.java
===================================================================
--- trunk/freenet/src/freenet/io/comm/UdpSocketHandler.java     2007-11-27 
13:49:59 UTC (rev 15962)
+++ trunk/freenet/src/freenet/io/comm/UdpSocketHandler.java     2007-11-27 
13:54:55 UTC (rev 15963)
@@ -201,6 +201,10 @@
      */
     public void sendPacket(byte[] blockToSend, Peer destination, boolean 
allowLocalAddresses) throws LocalAddressException {
        assert(blockToSend != null);
+       if(!_active) {
+               Logger.error(this, "Trying to send packet but no longer 
active");
+               return;
+       }
                // there should be no DNS needed here, but go ahead if we can, 
but complain doing it
                if( destination.getAddress(false, allowLocalAddresses) == null 
) {
                        Logger.error(this, "Tried sending to destination 
without pre-looked up IP address(needs a real Peer.getHostname()): null:" + 
destination.getPort(), new Exception("error"));


Reply via email to