Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9E08D19263 for ; Wed, 16 Mar 2016 15:05:55 +0000 (UTC) Received: (qmail 71493 invoked by uid 500); 16 Mar 2016 15:05:55 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 71291 invoked by uid 500); 16 Mar 2016 15:05:55 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 71091 invoked by uid 99); 16 Mar 2016 15:05:55 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Mar 2016 15:05:55 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0584CDFBA3; Wed, 16 Mar 2016 15:05:55 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dkulp@apache.org To: commits@cxf.apache.org Date: Wed, 16 Mar 2016 15:05:55 -0000 Message-Id: <2afc3aa21906431598b07d36089d6a72@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [01/10] cxf git commit: [CXF-6768]InternalContextUtils should bak all the data from the input stream before send back partialResponse Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 0213838ad -> 0afa9d25d [CXF-6768]InternalContextUtils should bak all the data from the input stream before send back partialResponse (cherry picked from commit 2726b68fa3dbc8a98018cc957bef47a23c9a950e) # Conflicts: # rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/bbb02cf6 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/bbb02cf6 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/bbb02cf6 Branch: refs/heads/3.0.x-fixes Commit: bbb02cf67e9f1431f3555e5aae3af79a6c9c9487 Parents: 0213838 Author: Freeman Fang Authored: Wed Feb 17 12:03:14 2016 +0800 Committer: Daniel Kulp Committed: Wed Mar 16 10:57:40 2016 -0400 ---------------------------------------------------------------------- .../addressing/impl/InternalContextUtils.java | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/bbb02cf6/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java ---------------------------------------------------------------------- diff --git a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java b/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java index 421958e..342850a 100644 --- a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java +++ b/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java @@ -269,7 +269,16 @@ final class InternalContextUtils { new PreexistingConduitSelector(backChannel, exchange.get(Endpoint.class))); - if (chain != null && !chain.doIntercept(partialResponse) + if (ContextUtils.retrieveAsyncPostResponseDispatch(inMessage) && !robust) { + //need to suck in all the data from the input stream as + //the transport might discard any data on the stream when this + //thread unwinds or when the empty response is sent back + DelegatingInputStream in = inMessage.getContent(DelegatingInputStream.class); + if (in != null) { + in.cacheInput(); + } + } + if (chain != null && !chain.doIntercept(partialResponse) && partialResponse.getContent(Exception.class) != null) { if (partialResponse.getContent(Exception.class) instanceof Fault) { throw (Fault)partialResponse.getContent(Exception.class); @@ -294,14 +303,7 @@ final class InternalContextUtils { if (ContextUtils.retrieveAsyncPostResponseDispatch(inMessage) && !robust) { - //need to suck in all the data from the input stream as - //the transport might discard any data on the stream when this - //thread unwinds or when the empty response is sent back - DelegatingInputStream in = inMessage.getContent(DelegatingInputStream.class); - if (in != null) { - in.cacheInput(); - } - + // async service invocation required *after* a response // has been sent (i.e. to a oneway, or a partial response // to a decoupled twoway)