Skip to content

Commit 02b10b4

Browse files
committed
Merge pull request #195 from sharwell/fix-191
Fix 191
2 parents 80dbe76 + 31bec6b commit 02b10b4

13 files changed

Lines changed: 56 additions & 102 deletions

File tree

src/console/console.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
<SpecificVersion>False</SpecificVersion>
4040
<HintPath>..\packages\Newtonsoft.Json.5.0.6\lib\net40\Newtonsoft.Json.dll</HintPath>
4141
</Reference>
42-
<Reference Include="SimpleRESTServices, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL">
42+
<Reference Include="SimpleRESTServices, Version=1.1.3.0, Culture=neutral, processorArchitecture=MSIL">
4343
<SpecificVersion>False</SpecificVersion>
44-
<HintPath>..\packages\SimpleRESTServices.1.1.2.0\lib\net40\SimpleRESTServices.dll</HintPath>
44+
<HintPath>..\packages\SimpleRESTServices.1.1.3.0\lib\net40\SimpleRESTServices.dll</HintPath>
4545
</Reference>
4646
<Reference Include="System" />
4747
<Reference Include="System.Core" />

src/console/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Newtonsoft.Json" version="5.0.6" targetFramework="net40" />
4-
<package id="SimpleRESTServices" version="1.1.2.0" targetFramework="net40" />
4+
<package id="SimpleRESTServices" version="1.1.3.0" targetFramework="net40" />
55
</packages>

