|
18 | 18 | using System;
|
19 | 19 | using Microsoft.AspNetCore.Hosting.Server;
|
20 | 20 | using Microsoft.AspNetCore.Http;
|
21 |
| -using Microsoft.AspNetCore.Http.Features; |
22 | 21 | using Microsoft.AspNetCore.Http.Internal;
|
23 | 22 | using Microsoft.AspNetCore.Server.Features;
|
| 23 | +using Microsoft.Extensions.ObjectPool; |
24 | 24 | using Microsoft.Net.Http.Server;
|
25 | 25 |
|
26 | 26 | namespace Microsoft.AspNetCore.Server.WebListener
|
27 | 27 | {
|
28 | 28 | internal static class Utilities
|
29 | 29 | {
|
30 |
| - // When tests projects are run in parallel, overlapping port ranges can cause a race condition when looking for free |
31 |
| - // ports during dynamic port allocation. To avoid this, make sure the port range here is different from the range in |
| 30 | + // When tests projects are run in parallel, overlapping port ranges can cause a race condition when looking for free |
| 31 | + // ports during dynamic port allocation. To avoid this, make sure the port range here is different from the range in |
32 | 32 | // Microsoft.Net.Http.Server.
|
33 | 33 | private const int BasePort = 5001;
|
34 | 34 | private const int MaxPort = 8000;
|
35 | 35 | private static int NextPort = BasePort;
|
36 | 36 | private static object PortLock = new object();
|
37 |
| - private static IHttpContextFactory Factory = new HttpContextFactory(new HttpContextAccessor()); |
| 37 | + private static IHttpContextFactory Factory = new HttpContextFactory( |
| 38 | + new DefaultObjectPoolProvider(), |
| 39 | + new HttpContextAccessor()); |
38 | 40 |
|
39 | 41 | internal static IServer CreateHttpServer(out string baseAddress, RequestDelegate app)
|
40 | 42 | {
|
|
0 commit comments