Commit Graph

51 Commits

Author SHA1 Message Date
Nate McMaster 83958886cc
Implement IHttpRequestIdentifierFeature on Frame
This feature generates a unique ID per request. This unique ID can be
used in event source and logging.

Also, this change improves KestrelEventSource by moving it back into the
Kestrel.Core assembly and de-coupling from the Libuv transport. This
adds two new events, RequestStart and RequestStop, which can be used to
identify the correlation between connection ID and request trace
identifier.
2017-03-31 16:54:35 -07:00
David Fowler 1bf9b057d4 Converted test projects to run on netcoreapp2.0
* Converted test projects to run on netcoreapp2.0
* Set DOTNET_RUNTME_ID because of an issue in corehost and RID calculation.
2017-03-31 02:58:18 -07:00
David Fowler c3ad007b0d Fixed regression caused by transport refactoring (#1573)
* Fixed regression caused by transport refactoring
- Libuv should not close the socket until it has started it. Before this was enforced
by calling ReadStart before starting the frame but the flow has changed. Now that closing the connection
is communicated via the pipe, we need to start consuming writes after calling ReadStart.
- Renamed OnSocketClosed to Close and moved dispose and logging into that method.

Fixes #1571
2017-03-30 09:33:28 -07:00
Stephen Halter 7f785588ef Transport agnostic kestrel refactoring (#1551)
- Add transport interfaces
- Create separate Core and Libuv projects

#828
2017-03-29 16:06:05 -07:00
Pranav K d6d13a0986 Remove net451 as a cross-compile target 2017-03-24 07:44:11 -07:00
Ben Adams ff99c4c865 Fix benchmarks (broken) (#1515)
* Fix benchmarks
* Remove Moq from benchmarks
2017-03-22 18:30:06 -07:00
David Fowler cf576559b6 Fix write after close (#1526)
- Change Alloc to be a Write with a callback that exposes the WritableBuffer.
This allows the ISocketOutput to implementation to not call the callback if
the underlying socket is dead.
- Added a new functional test
2017-03-20 23:58:26 -07:00
Stephen Halter 8923b0da70 Use correct config for response buffer limit (#1516) 2017-03-20 15:43:55 -07:00
Pavel Krymets 07cbf7faa9 Use pipelines for SocketOutput
- Changed socket output to be based on pipelines
- Changed connection filter glue to be based on pipelines
- Codegen that used `MemoryPoolIterator` for output now uses `WritableBuffer`
- Made `UvWriteReq` async/await friendly with `LibuvAwaitable<T>`
- Deleted MemoryPool and friends
2017-03-18 00:26:00 -07:00
Cesar Blum Silveira 2ef3804578 Span-based RemoveDotSegments (#1448) 2017-03-17 14:42:13 -07:00
Nate McMaster d4c0d4b81e Adds an EventSource named 'Microsoft-AspNetCore-Server-Kestrel' with the following event and properties:
ConnectionStart:
 - connectionId
 - scheme
 - localEndPoint
 - remoteEndPoint

ConnectionStop:
 - connectionId
2017-03-14 16:59:11 -07:00
Nate McMaster 5073d4fdaf Re-add .NET Framework to tests and other cleanup (#1494) 2017-03-14 11:02:49 -07:00
Ben Adams b94912bcb1 InitializeHeaders only at start of parsing/Fix remaining (#1488)
* Don't reinitialize header collection each loop
* Correct remaining tracking value
* Add tests
2017-03-13 15:32:28 -07:00
Cesar Blum Silveira 49f09d5a25 Log rejected request targets. 2017-03-12 18:37:08 -07:00
Nate McMaster 49b328d4c2 Handle absolute, asterisk, and authority-form request targets
Improves compliance with RFC 7230 on the expected handling of requests
that have URI or asterisk in the request target.

This means rejecting asterisk requests that are not OPTIONS and rejecting
authority-form requests taht are not CONNECT.

This also means the server will handle the path and query on targets
with absolute URIs as request-targets.
2017-03-09 16:54:12 -08:00
Cesar Blum Silveira bb973decb8 Unify header rejection messages.
- Log bad headers with escaped non-vchar characters
2017-03-08 15:27:44 -08:00
Cesar Blum Silveira 5743d740b4 Convert HTTP parsing FrameTests to IHttpParser tests (#1416).
- Also fix an issue in KestrelHttpParser where "Header: \r\n" is
  parsed with a value of " " instead of "".
2017-03-07 15:51:11 -08:00
Ben Adams e2f8c226ef Simplify TakeSingleHeader and Vectorize (#1457)
* Sanitize unsafe code
* Vectorize
* Extract Contains and add more tests
2017-03-07 13:30:57 -08:00
David Fowler 02a4342908 Made changes to TakeSingleHeader (#1453)
* Made changes to TakeSingleHeader
- Remove state machine and just parse in place
- Inline OnHeader into TakeSingleHeader
- Use IndexOfVectorized instead of custom indexof
- Normalize header whitespace error
- Combine IndexOf and IndexOfAny into a single IndexOfNameEnd call
2017-03-07 08:58:55 -08:00
Cesar Blum Silveira 11c7eb5665 Verify all request rejections are logged (#1295). 2017-03-06 12:05:38 -08:00
David Fowler 1d685e195e Parser cleanup and remove line continuation header error (#1431)
- Cleaned up some parsing logic (removed locals etc)
- Removing line continuation errors cleaned up code duplication
a little bit
2017-03-03 10:04:44 -08:00
David Fowler cb6059c143 Make the IHttpParser per frame and add a reset (#1415)
* Make the IHttpParser per frame and add a reset
- Made the IHttpParser a per frame object so state can be stored
across method calls and parses.
- Added HttpParserFactory to ServiceContext
2017-03-01 13:12:03 -08:00
Pavel Krymets d3694f085a Add IHttpParser interface (#1414) 2017-03-01 11:55:36 -08:00
Cesar Blum Silveira 568aaff9c4 Improve HTTP parsing tests (#1393).
- Add several more test cases
- Share data between functional and unit tests
2017-02-28 14:23:27 -08:00
Stephen Halter fde0f6b2fc Add an option to Kestrel to disable threadpool dispatching 2017-02-28 10:14:58 -08:00
Pavel Krymets 990e2a8dc4 Use pass through connection adapter instead of ssl for max buffer size tests (#1391) 2017-02-23 08:04:43 -08:00
Pavel Krymets 824ef2c937 Input Pipeline migration (#1277) 2017-02-17 15:38:13 -08:00
Doug Bunting be9f83b308 Bump test projects up to .NET 4.5.2
- aspnet/Testing#248
- xUnit no longer supports .NET 4.5.1
- build tests for desktop .NET only on Windows
2017-02-14 09:21:44 -08:00
Stephen Halter 5124adf450 Better report Kestrel crashing errors 2017-02-07 00:26:00 -08:00
Cesar Blum Silveira 1a2c438899 Upgrade to RC.3 2017-01-31 16:23:23 -08:00
Stephen Halter f32058c5c3 Warn instead of throw when ignoring IServerAddressesFeature
- Throwing could be too much when IServerAddressesFeature URLs come from VS
- Listen on 127.0.0.1:5000 by default

https://github.com/aspnet/Hosting/issues/917
2017-01-19 11:36:19 -08:00
Stephen Halter 2351c1b558 Create a direct way to configure Kestrel endpoints
- Replace endpoint configuration via .UseUrls() or --server.urls with Listen*
  methods on KestrelSerrverOptions.
- Replace IConnectionFilter with IConnectionAdapter which no longer exposes
  ServerAddress via a context.
- Simplify libuv Listener classes
- Support systemd socket activation
- Add docker-based test for systemd socket activation to be run on Travis
2017-01-06 17:37:58 -08:00
Cesar Blum Silveira b41c4078bd Abort connections not closed during shutdown (#1112). 2016-12-20 14:44:34 -08:00
Cesar Blum Silveira cedbe76f52 Abort request on client FIN (#1139). 2016-12-13 12:03:33 -08:00
Cesar Blum Silveira 51ecbd7949 Add benchmarks for Frame writes. 2016-12-13 11:33:56 -08:00
Stephen Halter b2d45c3dd0 Make TestApplicationErrorLogger thread-safe 2016-11-21 16:31:27 -08:00
Ben Adams 2eba4017c1 MemoryPoolIterator feedback 2016-11-21 22:48:58 +00:00
Ben Adams 8ce47fb8b6 Move perf, share code 2016-11-21 22:48:57 +00:00
Stephen Halter ec89197ecb Add ListenerPrimaryTests 2016-11-09 14:26:47 -08:00
Cesar Blum Silveira 29408956f9 Handle tokens in Transfer-Encoding header (#1181). 2016-10-31 13:57:34 -07:00
Cesar Blum Silveira bf94f8526a Remove TCP Loopback Fast Path code (#1147). 2016-10-12 11:41:57 -07:00
Cesar Blum Silveira f8813a600d Handle response content length mismatches (#175). 2016-10-11 13:25:22 -07:00
Cesar Blum Silveira 4117ad8a1e Refactor non-body response handling.
- Add functional tests
- Remove BadHttpResponse, ResponseRejectionReasons and TestFrameProtectedMembers
- Chunk non-keepalive HTTP/1.1 responses
- Set _canHaveBody to true when StatusCode == 101
- Add test to check that upgraded connections are always closed when the app
  is done
- Log writes on responses to HEAD requests only once.
2016-10-03 16:46:59 -07:00
Cesar Blum Silveira 0312da7df3 Add request headers timeout (#1110). 2016-09-27 17:08:02 -07:00
Cesar Blum Silveira f2085b1968 Add keep-alive timeout (#464). 2016-09-06 12:48:47 -07:00
Cesar Blum Silveira 19f8958fa8 Move TestServer to shared directory. 2016-09-06 12:47:24 -07:00
Cesar Blum Silveira 8836eec7d8 Limit request line length (#784). 2016-08-03 15:39:16 -07:00
Stephen Halter 1020d69171 Better logging for connection errors during HTTPS handshake 2016-08-03 11:15:15 -07:00
Cesar Blum Silveira 20c1bb567d Move TestConnection to the Microsoft.AspNetCore.Testing namespace. 2016-08-02 12:47:06 -07:00
Cesar Blum Silveira 5876e1983a Move TestConnection to shared directory. 2016-08-02 12:30:53 -07:00