mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 762974 - Don't retry if delegate or observer callbacks throw in BaseResource. r=liuche
This commit is contained in:
parent
9f658c894a
commit
7291a3cb6e
@ -240,16 +240,13 @@ public class BaseResource implements Resource {
|
||||
}
|
||||
|
||||
private void execute() {
|
||||
HttpResponse response;
|
||||
try {
|
||||
HttpResponse response = client.execute(request, context);
|
||||
response = client.execute(request, context);
|
||||
Logger.debug(LOG_TAG, "Response: " + response.getStatusLine().toString());
|
||||
HttpResponseObserver observer = getHttpResponseObserver();
|
||||
if (observer != null) {
|
||||
observer.observeHttpResponse(response);
|
||||
}
|
||||
delegate.handleHttpResponse(response);
|
||||
} catch (ClientProtocolException e) {
|
||||
delegate.handleHttpProtocolException(e);
|
||||
return;
|
||||
} catch (IOException e) {
|
||||
Logger.debug(LOG_TAG, "I/O exception returned from execute.");
|
||||
if (!retryOnFailedRequest) {
|
||||
@ -257,6 +254,7 @@ public class BaseResource implements Resource {
|
||||
} else {
|
||||
retryRequest();
|
||||
}
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
// Bug 740731: Don't let an exception fall through. Wrapping isn't
|
||||
// optimal, but often the exception is treated as an Exception anyway.
|
||||
@ -265,7 +263,15 @@ public class BaseResource implements Resource {
|
||||
} else {
|
||||
retryRequest();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't retry if the observer or delegate throws!
|
||||
HttpResponseObserver observer = getHttpResponseObserver();
|
||||
if (observer != null) {
|
||||
observer.observeHttpResponse(response);
|
||||
}
|
||||
delegate.handleHttpResponse(response);
|
||||
}
|
||||
|
||||
private void retryRequest() {
|
||||
|
Loading…
Reference in New Issue
Block a user