Skip to content

Commit 4f58c29

Browse files
committed
PR Cleanup
1 parent 5880415 commit 4f58c29

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/Servers/HttpSys/src/HttpSysOptions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public string RequestQueueName
9595
/// <summary>
9696
/// Gets or sets the maximum number of concurrent connections to accept, -1 for infinite, or null to
9797
/// use the machine wide setting from the registry. The default value is null.
98-
/// This settings do not apply when attaching to an existing queue.
98+
/// This settings does not apply when attaching to an existing queue.
9999
/// </summary>
100100
public long? MaxConnections
101101
{
@@ -118,7 +118,7 @@ public long? MaxConnections
118118

119119
/// <summary>
120120
/// Gets or sets the maximum number of requests that will be queued up in Http.Sys.
121-
/// This settings do not apply when attaching to an existing queue.
121+
/// This settings does not apply when attaching to an existing queue.
122122
/// </summary>
123123
public long RequestQueueLimit
124124
{
@@ -133,7 +133,7 @@ public long RequestQueueLimit
133133
throw new ArgumentOutOfRangeException(nameof(value), value, "The value must be greater than zero.");
134134
}
135135

136-
if (_requestQueue != null && _requestQueue.Created)
136+
if (_requestQueue != null)
137137
{
138138
_requestQueue.SetLengthLimit(_requestQueueLength);
139139
}
@@ -174,7 +174,7 @@ public long? MaxRequestBodySize
174174
/// Gets or sets a value that controls how http.sys reacts when rejecting requests due to throttling conditions - like when the request
175175
/// queue limit is reached. The default in http.sys is "Basic" which means http.sys is just resetting the TCP connection. IIS uses Limited
176176
/// as its default behavior which will result in sending back a 503 - Service Unavailable back to the client.
177-
/// These settings do not apply when attaching to an existing queue.
177+
/// This settings does not apply when attaching to an existing queue.
178178
/// </summary>
179179
public Http503VerbosityLevel Http503Verbosity
180180
{

src/Servers/HttpSys/src/NativeInterop/RequestQueue.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5+
using System.Diagnostics;
56
using System.Runtime.InteropServices;
67
using System.Threading;
78
using Microsoft.AspNetCore.HttpSys.Internal;
@@ -42,7 +43,7 @@ internal RequestQueue(UrlGroup urlGroup, string requestQueueName, RequestQueueMo
4243

4344
if (_mode == RequestQueueMode.CreateOrAttach && statusCode == UnsafeNclNativeMethods.ErrorCodes.ERROR_ALREADY_EXISTS)
4445
{
45-
// Tried to create, but it already exist so attach to it instead.
46+
// Tried to create, but it already exists so attach to it instead.
4647
Created = false;
4748
flags = HttpApiTypes.HTTP_CREATE_REQUEST_QUEUE_FLAG.OpenExisting;
4849
statusCode = HttpApi.HttpCreateRequestQueue(
@@ -87,7 +88,7 @@ internal RequestQueue(UrlGroup urlGroup, string requestQueueName, RequestQueueMo
8788
}
8889

8990
/// <summary>
90-
/// Set true if we created queue instead of attaching to existing
91+
/// True if this instace created the queue instead of attaching to an existing one.
9192
/// </summary>
9293
internal bool Created { get; }
9394

@@ -96,6 +97,7 @@ internal RequestQueue(UrlGroup urlGroup, string requestQueueName, RequestQueueMo
9697

9798
internal unsafe void AttachToUrlGroup()
9899
{
100+
Debug.Assert(Created);
99101
CheckDisposed();
100102
// Set the association between request queue and url group. After this, requests for registered urls will
101103
// get delivered to this request queue.
@@ -112,6 +114,7 @@ internal unsafe void AttachToUrlGroup()
112114

113115
internal unsafe void DetachFromUrlGroup()
114116
{
117+
Debug.Assert(Created);
115118
CheckDisposed();
116119
// Break the association between request queue and url group. After this, requests for registered urls
117120
// will get 503s.
@@ -132,6 +135,7 @@ internal unsafe void DetachFromUrlGroup()
132135
// The listener must be active for this to work.
133136
internal unsafe void SetLengthLimit(long length)
134137
{
138+
Debug.Assert(Created);
135139
CheckDisposed();
136140

137141
var result = HttpApi.HttpSetRequestQueueProperty(Handle,
@@ -147,6 +151,7 @@ internal unsafe void SetLengthLimit(long length)
147151
// The listener must be active for this to work.
148152
internal unsafe void SetRejectionVerbosity(Http503VerbosityLevel verbosity)
149153
{
154+
Debug.Assert(Created);
150155
CheckDisposed();
151156

152157
var result = HttpApi.HttpSetRequestQueueProperty(Handle,

src/Servers/HttpSys/src/RequestProcessing/Request.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
using System.Security.Principal;
1212
using System.Threading;
1313
using System.Threading.Tasks;
14-
using Microsoft.AspNetCore.Builder;
15-
using Microsoft.AspNetCore.Http;
1614
using Microsoft.AspNetCore.HttpSys.Internal;
1715

1816
namespace Microsoft.AspNetCore.Server.HttpSys

0 commit comments

Comments
 (0)