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 11:46:58 UTC
svn commit: r1544478 -
/cxf/branches/2.7.x-fixes/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java
Author: ay
Date: Fri Nov 22 10:46:58 2013
New Revision: 1544478
URL: http://svn.apache.org/r1544478
Log:
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.7.x-fixes/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java
Modified: cxf/branches/2.7.x-fixes/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java?rev=1544478&r1=1544477&r2=1544478&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java (original)
+++ cxf/branches/2.7.x-fixes/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java Fri Nov 22 10:46:58 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);