Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Spdy Support #103

Open
wants to merge 84 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
4b5e96f
revert to match upstream
kersny May 26, 2011
45a1b99
Made tests compile
kersny May 30, 2011
d039de9
Add test project to main sln
kersny May 30, 2011
a45eb21
Make Route Handling Pass
kersny May 30, 2011
326d18a
Add compression dep for Spdy
kersny May 30, 2011
92b0281
Initial commit of SPDY bits
kersny May 30, 2011
1a645fa
Change test attributes
kersny May 30, 2011
b04eca2
Added Headers tests
kersny May 30, 2011
d5436e7
Add cleanup for headers test
kersny May 30, 2011
0ac3e60
Add Window Update Frame Test
kersny May 30, 2011
32ceb6b
Added Version Packet Tests
kersny May 30, 2011
c679772
add cleanup again
kersny May 30, 2011
fbb14d3
Data packet parsing needs to happen too
kersny May 30, 2011
164930c
prepartory stuff for generation tests
kersny May 31, 2011
55e03d3
Syn Stream generation Test
kersny May 31, 2011
237260e
name fix
kersny Jun 2, 2011
9c39136
Test Syn Reply Generation
kersny Jun 2, 2011
f42d118
Test Rst Stream Generation
kersny Jun 2, 2011
9b29479
Test Settings Generation, with changes to Settings Frame
kersny Jun 2, 2011
b9ddd0b
bracket fix
kersny Jun 2, 2011
d874698
Test Ping Generation
kersny Jun 2, 2011
47a6113
Test Go Away
kersny Jun 2, 2011
342898c
Headers Frame Generation Test
kersny Jun 3, 2011
35c65e5
Window Update Frame Generation Test
kersny Jun 3, 2011
be31c7f
Generate Version Frame
kersny Jun 3, 2011
3087384
Data Frame Generation Test
kersny Jun 3, 2011
562ae3e
Little fixes that missed a few commits
kersny Jun 3, 2011
fa0fc15
remove boilerplate test stuff, start implementing frame choice in swi…
kersny Jun 3, 2011
4bbb255
Wrong Enum type in GoAway Test
kersny Jun 3, 2011
826c604
Add constructors from raw data
kersny Jun 3, 2011
e1fda91
Switch to enum for parsing
kersny Jun 3, 2011
d3ee0f6
et duhh, type is two bytes
kersny Jun 3, 2011
48608dc
Missed One
kersny Jun 3, 2011
077eaf4
Start implementation of parser
kersny Jun 4, 2011
ceccb07
Finished Parser, Tests are green
kersny Jun 4, 2011
af82f2d
Migrate to AsyncTest
kersny Jun 4, 2011
4a0cca5
Last move to AsyncTest
kersny Jun 4, 2011
5ae6b95
Util function to convert Int to bytes in place
kersny Jun 6, 2011
f8f04e6
Array combine method
kersny Jun 6, 2011
bf4cbda
Serialize Control frame header
kersny Jun 6, 2011
a6a0f21
Implement Name Value Header Block serialization, including compression
kersny Jun 6, 2011
f586a67
Syn Stream Serialization, passes tests
kersny Jun 6, 2011
1ea6b56
Syn Reply Serialization finished and passing
kersny Jun 6, 2011
4868fd7
Fix test: expected should be first
kersny Jun 6, 2011
123a7dd
Reset Stream Frame Serialization
kersny Jun 6, 2011
e4fd32c
Change Settings to use private props and recognize when updated
kersny Jun 7, 2011
7ddfeb9
Settings Serialization
kersny Jun 7, 2011
bee12ca
Ping frame serialization implemented
kersny Jun 7, 2011
27d5e3d
Fix Status Code in Go Away Test
kersny Jun 7, 2011
6ef9b1f
Implement Go Away Frame Serialization
kersny Jun 7, 2011
0b399ed
Header Frame Serialization
kersny Jun 7, 2011
ab63e45
Window Update Frame Serialization
kersny Jun 7, 2011
6ba18bb
Version Frame Serialization
kersny Jun 7, 2011
7d0e95d
Data Frame Serialization
kersny Jun 7, 2011
7145aac
Add SPDY listen support to manostool
kersny Jun 8, 2011
b9243d2
Basic SPDY implementation on app server side
kersny Jun 8, 2011
0b0491e
Add Zlib dll in same fashion as Nini
kersny Jun 8, 2011
ca4b8d0
Change Compression to use instances to get the stream context thing r…
kersny Jun 9, 2011
5cd5179
Change tests, but they're broken now with new system
kersny Jun 9, 2011
7abc821
Use new zlib context for inflation and deflation
kersny Jun 9, 2011
db3817e
revert to SPDY version 2 for Name Value Header
kersny Jun 9, 2011
5be3cef
SPDY session and transaction model for requests
kersny Jun 9, 2011
8db55e0
Remove extraneous Console.WriteLine
kersny Jun 9, 2011
d7ab067
Convert a NameValueHeaderBlock to HttpHeaders
kersny Jun 10, 2011
5a615f9
Add Spdy Request and Responses
kersny Jun 10, 2011
efbabb9
Remove unnecessary new
kersny Jun 10, 2011
e0a1595
build out session and transaction
kersny Jun 10, 2011
adeafb6
Merge branch 'master' into spdy
kersny Jun 13, 2011
1522960
Fixes after latest master pull
kersny Jun 13, 2011
987b933
Refactor Body handlers to use interface instead of HttpEntity\n Allow…
kersny Jun 14, 2011
3bc00ed
Change Inflation/Deflation method to not use out
kersny Jun 16, 2011
09b7183
Spdy Server Working
kersny Jun 16, 2011
2ff2029
Change SPDY command wording
kersny Jun 16, 2011
89f9bca
Send back ping frames when we get them
kersny Jun 20, 2011
a692bad
use SendFile for spdy if capable
kersny Jun 20, 2011
2b9ef13
Rework tool commands for spdy to be more flexible and easier to use
kersny Jun 27, 2011
86a6167
Include AssemblyInfo.cs files to match master
kersny Jun 27, 2011
0fb7f37
Revert config.h.in to match master
kersny Jun 27, 2011
d3d2405
Formatting fix to match rest of codebase
kersny Jun 29, 2011
4eb5aaf
Merge branch 'master' into spdy
kersny Jun 29, 2011
759199a
Merge branch 'master' into spdy
kersny Jul 4, 2011
325a4b4
Start refactor of Spdy request/response into base entity
kersny Jul 5, 2011
fc97703
SendFile doesn't work, we just have to do it manually
kersny Jul 5, 2011
6301469
Simple documentation
kersny Aug 8, 2011
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions SPDY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Run your Manos app with SPDY
==================================

*Note: SPDY support in Manos is an experimental feature*


SSL:

1. Start Manos:

manos -s -N 8080 -c certificate.crt -k keyfile.key

2. Start Chrome:

chrome --use-spdy=ssl

3. Navigate to your app (https://localhost:8080)

No SSL:

1. Start Manos:

manos -s -n 8080

2. Start Chrome:

chrome --use-spdy=no-ssl

3. Navigate to your app (http://localhost:8080)

To view SPDY details, head to
[chrome://net-internals/#events&q=type:SPDY_SESSION%20is:active](chrome://net-internals/#events&q=type:SPDY_SESSION%20is:active).
Binary file added libs/Ionic.Zlib.dll
Binary file not shown.
44 changes: 22 additions & 22 deletions src/Manos.Tests/Manos.Routing/MatchOperationFactoryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ public class MatchOperationFactoryTest
[Test ()]
public void TestCreateNull ()
{
Should.Throw<ArgumentNullException> (() => MatchOperationFactory.Create (null));
Should.Throw<ArgumentNullException> (() => MatchOperationFactory.Create (null, MatchType.String));
}

[Test ()]
public void TestIsNop ()
{
IMatchOperation op;

op = MatchOperationFactory.Create (String.Empty);
op = MatchOperationFactory.Create (String.Empty, MatchType.String);
Should.BeInstanceOf<NopMatchOperation> (op, "a1");
}

Expand All @@ -57,84 +57,84 @@ public void TestIsRegex ()
{
IMatchOperation op;

op = MatchOperationFactory.Create ("dog.");
op = MatchOperationFactory.Create ("dog.", MatchType.Regex);
Should.BeInstanceOf<RegexMatchOperation> (op, "a1");

op = MatchOperationFactory.Create (".dog");
op = MatchOperationFactory.Create (".dog", MatchType.Regex);
Should.BeInstanceOf<RegexMatchOperation> (op, "a2");

op = MatchOperationFactory.Create ("d.og");
op = MatchOperationFactory.Create ("d.og", MatchType.Regex);
Should.BeInstanceOf<RegexMatchOperation> (op, "a3");

op = MatchOperationFactory.Create (".");
op = MatchOperationFactory.Create (".", MatchType.Regex);
Should.BeInstanceOf<RegexMatchOperation> (op, "a4");

op = MatchOperationFactory.Create ("[dog]");
op = MatchOperationFactory.Create ("[dog]", MatchType.Regex);
Should.BeInstanceOf<RegexMatchOperation> (op, "a6");

op = MatchOperationFactory.Create ("(dog)");
op = MatchOperationFactory.Create ("(dog)", MatchType.Regex);
Should.BeInstanceOf<RegexMatchOperation> (op, "a7");

op = MatchOperationFactory.Create ("^dog");
op = MatchOperationFactory.Create ("^dog", MatchType.Regex);
Should.BeInstanceOf<RegexMatchOperation> (op, "a8");

op = MatchOperationFactory.Create ("dog*");
op = MatchOperationFactory.Create ("dog*", MatchType.Regex);
Should.BeInstanceOf<RegexMatchOperation> (op, "a9");

op = MatchOperationFactory.Create (".*dog");
op = MatchOperationFactory.Create (".*dog", MatchType.Regex);
Should.BeInstanceOf<RegexMatchOperation> (op, "a10");

op = MatchOperationFactory.Create ("$dog");
op = MatchOperationFactory.Create ("$dog", MatchType.Regex);
Should.BeInstanceOf<RegexMatchOperation> (op, "a11");

op = MatchOperationFactory.Create ("dog$");
op = MatchOperationFactory.Create ("dog$", MatchType.Regex);
Should.BeInstanceOf<RegexMatchOperation> (op, "a12");
}

[Test]
public void Create_SimpleMatchInMiddle_CreatesSimpleMatch ()
{
IMatchOperation op = MatchOperationFactory.Create ("/Foo/{bar}/");
IMatchOperation op = MatchOperationFactory.Create ("/Foo/{bar}/", MatchType.Simple);

Should.BeInstanceOf<SimpleMatchOperation> (op);
}

[Test]
public void Create_SimpleMatchAtBeginning_CreatesSimpleMatch ()
{
IMatchOperation op = MatchOperationFactory.Create ("{bar}/Foo");
IMatchOperation op = MatchOperationFactory.Create ("{bar}/Foo", MatchType.Simple);

Should.BeInstanceOf<SimpleMatchOperation> (op);
}

[Test]
public void Create_SimpleMatchAtEnd_CreatesSimpleMatch ()
{
IMatchOperation op = MatchOperationFactory.Create ("/Foo/{bar}");
IMatchOperation op = MatchOperationFactory.Create ("/Foo/{bar}", MatchType.Simple);

Should.BeInstanceOf<SimpleMatchOperation> (op);
}

[Test]
public void Create_SimpleMatchIsWholePattern_CreatesSimpleMatch ()
{
IMatchOperation op = MatchOperationFactory.Create ("{bar}");
IMatchOperation op = MatchOperationFactory.Create ("{bar}", MatchType.Simple);

Should.BeInstanceOf<SimpleMatchOperation> (op);
}

[Test]
public void Create_EscapedOpenSimpleMatch_CreatesStringMatch ()
{
IMatchOperation op = MatchOperationFactory.Create ("{{bar}");
IMatchOperation op = MatchOperationFactory.Create ("{{bar}", MatchType.String);

Should.BeInstanceOf<StringMatchOperation> (op);
}

[Test]
public void Create_EscapedCloseSimpleMatch_CreatesStringMatch ()
{
IMatchOperation op = MatchOperationFactory.Create ("{bar}}");
IMatchOperation op = MatchOperationFactory.Create ("{bar}}", MatchType.String);

Should.BeInstanceOf<StringMatchOperation> (op);
}
Expand All @@ -144,13 +144,13 @@ public void TestIsString ()
{
IMatchOperation op;

op = MatchOperationFactory.Create ("foobar");
op = MatchOperationFactory.Create ("foobar", MatchType.String);
Should.BeInstanceOf<StringMatchOperation> (op, "a1");

op = MatchOperationFactory.Create ("1");
op = MatchOperationFactory.Create ("1", MatchType.String);
Should.BeInstanceOf<StringMatchOperation> (op, "a2");

op = MatchOperationFactory.Create ("i am the walrus");
op = MatchOperationFactory.Create ("i am the walrus", MatchType.String);
Should.BeInstanceOf<StringMatchOperation> (op, "a3");
}
}
Expand Down
27 changes: 20 additions & 7 deletions src/Manos.Tests/Manos.Routing/ParameterizedActionTargetTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,24 @@ public class ParameterizedActionTargetTest
public void MethodWithNoArgs ()
{
}

public void MethodWithIntArg(int i)
{
}
public void MethodWithStringArg(string s)
{
}
private MethodInfo GetMethodWithNoArgs ()
{
return GetType ().GetMethod ("MethodWithNoArgs");
}
private MethodInfo GetMethodWithIntArg()
{
return GetType().GetMethod("MethodWithIntArg");
}
private MethodInfo GetMethodWithStringArg()
{
return GetType().GetMethod("MethodWithStringArg");
}

[Test]
public void Ctor_NullTarget_DoesNotThrow ()
Expand Down Expand Up @@ -78,7 +91,7 @@ public void TryConvertType_StringValue_ReturnsTrue ()
IManosContext ctx = new ManosContextStub ();

object data = null;
bool converted = ParameterizedActionTarget.TryConvertType (ctx, typeof (string), new UnsafeString ("foobar"), out data);
bool converted = ParameterizedActionTarget.TryConvertUnsafeString (ctx, typeof (string), GetMethodWithStringArg().GetParameters()[0], new UnsafeString ("foobar"), out data);
Assert.IsTrue (converted);
}

Expand All @@ -89,7 +102,7 @@ public void TryConvertType_StringValue_SetsData ()

object data = null;

ParameterizedActionTarget.TryConvertType (ctx, typeof (string), new UnsafeString ("foobar"), out data);
ParameterizedActionTarget.TryConvertUnsafeString (ctx, typeof (string), GetMethodWithStringArg().GetParameters()[0], new UnsafeString ("foobar"), out data);
Assert.AreEqual ("foobar", data);
}

Expand All @@ -99,7 +112,7 @@ public void TryConvertType_IntValue_ReturnsTrue ()
IManosContext ctx = new ManosContextStub ();

object data = null;
bool converted = ParameterizedActionTarget.TryConvertType (ctx, typeof (int), new UnsafeString ("42"), out data);
bool converted = ParameterizedActionTarget.TryConvertUnsafeString (ctx, typeof (int), GetMethodWithIntArg().GetParameters()[0], new UnsafeString ("42"), out data);
Assert.IsTrue (converted);
}

Expand All @@ -110,7 +123,7 @@ public void TryConvertType_IntValue_SetsData ()

object data = null;

ParameterizedActionTarget.TryConvertType (ctx, typeof (int), new UnsafeString ("42"), out data);
ParameterizedActionTarget.TryConvertUnsafeString (ctx, typeof (int), GetMethodWithIntArg().GetParameters()[0], new UnsafeString ("42"), out data);
Assert.AreEqual (42, data);
}

Expand All @@ -120,7 +133,7 @@ public void TryConvertType_BadValue_ReturnsFalse ()
IManosContext ctx = new ManosContextStub ();

object data = null;
bool converted = ParameterizedActionTarget.TryConvertType (ctx, typeof (int), new UnsafeString ("foobar"), out data);
bool converted = ParameterizedActionTarget.TryConvertUnsafeString (ctx, typeof (int), GetMethodWithIntArg().GetParameters()[0], new UnsafeString ("foobar"), out data);
Assert.IsFalse (converted);
}

Expand All @@ -131,7 +144,7 @@ public void TryConvertType_IntValue_SetsDataNull ()

object data = null;

ParameterizedActionTarget.TryConvertType (ctx, typeof (int), new UnsafeString ("foobar"), out data);
ParameterizedActionTarget.TryConvertUnsafeString (ctx, typeof (int), GetMethodWithIntArg().GetParameters()[0], new UnsafeString ("foobar"), out data);
Assert.IsNull (data);
}
}
Expand Down
Loading