Commit Graph

602 Commits

Author SHA1 Message Date
Kristian Hellang 75cfe2c3bb Moved GetThreadCount into KestrelServerInformation 2015-12-07 15:38:05 +01:00
Stephen Halter 706ff04160 Merge branch 'benaadams/statemachines' into dev 2015-12-07 00:07:14 -08:00
Stephen Halter c451ce1863 Merge branch 'khellang/thread-count-init' into dev 2015-12-06 23:32:57 -08:00
Kristian Hellang 5eaa7e51c8 Initialize ThreadCount as early as possible
This will allow you to inspect the property
in the Configure method.

Closes #404
2015-12-04 20:55:37 +01:00
Ben Adams 35a06369d7 Pooled block always has pool 2015-12-04 08:23:12 +00:00
Stephen Halter 1c320d7a74 Merge branch 'benaadams/dont-use-default-buffer-size' into dev 2015-12-03 18:28:24 -08:00
Stephen Halter 737aac4cfc Merge branch 'benaadams/over-the-edge' into dev 2015-12-03 18:28:05 -08:00
Ben Adams 858e5ab3a2 Moar stopping power, Timeout is total timout 2015-12-03 23:37:54 +00:00
Ben Adams 1ca67695ed Use pooled memory for filtered stream 2015-12-03 19:17:40 +00:00
Ben Adams 9af9dea72c Smaller default buffer 2015-12-03 18:46:43 +00:00
Ben Adams c41b449681 Lighter & less async sMachines
Selected excerpts from "Value tasks + Less Async" #432
2015-12-03 11:10:20 +00:00
Ben Adams b1e8f0cdea Add IThreadPool interface 2015-12-03 10:37:52 +00:00
Ben Adams 850d2b0c7e Construct ThreadPoolActions in KestrelServer 2015-12-03 09:56:21 +00:00
Ben Adams 5ae9b3c383 Log user code threadpool continuation execptions 2015-12-03 09:56:21 +00:00
Stephen Halter 10490888d3 Merge branch 'tenor/speed-up-date' into dev 2015-12-02 19:52:48 -08:00
Stephen Halter b84d8dbd07 Minor style changes to tenor/speed-up-date
- Removed some code required to support sub-second timer intervals
2015-12-02 19:50:55 -08:00
Stephen Halter 7cbbf68e9d Merge branch 'benaadams/connectionfilter' into dev 2015-12-02 19:21:05 -08:00
Stephen Halter bb2c17a779 Merge branch 'benaadams/req-delegate' into dev 2015-12-02 19:17:16 -08:00
Ben Adams a55be21469 Empty buffer when null buffer 2015-12-03 02:10:36 +00:00
Ben Adams b7c60de98a Don't allocate request processing delegate 2015-12-02 15:23:09 +00:00
John Luo 168f4770f4 Reacting to new IServer and IHttpApplication design 2015-12-01 13:03:46 -08:00
Stephen Halter 0c33cad343 Merge branch 'benaadams/kestrel-thread-api' into dev 2015-12-01 12:20:41 -08:00
Sunny Ahuwanya 6251b8f3e6 Changed timer interval to 1 second. 2015-12-01 09:29:54 -05:00
Cesar Blum Silveira 921c338a40 Support PathBase (#214). 2015-11-30 16:42:02 -08:00
Ben Adams 9102c1bb92 Remove unused IMemoryPool 2015-11-29 10:13:14 +00:00
Ben Adams 2937fc3c98 OnConnection->OnConnectionAsync
Resolves  #433
2015-11-29 03:57:47 +00:00
Sunny Ahuwanya 67a0f2d420 Reverted ISystemClock to use DateTimeOffset 2015-11-28 21:27:51 -05:00
Sunny Ahuwanya 7f025a6bd4 Speed up DateHeaderValueManager
Replaced PumpTimer() method with StartTimer(), introduced StopTimer()
method which pauses timer when idle instead of disposing it,
ISystemClock returns DateTime instead of DateTimeOffset.
2015-11-28 20:15:17 -05:00
David Fowler ea7f40c592 Merge pull request #408 from benaadams/CancellationTokenSource
Remove CreateLinkedTokenSource
2015-11-25 01:32:04 -08:00
Stephen Halter 07c0b414f0 Merge branch 'benaadams/faster-headers' into dev 2015-11-23 15:10:24 -08:00
Ben Adams 81dba3961d less work in locks 2015-11-21 14:13:23 +00:00
stephentoub c7d7f0e575 Lazily allocate the RequestAborted CTS
Avoid allocating the CancellationTokenSource unless it's actually requested.  This makes it pay-for-play with regards to code that actually asks for the RequestAborted token and requests that are aborted.
2015-11-21 08:38:48 -05:00
Cesar Blum Silveira e4fd91bb68 Fix hang on Connection: close requests. (#406) 2015-11-20 20:43:52 -08:00
Ben Adams feb40402de merge preamble-output, socket-output 2015-11-21 04:18:06 +00:00
Ben Adams a3173c487a Precomputed header bytes 2015-11-21 00:22:44 +00:00
Stephen Halter 0dbf108353 Smarter unpinning of MemoryPoolBlock2 in SocketOutput 2015-11-20 12:59:53 -08:00
Stephen Halter 2572256d3f Use MemoryPool2 for SocketOutput Buffers
Add ProducingStart and ProducingComplete methods to ISocketOutput.
These new methods can help prevent double buffering when encoding.
2015-11-20 04:41:33 -08:00
Ben Adams 9d852632c0 Remove _nullBuffer
Was meant to be removed as part of #335

/cc @rynowak
2015-11-20 05:51:25 +00:00
Ben Adams 174ec739bb Don't log ODEs thrown from _abortedCts.Cancel 2015-11-20 00:30:08 +00:00
Chris R 1c40548928 Add LoggingConnectionFilter. 2015-11-19 16:28:45 -08:00
Ben Adams 3c7431aa35 Change disconnect to abort cts 2015-11-19 23:25:31 +00:00
Ben Adams 58d8c851c5 Remove CreateLinkedTokenSource
Resolves  #407
2015-11-19 21:50:10 +00:00
Cesar Blum Silveira 307e020703 Don't crash the server if a connection filter throws synchronously. 2015-11-19 13:27:43 -08:00
Master T efec0feda2 Fix merge 2015-11-18 08:29:30 +01:00
Master T 2cdd659e67 Fix indentation 2015-11-18 05:11:57 +01:00
Master T 592d802fde Add test for https scheme, code cleanup 2015-11-18 05:06:30 +01:00
Master T 85eb6ab600 Code cleanup 2015-11-18 05:06:29 +01:00
Master T ba63c894be Remove Console.WriteLine 2015-11-18 05:06:28 +01:00
Master T 8e910baf04 Improve based on pull request feedback 2015-11-18 05:06:27 +01:00
Master T bed8c67181 Add SslProtocols option to HttpsConnectionFilter 2015-11-18 05:05:50 +01:00
Master T bd30f28dfd Implement client certificate authentication 2015-11-18 05:05:50 +01:00
David Fowler b8f01cf674 Merge pull request #378 from benaadams/thread-count
Network thread count defaults
2015-11-17 07:34:29 -08:00
Stephen Halter 5d59a20178 Merge branch 'benaadams/no-delay' into dev 2015-11-16 20:56:26 -08:00
David Fowler b1a772f19c Merge pull request #393 from benaadams/patch-1
Disconnect is Debug not Error
2015-11-16 20:29:50 -08:00
David Fowler 9c47796ec0 Merge pull request #312 from benaadams/MemoryPoolIterator2-GetString
Reduce GetString allocs and conversions
2015-11-16 20:13:38 -08:00
Ben Adams 4dc4346fca Reduce GetString allocs and conversions 2015-11-17 03:46:09 +00:00
Stephen Halter f7a5c38f65 Follow common pattern for implementing IHttpRequestLifetimeFeature 2015-11-16 16:03:55 -08:00
Stephen Halter b73e42b617 Abort request on any write failure 2015-11-16 16:03:53 -08:00
Stephen Halter 874bd29ce1 Throw IOExceptions instead of ODEs after a request is aborted 2015-11-16 16:03:51 -08:00
Stephen Halter 062caf16be Support for IHttpRequestLifetimeFeature 2015-11-16 16:03:50 -08:00
Ben Adams 1cbb273b0d Corrected Exception messages 2015-11-16 16:03:48 -08:00
Ben Adams 5e883827e0 Explain why dispose can't be used 2015-11-16 16:03:46 -08:00
Ben Adams f60f6c92ca Stop streams on finish
Can't use dispose (or close) as can be disposed too early by user code

Resolves #263
2015-11-16 16:03:44 -08:00
David Fowler 5774cf9f1e Merge pull request #390 from benaadams/stack2queue
ConcurrentStack -> ConcurrentQueue
2015-11-16 15:36:29 -08:00
David Fowler 7ba0f7da19 Merge pull request #377 from benaadams/legacy
Result -> GetAwaiter().GetResult() for legacy
2015-11-16 12:13:45 -08:00
David Fowler e3a62ff09f Merge pull request #335 from benaadams/used-pool-array
Consume body without allocating or reading
2015-11-16 11:47:18 -08:00
Ben Adams 8941d4b620 Disconnect is Debug not Error
Resolves #392
2015-11-16 17:44:24 +00:00
Ben Adams 7691a7cc23 Improved Send100 Check 2015-11-16 06:43:49 +00:00
Ben Adams ecc439555e Reuse ReadAsync for Consume 2015-11-15 22:27:39 +00:00
Ben Adams 1589b54018 Early bail, completed tasks+Interlocked 2015-11-15 21:56:20 +00:00
Ben Adams f089abd337 Consume in single call 2015-11-15 21:39:36 +00:00
Ben Adams f48e6ba51a Add Async in method name 2015-11-15 21:28:36 +00:00
Ben Adams f7bdc5a4e9 Skip non-consumed rather than reading 2015-11-15 21:28:33 +00:00
Ben Adams bd6e181d93 ConcurrentStack -> ConcurrentQueue 2015-11-15 21:17:14 +00:00
Troy Dai 2e2dfd87c1 Fix byte[] array allocation in IsDarwin 2015-11-14 22:55:25 -08:00
Cesar Blum Silveira a3a49d21b8 Reset Frame.Scheme on each request (#366). 2015-11-13 16:05:10 -08:00
Ben Adams 96c1668c54 Result -> GetAwaiter().GetResult() for legacy 2015-11-13 20:08:59 +00:00
Ben Adams 558b0ae643 statics to instance 2015-11-13 20:08:11 +00:00
Ben Adams d82c571831 Trim exposed KestrelThread api 2015-11-13 20:08:11 +00:00
Ben Adams a95318c616 Network thread count defaults 2015-11-13 20:00:32 +00:00
Ben Adams 59a95f43a3 Set NoDelay as default
Resolves  #374
2015-11-13 19:33:24 +00:00
Murat Girgin 52fe469688 Update project.json 2015-11-12 22:59:34 -08:00
Stephen Halter fc346f7768 Avoid some closure allocations in SocketOutput 2015-11-12 17:08:44 -08:00
Stephen Halter 59cdd60af6 Don't pre-complete too many writes 2015-11-12 17:08:43 -08:00
Stephen Halter 6b995362f1 Merge branch 'benaadams/odd-sync' into dev 2015-11-12 16:47:27 -08:00
Stephen Halter 983997ab9c Merge branch 'nickcraver/cancellation' into dev 2015-11-12 16:15:59 -08:00
Stephen Halter 9958427db7 Merge branch 'benaadams/result-getawaiter' into dev 2015-11-12 16:05:50 -08:00
Stephen Halter 0ead24680d Merge branch 'benaadams/reduce-log-boxing' into dev 2015-11-12 16:01:06 -08:00
Stephen Halter fdfd7dcf36 Merge branch 'benaadams/Task.Run-QueueUserWorkItem' into dev 2015-11-12 15:51:42 -08:00
N. Taylor Mullen 86e1924cad Remove System beta tag in project.json for coreclr packages. 2015-11-12 12:23:45 -08:00
Nick Craver a45a671b22 Make ReadAsync state overload 451 only and private. 2015-11-11 18:55:56 -05:00
Stephen Halter e5ff33eda2 Remove UvAsyncHandle.DangerousClose
- This should stop the AVs we've been seeing in some of our test runs
2015-11-11 15:24:09 -08:00
Ben Adams 0500043cc9 .Result -> .GetAwaiter().GetResult() 2015-11-11 09:46:56 +00:00
Nick Craver d1221e82c1 Pass cancellation tokens down consistently
I'm assuming these are oversights since the usage is inconsistent.
Otherwise this served only as a mild waste of time :)
2015-11-10 22:58:19 -05:00
Stephen Halter 55f6f21d5a Build Microsoft.AspNet.Server.Kestrel.Https for dotnet5.4 2015-11-10 17:15:35 -08:00
Stephen Halter bdbd9ae7a6 Merge branch 'benaadams/socketoutput-tasks' into dev 2015-11-10 15:55:10 -08:00
Ben Adams d32937eafe Add tests for non-immediate byte counting 2015-11-10 23:17:40 +00:00
Ben Adams 34cec3448d SocketOutput to Tasks 2015-11-10 19:53:43 +00:00
Troy Dai d0bdede709 Update the reference link in comments of SockAddr 2015-11-10 11:11:32 -08:00
Troy Dai d9c15e0180 Add references to socket in comments 2015-11-10 10:37:12 -08:00
Ben Adams 344c821f83 Remove sync block->task
await rather than synchronously blocking and then returning a
Task.FromResult
2015-11-10 18:23:44 +00:00
Troy Dai d08b83a1c7 Fix get IPAddress for Darwin 2015-11-10 10:04:10 -08:00
Ben Adams c0f82765aa Move logging to new style 2015-11-10 10:43:51 +00:00
Ben Adams a2c4e3a654 Task.Run -> ThreadPool.QueueUserWorkItem
Task.Run eventually ends up being QueueUserWorkItem.
The returned task is ignored, so no added goodness.
Short running item.

Cut out the middleman
2015-11-10 07:28:17 +00:00
Ben Adams 278bd9c962 Completed Task opt 2015-11-09 04:32:08 +00:00
Stephen Halter 9d19eed88f Merge branch 'benaadams/memorypool2-allocate' into dev 2015-11-05 12:16:43 -08:00
Stephen Halter bb9f83186b Remove unused parameter from ListenerSecondary.ReadStartCallback 2015-11-05 12:09:50 -08:00
Stephen Halter fff28990fe Ensure ListenerSecondary buffer isn't double freed or freed too early
- Call buf_init in StartAsync so we have access to a KestrelThread
2015-11-04 16:21:29 -08:00
Stephen Halter 74f08c16df Merge branch 'benaadams/listenersecondary-allocs' into dev 2015-11-04 15:34:42 -08:00
Ben Adams 3e7969cefe Move handle creation to constructor 2015-11-04 22:44:30 +00:00
Stephen Halter 272ce27c79 Merge branch 'benaadams/delegates' into dev 2015-11-04 14:21:13 -08:00
Ben Adams 5cef608e52 Dispose _ptr 2015-11-04 22:20:51 +00:00
Ben Adams 22dfd31261 More readable loop condition 2015-11-04 22:04:19 +00:00
Stephen Halter 35bbddf9b5 Merge branch 'benaadams/listener-primary-alloc' into dev 2015-11-04 10:14:52 -08:00
Stephen Halter 04b2885f10 Merge branch 'benaadams/listener-allocation' into dev 2015-11-04 10:12:33 -08:00
Stephen Halter f4be290d4a Merge branch 'benaadams/connection-allocs' into dev 2015-11-04 10:08:36 -08:00
Ben Adams cc84097016 Listener - remove closure allocation 2015-11-04 12:36:32 +00:00
Ben Adams 1d4b9d6633 ListenerPrimary - reduce closure allocation
Still captures string pipeName
2015-11-04 12:33:51 +00:00
Ben Adams d104e8a08d Reduce delegate allocation 2015-11-04 12:31:44 +00:00
Ben Adams 34c1a671f0 ListenerSecondary - reduce closure allocation 2015-11-04 12:20:00 +00:00
Ben Adams 5ae1c4ecb2 MemoryPool2 Allocate returns newest
Rather than a while loop on Allocate; return last memory block created
rather than returning it to the pool and checking if one can be removed.
2015-11-04 08:37:12 +00:00
Ben Adams c113c0d3a2 Don't alloc array per header
i.e `new StringValues(string)` rather than `new StringValues(new [] {
string } )`
2015-11-04 07:11:55 +00:00
Cesar Blum Silveira 889a24278d Merge branch 'release' into dev 2015-11-02 17:36:41 -08:00
Cesar Blum Silveira eaee76dfeb Strong name everything. 2015-11-02 16:16:55 -08:00
Ben Adams ea6f6b10dc Don't capture connection on closure 2015-11-01 13:27:17 +00:00
John Luo b466c3b7d7 Reacting to Hosting changes 2015-10-30 14:19:55 -07:00
Stephen Halter fe654598f6 Merge branch 'release' into dev 2015-10-29 14:30:02 -07:00
Stephen Halter 85202b0174 Merge branch 'benaadams/read-to-null-buffer' into release 2015-10-29 12:24:40 -07:00
Stephen Halter 1722150ee9 Do nothing in KestrelThread.Stop if libuv fails to load
This prevents DllNotFoundExceptions from being masked by NullReferenceExceptions
2015-10-29 12:21:25 -07:00
Troy Dai e9a6061023 Make Frame implements IHttpConnectionFeature
Provide RemoteIPAddress as well as RemotePort
2015-10-29 10:08:35 -07:00
Ben Adams bdadc8a3da Move comment into loop, remove noop 2015-10-28 22:44:35 +00:00
Ben Adams 4bba074d77 Read to null buffer
Read to null buffer rather than Stream.Null as the CopyToAsync will
create a `new byte[]` on each call
bc14660885/src/mscorlib/src/System/IO/Stream.cs (L218)
of size 81920 bytes!
bc14660885/src/mscorlib/src/System/IO/Stream.cs (L48)
2015-10-28 08:53:11 +00:00
moozzyk c1b21b89d5 Removing dependency on Microsoft.Extensions.PlatformAbstractions 2015-10-27 01:40:28 -07:00
moozzyk d4853f9b7c Switching to using the built-in loading of native libs 2015-10-27 01:13:21 -07:00
Stephen Halter fb01ea3918 Consume the full request body when the app does not 2015-10-26 11:13:07 -07:00
Stephen Halter 094b8efbf8 Properly handle headers with empty values 2015-10-25 01:40:22 -07:00
Troy Dai 52f4fa91e3 Unescape string in memory
1. In place unescape;
1. UTF-8 verification;
2. MemoryPoolIterator2.Put
3. Tests
2015-10-23 15:26:59 -07:00
Ryan Nowak f88631efb3 React to breaking changes in StringValues 2015-10-23 15:05:09 -07:00
Pavel Krymets eb2c3a1ce8 Rename Microsoft.Runtime.Abstractions to Microsoft.Extensions.PlatformAbstractions 2015-10-22 18:22:05 -07:00
Pranav K dea782163d Updating packages to use generations 2015-10-22 15:18:49 -07:00
Troy Dai a1e4e022b9 Clean up 2015-10-21 22:08:03 -07:00
Pavel Krymets f8fd2f9ac9 React to hosting changes 2015-10-21 10:23:53 -07:00
Stephen Halter 8f0d1179ab Allow Nagle’s algorithm to be disabled via IKestrelServerInformation.NoDelay 2015-10-19 12:44:21 -07:00
Stephen Halter c809beec18 Don't allocate Exceptions unnecessarily
- Allocate Exceptions in the ReadStart callbacks if necessary instead
  of in UvStreamHandle.
- This also fixes a bug in ListenerSecondary where it should have
  previously been looking at the error code instead of the read count.

#237
2015-10-16 15:25:37 -07:00
Stephen Halter 8e818e3549 Address PR feedback 2015-10-15 16:52:37 -07:00
Stephen Halter 7b315d2470 Close connection gracefully in Frame.ProduceEnd
- Try sending a FIN before closing the socket
- Don't attempt to send a FIN twice for the same connection
2015-10-15 15:35:40 -07:00
Stephen Halter 513abb4561 Log errors in OnStarting and OnCompleted 2015-10-15 15:35:38 -07:00
Stephen Halter b98425d3b1 Log unhandled exceptions thrown from the AppFunc 2015-10-15 15:35:36 -07:00
Stephen Halter 7c27c5c0e7 Better handle blocks not taken taken from slabs
- If the block needs to be larger than 4032 bytes it won't be backed by a slab
2015-10-14 16:05:35 -07:00
David Fowler 6aaa3cbe06 Use IApplicationLifetime.StopApplication instead of
IApplicationShutdown.

React to hosting changes 374526b270
2015-10-14 01:09:11 -07:00
David Fowler ef38f5589d React to hosting changes to IApplicationLifetime 2015-10-14 00:46:18 -07:00
Chris R cfe6e22a29 React to IHeaderDictionary changes. 2015-10-12 09:29:34 -07:00
Stephen Halter 3eec43a0c3 Move static BitCount method to base class
- Updated comment to point to a specific commit in corefx
- This is more consistent with AppendValue since BitCount doesn't need
  to be generated
2015-10-09 17:27:33 -07:00
Stephen Halter a33a5d0f1b Merge branch 'benaadams/bitcount-fast' into dev 2015-10-09 17:17:03 -07:00
Louis DeJardin 78177e7082 Fixing rebase errors 2015-10-09 13:26:34 -07:00
Louis DeJardin 6ae0f5d505 PR feedback - code formatting 2015-10-09 13:19:10 -07:00
Louis DeJardin 29b0b124ee Moving non-changing methods into .cs partial 2015-10-09 13:19:09 -07:00
Ben Adams ccfeef6353 All features to have backing object 2015-10-09 13:18:32 -07:00
Ben Adams 8f41e47eca Remove bitfield for locally implemented interface items
Only generate type statics for cached features
2015-10-09 13:18:09 -07:00
Ben Adams 3c20053d9a Don used cached typeof for tests 2015-10-09 13:15:39 -07:00
Ben Adams 56893df7f9 Don't iterate overriden features twice 2015-10-09 13:11:48 -07:00
Louis DeJardin cbc3b4e6f5 PR Feedback
* Sorting namespaces
* Removing `as` casting for Frame's implemented interfaces
2015-10-09 13:10:27 -07:00
Louis DeJardin dc0eb679ae Updating unit tests for Frame IFeatureCollection update 2015-10-09 13:09:37 -07:00
Louis DeJardin 71fc2bf2e5 Rough implementation of feature collection optimization 2015-10-09 13:09:35 -07:00
Ben Adams 6b0fa776ca More comment clarity 2015-10-09 12:16:54 -07:00
Ben Adams 47973541b5 Remove redundant cast 2015-10-09 12:16:53 -07:00
Ben Adams e107c47913 Add comment explanation 2015-10-09 12:16:52 -07:00
Ben Adams 05702e81e6 more typeof caching 2015-10-09 12:16:50 -07:00
Ben Adams d48a27dd59 Use bitflag for override and cache typeof in statics 2015-10-09 12:16:49 -07:00
Louis DeJardin dcf591c832 Rough implementation of feature collection optimization 2015-10-09 12:16:48 -07:00
Stephen Halter 0c1b05ce2d Merge branch 'release' into dev 2015-10-08 16:40:13 -07:00
Ben Adams 6f506ba988 subsequent block has data - IsEnd is false
Resolves #249
2015-10-08 16:18:47 -07:00
Stephen Halter 24c0a8e142 Fix MemoryPoolIterator2.CopyTo's block traversal
- This fix prevents large request streams from being corrupted

#234
2015-10-08 16:16:41 -07:00
Ben Adams 9d251cdb54 subsequent block has data - IsEnd is false
Resolves #249
2015-10-08 18:13:22 -04:00
Chris R 0b36382448 Merge pull request #236 from benaadams/sanitize-loops
Sanitize loops
2015-10-08 10:05:17 -07:00
Ben Adams 0a297688b4 Use Jit recongised, standard loop construct
For bounds check elimination.
Convey intent more clearly; eliminate bounds checks
2015-10-08 12:31:21 -04:00
Ben Adams 4250d35347 PR feeback 2015-10-08 01:11:41 -04:00
Ben Adams 05418dd18a Use corefx implementation 2015-10-07 16:51:10 -04:00
Ben Adams 8bf2c814d6 Add BitCount LongExtensions 2015-10-07 12:23:20 -04:00
Chris R 1f50f4c2a8 #231 bind to IPv6Any, add functional tests. 2015-10-05 16:13:11 -07:00
Ryan Nowak f545f99dab Add attributes to fix the build 2015-10-05 11:22:30 -07:00
Stephen Halter 2f3a00625a Initial work to support HTTPS using SslStream
- Add extension method "UseKestrelHttps" to IApplicationBuilder
2015-10-05 03:15:18 -07:00
Pranav K 49451fb11e Renaming Microsoft.Framework.* -> Microsoft.Extensions.* 2015-10-03 15:44:45 -07:00
Stephen Halter 6d3e5d3bf2 Merge branch 'benaadams/fastpath-header-enumerator' into dev 2015-09-28 12:21:58 -07:00
moozzyk d2f282f54f Consuming Libuv from NuGet package
Fixes #50
2015-09-26 18:00:50 -07:00
Chris R e3f141fcde #227 Fix OverflowException in MemoryPool 2015-09-26 06:56:54 -07:00
Stephen Halter f0137b7b9e Bind to specific IP addresses if provided with any
This still only applies to IPv4.

#98
2015-09-25 16:26:01 -07:00
Ben Adams 1718b69f22 Fast path header enumerator
Use strongly typed enumerable as interface's allocates.
2015-09-26 00:16:42 +01:00
damianedwards a7b65efa75 CR feedback 2015-09-25 14:59:47 -07:00
damianedwards 3c2408db68 Fix tests after rebase 2015-09-25 14:59:47 -07:00
damianedwards 7c46b2bd3b Use a timer to generate the value for the Date header in responses:
- Doing it on each request is expensive
- The Timer is started when the first request comes in and fires every second
- Every request flips a bool so the Timer knows requests are coming in
- The Timer stops itself after a period of no requests coming in (10 seconds)
- #163
2015-09-25 14:59:47 -07:00
Louis DeJardin 5070b8073e Temporarily commenting out the Debug.Assert of block freeing
Unit tests using ad-hoc contexts aren't guaranteed to dispose pools.
That's kinda making unit tests fail, more or less, because Debug...
2015-09-25 14:17:09 -07:00
Louis DeJardin 318f3b7145 Changing Trace.Assert to Debug.Assert
* Also Debug.Assert for unreturned memory blocks
2015-09-25 13:01:54 -07:00
Louis DeJardin f740616573 disposedValue changed to _disposedValue
Boilerplate code didn't have _
2015-09-25 12:49:30 -07:00
Louis DeJardin c42dace9e6 consts looked like local vars 2015-09-25 12:49:30 -07:00
Louis DeJardin 0adbbd0217 Using the well-known-header field without checking set bit 2015-09-25 12:49:29 -07:00
Stephen Halter dc902f5fc4 Update SocketOutput to not call QueueUserWorkItem unnecessarily 2015-09-25 12:49:28 -07:00
Louis DeJardin 789d5b3595 Writes which are not immediate always return completed tasks
They must always be followed with Writes which are immediate, and
returning an incomplete task put them in a state where the callback
might not have been initiated.
2015-09-25 12:49:27 -07:00
Louis DeJardin 5e678fdbaa Adding volatile keyword to stopping boolean 2015-09-25 12:49:27 -07:00
Louis DeJardin 99fc7e4e50 Moving the Start/Stop logic into Frame.
Also formalizes the relationship between the function's Task and
how it relates to graceful shutdown. Specifically how it relates
to finishing the requests currently in progress.
2015-09-25 12:49:26 -07:00
Louis DeJardin f89a586b75 Removing boilerplate-generated #region 2015-09-25 12:49:25 -07:00
Louis DeJardin 37f7dfd01f Typo in comments 2015-09-25 12:49:25 -07:00
Louis DeJardin c424b8437c Renaming based on PR feedback 2015-09-25 12:49:24 -07:00
Louis DeJardin 844c791b16 Processing function should return Task 2015-09-25 12:49:23 -07:00
Louis DeJardin 091084cfe2 Refactoring MemoryPool class locations
Moving Iterator out into its own file rather than being a nested class
Moving pool classes into Infrastructure namespace instead of Http
2015-09-25 12:49:23 -07:00
Louis DeJardin 13defc5a32 Initialize Memory2 in ListenerContext
Better than initializing from multiple other classes
2015-09-25 12:49:22 -07:00
Louis DeJardin 5ba1b9fb3c Secondary listeners need to allocate their own memory pool 2015-09-25 12:49:21 -07:00
Louis DeJardin 6db3d9e645 Using specific exception types 2015-09-25 12:49:21 -07:00
Louis DeJardin 76b528e1d2 Adding comments to MemoryPool classes 2015-09-25 12:49:20 -07:00
Louis DeJardin ff0affe34d Removing _frameTask and fixing Task.Run argument 2015-09-25 12:49:19 -07:00
Louis DeJardin 30ec2cb0b1 Harden framing epilog
* Connection no longer needes Frame's processing Task
* Any exceptions from unusual processing is logged
2015-09-25 12:49:19 -07:00
Louis DeJardin 28250d9981 Providing Path to application 2015-09-25 12:49:18 -07:00
Louis DeJardin 04f6446a50 Updates for PR feedback 2015-09-25 12:49:18 -07:00
Louis DeJardin d3a87c4c14 Removing MessageBodyExchanger base class 2015-09-25 12:49:17 -07:00
Louis DeJardin 52dc37eae7 Fixing a header parsing bug
When request header data arrives with \r\n split across packets
2015-09-25 12:49:16 -07:00
Louis DeJardin e5a3bda3a2 Progress on flow control
* Dealing with race conditions
* Reworking iterator methods
* Shutdown and Close need to be passed throught the write-behind mechanism
2015-09-25 12:49:15 -07:00
Louis DeJardin 4193c92ba7 Fixing merge conflicts 2015-09-25 12:49:15 -07:00
Louis DeJardin 1f6aaebeda Changing flow control for incoming data
SocketInput is now awaitable
Input buffers are slab-allocated and pinned from large object heap
Request frame parsing is offloaded from libuv thread
2015-09-25 12:49:14 -07:00
Louis DeJardin 557f6d6993 Refactoring response control flow
- Bring through both sync and async execution paths
- Remove callback pattern from from and socketoutput write calls
2015-09-25 12:47:51 -07:00
Stephen Halter 1e39473047 uv_pipe_connect returns void
This fix prevents Libuv.pipe_connect from throwing when the stack
memory that was previously incorrectly interpreted as the int return
value happens to be negative.

When pipe_connect threw, an assertion failure would follow since the
pipe handle would be closed prematurely.

http://docs.libuv.org/en/v1.x/pipe.html#c.uv_pipe_connect

#205
2015-09-25 11:40:40 -07:00
Eilon Lipton c4bf10d6e9 Add third party notices for libuv
Fixes #218
2015-09-23 15:42:58 -07:00
Chris R 355bc01a15 Hosting#358 Move the default address into Hosting. 2015-09-22 11:56:46 -07:00
David Fowler 891b991a34 Use new packInclude feature to include native assets
- Now Kestrel won't break when people overwrite the build.cmd
2015-09-19 03:59:58 -07:00
Stephen Halter 47323a88e1 Surface errors from Listener.StartAsync better
If CreateListenSocket fails, surface the original error instead of throwing a
NullReferenceException from Listener.Dispose().

#185
2015-09-16 18:19:01 -07:00
Stephen Halter 2d01f2752b Catch and log uv_accept errors
- This is also what is done by node.js
- "tcp, pipe: don't assert on uv_accept() errors (Ben Noordhuis)"

0685707bc6
2015-09-16 18:18:58 -07:00
Stephen Halter f14af1f409 Don't swallow too many exceptions
- Swallowing too many exceptions can end up hiding issues in
  Kestrel itself. It's better to let the process die.
- If we want to handle certain exceptions we should be as
  specific as possible with our try/catch blocks.
2015-09-16 18:18:55 -07:00
Chris R 2e225b0db6 Hosting#331 Add IServerAddressesFeature. 2015-09-15 12:47:18 -07:00
Pranav K 78de14d248 Adding NeutralResourcesLanguageAttribute 2015-09-10 18:15:27 -07:00
Stephen Halter 958cc3eca3 Add missing arguments to LogDebug arguments in KestrelTrace 2015-09-10 12:40:16 -07:00
Stephen Halter 813127e7f6 Merge branch 'benaadams/negative-threads' into dev 2015-09-10 11:58:09 -07:00
Stephen Halter ec88e57f67 Remove commented code in KestrelTrace 2015-09-10 11:41:27 -07:00
Stephen Halter 1ebf98d40d Log message style changes
- Disabled some log messages for possibly being too verbose.
- Don't log ConnectionReadFin when there is an error.
2015-09-10 11:41:25 -07:00
Stephen Halter 0ef096b41c Increment connection id for logging 2015-09-10 11:41:22 -07:00
Ben Adams dda5774a8b Throw exception if ThreadCount negative 2015-09-10 08:03:42 +01:00
Ben Adams 887cf2c7be Negative thread count fix 2015-09-10 02:57:49 +01:00
Stephen Halter dc08062545 Merge branch 'drussilla/add-logging' into dev
Conflicts:
	src/Microsoft.AspNet.Server.Kestrel/Http/Connection.cs
	src/Microsoft.AspNet.Server.Kestrel/Http/ListenerSecondary.cs
2015-09-09 11:28:09 -07:00
Ivan Derevyanko ac77c11211 Make ConnectionCallback static again. 2015-09-09 02:13:49 +02:00
Ivan Derevyanko 2b2943d5b0 Restore static delegates 2015-09-09 01:27:44 +02:00
Stephen Halter 2041e4d08b Prevent pipes from being closed prematurely on OS X and Linux
This change fixes the in-process marshalling of TCP handles on Mac and Linux
that is used to support having multiple threads accepting connections from
multiple loops.

On these two platforms, the ReadStart callback somtimes gets called with a
status and pipe_pending_count equal to zero. Now when the status is zero
just exit the callback without closing the pipe.

This change more closely follows the example at
https://nikhilm.github.io/uvbook/processes.html#sending-file-descriptors-over-pipes
2015-09-08 16:21:45 -07:00
Ivan Derevyanko a93a66fe7c Replace Trace.WriteLine with ITraceLogger 2015-09-09 00:26:26 +02:00
Ivan Derevyanko 6d47227975 KestrelTrace refactored and added to the ServiceContext. Close aspnet/KestrelHttpServer#141 2015-09-05 18:17:17 +02:00
Kai Ruhnau 5ee80e0155 Fix bug #191 introduced by b25d2d9 2015-09-05 12:29:00 +02:00
Stephen Halter f10c989d90 Add ServiceContext to make it easier to flow new services through ctors 2015-09-04 15:04:25 -07:00
Stephen Halter 1584d70e1f Clean up if an exception is thrown in the middle of ServerFactory.Start 2015-09-03 15:26:30 -07:00
Louis DeJardin c50aec1729 Adding comments to meaningless field names 2015-09-02 21:14:18 -07:00
Louis DeJardin dffd977c3f Fixing field names 2015-09-02 20:50:21 -07:00
Louis DeJardin 5c7007a4e9 Fixing member field name 2015-09-02 20:37:11 -07:00
Louis DeJardin 0859d82d6b Adding private keyword to private enums 2015-09-02 20:33:51 -07:00
Louis DeJardin 3bbb77f9d0 Alphabetizing using statements 2015-09-02 20:31:11 -07:00
Louis DeJardin b25d2d9772 Continued updates for #184
* Reordering members
- Fields
- Constructors
- Properties
- EverythingElse
- NestedTypes

* Removing commented code
2015-09-02 20:08:54 -07:00