Author: ay
Date: Tue Feb 26 18:18:26 2013
New Revision: 1450330
URL: http://svn.apache.org/r1450330
Log:
Merged revisions 1450233 via svn merge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1450233 | ay | 2013-02-26 16:45:44 +0100 (Tue, 26 Feb 2013) | 1 line
[CXF-4857] Workaround for Socket Closed exception for jdk1.6
........
Modified:
cxf/branches/2.7.x-fixes/ (props changed)
cxf/branches/2.7.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/URLConnectionHTTPConduit.java
Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.7.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/URLConnectionHTTPConduit.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/URLConnectionHTTPConduit.java?rev=1450330&r1=1450329&r2=1450330&view=diff
==============================================================================
---
cxf/branches/2.7.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/URLConnectionHTTPConduit.java
(original)
+++
cxf/branches/2.7.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/URLConnectionHTTPConduit.java
Tue Feb 26 18:18:26 2013
@@ -24,6 +24,7 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.Proxy;
+import java.net.SocketException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
@@ -162,12 +163,23 @@ public class URLConnectionHTTPConduit ex
protected void setupWrappedStream() throws IOException {
// If we need to cache for retransmission, store data in a
// CacheAndWriteOutputStream. Otherwise write directly to the
output stream.
+ OutputStream cout = null;
+ try {
+ cout = connection.getOutputStream();
+ } catch (SocketException e) {
+ if ("Socket Closed".equals(e.getMessage())) {
+ connection.connect();
+ cout = connection.getOutputStream();
+ } else {
+ throw e;
+ }
+ }
if (cachingForRetransmission) {
cachedStream =
- new
CacheAndWriteOutputStream(connection.getOutputStream());
+ new CacheAndWriteOutputStream(cout);
wrappedStream = cachedStream;
} else {
- wrappedStream = connection.getOutputStream();
+ wrappedStream = cout;
}
}