hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r518592 - /jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionRequestImpl.java
Date Thu, 15 Mar 2007 11:43:30 GMT
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);



Mime
View raw message