Skip to content
This repository was archived by the owner on Apr 10, 2018. It is now read-only.

Commit 686bcda

Browse files
committed
Merge branch 'feature/timeout-property' into develop
2 parents dd026bb + add1fea commit 686bcda

10 files changed

+37
-12
lines changed

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ This is some kind of a RestSharp port to PCL.
66

77
# News #
88

9-
* Version 2.3.2 is available now!
9+
* Version 2.4.0 is available now!
1010

1111
# Changes #
1212

13+
## 2.4.0 ##
14+
15+
* New "Timeout" property to fix issue [#13](https://github.com/FubarDevelopment/restsharp.portable/issues/13) with [CancellationTokenSource.CancelAfter](https://msdn.microsoft.com/de-de/library/hh194678%28v=vs.110%29.aspx)
16+
1317
## 2.3.2 ##
1418

1519
* Fixes concurrent requests on the same RestClient (fixes [#19](https://github.com/FubarDevelopment/restsharp.portable/issues/19),

RestSharp.Portable.Encodings.nuspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Supported Platforms:
2121
- Xamarin iOS / MonoTouch
2222
- Portable Class Libraries</description>
2323
<summary>Library that will contain some standard Content-Encoding handlers</summary>
24-
<releaseNotes>- Parallel release (issues #11, #12, and #15 fixed)</releaseNotes>
24+
<releaseNotes>- Parallel release (issue #13)</releaseNotes>
2525
<copyright>Copyright © RestSharp.Portable project 2013-2015</copyright>
2626
<language>en-US</language>
2727
<tags>PCL RestSharp portable encoding gzip</tags>

RestSharp.Portable.OAuth.nuspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Supported Platforms:
2222
- Xamarin iOS / MonoTouch
2323
- Portable Class Libraries</description>
2424
<summary>OAuth authenticator</summary>
25-
<releaseNotes>- Parallel release (Issues #17 fixed)</releaseNotes>
25+
<releaseNotes>- Parallel release (issue #13)</releaseNotes>
2626
<copyright>Copyright © John Sheehan and RestSharp.Portable project</copyright>
2727
<language>en-US</language>
2828
<tags>PCL RestSharp portable OAuth</tags>

RestSharp.Portable.OAuth2.nuspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Supported Platforms:
2222
- Xamarin iOS / MonoTouch
2323
- Portable Class Libraries (.NET 4.0.3+)</description>
2424
<summary>OAuth 2.0 authenticators and clients</summary>
25-
<releaseNotes>- Parallel release (Issues #17 fixed)</releaseNotes>
25+
<releaseNotes>- Parallel release (issues #13)</releaseNotes>
2626
<copyright>Copyright © Constantin Titarenko, RestSharp.Portable project and others</copyright>
2727
<language>en-US</language>
2828
<tags>PCL RestSharp portable OAuth 2.0 OAuth2</tags>

RestSharp.Portable.nuspec

+1-4
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ Supported Platforms:
2121
- Xamarin iOS / MonoTouch
2222
- Portable Class Libraries</description>
2323
<summary>Some kind of a RestSharp port to PCL</summary>
24-
<releaseNotes>- New IsSuccess proeprty for IRestResponse (fixes issue #17)
25-
- All data is converted to a string using the en-US culture
26-
- All DateTime(Offset) HTTP header values are encoded as described in RFC 1123 after conversion to UTC/GMT
27-
- Synchronization of requests for the same client (fixes issue #19)</releaseNotes>
24+
<releaseNotes>- New timeout property to avoid problems with CancellationTokenSource (issue #13)</releaseNotes>
2825
<copyright>Copyright © RestSharp.Portable project 2013-2015</copyright>
2926
<language>en-US</language>
3027
<tags>PCL RestSharp portable</tags>

RestSharp.Portable/HttpClientImpl/DefaultHttpClientFactory.cs

+6
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@ public virtual HttpClient CreateClient(IRestClient client, IRestRequest request)
4242
{
4343
BaseAddress = GetBaseAddress(client)
4444
};
45+
4546
httpClient = AddHttpHeaderParameters(httpClient, client);
47+
48+
var timeout = client.Timeout;
49+
if (timeout.HasValue)
50+
httpClient.Timeout = timeout.Value;
51+
4652
return httpClient;
4753
}
4854

RestSharp.Portable/IRestClient.cs

+9
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ public interface IRestClient : IDisposable
5757
/// </remarks>
5858
StringComparer DefaultParameterNameComparer { get; set; }
5959

60+
/// <summary>
61+
/// Gets or sets the timeout to be used for requests.
62+
/// </summary>
63+
/// <remarks>
64+
/// When the value isn't set, it uses the default timeout of <see cref="System.Net.Http.HttpClient"/> (100 seconds) or whatever
65+
/// is used to implement the <see cref="IHttpClientFactory"/>.
66+
/// </remarks>
67+
TimeSpan? Timeout { get; set; }
68+
6069
/// <summary>
6170
/// Execute the given request
6271
/// </summary>

RestSharp.Portable/RestClient.cs

+9
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@ public RestClient(string baseUrl)
101101
/// </remarks>
102102
public StringComparer DefaultParameterNameComparer { get; set; }
103103

104+
/// <summary>
105+
/// Gets or sets the timeout to be used for requests.
106+
/// </summary>
107+
/// <remarks>
108+
/// When the value isn't set, it uses the default timeout of <see cref="System.Net.Http.HttpClient"/> (100 seconds) or whatever
109+
/// is used to implement the <see cref="IHttpClientFactory"/>.
110+
/// </remarks>
111+
public TimeSpan? Timeout { get; set; }
112+
104113
/// <summary>
105114
/// Gets the collection of the default parameters for all requests
106115
/// </summary>

SharedAssemblyInfo.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
2525
// durch Einsatz von '*', wie in nachfolgendem Beispiel:
2626
// [assembly: AssemblyVersion("1.0.*")]
27-
[assembly: AssemblyVersion("2.3.0")]
28-
[assembly: AssemblyFileVersion("2.3.2")]
29-
[assembly: AssemblyInformationalVersion("2.3.2")]
27+
[assembly: AssemblyVersion("2.4.0")]
28+
[assembly: AssemblyFileVersion("2.4.0")]
29+
[assembly: AssemblyInformationalVersion("2.4.0")]
3030

3131
[assembly: InternalsVisibleTo("RestSharp.Portable.OAuth, PublicKey=" +
3232
"00240000048000009400000006020000002400005253413100040000010001000f8415df6f1232" +

nuget-pack.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[OutputType([void])]
22
param(
33
[Parameter()]
4-
$version = "2.3.2",
4+
$version = "2.4.0",
55
[Parameter()]
66
$config = "Release"
77
)

0 commit comments

Comments
 (0)