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

Commit 0b3f4df

Browse files
committed
fix build
1 parent 5a1973f commit 0b3f4df

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

src/Microsoft.AspNetCore.Sockets.Http/HttpConnectionDispatcher.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private async Task ExecuteEndpointAsync(HttpContext context, SocketDelegate sock
101101
return;
102102
}
103103

104-
if (!await EnsureConnectionStateAsync(connection, context, TransportType.ServerSentEvents, supportedTransports, logScope))
104+
if (!await EnsureConnectionStateAsync(connection, context, TransportType.ServerSentEvents, supportedTransports, logScope, options))
105105
{
106106
// Bad connection state. It's already set the response status code.
107107
return;
@@ -127,7 +127,7 @@ private async Task ExecuteEndpointAsync(HttpContext context, SocketDelegate sock
127127
return;
128128
}
129129

130-
if (!await EnsureConnectionStateAsync(connection, context, TransportType.WebSockets, supportedTransports, logScope))
130+
if (!await EnsureConnectionStateAsync(connection, context, TransportType.WebSockets, supportedTransports, logScope, options))
131131
{
132132
// Bad connection state. It's already set the response status code.
133133
return;
@@ -154,7 +154,7 @@ private async Task ExecuteEndpointAsync(HttpContext context, SocketDelegate sock
154154
return;
155155
}
156156

157-
if (!await EnsureConnectionStateAsync(connection, context, TransportType.LongPolling, supportedTransports, logScope))
157+
if (!await EnsureConnectionStateAsync(connection, context, TransportType.LongPolling, supportedTransports, logScope, options))
158158
{
159159
// Bad connection state. It's already set the response status code.
160160
return;
@@ -220,7 +220,7 @@ private async Task ExecuteEndpointAsync(HttpContext context, SocketDelegate sock
220220
var longPolling = new LongPollingTransport(timeoutSource.Token, options.LongPolling.PollTimeout, connection.Application.Reader, connection.ConnectionId, _loggerFactory);
221221

222222
// Start the transport
223-
connection.TransportTask = longPolling.ProcessRequestAsync(connection, context, tokenSource.Token);
223+
connection.TransportTask = longPolling.ProcessRequestAsync(context, tokenSource.Token);
224224

225225
// Start the timeout after we return from creating the transport task
226226
timeoutSource.CancelAfter(options.LongPolling.PollTimeout);
@@ -324,7 +324,7 @@ private async Task DoPersistentConnection(SocketDelegate socketDelegate,
324324
connection.ApplicationTask = ExecuteApplication(socketDelegate, connection);
325325

326326
// Start the transport
327-
connection.TransportTask = transport.ProcessRequestAsync(connection, context, context.RequestAborted);
327+
connection.TransportTask = transport.ProcessRequestAsync(context, context.RequestAborted);
328328
}
329329
finally
330330
{
@@ -446,7 +446,7 @@ private async Task ProcessSend(HttpContext context)
446446
}
447447
}
448448

449-
private async Task<bool> EnsureConnectionStateAsync(DefaultConnectionContext connection, HttpContext context, TransportType transportType, TransportType supportedTransports, ConnectionLogScope logScope)
449+
private async Task<bool> EnsureConnectionStateAsync(DefaultConnectionContext connection, HttpContext context, TransportType transportType, TransportType supportedTransports, ConnectionLogScope logScope, HttpSocketOptions options)
450450
{
451451
if ((supportedTransports & transportType) == 0)
452452
{
@@ -473,7 +473,7 @@ private async Task<bool> EnsureConnectionStateAsync(DefaultConnectionContext con
473473
// Configure transport-specific features.
474474
if (transportType == TransportType.LongPolling)
475475
{
476-
connection.Features.Set<IConnectionInherentKeepAliveFeature>(new ConnectionInherentKeepAliveFeature(_timeout));
476+
connection.Features.Set<IConnectionInherentKeepAliveFeature>(new ConnectionInherentKeepAliveFeature(options.LongPolling.PollTimeout));
477477
}
478478

479479
// Setup the connection state from the http context

src/Microsoft.AspNetCore.Sockets.Http/Internal/Transports/LongPollingTransport.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public LongPollingTransport(CancellationToken timeoutToken, TimeSpan timeout, Ch
2929
_logger = loggerFactory.CreateLogger<LongPollingTransport>();
3030
}
3131

32-
public async Task ProcessRequestAsync(ConnectionContext connection, HttpContext context, CancellationToken token)
32+
public async Task ProcessRequestAsync(HttpContext context, CancellationToken token)
3333
{
3434
try
3535
{

src/Microsoft.AspNetCore.Sockets.Http/Internal/Transports/ServerSentEventsTransport.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public ServerSentEventsTransport(ChannelReader<byte[]> application, string conne
2626
_logger = loggerFactory.CreateLogger<ServerSentEventsTransport>();
2727
}
2828

29-
public async Task ProcessRequestAsync(ConnectionContext connection, HttpContext context, CancellationToken token)
29+
public async Task ProcessRequestAsync(HttpContext context, CancellationToken token)
3030
{
3131
context.Response.ContentType = "text/event-stream";
3232
context.Response.Headers["Cache-Control"] = "no-cache";

src/Microsoft.AspNetCore.Sockets.Http/Internal/Transports/WebSocketsTransport.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public WebSocketsTransport(WebSocketOptions options, Channel<byte[]> application
4343
_logger = loggerFactory.CreateLogger<WebSocketsTransport>();
4444
}
4545

46-
public async Task ProcessRequestAsync(ConnectionContext connection, HttpContext context, CancellationToken token)
46+
public async Task ProcessRequestAsync(HttpContext context, CancellationToken token)
4747
{
4848
Debug.Assert(context.WebSockets.IsWebSocketRequest, "Not a websocket request");
4949

test/Microsoft.AspNetCore.Sockets.Tests/LongPollingTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public async Task Set204StatusCodeWhenChannelComplete()
2929

3030
Assert.True(toTransport.Writer.TryComplete());
3131

32-
await poll.ProcessRequestAsync(connection, context, context.RequestAborted).OrTimeout();
32+
await poll.ProcessRequestAsync(context, context.RequestAborted).OrTimeout();
3333

3434
Assert.Equal(204, context.Response.StatusCode);
3535
}
@@ -47,7 +47,7 @@ public async Task Set200StatusCodeWhenTimeoutTokenFires()
4747

4848
using (var cts = CancellationTokenSource.CreateLinkedTokenSource(timeoutToken, context.RequestAborted))
4949
{
50-
await poll.ProcessRequestAsync(connection, context, cts.Token).OrTimeout();
50+
await poll.ProcessRequestAsync(context, cts.Token).OrTimeout();
5151

5252
Assert.Equal(0, context.Response.ContentLength);
5353
Assert.Equal(200, context.Response.StatusCode);
@@ -70,7 +70,7 @@ public async Task FrameSentAsSingleResponse()
7070

7171
Assert.True(toTransport.Writer.TryComplete());
7272

73-
await poll.ProcessRequestAsync(connection, context, context.RequestAborted).OrTimeout();
73+
await poll.ProcessRequestAsync(context, context.RequestAborted).OrTimeout();
7474

7575
Assert.Equal(200, context.Response.StatusCode);
7676
Assert.Equal("Hello World", Encoding.UTF8.GetString(ms.ToArray()));
@@ -94,7 +94,7 @@ public async Task MultipleFramesSentAsSingleResponse()
9494

9595
Assert.True(toTransport.Writer.TryComplete());
9696

97-
await poll.ProcessRequestAsync(connection, context, context.RequestAborted).OrTimeout();
97+
await poll.ProcessRequestAsync(context, context.RequestAborted).OrTimeout();
9898

9999
Assert.Equal(200, context.Response.StatusCode);
100100

@@ -117,7 +117,7 @@ public async Task SetsInherentKeepAliveFeatureOnFirstPoll()
117117

118118
Assert.True(toTransport.Writer.TryComplete());
119119

120-
await poll.ProcessRequestAsync(connection, context, context.RequestAborted).OrTimeout();
120+
await poll.ProcessRequestAsync(context, context.RequestAborted).OrTimeout();
121121

122122
Assert.NotNull(connection.Features.Get<IConnectionInherentKeepAliveFeature>());
123123
Assert.Equal(pollTimeout, connection.Features.Get<IConnectionInherentKeepAliveFeature>().KeepAliveInterval);

test/Microsoft.AspNetCore.Sockets.Tests/ServerSentEventsTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public async Task SSESetsContentType()
2727

2828
Assert.True(toTransport.Writer.TryComplete());
2929

30-
await sse.ProcessRequestAsync(connection, context, context.RequestAborted);
30+
await sse.ProcessRequestAsync(context, context.RequestAborted);
3131

3232
Assert.Equal("text/event-stream", context.Response.ContentType);
3333
Assert.Equal("no-cache", context.Response.Headers["Cache-Control"]);
@@ -47,7 +47,7 @@ public async Task SSETurnsResponseBufferingOff()
4747

4848
Assert.True(toTransport.Writer.TryComplete());
4949

50-
await sse.ProcessRequestAsync(connection, context, context.RequestAborted);
50+
await sse.ProcessRequestAsync(context, context.RequestAborted);
5151

5252
Assert.True(feature.ResponseBufferingDisabled);
5353
}
@@ -67,7 +67,7 @@ public async Task SSEWritesMessages()
6767
context.Response.Body = ms;
6868
var sse = new ServerSentEventsTransport(toTransport.Reader, connectionId: string.Empty, loggerFactory: new LoggerFactory());
6969

70-
var task = sse.ProcessRequestAsync(connection, context, context.RequestAborted);
70+
var task = sse.ProcessRequestAsync(context, context.RequestAborted);
7171

7272
await toTransport.Writer.WriteAsync(Encoding.ASCII.GetBytes("Hello"));
7373

@@ -97,7 +97,7 @@ public async Task SSEAddsAppropriateFraming(string message, string expected)
9797

9898
Assert.True(toTransport.Writer.TryComplete());
9999

100-
await sse.ProcessRequestAsync(connection, context, context.RequestAborted);
100+
await sse.ProcessRequestAsync(context, context.RequestAborted);
101101

102102
Assert.Equal(expected, Encoding.UTF8.GetString(ms.ToArray()));
103103
}

0 commit comments

Comments
 (0)