cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asold...@apache.org
Subject svn commit: r1022402 - /cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Date Thu, 14 Oct 2010 07:51:20 GMT
Author: asoldano
Date: Thu Oct 14 07:51:19 2010
New Revision: 1022402

URL: http://svn.apache.org/viewvc?rev=1022402&view=rev
Log:
[CXF-3065] Follow HTTP 301 redirect responses to HTTP GET requests

Modified:
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?rev=1022402&r1=1022401&r2=1022402&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Thu Oct 14 07:51:19 2010
@@ -1639,7 +1639,9 @@ public class HTTPConduit 
         }
         message.put(KEY_HTTP_CONNECTION, connection);
 
-        connection.setFixedLengthStreamingMode(stream.size());
+        if (stream != null) {
+            connection.setFixedLengthStreamingMode(stream.size());
+        }
         
         // Need to set the headers before the trust decision
         // because they are set before the connect().
@@ -2009,9 +2011,10 @@ public class HTTPConduit 
          */
         protected void handleRetransmits() throws IOException {
             // If we have a cachedStream, we are caching the request.
-            if (cachedStream != null) {
+            if (cachedStream != null
+                || ("GET".equals(connection.getRequestMethod()) && getClient().isAutoRedirect()))
{
 
-                if (LOG.isLoggable(Level.FINE)) {
+                if (LOG.isLoggable(Level.FINE) && cachedStream != null) {
                     LOG.fine("Conduit \""
                              + getConduitName() 
                              + "\" Transmit cached message to: " 



Mime
View raw message