mina-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r547098 - /mina/trunk/example/src/main/java/org/apache/mina/example/httpserver/codec/ServerHandler.java
Date Thu, 14 Jun 2007 02:58:38 GMT
Author: trustin
Date: Wed Jun 13 19:58:37 2007
New Revision: 547098

URL: http://svn.apache.org/viewvc?view=rev&rev=547098
Log:
Fixed deadlock in HTTP server codec example

Modified:
    mina/trunk/example/src/main/java/org/apache/mina/example/httpserver/codec/ServerHandler.java

Modified: mina/trunk/example/src/main/java/org/apache/mina/example/httpserver/codec/ServerHandler.java
URL: http://svn.apache.org/viewvc/mina/trunk/example/src/main/java/org/apache/mina/example/httpserver/codec/ServerHandler.java?view=diff&rev=547098&r1=547097&r2=547098
==============================================================================
--- mina/trunk/example/src/main/java/org/apache/mina/example/httpserver/codec/ServerHandler.java
(original)
+++ mina/trunk/example/src/main/java/org/apache/mina/example/httpserver/codec/ServerHandler.java
Wed Jun 13 19:58:37 2007
@@ -20,6 +20,7 @@
 package org.apache.mina.example.httpserver.codec;
 
 import org.apache.mina.common.IdleStatus;
+import org.apache.mina.common.IoFutureListener;
 import org.apache.mina.common.IoHandler;
 import org.apache.mina.common.IoHandlerAdapter;
 import org.apache.mina.common.IoSession;
@@ -66,7 +67,7 @@
         // HttpResponseMessage.HTTP_STATUS_NOT_FOUND));
 
         if( response != null ) {
-            session.write( response ).awaitUninterruptibly();
+            session.write( response ).addListener(IoFutureListener.CLOSE);
         }
     }
 
@@ -80,6 +81,7 @@
     @Override
     public void exceptionCaught( IoSession session, Throwable cause )
     {
+        SessionLog.warn(session, cause);
         session.close();
     }
 }



Mime
View raw message