cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1379547 - /cxf/sandbox/dkulp_async_clients/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
Date Fri, 31 Aug 2012 18:37:59 GMT
Author: dkulp
Date: Fri Aug 31 18:37:59 2012
New Revision: 1379547

URL: http://svn.apache.org/viewvc?rev=1379547&view=rev
Log:
Completely reset on retransmit
Read cookie headers

Modified:
    cxf/sandbox/dkulp_async_clients/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java

Modified: cxf/sandbox/dkulp_async_clients/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dkulp_async_clients/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java?rev=1379547&r1=1379546&r2=1379547&view=diff
==============================================================================
--- cxf/sandbox/dkulp_async_clients/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
(original)
+++ cxf/sandbox/dkulp_async_clients/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
Fri Aug 31 18:37:59 2012
@@ -155,10 +155,11 @@ public class AsyncHTTPConduit extends UR
     
     
     class AsyncWrappedOutputStream extends WrappedOutputStream {
-        final CXFHttpRequest entity;
-        final BasicHttpEntity basicEntity;
         final HTTPClientPolicy csPolicy;
 
+        CXFHttpRequest entity;
+        BasicHttpEntity basicEntity;
+
         boolean isAsync;
         SharedInputBuffer inbuf;
         SharedOutputBuffer outbuf;
@@ -402,8 +403,8 @@ public class AsyncHTTPConduit extends UR
             return getHttpResponse().getStatusLine().getReasonPhrase();
         }
         
-        private String readHeaders(Headers h) {
-            Header headers[] = httpResponse.getAllHeaders();
+        private String readHeaders(Headers h) throws IOException {
+            Header headers[] = getHttpResponse().getAllHeaders();
             h.headerMap().clear();
             String ct = null;
             for (Header header : headers) {
@@ -420,9 +421,10 @@ public class AsyncHTTPConduit extends UR
             return ct;
         }
         
-        protected void updateResponseHeaders(Message inMessage) {
+        protected void updateResponseHeaders(Message inMessage) throws IOException {
             Headers h = new Headers(inMessage);
             inMessage.put(Message.CONTENT_TYPE, readHeaders(h));
+            cookies.readFromHeaders(h);
         }
         
         protected InputStream getPartialResponse() throws IOException {
@@ -461,7 +463,7 @@ public class AsyncHTTPConduit extends UR
             return in;
         }
         
-        protected void updateCookiesBeforeRetransmit() {
+        protected void updateCookiesBeforeRetransmit() throws IOException {
             Headers h = new Headers();
             readHeaders(h);
             cookies.readFromHeaders(h);
@@ -474,11 +476,16 @@ public class AsyncHTTPConduit extends UR
         }
 
         protected void setupNewConnection(String newURL) throws IOException {
+            
+            
             httpResponse = null;
             isAsync = false;
             exception = null;
+            
             try {
-                entity.setURI(new URI(newURL));
+                setupConnection(outMessage, new URI(newURL), csPolicy);
+                entity = outMessage.get(CXFHttpRequest.class);
+                basicEntity = (BasicHttpEntity)entity.getEntity();
             } catch (URISyntaxException e) {
                 throw new IOException(e);
             }



Mime
View raw message