You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2013/07/15 20:50:00 UTC

svn commit: r1503409 - in /cxf/branches/2.5.x-fixes/rt/transports: http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java

Author: dkulp
Date: Mon Jul 15 18:49:59 2013
New Revision: 1503409

URL: http://svn.apache.org/r1503409
Log:
Merged revisions 1501862 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes

........
  r1501862 | asoldano | 2013-07-10 13:23:33 -0400 (Wed, 10 Jul 2013) | 16 lines

  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.5.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java
    cxf/branches/2.5.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java

Modified: cxf/branches/2.5.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.5.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java?rev=1503409&r1=1503408&r2=1503409&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java (original)
+++ cxf/branches/2.5.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java Mon Jul 15 18:49:59 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.5.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java?rev=1503409&r1=1503408&r2=1503409&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java (original)
+++ cxf/branches/2.5.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java Mon Jul 15 18:49:59 2013
@@ -213,14 +213,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 {
@@ -261,13 +261,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();
             }