hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r543990 - /jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/util/SharedOutputBuffer.java
Date Sun, 03 Jun 2007 21:26:10 GMT
Author: olegk
Date: Sun Jun  3 14:26:09 2007
New Revision: 543990

URL: http://svn.apache.org/viewvc?view=rev&rev=543990
Log:
Fixed bug in the #writeCompleted method

Modified:
    jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/util/SharedOutputBuffer.java

Modified: jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/util/SharedOutputBuffer.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/util/SharedOutputBuffer.java?view=diff&rev=543990&r1=543989&r2=543990
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/util/SharedOutputBuffer.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/util/SharedOutputBuffer.java
Sun Jun  3 14:26:09 2007
@@ -87,7 +87,8 @@
                 if (this.state == CLOSING && !encoder.isCompleted()) {
                     encoder.complete();
                     this.state = CLOSED;
-                } else {
+                } 
+                if (this.state == STREAMING) {
                     // suspend output events
                     this.ioctrl.suspendOutput();
                 }
@@ -167,10 +168,13 @@
     }
     
     public void writeCompleted() throws IOException {
+        if (this.state == CLOSING || this.state == CLOSED) {
+            return;
+        }
         synchronized (this.mutex) {
             this.state = CLOSING;
             try {
-                while (hasData() && this.state != CLOSED && !this.shutdown)
{
+                while (this.state != CLOSED && !this.shutdown) {
                     this.ioctrl.requestOutput();
                     this.mutex.wait();
                 }



Mime
View raw message