Skip to content

Commit f97debe

Browse files
committed
PR feedback
1 parent 7834169 commit f97debe

8 files changed

+7
-38
lines changed

src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.Generated.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Collections;
66
using System.Collections.Generic;
77
using System.Runtime.CompilerServices;
8+
89
using Microsoft.AspNetCore.Connections.Features;
910
using Microsoft.AspNetCore.Http.Features;
1011
using Microsoft.AspNetCore.Http.Features.Authentication;

src/Servers/Kestrel/Transport.Quic/src/Internal/QuicStreamContext.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ public override string ConnectionId
132132

133133
public void Start()
134134
{
135+
Debug.Assert(_processingTask.IsCompletedSuccessfully);
136+
135137
_processingTask = StartAsync();
136138
}
137139

src/Servers/Kestrel/Transport.Quic/test/QuicConnectionContextTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ public async Task StreamPool_ManyConcurrentStreams_StreamPoolFull()
404404
// TODO: Race condition in QUIC library.
405405
// Delay between sending streams to avoid
406406
// https://github.com/dotnet/runtime/issues/55249
407-
await Task.Delay(50);
407+
await Task.Delay(100);
408408
streamTasks.Add(SendStream(requestState));
409409
}
410410

src/Servers/Kestrel/shared/PooledStreamStack.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ internal interface IPooledStream
1414
void DisposeCore();
1515
}
1616

17-
// See https://github.com/dotnet/runtime/blob/master/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/BufferSegmentStack.cs
17+
// See https://github.com/dotnet/runtime/blob/da9b16f2804e87c9c1ca9dcd9036e7b53e724f5d/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/BufferSegmentStack.cs
1818
internal struct PooledStreamStack<TValue> where TValue : class, IPooledStream
1919
{
2020
// Internal for testing
@@ -139,6 +139,7 @@ private static int CalculateRemoveCount(long now, int size, StreamAsValueType[]
139139
return size;
140140
}
141141

142+
// See https://github.com/dotnet/runtime/blob/da9b16f2804e87c9c1ca9dcd9036e7b53e724f5d/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/BufferSegmentStack.cs#L68-L79
142143
internal readonly struct StreamAsValueType
143144
{
144145
private readonly TValue _value;

src/Servers/Kestrel/shared/TransportMultiplexedConnection.FeatureCollection.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ internal partial class TransportMultiplexedConnection
1616
// and the code generator re-reun, which will change the interface list.
1717
// See also: tools/CodeGenerator/TransportConnectionFeatureCollection.cs
1818

19-
private IDictionary<object, object?>? _persistentState;
20-
2119
MemoryPool<byte> IMemoryPoolFeature.MemoryPool => MemoryPool;
2220

2321
IDictionary<object, object?> IConnectionItemsFeature.Items
@@ -33,14 +31,5 @@ CancellationToken IConnectionLifetimeFeature.ConnectionClosed
3331
}
3432

3533
void IConnectionLifetimeFeature.Abort() => Abort(new ConnectionAbortedException("The connection was aborted by the application via IConnectionLifetimeFeature.Abort()."));
36-
37-
IDictionary<object, object?> IPersistentStateFeature.State
38-
{
39-
get
40-
{
41-
// Lazily allocate persistent state
42-
return _persistentState ?? (_persistentState = new ConnectionItems());
43-
}
44-
}
4534
}
4635
}

