directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r328571 - /directory/network/trunk/src/java/org/apache/mina/filter/BlacklistFilter.java
Date Wed, 26 Oct 2005 06:01:53 GMT
Author: trustin
Date: Tue Oct 25 23:01:50 2005
New Revision: 328571

URL: http://svn.apache.org/viewcvs?rev=328571&view=rev
Log:
Added some logging to BlacklistFilter.

Modified:
    directory/network/trunk/src/java/org/apache/mina/filter/BlacklistFilter.java

Modified: directory/network/trunk/src/java/org/apache/mina/filter/BlacklistFilter.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/filter/BlacklistFilter.java?rev=328571&r1=328570&r2=328571&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/filter/BlacklistFilter.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/filter/BlacklistFilter.java Tue Oct 25
23:01:50 2005
@@ -27,6 +27,7 @@
 import org.apache.mina.common.IoFilter;
 import org.apache.mina.common.IoFilterAdapter;
 import org.apache.mina.common.IoSession;
+import org.apache.mina.util.SessionLog;
 
 /**
  * A {@link IoFilter} which blocks connections from blacklisted remote
@@ -64,38 +65,8 @@
         }
         else
         {
+            SessionLog.info( session, "Remote address in the blacklist; closing." );
             session.close();
-        }
-    }
-
-    /**
-     * Forwards event if and if only the remote address of session is not
-     * blacklisted.
-     */
-    public void messageReceived( NextFilter nextFilter, IoSession session,
-                                 Object message ) throws Exception
-    {
-        if( !isBlocked( session ) )
-        {
-            // forward if not blocked
-            super.messageReceived( nextFilter, session, message );
-        }
-    }
-
-    /**
-     * Close connection immediately if the remote address of session is
-     * blacklisted.
-     */
-    public void sessionOpened( NextFilter nextFilter, IoSession session ) throws Exception
-    {
-        if( isBlocked( session ) )
-        {
-            // Close immediately if blocked
-            session.close();
-        }
-        else
-        {
-            super.sessionOpened( nextFilter, session );
         }
     }
 



Mime
View raw message