hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r987280 - /httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpClient.java
Date Thu, 19 Aug 2010 19:37:03 GMT
Author: olegk
Date: Thu Aug 19 19:37:03 2010
New Revision: 987280

URL: http://svn.apache.org/viewvc?rev=987280&view=rev
Log:
HTTPCLIENT-980: CachingHttpClient returns a 503 response when the backend HttpClient produces
an IOException
Contributed by Jonathan Moore <jonathan_moore at comcast.com>

Modified:
    httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpClient.java

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpClient.java?rev=987280&r1=987279&r2=987280&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpClient.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpClient.java
Thu Aug 19 19:37:03 2010
@@ -41,7 +41,6 @@ import org.apache.http.HttpStatus;
 import org.apache.http.HttpVersion;
 import org.apache.http.ProtocolException;
 import org.apache.http.RequestLine;
-import org.apache.http.StatusLine;
 import org.apache.http.annotation.ThreadSafe;
 import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.HttpClient;
@@ -53,7 +52,6 @@ import org.apache.http.client.methods.Ht
 import org.apache.http.conn.ClientConnectionManager;
 import org.apache.http.impl.client.DefaultHttpClient;
 import org.apache.http.message.BasicHttpResponse;
-import org.apache.http.message.BasicStatusLine;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.HttpContext;
 
@@ -452,18 +450,10 @@ public class CachingHttpClient implement
 
         Date requestDate = getCurrentDate();
 
-        try {
-            log.debug("Calling the backend");
-            HttpResponse backendResponse = backend.execute(target, request, context);
-            return handleBackendResponse(target, request, requestDate, getCurrentDate(),
-                                         backendResponse);
-        } catch (ClientProtocolException cpex) {
-            throw cpex;
-        } catch (IOException ex) {
-            StatusLine status = new BasicStatusLine(HttpVersion.HTTP_1_1, HttpStatus.SC_SERVICE_UNAVAILABLE,
ex
-                    .getMessage());
-            return new BasicHttpResponse(status);
-        }
+        log.debug("Calling the backend");
+        HttpResponse backendResponse = backend.execute(target, request, context);
+        return handleBackendResponse(target, request, requestDate, getCurrentDate(),
+                backendResponse);
 
     }
 



Mime
View raw message