src/Servers/Kestrel/shared/TransportMultiplexedConnection.Generated.cs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@ namespace Microsoft.AspNetCore.Connections
1616
internal partial class TransportMultiplexedConnection : IFeatureCollection,
1717
IConnectionIdFeature,
1818
IConnectionItemsFeature,
19-
IPersistentStateFeature,
2019
IMemoryPoolFeature,
2120
IConnectionLifetimeFeature
2221
{
2322
// Implemented features
2423
internal protected IConnectionIdFeature? _currentIConnectionIdFeature;
2524
internal protected IConnectionItemsFeature? _currentIConnectionItemsFeature;
26-
internal protected IPersistentStateFeature? _currentIPersistentStateFeature;
2725
internal protected IMemoryPoolFeature? _currentIMemoryPoolFeature;
2826
internal protected IConnectionLifetimeFeature? _currentIConnectionLifetimeFeature;
2927

@@ -38,7 +36,6 @@ private void FastReset()
3836
{
3937
_currentIConnectionIdFeature = this;
4038
_currentIConnectionItemsFeature = this;
41-
_currentIPersistentStateFeature = this;
4239
_currentIMemoryPoolFeature = this;
4340
_currentIConnectionLifetimeFeature = this;
4441

@@ -126,10 +123,6 @@ private void ExtraFeatureSet(Type key, object? value)
126123
{
127124
feature = _currentIConnectionItemsFeature;
128125
}
129-
else if (key == typeof(IPersistentStateFeature))
130-
{
131-
feature = _currentIPersistentStateFeature;
132-
}
133126
else if (key == typeof(IMemoryPoolFeature))
134127
{
135128
feature = _currentIMemoryPoolFeature;
@@ -162,10 +155,6 @@ private void ExtraFeatureSet(Type key, object? value)
162155
{
163156
_currentIConnectionItemsFeature = (IConnectionItemsFeature?)value;
164157
}
165-
else if (key == typeof(IPersistentStateFeature))
166-
{
167-
_currentIPersistentStateFeature = (IPersistentStateFeature?)value;
168-
}
169158
else if (key == typeof(IMemoryPoolFeature))
170159
{
171160
_currentIMemoryPoolFeature = (IMemoryPoolFeature?)value;
@@ -200,10 +189,6 @@ private void ExtraFeatureSet(Type key, object? value)
200189
{
201190
feature = Unsafe.As<IConnectionItemsFeature?, TFeature?>(ref _currentIConnectionItemsFeature);
202191
}
203-
else if (typeof(TFeature) == typeof(IPersistentStateFeature))
204-
{
205-
feature = Unsafe.As<IPersistentStateFeature?, TFeature?>(ref _currentIPersistentStateFeature);
206-
}
207192
else if (typeof(TFeature) == typeof(IMemoryPoolFeature))
208193
{
209194
feature = Unsafe.As<IMemoryPoolFeature?, TFeature?>(ref _currentIMemoryPoolFeature);
@@ -239,10 +224,6 @@ private void ExtraFeatureSet(Type key, object? value)
239224
{
240225
_currentIConnectionItemsFeature = Unsafe.As<TFeature?, IConnectionItemsFeature?>(ref feature);
241226
}
242-
else if (typeof(TFeature) == typeof(IPersistentStateFeature))
243-
{
244-
_currentIPersistentStateFeature = Unsafe.As<TFeature?, IPersistentStateFeature?>(ref feature);
245-
}
246227
else if (typeof(TFeature) == typeof(IMemoryPoolFeature))
247228
{
248229
_currentIMemoryPoolFeature = Unsafe.As<TFeature?, IMemoryPoolFeature?>(ref feature);
@@ -271,10 +252,6 @@ private IEnumerable<KeyValuePair<Type, object>> FastEnumerable()
271252
{
272253
yield return new KeyValuePair<Type, object>(typeof(IConnectionItemsFeature), _currentIConnectionItemsFeature);
273254
}
274-
if (_currentIPersistentStateFeature != null)
275-
{
276-
yield return new KeyValuePair<Type, object>(typeof(IPersistentStateFeature), _currentIPersistentStateFeature);
277-
}
278255
if (_currentIMemoryPoolFeature != null)
279256
{
280257
yield return new KeyValuePair<Type, object>(typeof(IMemoryPoolFeature), _currentIMemoryPoolFeature);

src/Servers/Kestrel/tools/CodeGenerator/HttpProtocolFeatureCollection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public static string GenerateFile()
8181
};
8282

8383
var usings = $@"
84+
using Microsoft.AspNetCore.Connections.Features;
8485
using Microsoft.AspNetCore.Http.Features;
8586
using Microsoft.AspNetCore.Http.Features.Authentication;
8687
using Microsoft.AspNetCore.Server.Kestrel.Core.Features;";

src/Servers/Kestrel/tools/CodeGenerator/TransportMultiplexedConnectionFeatureCollection.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@ public static string GenerateFile()
1616
"IConnectionIdFeature",
1717
"IConnectionTransportFeature",
1818
"IConnectionItemsFeature",
19-
"IPersistentStateFeature",
2019
"IMemoryPoolFeature",
2120
"IConnectionLifetimeFeature"
2221
};
2322
var implementedFeatures = new[]
2423
{
2524
"IConnectionIdFeature",
2625
"IConnectionItemsFeature",
27-
"IPersistentStateFeature",
2826
"IMemoryPoolFeature",
2927
"IConnectionLifetimeFeature"
3028
};

0 commit comments

Comments
 (0)