- #549, #592
- move feature implementations to `Microsoft.AspNetCore.Http.Features` and `...Authentication.Features`
- move `DefaultHttpContext`, `HttpContextAccessor`, `HttpContextFactory`, `FormCollection` and
`HeaderDictionary` to `Microsoft.AspNetCore.Http`
- move `FormFile` to `Microsoft.AspNetCore.Http.Internal`
- that and `Microsoft.AspNetCore.Http.Authentication.Internal` are the remaining `.Internal` namespaces
nits:
- remove a couple of parameterless constructors
- add / fill subfolders to align with new namespaces
- remove all use of (unnecessary) "T:..." `<see cref=""/>` values
- #561
- new `SetCookieHeaderValue.AppendToStringBuilder()` method; avoids per-call `StringBuilder` allocation
- `ResponseCookies` uses `ObjectPool<StringBuilder>` that `ResponseCookiesFeature` provides
- `ResponseCookies` works fine if no `ObjectPoolProvider` is available
- `IHttpContextFactory` instance is a singleton instantiated from CI
- make `HttpContextFactory` `ObjectPoolProvider` and `ResponseCookiesFeature`-aware
- apply same pattern to sample `PooledHttpContextFactory`
- pool is not currently configurable; defaults are fine for response cookies
- if we need (policy) configuration, would add an `IOptions<HttpContextFactorySettings>`
nit: Add some doc comments
- #590, also related to #561
- move feature interfaces from `Microsoft.AspNetCore.Http` package
- move required classes from `Microsoft.AspNetCore.Http.Abstractions` package
- move `ISession` and `WebSocketAcceptContext` to `Microsoft.AspNetCore.Http` namespace (#590)
nit: remove transient dependencies listed in `Microsoft.AspNetCore.Http.Abstractions`'s `project.json`
Submatch has been sped up by implementing a modified Boyer–Moore–Horspool algorithm with an average-case complexity of O(N) on random text. Worst case, it behaves similarly to the previous implementation O(MN), where M is the length of the boundary and N is the length of the buffer to operate on.
Method SubMatch looks for two things:
1. Whether the byte array segment fully contains the boundary, or
2. Whether the byte array ends with the start of the boundary.
Case 1 is now a lot faster than the previous implementation. Case 2 remains using the same code as before. The method will do Case 1 until the matchOffset is equal to N-M. It then switches to Case 2, unless a match is found.
The code can be further sped up with a full Boyer–Moore implementation, or something more sophisticated. This however can be evaluated in the case that this implementation is insufficiently performant for our main scenarios.
This commit resolves issue #575.
- aspnet/Coherence-Signed#187
- remove `<RootNamespace>` settings but maintain other unique aspects e.g. `<DnxInvisibleContent ... />`
- in a few cases, standardize on VS version `14.0` and not something more specific
- rewrite existing methods in terms of the new ones
- don't allocate multiple 0-length arrays
nits:
- clarify a couple of doc comments e.g. using `<paramref/>`
- move an error message into a resource
- pass parameter names into new resource
- rename parameters for consistency e.g. `inputLength` -> `count`
- name literal `int` parameters
- more `var`
Also correct tests to avoid warnings and to ensure scenarios are actually tested
- tests previously went `async` without waiting for completion
nit: add parameter `null` checks