[prev in list] [next in list] [prev in thread] [next in thread] 

List:       httpcomponents-commits
Subject:    svn commit: r518592 -
From:       olegk () apache ! org
Date:       2007-03-15 11:43:30
Message-ID: 20070315114330.AA6741A9838 () eris ! apache ! org
[Download RAW message or body]

Author: olegk
Date: Thu Mar 15 04:43:29 2007
New Revision: 518592

URL: http://svn.apache.org/viewvc?view=rev&rev=518592
Log:
HTTPCORE-58: Fixed IllegalStateException after cancelling session request

Modified:
    jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionRequestImpl.java


Modified: jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionRequestImpl.java
                
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-nio/src \
/main/java/org/apache/http/impl/nio/reactor/SessionRequestImpl.java?view=diff&rev=518592&r1=518591&r2=518592
 ==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionRequestImpl.java \
                (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionRequestImpl.java \
Thu Mar 15 04:43:29 2007 @@ -113,7 +113,7 @@
             throw new IllegalArgumentException("Session may not be null");
         }
         if (this.completed) {
-            throw new IllegalStateException("Session request already completed");
+            return;
         }
         this.completed = true;
         synchronized (this) {
@@ -130,7 +130,7 @@
             return;
         }
         if (this.completed) {
-            throw new IllegalStateException("Session request already completed");
+            return;
         }
         this.completed = true;
         synchronized (this) {
@@ -144,7 +144,7 @@
  
     public void timeout() {
         if (this.completed) {
-            throw new IllegalStateException("Session request already completed");
+            return;
         }
         synchronized (this) {
             if (this.callback != null) {
@@ -171,10 +171,13 @@
     }
 
     public void cancel() {
+        if (this.completed) {
+            return;
+        }
+        this.completed = true;
         if (this.key != null) {
             this.key.cancel();
         }
-        this.completed = true;
         synchronized (this) {
             if (this.callback != null) {
                 this.callback.cancelled(this);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic