Commit Graph

376 Commits

Author SHA1 Message Date
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
Louis DeJardin b6c272cd5b Removing console output from unit tests 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 325423de40 Sorting usings 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 13f46bb66b Using multiple threads in SampleApp 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 7917569466 Changing chunked with exception test criteria 2015-09-25 12:49:16 -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
Stephen Halter ca8161466e Allow mock libuv to shutdown gracefully.
This speeds up SocketOutputTests and reduces the total test time on my
machine from 35 seconds to 25 seconds.
2015-09-24 17:20:39 -07:00
Brennan b9f26311ef Fix test dependency 2015-09-24 08:26:00 -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
Ajay Bhargav Baaskaran 5354ce0a71 Enabling NuGetPackageVerifier 2015-09-21 10:40:36 -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
N. Taylor Mullen 3470c6206a Update nuget.exe and corresponding feeds to v3. 2015-09-17 18:32:59 -07:00
Stephen Halter 6f8c040cfe Fix false positive in Standards Police warning warning SP1004
- "warning SP1004: namespaces not alphabetized"
- Any using statement can come after "using System;"
2015-09-17 00:51:43 -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