hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r413445 - /jakarta/httpcomponents/tcconnector/trunk/src/java/org/apache/http/tcconnector/impl/CoyoteHttpConnectionImpl.java
Date Sun, 11 Jun 2006 13:42:25 GMT
Author: olegk
Date: Sun Jun 11 06:42:25 2006
New Revision: 413445

URL: http://svn.apache.org/viewvc?rev=413445&view=rev
Log:
Various optimizations in the HTTP header processing code

Modified:
    jakarta/httpcomponents/tcconnector/trunk/src/java/org/apache/http/tcconnector/impl/CoyoteHttpConnectionImpl.java

Modified: jakarta/httpcomponents/tcconnector/trunk/src/java/org/apache/http/tcconnector/impl/CoyoteHttpConnectionImpl.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/tcconnector/trunk/src/java/org/apache/http/tcconnector/impl/CoyoteHttpConnectionImpl.java?rev=413445&r1=413444&r2=413445&view=diff
==============================================================================
--- jakarta/httpcomponents/tcconnector/trunk/src/java/org/apache/http/tcconnector/impl/CoyoteHttpConnectionImpl.java
(original)
+++ jakarta/httpcomponents/tcconnector/trunk/src/java/org/apache/http/tcconnector/impl/CoyoteHttpConnectionImpl.java
Sun Jun 11 06:42:25 2006
@@ -34,6 +34,7 @@
 import java.io.OutputStream;
 import java.net.Socket;
 import java.net.SocketAddress;
+import java.util.Iterator;
 
 import org.apache.coyote.Request;
 import org.apache.coyote.Response;
@@ -173,9 +174,7 @@
         HttpRequest request = this.requestfactory.newHttpRequest(requestline);
         request.getParams().setDefaults(params);
         Header[] headers = HeaderUtils.parseHeaders(this.datareceiver, this.maxHeaderCount);
-        for (i = 0; i < headers.length; i++) {
-            request.addHeader(headers[i]);
-        }
+        request.setHeaders(headers);
         
         // Prepare input stream
         this.in = null;
@@ -234,10 +233,9 @@
         this.charbuffer.clear();
         StatusLine.format(this.charbuffer, response.getStatusLine());
         this.datatransmitter.writeLine(this.charbuffer);
-        Header[] headers = response.getAllHeaders();
-        for (int i = 0; i < headers.length; i++) {
+        for (Iterator it = response.headerIterator(); it.hasNext(); ) {
             this.charbuffer.clear();
-            Header.format(this.charbuffer, headers[i]);
+            Header.format(this.charbuffer, (Header) it.next());
             this.datatransmitter.writeLine(this.charbuffer);
         }
         this.charbuffer.clear();



Mime
View raw message