You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ay...@apache.org on 2013/11/22 12:25:30 UTC

svn commit: r1544491 - /cxf/branches/2.6.x-fixes/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java

Author: ay
Date: Fri Nov 22 11:25:30 2013
New Revision: 1544491

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

........
  r1544478 | ay | 2013-11-22 11:46:58 +0100 (Fri, 22 Nov 2013) | 10 lines

  Merged revisions 1544449 via  git cherry-pick from
  https://svn.apache.org/repos/asf/cxf/trunk

  ........
    r1544449 | ay | 2013-11-22 10:32:13 +0100 (Fri, 22 Nov 2013) | 2 lines

    [CXF-5409] Make response code be included in logging for LocalTransport

  ........

........

Modified:
    cxf/branches/2.6.x-fixes/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java

Modified: cxf/branches/2.6.x-fixes/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java?rev=1544491&r1=1544490&r2=1544491&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java (original)
+++ cxf/branches/2.6.x-fixes/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java Fri Nov 22 11:25:30 2013
@@ -33,6 +33,7 @@ import org.apache.cxf.io.CachedOutputStr
 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.service.model.EndpointInfo;
 import org.apache.cxf.transport.AbstractConduit;
 import org.apache.cxf.transport.AbstractDestination;
@@ -149,6 +150,13 @@ public class LocalDestination extends Ab
 
         @Override
         public void close(Message message) throws IOException {
+            // set the pseudo status code if not set (REVISIT add this method in MessageUtils to be reused elsewhere?)
+            Integer i = (Integer)message.get(Message.RESPONSE_CODE);
+            if (i == null) {
+                int code = ((message.getExchange().isOneWay() && !MessageUtils.isPartialResponse(message)) 
+                    || MessageUtils.isEmptyPartialResponse(message)) ? 202 : 200;
+                message.put(Message.RESPONSE_CODE, code);
+            }
             if (Boolean.TRUE.equals(message.getExchange().get(LocalConduit.DIRECT_DISPATCH))) {
                 final Exchange exchange = (Exchange)message.getExchange().get(LocalConduit.IN_EXCHANGE);