Author: asoldano
Date: Wed Jul 10 17:23:33 2013
New Revision: 1501862

URL: http://svn.apache.org/r1501862
Log:
Merged revisions 1501854 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

................
  r1501854 | asoldano | 2013-07-10 19:04:18 +0200 (Wed, 10 Jul 2013) | 9 lines
  
  Merged revisions 1501833 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1501833 | asoldano | 2013-07-10 18:27:16 +0200 (Wed, 10 Jul 2013) | 2 lines
    
    [CXF-5116] DelegatingInputStream created in AbstractHTTPDestination is 
cached into wrong Message instance
  ........
................

Modified:
    cxf/branches/2.6.x-fixes/   (props changed)
    
cxf/branches/2.6.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java
    
cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/branches/2.7.x-fixes:r1501854
  Merged /cxf/trunk:r1501833

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: 
cxf/branches/2.6.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java?rev=1501862&r1=1501861&r2=1501862&view=diff
==============================================================================
--- 
cxf/branches/2.6.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java
 (original)
+++ 
cxf/branches/2.6.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java
 Wed Jul 10 17:23:33 2013
@@ -335,12 +335,12 @@ public class JettyHTTPDestination extend
         if (inMessage == null) {
             
             inMessage = new MessageImpl();
+            ExchangeImpl exchange = new ExchangeImpl();
+            exchange.setInMessage(inMessage);
             setupMessage(inMessage, context, req, resp);
             
             ((MessageImpl)inMessage).setDestination(this);
     
-            ExchangeImpl exchange = new ExchangeImpl();
-            exchange.setInMessage(inMessage);
             exchange.setSession(new HTTPSession(req));
         }
         

Modified: 
cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java?rev=1501862&r1=1501861&r2=1501862&view=diff
==============================================================================
--- 
cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
 (original)
+++ 
cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
 Wed Jul 10 17:23:33 2013
@@ -217,14 +217,14 @@ public abstract class AbstractHTTPDestin
         if (inMessage == null) {
             LOG.fine("Create a new message for processing");
             inMessage = new MessageImpl();
+            ExchangeImpl exchange = new ExchangeImpl();
+            exchange.setInMessage(inMessage);
             setupMessage(inMessage,
                      config,
                      context,
                      req,
                      resp);
 
-            ExchangeImpl exchange = new ExchangeImpl();
-            exchange.setInMessage(inMessage);
             exchange.setSession(new HTTPSession(req));
             ((MessageImpl)inMessage).setDestination(this);
         } else {
@@ -265,13 +265,15 @@ public abstract class AbstractHTTPDestin
                           req, 
                           resp);
         
+        final Exchange exchange = inMessage.getExchange();
         DelegatingInputStream in = new 
DelegatingInputStream(req.getInputStream()) {
             public void cacheInput() {
-                if (!cached && inMessage.getExchange().getOutMessage() == 
null) {
+                if (!cached && exchange.isOneWay()) {
                     //For one-ways, we need to cache the values of the 
HttpServletRequest
                     //so they can be queried later for things like paths and 
schemes 
                     //and such like that.                   
-                    inMessage.put(HTTP_REQUEST, new 
HttpServletRequestSnapshot(req));
+                    //Please note, exchange used to always get the "current" 
message
+                    exchange.getInMessage().put(HTTP_REQUEST, new 
HttpServletRequestSnapshot(req));
                 }
                 super.cacheInput();
             }


Reply via email to