File tree Expand file tree Collapse file tree 5 files changed +6
-7
lines changed
Servers/Kestrel/Core/src/Internal/Http Expand file tree Collapse file tree 5 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -23,5 +23,5 @@ public interface IHttpConnectFeature
23
23
/// Send the response headers with a 200 status code and transition to opaque streaming.
24
24
/// </summary>
25
25
/// <returns>An opaque bidirectional stream.</returns>
26
- Task < Stream > AcceptAsync ( ) ;
26
+ ValueTask < Stream > AcceptAsync ( ) ;
27
27
}
Original file line number Diff line number Diff line change 1
1
#nullable enable
2
2
Microsoft.AspNetCore.Http.Features.IHttpConnectFeature
3
- Microsoft.AspNetCore.Http.Features.IHttpConnectFeature.AcceptAsync() -> System.Threading.Tasks.Task <System.IO.Stream!>!
3
+ Microsoft.AspNetCore.Http.Features.IHttpConnectFeature.AcceptAsync() -> System.Threading.Tasks.ValueTask <System.IO.Stream!>
4
4
Microsoft.AspNetCore.Http.Features.IHttpConnectFeature.IsConnectRequest.get -> bool
5
- Microsoft.AspNetCore.Http.Features.IHttpConnectFeature.Protocol.get -> string!
5
+ Microsoft.AspNetCore.Http.Features.IHttpConnectFeature.Protocol.get -> string?
Original file line number Diff line number Diff line change 6
6
using Microsoft . AspNetCore . Builder ;
7
7
using Microsoft . AspNetCore . Http ;
8
8
using Microsoft . AspNetCore . Http . Features ;
9
- using Microsoft . AspNetCore . Server . Kestrel . Core . Features ;
10
9
using Microsoft . Extensions . Logging ;
11
10
using Microsoft . Extensions . Options ;
12
11
using Microsoft . Extensions . Primitives ;
Original file line number Diff line number Diff line change @@ -61,14 +61,14 @@ public sealed class ConnectFeature : IHttpConnectFeature
61
61
public Stream Stream { get ; set ; } = Stream . Null ;
62
62
63
63
/// <inheritdoc/>
64
- public Task < Stream > AcceptAsync ( )
64
+ public ValueTask < Stream > AcceptAsync ( )
65
65
{
66
66
if ( ! IsConnectRequest )
67
67
{
68
68
throw new InvalidOperationException ( "This is not a CONNECT request." ) ;
69
69
}
70
70
71
- return Task . FromResult ( Stream ) ;
71
+ return new ValueTask < Stream > ( Stream ) ;
72
72
}
73
73
}
74
74
}
Original file line number Diff line number Diff line change @@ -288,7 +288,7 @@ async Task<Stream> IHttpUpgradeFeature.UpgradeAsync()
288
288
return _bodyControl ! . Upgrade ( ) ;
289
289
}
290
290
291
- async Task < Stream > IHttpConnectFeature . AcceptAsync ( )
291
+ async ValueTask < Stream > IHttpConnectFeature . AcceptAsync ( )
292
292
{
293
293
if ( ! IsConnectRequest )
294
294
{
You can’t perform that action at this time.
0 commit comments