Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(125)

Unified Diff: Src/GoogleApis/Apis/Services/BaseClientService.cs

Issue 12566043: Issue 369: Change default behavior of an HTTP request (Closed) Base URL: https://google-api-dotnet-client.googlecode.com/hg/
Patch Set: Miceli review Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Src/GoogleApis/Apis/Services/BaseClientService.cs
===================================================================
--- a/Src/GoogleApis/Apis/Services/BaseClientService.cs
b/Src/GoogleApis/Apis/Services/BaseClientService.cs
@@ -54,7 54,7 @@
#region Initializer
/// <summary>
- /// Indicates if exponential back-off is used automatically on exception in a service request and\or when 5xx
/// Indicates if exponential back-off is used automatically on exception in a service request and\or when 503
/// response is returned form the server.
/// </summary>
[Flags]
@@ -62,7 62,7 @@
{
None = 0,
Exception = 1,
- UnsuccessfulResponse5xx = 2
UnsuccessfulResponse503 = 2
}
/// <summary> An initializer class for the client service. </summary>
@@ -82,9 82,9 @@
public IConfigurableHttpClientInitializer HttpClientInitializer { get; set; }
/// <summary>
- /// Gets or sets the exponential back-off policy used by the service. Default value is <c>Exception</c> |
- /// <c>UnsuccessfulResponse5xx</c>, which means that exponential back-off is used on any 5xx abnormal Http
- /// response and on any exception whose thrown when sending a request (except task canceled exception).
/// Get or sets the exponential back-off policy used by the service. Default value is
/// <c>UnsuccessfulResponse503</c>, which means that exponential back-off is used on 503 abnormal HTTP
/// response.
/// If the value is set to <c>None</c>, no exponential back-off policy is used, and it's up to user to
/// configure the <seealso cref="Google.Apis.Http.ConfigurableMessageHandler"/> in an
/// <seealso cref="Google.Apis.Http.IConfigurableHttpClientInitializer"/> to set a specific back-off
@@ -120,8 120,7 @@
GZipEnabled = true;
Serializer = new NewtonsoftJsonSerializer();
Authenticator = NullAuthenticator.Instance;
- DefaultExponentialBackOffPolicy = ExponentialBackOffPolicy.Exception |
- ExponentialBackOffPolicy.UnsuccessfulResponse5xx;
DefaultExponentialBackOffPolicy = ExponentialBackOffPolicy.UnsuccessfulResponse503;
}
}
@@ -153,8 152,8 @@
httpClient.MessageHandler.ExceptionHandlers.Add(backOff);
}
- if ((Policy & ExponentialBackOffPolicy.UnsuccessfulResponse5xx) ==
- ExponentialBackOffPolicy.UnsuccessfulResponse5xx)
if ((Policy & ExponentialBackOffPolicy.UnsuccessfulResponse503) ==
ExponentialBackOffPolicy.UnsuccessfulResponse503)
{
httpClient.MessageHandler.UnsuccessfulResponseHandlers.Add(backOff);
}
@@ -182,9 181,7 @@
HttpClient = CreateHttpClient(initializer);
}
- /// <summary>
- /// Return true if this service contains the specified feature.
- /// </summary>
/// <summary> Return <c>true</c> if this service contains the specified feature. </summary>
private bool HasFeature(Features feature)
{
return Features.Contains(feature.GetStringValue());
« no previous file with comments | « Src/GoogleApis/Apis/Http/ConfigurableMessageHandler.cs ('k') | Src/GoogleApis/Apis/[Media]/Download/MediaDownloader.cs » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b