You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by el...@apache.org on 2016/08/11 15:28:16 UTC

[06/10] mina git commit: o The poll() method close and dispose the session if the CLOSE_REQUEST message is read from the WriteRequestQueue o Don't call super() when not needed

o The poll() method close and dispose the session if the CLOSE_REQUEST
message is read from the WriteRequestQueue
o Don't call super() when not needed

Project: http://git-wip-us.apache.org/repos/asf/mina/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina/commit/ebd9a5aa
Tree: http://git-wip-us.apache.org/repos/asf/mina/tree/ebd9a5aa
Diff: http://git-wip-us.apache.org/repos/asf/mina/diff/ebd9a5aa

Branch: refs/heads/2.0
Commit: ebd9a5aa3cc7e134261976f914eaf7771f79f8a0
Parents: 8c0ad04
Author: Emmanuel L�charny <el...@symas.com>
Authored: Thu Aug 11 16:45:38 2016 +0200
Committer: Emmanuel L�charny <el...@symas.com>
Committed: Thu Aug 11 16:45:38 2016 +0200

----------------------------------------------------------------------
 .../session/DefaultIoSessionDataStructureFactory.java    | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina/blob/ebd9a5aa/mina-core/src/main/java/org/apache/mina/core/session/DefaultIoSessionDataStructureFactory.java
----------------------------------------------------------------------
diff --git a/mina-core/src/main/java/org/apache/mina/core/session/DefaultIoSessionDataStructureFactory.java b/mina-core/src/main/java/org/apache/mina/core/session/DefaultIoSessionDataStructureFactory.java
index 53ad09d..3fd0ca1 100644
--- a/mina-core/src/main/java/org/apache/mina/core/session/DefaultIoSessionDataStructureFactory.java
+++ b/mina-core/src/main/java/org/apache/mina/core/session/DefaultIoSessionDataStructureFactory.java
@@ -182,7 +182,6 @@ public class DefaultIoSessionDataStructureFactory implements IoSessionDataStruct
          * Default constructor
          */
         public DefaultWriteRequestQueue() {
-            super();
         }
 
         /**
@@ -217,7 +216,15 @@ public class DefaultIoSessionDataStructureFactory implements IoSessionDataStruct
          * {@inheritDoc}
          */
         public synchronized WriteRequest poll(IoSession session) {
-            return q.poll();
+            WriteRequest answer = q.poll();
+
+            if (answer == AbstractIoSession.CLOSE_REQUEST) {
+                session.closeNow();
+                dispose(session);
+                answer = null;
+            }
+
+            return answer;
         }
 
         @Override