src/corelib/Providers/Rackspace/ProviderBase`1.cs

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ public abstract class ProviderBase<TProvider>
4646
/// </summary>
4747
protected readonly IHttpResponseCodeValidator ResponseCodeValidator;
4848

49+
/// <summary>
50+
/// This is the backing field for <see cref="ConnectionLimit"/>.
51+
/// </summary>
52+
private int? _connectionLimit;
53+
4954
/// <summary>
5055
/// Initializes a new instance of the <see cref="ProviderBase{TProvider}"/> class using
5156
/// the specified default identity, identity provider, and REST service implementation,
@@ -73,6 +78,28 @@ protected ProviderBase(CloudIdentity defaultIdentity, IIdentityProvider identit
7378
ResponseCodeValidator = httpStatusCodeValidator ?? HttpResponseCodeValidator.Default;
7479
}
7580

81+
/// <summary>
82+
/// Gets or sets the maximum number of connections allowed on the <see cref="ServicePoint"/>
83+
/// objects used for requests. If the value is <c>null</c>, the connection limit value for the
84+
/// <see cref="ServicePoint"/> object is not altered.
85+
/// </summary>
86+
/// <exception cref="ArgumentOutOfRangeException">If <paramref name="value"/> is less than or equal to 0.</exception>
87+
public int? ConnectionLimit
88+
{
89+
get
90+
{
91+
return _connectionLimit;
92+
}
93+
94+
set
95+
{
96+
if (value <= 0)
97+
throw new ArgumentOutOfRangeException("value");
98+
99+
_connectionLimit = value;
100+
}
101+
}
102+
76103
/// <summary>
77104
/// Execute a REST request with an <see cref="object"/> body and strongly-typed result.
78105
/// </summary>
@@ -469,7 +496,14 @@ protected virtual RequestSettings BuildDefaultRequestSettings(IEnumerable<HttpSt
469496
if(non200SuccessCodes != null)
470497
non200SuccessCodesAggregate.AddRange(non200SuccessCodes);
471498

472-
return new JsonRequestSettings { RetryCount = 2, RetryDelay = TimeSpan.FromMilliseconds(200), Non200SuccessCodes = non200SuccessCodesAggregate, UserAgent = UserAgentGenerator.UserAgent };
499+
return new JsonRequestSettings
500+
{
501+
RetryCount = 2,
502+
RetryDelay = TimeSpan.FromMilliseconds(200),
503+
Non200SuccessCodes = non200SuccessCodesAggregate,
504+
UserAgent = UserAgentGenerator.UserAgent,
505+
ConnectionLimit = ConnectionLimit,
506+
};
473507
}
474508

475509
/// <summary>

src/corelib/corelib.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
<SpecificVersion>False</SpecificVersion>
3939
<HintPath>..\packages\Newtonsoft.Json.5.0.6\lib\net40\Newtonsoft.Json.dll</HintPath>
4040
</Reference>
41-
<Reference Include="SimpleRESTServices, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL">
41+
<Reference Include="SimpleRESTServices, Version=1.1.3.0, Culture=neutral, processorArchitecture=MSIL">
4242
<SpecificVersion>False</SpecificVersion>
43-
<HintPath>..\packages\SimpleRESTServices.1.1.2.0\lib\net40\SimpleRESTServices.dll</HintPath>
43+
<HintPath>..\packages\SimpleRESTServices.1.1.3.0\lib\net40\SimpleRESTServices.dll</HintPath>
4444
</Reference>
4545
<Reference Include="System" />
4646
<Reference Include="System.Core" />

src/corelib/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Newtonsoft.Json" version="5.0.6" targetFramework="net40" />
4-
<package id="SimpleRESTServices" version="1.1.2.0" targetFramework="net40" />
4+
<package id="SimpleRESTServices" version="1.1.3.0" targetFramework="net40" />
55
</packages>
Binary file not shown.

src/packages/SimpleRESTServices.1.1.2.0/SimpleRESTServices.1.1.2.0.nuspec renamed to src/packages/SimpleRESTServices.1.1.3.0/SimpleRESTServices.1.1.3.0.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
33
<metadata>
44
<id>SimpleRESTServices</id>
5-
<version>1.1.2.0</version>
5+
<version>1.1.3.0</version>
66
<title>SimpleRESTServices</title>
77
<authors>Alan Quillin</authors>
88
<owners>Alan Quillin</owners>
99
<licenseUrl>https://github.com/JSIStudios/SimpleRestServices/wiki/License</licenseUrl>
1010
<projectUrl>https://github.com/JSIStudios/SimpleRestServices</projectUrl>
1111
<requireLicenseAcceptance>true</requireLicenseAcceptance>
1212
<description>A simple set of client side and server side REST helpers</description>
13-
<releaseNotes>https://github.com/JSIStudios/SimpleRestServices/wiki/v1.1.2.0</releaseNotes>
13+
<releaseNotes>https://github.com/JSIStudios/SimpleRestServices/wiki/v1.1.3.0</releaseNotes>
1414
<copyright>Copyright © JSI Studios 2013</copyright>
1515
<tags>REST REST_client</tags>
1616
<dependencies>
Binary file not shown.

src/packages/SimpleRESTServices.1.1.2.0/lib/net40/SimpleRESTServices.xml renamed to src/packages/SimpleRESTServices.1.1.3.0/lib/net40/SimpleRESTServices.xml

Lines changed: 7 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,13 @@
687687
Internet resource.
688688
</summary>
689689
</member>
690+
<member name="P:JSIStudios.SimpleRESTServices.Client.RequestSettings.ConnectionLimit">
691+
<summary>
692+
Gets or sets the maximum number of connections allowed on the <see cref="T:System.Net.ServicePoint" /> object
693+
used for the request. If the value is <c>null</c>, the connection limit value for the
694+
<see cref="T:System.Net.ServicePoint" /> object is not altered.
695+
</summary>
696+
</member>
690697
<member name="P:JSIStudios.SimpleRESTServices.Client.RequestSettings.ContentLength">
691698
<summary>
692699
Gets or sets the value of the Content-Length HTTP header.
@@ -1830,93 +1837,6 @@
18301837
Gets the default <see cref="T:JSIStudios.SimpleRESTServices.Client.RequestSettings" /> to use for requests sent from this service.
18311838
</summary>
18321839
</member>
1833-
<member name="M:JSIStudios.SimpleRESTServices.Client.Json.JsonRestServices.Execute(System.Uri,JSIStudios.SimpleRESTServices.Client.HttpMethod,System.Func{System.Net.HttpWebResponse,System.Boolean,JSIStudios.SimpleRESTServices.Client.Response},System.String,System.Collections.Generic.Dictionary{System.String,System.String},System.Collections.Generic.Dictionary{System.String,System.String},JSIStudios.SimpleRESTServices.Client.RequestSettings)">
1834-
<summary>
1835-
Executes a REST request with a string <paramref name="body" /> and user-defined
1836-
callback function for constructing the resulting <see cref="T:JSIStudios.SimpleRESTServices.Client.Response" /> object.
1837-
</summary>
1838-
<param name="url">The base URI.</param>
1839-
<param name="method">The HTTP method to use for the request.</param>
1840-
<param name="responseBuilderCallback">A user-specified function used to construct the resulting <see cref="T:JSIStudios.SimpleRESTServices.Client.Response" />
1841-
object from the <see cref="T:System.Net.HttpWebResponse" /> and a Boolean value specifying whether or not a <see cref="T:System.Net.WebException" />
1842-
was thrown during the request. If this value is <c>null</c>, this method is equivalent to calling
1843-
<see cref="M:JSIStudios.SimpleRESTServices.Client.IRestService.Execute(System.Uri,JSIStudios.SimpleRESTServices.Client.HttpMethod,System.String,System.Collections.Generic.Dictionary{System.String,System.String},System.Collections.Generic.Dictionary{System.String,System.String},JSIStudios.SimpleRESTServices.Client.RequestSettings)" />.</param>
1844-
<param name="body">The body of the request. If the value is <c>null</c>, the request is sent without a body.</param>
1845-
<param name="headers">
1846-
A collection of custom HTTP headers to include with the request. If the value is
1847-
<c>null</c>, no custom headers are added to the HTTP request.
1848-
</param>
1849-
<param name="queryStringParameters">
1850-
A collection of parameters to add to the query string portion of the request URI.
1851-
If the value is <c>null</c>, no parameters are added to the query string.
1852-
</param>
1853-
<param name="settings">
1854-
The settings to use for the request. If the value is <c>null</c>, an implementation-specific
1855-
set of default settings will be used for the request.
1856-
</param>
1857-
<returns>Returns a <see cref="T:JSIStudios.SimpleRESTServices.Client.Response" /> object containing the HTTP status code, headers,
1858-
and body from the REST response.</returns>
1859-
<exception cref="T:System.ArgumentNullException">If <paramref name="url" /> is <c>null</c>.</exception>
1860-
<exception cref="T:System.NotSupportedException">If <paramref name="method" /> is not supported by the service.</exception>
1861-
</member>
1862-
<member name="M:JSIStudios.SimpleRESTServices.Client.Json.JsonRestServices.Stream(System.Uri,JSIStudios.SimpleRESTServices.Client.HttpMethod,System.Func{System.Net.HttpWebResponse,System.Boolean,JSIStudios.SimpleRESTServices.Client.Response},System.IO.Stream,System.Int32,System.Int64,System.Collections.Generic.Dictionary{System.String,System.String},System.Collections.Generic.Dictionary{System.String,System.String},JSIStudios.SimpleRESTServices.Client.RequestSettings,System.Action{System.Int64})">
1863-
<summary>
1864-
Executes a REST request with a <see cref="T:System.IO.Stream" /><paramref name="content" />
1865-
and user-defined callback function for constructing the resulting <see cref="T:JSIStudios.SimpleRESTServices.Client.Response" />
1866-
object.
1867-
</summary>
1868-
<param name="url">The base URI.</param>
1869-
<param name="method">The HTTP method to use for the request.</param>
1870-
<param name="responseBuilderCallback">A user-specified function used to construct the resulting <see cref="T:JSIStudios.SimpleRESTServices.Client.Response" />
1871-
object from the <see cref="T:System.Net.HttpWebResponse" /> and a Boolean value specifying whether or not a <see cref="T:System.Net.WebException" />
1872-
was thrown during the request. If this value is <c>null</c>, this method is equivalent to calling
1873-
<see cref="M:JSIStudios.SimpleRESTServices.Client.RestServiceBase.Stream(System.Uri,JSIStudios.SimpleRESTServices.Client.HttpMethod,System.IO.Stream,System.Int32,System.Int64,System.Collections.Generic.Dictionary{System.String,System.String},System.Collections.Generic.Dictionary{System.String,System.String},JSIStudios.SimpleRESTServices.Client.RequestSettings,System.Action{System.Int64})" />.</param>
1874-
<param name="content">A stream providing the body of the request.</param>
1875-
<param name="bufferSize">
1876-
The size of the buffer used for copying data from <paramref name="content" /> to the
1877-
HTTP request stream.
1878-
</param>
1879-
<param name="maxReadLength">
1880-
The maximum number of bytes to send with the request. This parameter is optional.
1881-
If the value is 0, the request will include all data from <paramref name="content" />.
1882-
</param>
1883-
<param name="headers">
1884-
A collection of custom HTTP headers to include with the request. This parameter is
1885-
optional. If the value is <c>null</c>, no custom headers are added to the HTTP request.
1886-
</param>
1887-
<param name="queryStringParameters">
1888-
A collection of parameters to add to the query string portion of the request URI.
1889-
This parameter is optional. If the value is <c>null</c>, no parameters are added
1890-
to the query string.
1891-
</param>
1892-
<param name="settings">
1893-
The settings to use for the request. This parameters is optional. If the value is
1894-
<c>null</c>, an implementation-specific set of default settings will be used for the request.
1895-
</param>
1896-
<param name="progressUpdated">
1897-
A user-defined callback function for reporting progress of the send operation.
1898-
This parameter is optional. If the value is <c>null</c>, the method does not report
1899-
progress updates to the caller.
1900-
</param>
1901-
<param name="contents">
1902-
<markup>
1903-
<include item="SMCMissingParamTag">
1904-
<parameter>param</parameter>
1905-
<parameter>contents</parameter>
1906-
<parameter>M:JSIStudios.SimpleRESTServices.Client.Json.JsonRestServices.Stream(System.Uri,JSIStudios.SimpleRESTServices.Client.HttpMethod,System.Func{System.Net.HttpWebResponse,System.Boolean,JSIStudios.SimpleRESTServices.Client.Response},System.IO.Stream,System.Int32,System.Int64,System.Collections.Generic.Dictionary{System.String,System.String},System.Collections.Generic.Dictionary{System.String,System.String},JSIStudios.SimpleRESTServices.Client.RequestSettings,System.Action{System.Int64})</parameter>
1907-
</include>
1908-
</markup>
1909-
</param>
1910-
<returns>Returns a <see cref="T:JSIStudios.SimpleRESTServices.Client.Response" /> object containing the HTTP status code, headers,
1911-
and body from the REST response.</returns>
1912-
<exception cref="T:System.ArgumentNullException">
1913-
If <paramref name="url" /> is <c>null</c>.
1914-
<para>-or-</para><para>If <paramref name="content" /> is <c>null</c>.</para></exception>
1915-
<exception cref="T:System.ArgumentOutOfRangeException">
1916-
If <paramref name="bufferSize" /> is less than or equal to zero.
1917-
<para>-or-</para><para>If <paramref name="maxReadLength" /> is less than zero.</para></exception>
1918-
<exception cref="T:System.NotSupportedException">If <paramref name="method" /> is not supported by the service.</exception>
1919-
</member>
19201840
<member name="T:JSIStudios.SimpleRESTServices.Client.Json.JsonStringSerializer">
19211841
<summary>
19221842
Provides a default implementation of <see cref="T:JSIStudios.SimpleRESTServices.Client.IStringSerializer" /> using JSON for

src/testing/integration/integration.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
<SpecificVersion>False</SpecificVersion>
4646
<HintPath>..\..\packages\SSH.NET.2013.4.7\lib\net40\Renci.SshNet.dll</HintPath>
4747
</Reference>
48-
<Reference Include="SimpleRESTServices, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL">
48+
<Reference Include="SimpleRESTServices, Version=1.1.3.0, Culture=neutral, processorArchitecture=MSIL">
4949
<SpecificVersion>False</SpecificVersion>
50-
<HintPath>..\..\packages\SimpleRESTServices.1.1.2.0\lib\net40\SimpleRESTServices.dll</HintPath>
50+
<HintPath>..\..\packages\SimpleRESTServices.1.1.3.0\lib\net40\SimpleRESTServices.dll</HintPath>
5151
</Reference>
5252
<Reference Include="System" />
5353
<Reference Include="System.Configuration" />

0 commit comments

Comments
 (0)