hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r439057 - in /jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http: impl/AbstractHttpServerConnection.java protocol/HttpService.java
Date Thu, 31 Aug 2006 21:44:16 GMT
Author: olegk
Date: Thu Aug 31 14:44:16 2006
New Revision: 439057

URL: http://svn.apache.org/viewvc?rev=439057&view=rev
Log:
Fixed a number of bugs in connection management code

Modified:
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/AbstractHttpServerConnection.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpService.java

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/AbstractHttpServerConnection.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/AbstractHttpServerConnection.java?rev=439057&r1=439056&r2=439057&view=diff
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/AbstractHttpServerConnection.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/AbstractHttpServerConnection.java
Thu Aug 31 14:44:16 2006
@@ -165,9 +165,13 @@
         request.setHeaders(headers);
     }
 
+    protected void doFlush() throws IOException  {
+        this.datatransmitter.flush();
+    }
+    
     public void flush() throws IOException {
         assertOpen();
-        this.datatransmitter.flush();
+        doFlush();
     }
     
 	public void sendResponseHeader(final HttpResponse response) 

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpService.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpService.java?rev=439057&r1=439056&r2=439057&view=diff
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpService.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpService.java
Thu Aug 31 14:44:16 2006
@@ -120,6 +120,14 @@
         }
     }
             
+    protected void shutdownConnection() {
+        try {
+            this.conn.shutdown();
+        } catch (IOException ex) {
+            logIOException(ex);
+        }
+    }
+            
     public void handleRequest() { 
         this.context.setAttribute(HttpExecutionContext.HTTP_CONNECTION, this.conn);
         HttpResponse response;
@@ -162,7 +170,7 @@
             }
         } catch (ConnectionClosedException ex) {
             logMessage("Client closed connection");
-            closeConnection();
+            shutdownConnection();
             return;
         } catch (HttpException ex) {
             response = this.responseFactory.newHttpResponse(HttpVersion.HTTP_1_0, 
@@ -171,7 +179,7 @@
             handleException(ex, response);
         } catch (IOException ex) {
             logIOException(ex);
-            closeConnection();
+            shutdownConnection();
             return;
         }
         try {
@@ -186,7 +194,7 @@
             return;
         } catch (IOException ex) {
             logIOException(ex);
-            closeConnection();
+            shutdownConnection();
             return;
         }
         if (!this.connStrategy.keepAlive(conn, response)) {



Mime
View raw message