cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r996033 - in /cxf/branches/async-client/rt/transports/http/src/main/java/org/apache/cxf/transport/http/async: AsyncHTTPConduit.java HttpClientController.java
Date Sat, 11 Sep 2010 01:31:47 GMT
Author: dkulp
Date: Sat Sep 11 01:31:47 2010
New Revision: 996033

URL: http://svn.apache.org/viewvc?rev=996033&view=rev
Log:
Fix some of the ws-specs sys tests

Modified:
    cxf/branches/async-client/rt/transports/http/src/main/java/org/apache/cxf/transport/http/async/AsyncHTTPConduit.java
    cxf/branches/async-client/rt/transports/http/src/main/java/org/apache/cxf/transport/http/async/HttpClientController.java

Modified: cxf/branches/async-client/rt/transports/http/src/main/java/org/apache/cxf/transport/http/async/AsyncHTTPConduit.java
URL: http://svn.apache.org/viewvc/cxf/branches/async-client/rt/transports/http/src/main/java/org/apache/cxf/transport/http/async/AsyncHTTPConduit.java?rev=996033&r1=996032&r2=996033&view=diff
==============================================================================
--- cxf/branches/async-client/rt/transports/http/src/main/java/org/apache/cxf/transport/http/async/AsyncHTTPConduit.java
(original)
+++ cxf/branches/async-client/rt/transports/http/src/main/java/org/apache/cxf/transport/http/async/AsyncHTTPConduit.java
Sat Sep 11 01:31:47 2010
@@ -44,6 +44,7 @@ import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.message.MessageUtils;
+import org.apache.cxf.phase.PhaseInterceptorChain;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transport.http.Cookie;
 import org.apache.cxf.transport.http.DigestAuthSupplier;
@@ -400,7 +401,8 @@ public class AsyncHTTPConduit extends HT
             if (responseCode == HttpURLConnection.HTTP_ACCEPTED
                 || responseCode == HttpURLConnection.HTTP_OK) {
                 int cl = -1;
-                List<String> cls = headers.get("content-length");
+                List<String> cls = headers.get(HttpHeaderHelper
+                                               .getHeaderKey(HttpHeaderHelper.CONTENT_LENGTH));
                 if (cls != null) {
                     cl = Integer.parseInt(cls.get(0));
                 }
@@ -488,10 +490,13 @@ public class AsyncHTTPConduit extends HT
                 && !MessageUtils.isTrue(outMessage.getContextualProperty(
                     "org.apache.cxf.http.no_io_exceptions"))) {
                 
-                Exception ex = new Fault(new IOException("HTTP response '" + responseCode
+ ": " 
-                                + response.getStatusLine().getReasonPhrase() + "'"));
+                Exception ex = new IOException("HTTP response '" + responseCode + ": " 
+                                              + response.getStatusLine().getReasonPhrase()
+ "'");
+                //ex = new Fault(ex);
                 exchange.put(Exception.class, ex);
                 inMessage.setContent(Exception.class, ex);
+                ((PhaseInterceptorChain)outMessage.getInterceptorChain())
+                    .unwind(outMessage);
                 incomingObserver.onMessage(inMessage);
                 response.getEntity().getContent().close();
                 return;
@@ -507,16 +512,6 @@ public class AsyncHTTPConduit extends HT
                     response.getEntity().getContent().close();
                     return;
                 }
-            } else {
-                //not going to be resending or anything, clear out the stuff in the out message
-                //to free memory
-                /*
-                outMessage.removeContent(OutputStream.class);
-                if (cachingForRetransmission && cachedStream != null) {
-                    cachedStream.close();
-                }
-                cachedStream = null;
-                */
             }
             
 

Modified: cxf/branches/async-client/rt/transports/http/src/main/java/org/apache/cxf/transport/http/async/HttpClientController.java
URL: http://svn.apache.org/viewvc/cxf/branches/async-client/rt/transports/http/src/main/java/org/apache/cxf/transport/http/async/HttpClientController.java?rev=996033&r1=996032&r2=996033&view=diff
==============================================================================
--- cxf/branches/async-client/rt/transports/http/src/main/java/org/apache/cxf/transport/http/async/HttpClientController.java
(original)
+++ cxf/branches/async-client/rt/transports/http/src/main/java/org/apache/cxf/transport/http/async/HttpClientController.java
Sat Sep 11 01:31:47 2010
@@ -133,8 +133,10 @@ public class HttpClientController implem
                 protected void handleTimeout(final NHttpConnection conn) {
                     super.handleTimeout(conn);
                     MessageHolder m = (MessageHolder)conn.getContext().getAttribute("MESSAGE");
-                    m.get().get(AsyncHTTPConduit.class).sendException(m.get(),
+                    if (m.get() != null) {
+                        m.get().get(AsyncHTTPConduit.class).sendException(m.get(),
                                                                       new SocketTimeoutException());
+                    }
                 }
             };
 



Mime
View raw message