#283 Merge packages, namespaces, test projects, and samples

This commit is contained in:
Chris R 2016-12-15 12:46:16 -08:00
parent fe8e3bbe67
commit 4c388e89ce
146 changed files with 467 additions and 1157 deletions

View File

@ -10,17 +10,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{E183C826-1
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{3A1E31E3-2794-4CA3-B8E2-253E96BDE514}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{3A1E31E3-2794-4CA3-B8E2-253E96BDE514}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Net.Http.Server", "src\Microsoft.Net.Http.Server\Microsoft.Net.Http.Server.xproj", "{3F5212AA-E287-49DD-8CEC-44BF0A2AC9A1}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "HelloWorld", "samples\HelloWorld\HelloWorld.xproj", "{6DAF3E6B-8E1B-4E6E-B9FE-7B1E5FDB7DB4}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "SelfHostServer", "samples\SelfHostServer\SelfHostServer.xproj", "{1236F93A-AC5C-4A77-9477-C88F040151CA}" Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "SelfHostServer", "samples\SelfHostServer\SelfHostServer.xproj", "{1236F93A-AC5C-4A77-9477-C88F040151CA}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Server.WebListener.FunctionalTests", "test\Microsoft.AspNetCore.Server.WebListener.FunctionalTests\Microsoft.AspNetCore.Server.WebListener.FunctionalTests.xproj", "{4492FF4C-9032-411D-853F-46B01755E504}" Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Server.HttpSys.FunctionalTests", "test\Microsoft.AspNetCore.Server.HttpSys.FunctionalTests\Microsoft.AspNetCore.Server.HttpSys.FunctionalTests.xproj", "{4492FF4C-9032-411D-853F-46B01755E504}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Server.WebListener", "src\Microsoft.AspNetCore.Server.WebListener\Microsoft.AspNetCore.Server.WebListener.xproj", "{B9F45F9D-D206-47F0-8E5F-54CE2F0BDF92}" Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Server.HttpSys", "src\Microsoft.AspNetCore.Server.HttpSys\Microsoft.AspNetCore.Server.HttpSys.xproj", "{B9F45F9D-D206-47F0-8E5F-54CE2F0BDF92}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Net.Http.Server.FunctionalTests", "test\Microsoft.Net.Http.Server.FunctionalTests\Microsoft.Net.Http.Server.FunctionalTests.xproj", "{DCB6E0B1-223D-44E6-8696-4767E5B6E6A1}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5E9B546C-17AC-4BDF-BCB3-5955D4755ED8}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5E9B546C-17AC-4BDF-BCB3-5955D4755ED8}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
@ -29,7 +23,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "HotAddSample", "samples\HotAddSample\HotAddSample.xproj", "{8BFA392A-8B67-4454-916B-67C545EDFAEF}" Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "HotAddSample", "samples\HotAddSample\HotAddSample.xproj", "{8BFA392A-8B67-4454-916B-67C545EDFAEF}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Net.Http.Server.Tests", "test\Microsoft.Net.Http.Server.Tests\Microsoft.Net.Http.Server.Tests.xproj", "{E837249E-E666-4DF2-AFC3-7A4D70234F9F}" Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Server.HttpSys.Tests", "test\Microsoft.AspNetCore.Server.HttpSys.Tests\Microsoft.AspNetCore.Server.HttpSys.Tests.xproj", "{E837249E-E666-4DF2-AFC3-7A4D70234F9F}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -51,26 +45,6 @@ Global
{8B828433-B333-4C19-96AE-00BFFF9D8841}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {8B828433-B333-4C19-96AE-00BFFF9D8841}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{8B828433-B333-4C19-96AE-00BFFF9D8841}.Release|Mixed Platforms.Build.0 = Release|Any CPU {8B828433-B333-4C19-96AE-00BFFF9D8841}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{8B828433-B333-4C19-96AE-00BFFF9D8841}.Release|x86.ActiveCfg = Release|Any CPU {8B828433-B333-4C19-96AE-00BFFF9D8841}.Release|x86.ActiveCfg = Release|Any CPU
{3F5212AA-E287-49DD-8CEC-44BF0A2AC9A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3F5212AA-E287-49DD-8CEC-44BF0A2AC9A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3F5212AA-E287-49DD-8CEC-44BF0A2AC9A1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{3F5212AA-E287-49DD-8CEC-44BF0A2AC9A1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{3F5212AA-E287-49DD-8CEC-44BF0A2AC9A1}.Debug|x86.ActiveCfg = Debug|Any CPU
{3F5212AA-E287-49DD-8CEC-44BF0A2AC9A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3F5212AA-E287-49DD-8CEC-44BF0A2AC9A1}.Release|Any CPU.Build.0 = Release|Any CPU
{3F5212AA-E287-49DD-8CEC-44BF0A2AC9A1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{3F5212AA-E287-49DD-8CEC-44BF0A2AC9A1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{3F5212AA-E287-49DD-8CEC-44BF0A2AC9A1}.Release|x86.ActiveCfg = Release|Any CPU
{6DAF3E6B-8E1B-4E6E-B9FE-7B1E5FDB7DB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6DAF3E6B-8E1B-4E6E-B9FE-7B1E5FDB7DB4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6DAF3E6B-8E1B-4E6E-B9FE-7B1E5FDB7DB4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{6DAF3E6B-8E1B-4E6E-B9FE-7B1E5FDB7DB4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{6DAF3E6B-8E1B-4E6E-B9FE-7B1E5FDB7DB4}.Debug|x86.ActiveCfg = Debug|Any CPU
{6DAF3E6B-8E1B-4E6E-B9FE-7B1E5FDB7DB4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6DAF3E6B-8E1B-4E6E-B9FE-7B1E5FDB7DB4}.Release|Any CPU.Build.0 = Release|Any CPU
{6DAF3E6B-8E1B-4E6E-B9FE-7B1E5FDB7DB4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{6DAF3E6B-8E1B-4E6E-B9FE-7B1E5FDB7DB4}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{6DAF3E6B-8E1B-4E6E-B9FE-7B1E5FDB7DB4}.Release|x86.ActiveCfg = Release|Any CPU
{1236F93A-AC5C-4A77-9477-C88F040151CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1236F93A-AC5C-4A77-9477-C88F040151CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1236F93A-AC5C-4A77-9477-C88F040151CA}.Debug|Any CPU.Build.0 = Debug|Any CPU {1236F93A-AC5C-4A77-9477-C88F040151CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1236F93A-AC5C-4A77-9477-C88F040151CA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {1236F93A-AC5C-4A77-9477-C88F040151CA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@ -101,16 +75,6 @@ Global
{B9F45F9D-D206-47F0-8E5F-54CE2F0BDF92}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {B9F45F9D-D206-47F0-8E5F-54CE2F0BDF92}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{B9F45F9D-D206-47F0-8E5F-54CE2F0BDF92}.Release|Mixed Platforms.Build.0 = Release|Any CPU {B9F45F9D-D206-47F0-8E5F-54CE2F0BDF92}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{B9F45F9D-D206-47F0-8E5F-54CE2F0BDF92}.Release|x86.ActiveCfg = Release|Any CPU {B9F45F9D-D206-47F0-8E5F-54CE2F0BDF92}.Release|x86.ActiveCfg = Release|Any CPU
{DCB6E0B1-223D-44E6-8696-4767E5B6E6A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DCB6E0B1-223D-44E6-8696-4767E5B6E6A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DCB6E0B1-223D-44E6-8696-4767E5B6E6A1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{DCB6E0B1-223D-44E6-8696-4767E5B6E6A1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{DCB6E0B1-223D-44E6-8696-4767E5B6E6A1}.Debug|x86.ActiveCfg = Debug|Any CPU
{DCB6E0B1-223D-44E6-8696-4767E5B6E6A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DCB6E0B1-223D-44E6-8696-4767E5B6E6A1}.Release|Any CPU.Build.0 = Release|Any CPU
{DCB6E0B1-223D-44E6-8696-4767E5B6E6A1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{DCB6E0B1-223D-44E6-8696-4767E5B6E6A1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{DCB6E0B1-223D-44E6-8696-4767E5B6E6A1}.Release|x86.ActiveCfg = Release|Any CPU
{8BFA392A-8B67-4454-916B-67C545EDFAEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8BFA392A-8B67-4454-916B-67C545EDFAEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8BFA392A-8B67-4454-916B-67C545EDFAEF}.Debug|Any CPU.Build.0 = Debug|Any CPU {8BFA392A-8B67-4454-916B-67C545EDFAEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8BFA392A-8B67-4454-916B-67C545EDFAEF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {8BFA392A-8B67-4454-916B-67C545EDFAEF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@ -141,12 +105,9 @@ Global
EndGlobalSection EndGlobalSection
GlobalSection(NestedProjects) = preSolution GlobalSection(NestedProjects) = preSolution
{8B828433-B333-4C19-96AE-00BFFF9D8841} = {3A1E31E3-2794-4CA3-B8E2-253E96BDE514} {8B828433-B333-4C19-96AE-00BFFF9D8841} = {3A1E31E3-2794-4CA3-B8E2-253E96BDE514}
{3F5212AA-E287-49DD-8CEC-44BF0A2AC9A1} = {99D5E5F3-88F5-4CCF-8D8C-717C8925DF09}
{6DAF3E6B-8E1B-4E6E-B9FE-7B1E5FDB7DB4} = {3A1E31E3-2794-4CA3-B8E2-253E96BDE514}
{1236F93A-AC5C-4A77-9477-C88F040151CA} = {3A1E31E3-2794-4CA3-B8E2-253E96BDE514} {1236F93A-AC5C-4A77-9477-C88F040151CA} = {3A1E31E3-2794-4CA3-B8E2-253E96BDE514}
{4492FF4C-9032-411D-853F-46B01755E504} = {E183C826-1360-4DFF-9994-F33CED5C8525} {4492FF4C-9032-411D-853F-46B01755E504} = {E183C826-1360-4DFF-9994-F33CED5C8525}
{B9F45F9D-D206-47F0-8E5F-54CE2F0BDF92} = {99D5E5F3-88F5-4CCF-8D8C-717C8925DF09} {B9F45F9D-D206-47F0-8E5F-54CE2F0BDF92} = {99D5E5F3-88F5-4CCF-8D8C-717C8925DF09}
{DCB6E0B1-223D-44E6-8696-4767E5B6E6A1} = {E183C826-1360-4DFF-9994-F33CED5C8525}
{8BFA392A-8B67-4454-916B-67C545EDFAEF} = {3A1E31E3-2794-4CA3-B8E2-253E96BDE514} {8BFA392A-8B67-4454-916B-67C545EDFAEF} = {3A1E31E3-2794-4CA3-B8E2-253E96BDE514}
{E837249E-E666-4DF2-AFC3-7A4D70234F9F} = {E183C826-1360-4DFF-9994-F33CED5C8525} {E837249E-E666-4DF2-AFC3-7A4D70234F9F} = {E183C826-1360-4DFF-9994-F33CED5C8525}
EndGlobalSection EndGlobalSection

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>6daf3e6b-8e1b-4e6e-b9fe-7b1e5fdb7db4</ProjectGuid>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

View File

@ -1,89 +0,0 @@
using System;
using System.Net.WebSockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Net.Http.Server;
namespace HelloWorld
{
public class Program
{
public static void Main(string[] args)
{
Run(args).Wait();
}
public static async Task Run(string[] args)
{
var settings = new WebListenerSettings();
settings.UrlPrefixes.Add("http://localhost:8080");
using (WebListener listener = new WebListener(settings))
{
listener.Start();
Console.WriteLine("Running...");
while (true)
{
RequestContext context = await listener.AcceptAsync();
Console.WriteLine("Accepted");
// Context:
// context.User;
// context.DisconnectToken
// context.Dispose()
// context.Abort();
// Request
// context.Request.ProtocolVersion
// context.Request.Headers
// context.Request.Method
// context.Request.Body
// Content-Length - long?
// Content-Type - string
// IsSecureConnection
// HasEntityBody
// TODO: Request fields
// Content-Encoding - Encoding
// Host
// Client certs - GetCertAsync, CertErrors
// Cookies
// KeepAlive
// QueryString (parsed)
// RequestTraceIdentifier
// RawUrl
// URI
// IsWebSocketRequest
// LocalEndpoint vs LocalIP & LocalPort
// RemoteEndpoint vs RemoteIP & RemotePort
// AcceptTypes string[]
// ServiceName
// TransportContext
// Response
byte[] bytes = Encoding.ASCII.GetBytes("Hello World: " + DateTime.Now);
if (context.IsWebSocketRequest)
{
Console.WriteLine("WebSocket");
WebSocket webSocket = await context.AcceptWebSocketAsync();
await webSocket.SendAsync(new ArraySegment<byte>(bytes, 0, bytes.Length), WebSocketMessageType.Text, true, CancellationToken.None);
await webSocket.CloseAsync(WebSocketCloseStatus.NormalClosure, "Goodbye", CancellationToken.None);
webSocket.Dispose();
}
else
{
Console.WriteLine("Hello World");
context.Response.ContentLength = bytes.Length;
context.Response.ContentType = "text/plain";
context.Response.Body.Write(bytes, 0, bytes.Length);
context.Dispose();
}
}
}
}
}
}

View File

@ -1,9 +0,0 @@
{
"profiles": {
"HelloWorld": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "http://localhost:8080"
}
}
}

View File

@ -1,22 +0,0 @@
{
"buildOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.Net.Http.Server": "1.2.0-*"
},
"commands": {
"sample": "HelloWorld"
},
"frameworks": {
"net451": {},
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.2.0-*",
"type": "platform"
}
}
}
}
}

View File

@ -2,10 +2,9 @@ using System;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Server.WebListener; using Microsoft.AspNetCore.Server.HttpSys;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Server;
namespace HotAddSample namespace HotAddSample
{ {

View File

@ -1,6 +1,6 @@
{ {
"dependencies": { "dependencies": {
"Microsoft.AspNetCore.Server.WebListener": "1.2.0-*", "Microsoft.AspNetCore.Server.HttpSys": "1.2.0-*",
"Microsoft.Extensions.Logging.Console": "1.2.0-*" "Microsoft.Extensions.Logging.Console": "1.2.0-*"
}, },
"buildOptions": { "buildOptions": {

View File

@ -5,10 +5,9 @@ using System.Threading;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Server.WebListener; using Microsoft.AspNetCore.Server.HttpSys;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Server;
namespace SelfHostServer namespace SelfHostServer
{ {

View File

@ -1,6 +1,6 @@
{ {
"dependencies": { "dependencies": {
"Microsoft.AspNetCore.Server.WebListener": "1.2.0-*", "Microsoft.AspNetCore.Server.HttpSys": "1.2.0-*",
"Microsoft.Extensions.Logging.Console": "1.2.0-*" "Microsoft.Extensions.Logging.Console": "1.2.0-*"
}, },
"buildOptions": { "buildOptions": {

View File

@ -7,7 +7,7 @@ using System.Diagnostics.Contracts;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal unsafe class AsyncAcceptContext : IAsyncResult, IDisposable internal unsafe class AsyncAcceptContext : IAsyncResult, IDisposable
{ {

View File

@ -7,9 +7,8 @@ using System.Security.Claims;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Http.Features.Authentication; using Microsoft.AspNetCore.Http.Features.Authentication;
using Microsoft.Extensions.Internal; using Microsoft.Extensions.Internal;
using Microsoft.Net.Http.Server;
namespace Microsoft.AspNetCore.Server.WebListener namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal class AuthenticationHandler : IAuthenticationHandler internal class AuthenticationHandler : IAuthenticationHandler
{ {

View File

@ -10,7 +10,7 @@ using System.Security.Claims;
using System.Security.Principal; using System.Security.Principal;
using Microsoft.Extensions.Primitives; using Microsoft.Extensions.Primitives;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
// See the native HTTP_SERVER_AUTHENTICATION_INFO structure documentation for additional information. // See the native HTTP_SERVER_AUTHENTICATION_INFO structure documentation for additional information.
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa364638(v=vs.85).aspx // http://msdn.microsoft.com/en-us/library/windows/desktop/aa364638(v=vs.85).aspx

View File

@ -3,7 +3,7 @@
using System; using System;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
// REVIEW: this appears to be very similar to System.Net.AuthenticationSchemes // REVIEW: this appears to be very similar to System.Net.AuthenticationSchemes
[Flags] [Flags]

View File

@ -3,7 +3,7 @@
using System; using System;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal static class Constants internal static class Constants
{ {
@ -13,6 +13,7 @@ namespace Microsoft.Net.Http.Server
internal const string Close = "close"; internal const string Close = "close";
internal const string Zero = "0"; internal const string Zero = "0";
internal const string SchemeDelimiter = "://"; internal const string SchemeDelimiter = "://";
internal const int Status101SwitchingProtocols = 101;
internal static Version V1_0 = new Version(1, 0); internal static Version V1_0 = new Version(1, 0);
internal static Version V1_1 = new Version(1, 1); internal static Version V1_1 = new Version(1, 1);

View File

@ -16,9 +16,8 @@ using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Http.Features.Authentication; using Microsoft.AspNetCore.Http.Features.Authentication;
using Microsoft.Extensions.Internal; using Microsoft.Extensions.Internal;
using Microsoft.Net.Http.Headers; using Microsoft.Net.Http.Headers;
using Microsoft.Net.Http.Server;
namespace Microsoft.AspNetCore.Server.WebListener namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal class FeatureContext : internal class FeatureContext :
IHttpRequestFeature, IHttpRequestFeature,

View File

@ -7,7 +7,7 @@ using System.Collections.Generic;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Primitives; using Microsoft.Extensions.Primitives;
namespace Microsoft.AspNetCore.Server.WebListener namespace Microsoft.AspNetCore.Server.HttpSys
{ {
/// <summary> /// <summary>
/// Represents a wrapper for RequestHeaders and ResponseHeaders. /// Represents a wrapper for RequestHeaders and ResponseHeaders.

View File

@ -7,7 +7,7 @@ using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal static class Helpers internal static class Helpers
{ {

View File

@ -4,7 +4,7 @@
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
namespace Microsoft.AspNetCore.Server.WebListener.Internal namespace Microsoft.AspNetCore.Server.HttpSys.Internal
{ {
public class WebListenerOptionsSetup : IConfigureOptions<WebListenerOptions> public class WebListenerOptionsSetup : IConfigureOptions<WebListenerOptions>
{ {
@ -17,7 +17,7 @@ namespace Microsoft.AspNetCore.Server.WebListener.Internal
public void Configure(WebListenerOptions options) public void Configure(WebListenerOptions options)
{ {
options.ListenerSettings.Logger = _loggerFactory.CreateLogger<Microsoft.Net.Http.Server.WebListener>(); options.ListenerSettings.Logger = _loggerFactory.CreateLogger<WebListener>();
} }
} }
} }

View File

@ -5,7 +5,7 @@ using System;
using System.Diagnostics; using System.Diagnostics;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace Microsoft.AspNetCore.Server.WebListener namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal static class LogHelper internal static class LogHelper
{ {
@ -31,6 +31,18 @@ namespace Microsoft.AspNetCore.Server.WebListener
} }
} }
internal static void LogDebug(ILogger logger, string location, string data)
{
if (logger == null)
{
Debug.WriteLine(data);
}
else
{
logger.LogDebug(location + "; " + data);
}
}
internal static void LogDebug(ILogger logger, string location, Exception exception) internal static void LogDebug(ILogger logger, string location, Exception exception)
{ {
if (logger == null) if (logger == null)

View File

@ -11,13 +11,12 @@ using Microsoft.AspNetCore.Hosting.Server.Features;
using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Http.Features;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Microsoft.Net.Http.Server;
namespace Microsoft.AspNetCore.Server.WebListener namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal class MessagePump : IServer internal class MessagePump : IServer
{ {
private readonly Microsoft.Net.Http.Server.WebListener _listener; private readonly WebListener _listener;
private readonly ILogger _logger; private readonly ILogger _logger;
private IHttpApplication<object> _application; private IHttpApplication<object> _application;
@ -44,7 +43,7 @@ namespace Microsoft.AspNetCore.Server.WebListener
} }
var optionsInstance = options.Value; var optionsInstance = options.Value;
_listener = new Microsoft.Net.Http.Server.WebListener(optionsInstance.ListenerSettings); _listener = new WebListener(optionsInstance.ListenerSettings);
_logger = LogHelper.CreateLogger(loggerFactory, typeof(MessagePump)); _logger = LogHelper.CreateLogger(loggerFactory, typeof(MessagePump));
Features = new FeatureCollection(); Features = new FeatureCollection();
_serverAddresses = new ServerAddressesFeature(); _serverAddresses = new ServerAddressesFeature();
@ -56,7 +55,7 @@ namespace Microsoft.AspNetCore.Server.WebListener
_shutdownSignal = new ManualResetEvent(false); _shutdownSignal = new ManualResetEvent(false);
} }
internal Microsoft.Net.Http.Server.WebListener Listener internal WebListener Listener
{ {
get { return _listener; } get { return _listener; }
} }
@ -207,7 +206,7 @@ namespace Microsoft.AspNetCore.Server.WebListener
context.Dispose(); context.Dispose();
} }
private void ParseAddresses(ICollection<string> addresses, Microsoft.Net.Http.Server.WebListener listener) private void ParseAddresses(ICollection<string> addresses, WebListener listener)
{ {
foreach (var value in addresses) foreach (var value in addresses)
{ {

View File

@ -13,5 +13,8 @@
<PropertyGroup> <PropertyGroup>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" /> <Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project> </Project>

View File

@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
#if NET451 #if NET451
/// <devdoc> /// <devdoc>

View File

@ -4,7 +4,7 @@
using System; using System;
using Microsoft.Extensions.Internal; using Microsoft.Extensions.Internal;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal static class ComNetOS internal static class ComNetOS
{ {

View File

@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal enum ContextAttribute internal enum ContextAttribute
{ {

View File

@ -4,7 +4,7 @@
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
// Note this type should only be used while the request buffer remains pinned // Note this type should only be used while the request buffer remains pinned
internal class CookedUrl internal class CookedUrl

View File

@ -8,7 +8,7 @@ using System.Diagnostics;
using System.Threading; using System.Threading;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal class DisconnectListener internal class DisconnectListener
{ {

View File

@ -4,7 +4,7 @@
using System; using System;
using Microsoft.Win32.SafeHandles; using Microsoft.Win32.SafeHandles;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal sealed class HeapAllocHandle : SafeHandleZeroOrMinusOneIsInvalid internal sealed class HeapAllocHandle : SafeHandleZeroOrMinusOneIsInvalid
{ {

View File

@ -6,7 +6,7 @@ using System.Collections.Generic;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using Microsoft.Extensions.Primitives; using Microsoft.Extensions.Primitives;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal static unsafe class HttpApi internal static unsafe class HttpApi
{ {

View File

@ -3,7 +3,7 @@
using Microsoft.Win32.SafeHandles; using Microsoft.Win32.SafeHandles;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
// This class is a wrapper for Http.sys V2 request queue handle. // This class is a wrapper for Http.sys V2 request queue handle.
internal sealed class HttpRequestQueueV2Handle : SafeHandleZeroOrMinusOneIsInvalid internal sealed class HttpRequestQueueV2Handle : SafeHandleZeroOrMinusOneIsInvalid

View File

@ -5,7 +5,7 @@ using System;
using System.Threading; using System.Threading;
using Microsoft.Win32.SafeHandles; using Microsoft.Win32.SafeHandles;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal sealed class HttpServerSessionHandle : CriticalHandleZeroOrMinusOneIsInvalid internal sealed class HttpServerSessionHandle : CriticalHandleZeroOrMinusOneIsInvalid
{ {

View File

@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal enum HttpSysRequestHeader internal enum HttpSysRequestHeader
{ {

View File

@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal enum HttpSysResponseHeader internal enum HttpSysResponseHeader
{ {

View File

@ -10,7 +10,7 @@ using System.Security;
using Microsoft.Win32; using Microsoft.Win32;
#endif #endif
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal static class HttpSysSettings internal static class HttpSysSettings
{ {

View File

@ -3,7 +3,7 @@
using System; using System;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal static class IntPtrHelper internal static class IntPtrHelper
{ {

View File

@ -3,7 +3,7 @@
using System; using System;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal static class NclUtilities internal static class NclUtilities
{ {

View File

@ -6,7 +6,7 @@ using System.Runtime.InteropServices;
using System.Threading; using System.Threading;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal class RequestQueue internal class RequestQueue
{ {

View File

@ -4,7 +4,7 @@
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
internal struct SSPIHandle internal struct SSPIHandle

View File

@ -3,7 +3,7 @@
using Microsoft.Win32.SafeHandles; using Microsoft.Win32.SafeHandles;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal sealed class SafeLoadLibrary : SafeHandleZeroOrMinusOneIsInvalid internal sealed class SafeLoadLibrary : SafeHandleZeroOrMinusOneIsInvalid
{ {

View File

@ -4,7 +4,7 @@
using System; using System;
using Microsoft.Win32.SafeHandles; using Microsoft.Win32.SafeHandles;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal sealed class SafeLocalFree : SafeHandleZeroOrMinusOneIsInvalid internal sealed class SafeLocalFree : SafeHandleZeroOrMinusOneIsInvalid
{ {

View File

@ -4,7 +4,7 @@
using System; using System;
using System.Security.Authentication.ExtendedProtection; using System.Security.Authentication.ExtendedProtection;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal class SafeLocalFreeChannelBinding : ChannelBinding internal class SafeLocalFreeChannelBinding : ChannelBinding
{ {

View File

@ -4,7 +4,7 @@
using System; using System;
using Microsoft.Win32.SafeHandles; using Microsoft.Win32.SafeHandles;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal sealed class SafeLocalMemHandle : SafeHandleZeroOrMinusOneIsInvalid internal sealed class SafeLocalMemHandle : SafeHandleZeroOrMinusOneIsInvalid
{ {

View File

@ -5,7 +5,7 @@ using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Threading; using System.Threading;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal class SafeNativeOverlapped : SafeHandle internal class SafeNativeOverlapped : SafeHandle
{ {

View File

@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
using System; using System;
using System.Globalization; using System.Globalization;

View File

@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal enum SecurityStatus internal enum SecurityStatus
{ {

View File

@ -4,7 +4,7 @@
using System; using System;
using System.Diagnostics; using System.Diagnostics;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal class ServerSession : IDisposable internal class ServerSession : IDisposable
{ {

View File

@ -8,7 +8,7 @@ using System.Globalization;
using System.Net; using System.Net;
using System.Text; using System.Text;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
// a little perf app measured these times when comparing the internal // a little perf app measured these times when comparing the internal
// buffer implemented as a managed byte[] or unmanaged memory IntPtr // buffer implemented as a managed byte[] or unmanaged memory IntPtr

View File

@ -3,10 +3,10 @@
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using static Microsoft.Net.Http.Server.HttpApi; using static Microsoft.AspNetCore.Server.HttpSys.HttpApi;
using static Microsoft.Net.Http.Server.UnsafeNclNativeMethods.TokenBinding; using static Microsoft.AspNetCore.Server.HttpSys.UnsafeNclNativeMethods.TokenBinding;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
/// <summary> /// <summary>
/// Contains helpers for dealing with TLS token binding. /// Contains helpers for dealing with TLS token binding.

View File

@ -5,7 +5,7 @@ using System;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal static unsafe class UnsafeNclNativeMethods internal static unsafe class UnsafeNclNativeMethods
{ {

View File

@ -5,7 +5,7 @@ using System;
using System.Diagnostics; using System.Diagnostics;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal class UrlGroup : IDisposable internal class UrlGroup : IDisposable
{ {

View File

@ -10,4 +10,4 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyCompany("Microsoft Corporation.")] [assembly: AssemblyCompany("Microsoft Corporation.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")] [assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyProduct("Microsoft ASP.NET Core")] [assembly: AssemblyProduct("Microsoft ASP.NET Core")]
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Server.WebListener.FunctionalTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.AspNetCore.Server.HttpSys.FunctionalTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]

View File

@ -0,0 +1,206 @@
// <auto-generated />
namespace Microsoft.AspNetCore.Server.HttpSys
{
using System.Globalization;
using System.Reflection;
using System.Resources;
internal static class Resources
{
private static readonly ResourceManager _resourceManager
= new ResourceManager("Microsoft.AspNetCore.Server.HttpSys.Resources", typeof(Resources).GetTypeInfo().Assembly);
/// <summary>
/// The destination array is too small.
/// </summary>
internal static string Exception_ArrayTooSmall
{
get { return GetString("Exception_ArrayTooSmall"); }
}
/// <summary>
/// The destination array is too small.
/// </summary>
internal static string FormatException_ArrayTooSmall()
{
return GetString("Exception_ArrayTooSmall");
}
/// <summary>
/// End has already been called.
/// </summary>
internal static string Exception_EndCalledMultipleTimes
{
get { return GetString("Exception_EndCalledMultipleTimes"); }
}
/// <summary>
/// End has already been called.
/// </summary>
internal static string FormatException_EndCalledMultipleTimes()
{
return GetString("Exception_EndCalledMultipleTimes");
}
/// <summary>
/// The status code '{0}' is not supported.
/// </summary>
internal static string Exception_InvalidStatusCode
{
get { return GetString("Exception_InvalidStatusCode"); }
}
/// <summary>
/// The status code '{0}' is not supported.
/// </summary>
internal static string FormatException_InvalidStatusCode(object p0)
{
return string.Format(CultureInfo.CurrentCulture, GetString("Exception_InvalidStatusCode"), p0);
}
/// <summary>
/// The stream is not seekable.
/// </summary>
internal static string Exception_NoSeek
{
get { return GetString("Exception_NoSeek"); }
}
/// <summary>
/// The stream is not seekable.
/// </summary>
internal static string FormatException_NoSeek()
{
return GetString("Exception_NoSeek");
}
/// <summary>
/// The prefix '{0}' is already registered.
/// </summary>
internal static string Exception_PrefixAlreadyRegistered
{
get { return GetString("Exception_PrefixAlreadyRegistered"); }
}
/// <summary>
/// The prefix '{0}' is already registered.
/// </summary>
internal static string FormatException_PrefixAlreadyRegistered(object p0)
{
return string.Format(CultureInfo.CurrentCulture, GetString("Exception_PrefixAlreadyRegistered"), p0);
}
/// <summary>
/// This stream only supports read operations.
/// </summary>
internal static string Exception_ReadOnlyStream
{
get { return GetString("Exception_ReadOnlyStream"); }
}
/// <summary>
/// This stream only supports read operations.
/// </summary>
internal static string FormatException_ReadOnlyStream()
{
return GetString("Exception_ReadOnlyStream");
}
/// <summary>
/// More data written than specified in the Content-Length header.
/// </summary>
internal static string Exception_TooMuchWritten
{
get { return GetString("Exception_TooMuchWritten"); }
}
/// <summary>
/// More data written than specified in the Content-Length header.
/// </summary>
internal static string FormatException_TooMuchWritten()
{
return GetString("Exception_TooMuchWritten");
}
/// <summary>
/// Only the http and https schemes are supported.
/// </summary>
internal static string Exception_UnsupportedScheme
{
get { return GetString("Exception_UnsupportedScheme"); }
}
/// <summary>
/// Only the http and https schemes are supported.
/// </summary>
internal static string FormatException_UnsupportedScheme()
{
return GetString("Exception_UnsupportedScheme");
}
/// <summary>
/// This stream only supports write operations.
/// </summary>
internal static string Exception_WriteOnlyStream
{
get { return GetString("Exception_WriteOnlyStream"); }
}
/// <summary>
/// This stream only supports write operations.
/// </summary>
internal static string FormatException_WriteOnlyStream()
{
return GetString("Exception_WriteOnlyStream");
}
/// <summary>
/// The given IAsyncResult does not match this opperation.
/// </summary>
internal static string Exception_WrongIAsyncResult
{
get { return GetString("Exception_WrongIAsyncResult"); }
}
/// <summary>
/// The given IAsyncResult does not match this opperation.
/// </summary>
internal static string FormatException_WrongIAsyncResult()
{
return GetString("Exception_WrongIAsyncResult");
}
/// <summary>
/// An exception occured while running an action registered with {0}.
/// </summary>
internal static string Warning_ExceptionInOnResponseCompletedAction
{
get { return GetString("Warning_ExceptionInOnResponseCompletedAction"); }
}
/// <summary>
/// An exception occured while running an action registered with {0}.
/// </summary>
internal static string FormatWarning_ExceptionInOnResponseCompletedAction(object p0)
{
return string.Format(CultureInfo.CurrentCulture, GetString("Warning_ExceptionInOnResponseCompletedAction"), p0);
}
private static string GetString(string name, params string[] formatterNames)
{
var value = _resourceManager.GetString(name);
System.Diagnostics.Debug.Assert(value != null);
if (formatterNames != null)
{
for (var i = 0; i < formatterNames.Length; i++)
{
value = value.Replace("{" + formatterNames[i] + "}", "{" + i + "}");
}
}
return value;
}
}
}

View File

@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal enum BoundaryType internal enum BoundaryType
{ {

View File

@ -14,7 +14,7 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
// This class is used to load the client certificate on-demand. Because client certs are optional, all // This class is used to load the client certificate on-demand. Because client certs are optional, all
// failures are handled internally and reported via ClientCertException or ClientCertError. // failures are handled internally and reported via ClientCertException or ClientCertError.

View File

@ -6,7 +6,7 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.Extensions.Primitives; using Microsoft.Extensions.Primitives;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
public class HeaderCollection : IDictionary<string, StringValues> public class HeaderCollection : IDictionary<string, StringValues>
{ {

View File

@ -3,7 +3,7 @@
using System.Text; using System.Text;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal static class HeaderEncoding internal static class HeaderEncoding
{ {

View File

@ -5,7 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.Extensions.Primitives; using Microsoft.Extensions.Primitives;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal static class HeaderParser internal static class HeaderParser
{ {

View File

@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal static class HttpKnownHeaderNames internal static class HttpKnownHeaderNames
{ {

View File

@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal static class HttpReasonPhrase internal static class HttpReasonPhrase
{ {
@ -84,11 +84,6 @@ namespace Microsoft.Net.Http.Server
} }
}; };
internal static string Get(HttpStatusCode code)
{
return Get((int)code);
}
internal static string Get(int code) internal static string Get(int code)
{ {
if (code >= 100 && code < 600) if (code >= 100 && code < 600)

View File

@ -9,7 +9,7 @@ using System.Security.Claims;
using System.Security.Principal; using System.Security.Principal;
using Microsoft.Extensions.Primitives; using Microsoft.Extensions.Primitives;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal unsafe class NativeRequestContext : IDisposable internal unsafe class NativeRequestContext : IDisposable
{ {

View File

@ -6,7 +6,7 @@ using System.IO;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
// A duplex wrapper around RequestStream and ResponseStream. // A duplex wrapper around RequestStream and ResponseStream.
// TODO: Consider merging RequestStream and ResponseStream instead. // TODO: Consider merging RequestStream and ResponseStream instead.

View File

@ -3,7 +3,7 @@
using System; using System;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal static class RawUrlHelper internal static class RawUrlHelper
{ {

View File

@ -10,7 +10,7 @@ using System.Security.Cryptography.X509Certificates;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
public sealed class Request public sealed class Request
{ {

View File

@ -11,7 +11,7 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
public sealed class RequestContext : IDisposable public sealed class RequestContext : IDisposable
{ {
@ -99,8 +99,8 @@ namespace Microsoft.Net.Http.Server
} }
// Set the status code and reason phrase // Set the status code and reason phrase
Response.StatusCode = (int)HttpStatusCode.SwitchingProtocols; Response.StatusCode = Constants.Status101SwitchingProtocols;
Response.ReasonPhrase = HttpReasonPhrase.Get(HttpStatusCode.SwitchingProtocols); Response.ReasonPhrase = HttpReasonPhrase.Get(Constants.Status101SwitchingProtocols);
Response.SendOpaqueUpgrade(); // TODO: Async Response.SendOpaqueUpgrade(); // TODO: Async
Request.SwitchToOpaqueMode(); Request.SwitchToOpaqueMode();

View File

@ -1,25 +1,5 @@
// Copyright (c) Microsoft Open Technologies, Inc. // Copyright (c) .NET Foundation. All rights reserved.
// All Rights Reserved // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF
// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR
// NON-INFRINGEMENT.
// See the Apache 2 License for the specific language governing
// permissions and limitations under the License.
//-----------------------------------------------------------------------
// <copyright>
// Copyright (c) Katana Contributors. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
// <auto-generated /> // <auto-generated />
using System; using System;
@ -31,7 +11,7 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Primitives; using Microsoft.Extensions.Primitives;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
[GeneratedCode("TextTemplatingFileGenerator", "")] [GeneratedCode("TextTemplatingFileGenerator", "")]
internal partial class RequestHeaders internal partial class RequestHeaders
@ -82,7 +62,7 @@ namespace Microsoft.Net.Http.Server
private StringValues _Via; private StringValues _Via;
private StringValues _Warning; private StringValues _Warning;
internal StringValues Accept internal StringValues Accept
{ {
get get
{ {
@ -104,7 +84,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues AcceptCharset internal StringValues AcceptCharset
{ {
get get
{ {
@ -126,7 +106,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues AcceptEncoding internal StringValues AcceptEncoding
{ {
get get
{ {
@ -148,7 +128,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues AcceptLanguage internal StringValues AcceptLanguage
{ {
get get
{ {
@ -170,7 +150,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues Allow internal StringValues Allow
{ {
get get
{ {
@ -192,7 +172,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues Authorization internal StringValues Authorization
{ {
get get
{ {
@ -214,7 +194,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues CacheControl internal StringValues CacheControl
{ {
get get
{ {
@ -236,7 +216,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues Connection internal StringValues Connection
{ {
get get
{ {
@ -258,7 +238,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues ContentEncoding internal StringValues ContentEncoding
{ {
get get
{ {
@ -280,7 +260,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues ContentLanguage internal StringValues ContentLanguage
{ {
get get
{ {
@ -302,7 +282,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues ContentLength internal StringValues ContentLength
{ {
get get
{ {
@ -324,7 +304,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues ContentLocation internal StringValues ContentLocation
{ {
get get
{ {
@ -346,7 +326,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues ContentMd5 internal StringValues ContentMd5
{ {
get get
{ {
@ -368,7 +348,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues ContentRange internal StringValues ContentRange
{ {
get get
{ {
@ -390,7 +370,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues ContentType internal StringValues ContentType
{ {
get get
{ {
@ -412,7 +392,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues Cookie internal StringValues Cookie
{ {
get get
{ {
@ -434,7 +414,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues Date internal StringValues Date
{ {
get get
{ {
@ -456,7 +436,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues Expect internal StringValues Expect
{ {
get get
{ {
@ -478,7 +458,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues Expires internal StringValues Expires
{ {
get get
{ {
@ -500,7 +480,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues From internal StringValues From
{ {
get get
{ {
@ -522,7 +502,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues Host internal StringValues Host
{ {
get get
{ {
@ -544,7 +524,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues IfMatch internal StringValues IfMatch
{ {
get get
{ {
@ -566,7 +546,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues IfModifiedSince internal StringValues IfModifiedSince
{ {
get get
{ {
@ -588,7 +568,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues IfNoneMatch internal StringValues IfNoneMatch
{ {
get get
{ {
@ -610,7 +590,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues IfRange internal StringValues IfRange
{ {
get get
{ {
@ -632,7 +612,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues IfUnmodifiedSince internal StringValues IfUnmodifiedSince
{ {
get get
{ {
@ -654,7 +634,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues KeepAlive internal StringValues KeepAlive
{ {
get get
{ {
@ -676,7 +656,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues LastModified internal StringValues LastModified
{ {
get get
{ {
@ -698,7 +678,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues MaxForwards internal StringValues MaxForwards
{ {
get get
{ {
@ -720,7 +700,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues Pragma internal StringValues Pragma
{ {
get get
{ {
@ -742,7 +722,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues ProxyAuthorization internal StringValues ProxyAuthorization
{ {
get get
{ {
@ -764,7 +744,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues Range internal StringValues Range
{ {
get get
{ {
@ -786,7 +766,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues Referer internal StringValues Referer
{ {
get get
{ {
@ -808,7 +788,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues Te internal StringValues Te
{ {
get get
{ {
@ -830,7 +810,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues Trailer internal StringValues Trailer
{ {
get get
{ {
@ -852,7 +832,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues TransferEncoding internal StringValues TransferEncoding
{ {
get get
{ {
@ -874,7 +854,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues Translate internal StringValues Translate
{ {
get get
{ {
@ -896,7 +876,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues Upgrade internal StringValues Upgrade
{ {
get get
{ {
@ -918,7 +898,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues UserAgent internal StringValues UserAgent
{ {
get get
{ {
@ -940,7 +920,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues Via internal StringValues Via
{ {
get get
{ {
@ -962,7 +942,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal StringValues Warning internal StringValues Warning
{ {
get get
{ {
@ -1732,7 +1712,7 @@ namespace Microsoft.Net.Http.Server
{ {
case 2: case 2:
if (_Te.Count > 0 if (_Te.Count > 0
&& string.Equals(key, "Te", StringComparison.Ordinal)) && string.Equals(key, "Te", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag1 & 0x2u) != 0); bool wasSet = ((_flag1 & 0x2u) != 0);
Te = StringValues.Empty; Te = StringValues.Empty;
@ -1740,8 +1720,8 @@ namespace Microsoft.Net.Http.Server
} }
break; break;
case 3: case 3:
if (_Via.Count > 0 if (_Via.Count > 0
&& string.Equals(key, "Via", StringComparison.Ordinal)) && string.Equals(key, "Via", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag1 & 0x80u) != 0); bool wasSet = ((_flag1 & 0x80u) != 0);
Via = StringValues.Empty; Via = StringValues.Empty;
@ -1749,22 +1729,22 @@ namespace Microsoft.Net.Http.Server
} }
break; break;
case 4: case 4:
if (_Date.Count > 0 if (_Date.Count > 0
&& string.Equals(key, "Date", StringComparison.Ordinal)) && string.Equals(key, "Date", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x10000u) != 0); bool wasSet = ((_flag0 & 0x10000u) != 0);
Date = StringValues.Empty; Date = StringValues.Empty;
return wasSet; return wasSet;
} }
if (_From.Count > 0 if (_From.Count > 0
&& string.Equals(key, "From", StringComparison.Ordinal)) && string.Equals(key, "From", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x80000u) != 0); bool wasSet = ((_flag0 & 0x80000u) != 0);
From = StringValues.Empty; From = StringValues.Empty;
return wasSet; return wasSet;
} }
if (_Host.Count > 0 if (_Host.Count > 0
&& string.Equals(key, "Host", StringComparison.Ordinal)) && string.Equals(key, "Host", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x100000u) != 0); bool wasSet = ((_flag0 & 0x100000u) != 0);
Host = StringValues.Empty; Host = StringValues.Empty;
@ -1773,14 +1753,14 @@ namespace Microsoft.Net.Http.Server
break; break;
case 5: case 5:
if (_Allow.Count > 0 if (_Allow.Count > 0
&& string.Equals(key, "Allow", StringComparison.Ordinal)) && string.Equals(key, "Allow", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x10u) != 0); bool wasSet = ((_flag0 & 0x10u) != 0);
Allow = StringValues.Empty; Allow = StringValues.Empty;
return wasSet; return wasSet;
} }
if (_Range.Count > 0 if (_Range.Count > 0
&& string.Equals(key, "Range", StringComparison.Ordinal)) && string.Equals(key, "Range", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x80000000u) != 0); bool wasSet = ((_flag0 & 0x80000000u) != 0);
Range = StringValues.Empty; Range = StringValues.Empty;
@ -1789,28 +1769,28 @@ namespace Microsoft.Net.Http.Server
break; break;
case 6: case 6:
if (_Accept.Count > 0 if (_Accept.Count > 0
&& string.Equals(key, "Accept", StringComparison.Ordinal)) && string.Equals(key, "Accept", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x1u) != 0); bool wasSet = ((_flag0 & 0x1u) != 0);
Accept = StringValues.Empty; Accept = StringValues.Empty;
return wasSet; return wasSet;
} }
if (_Cookie.Count > 0 if (_Cookie.Count > 0
&& string.Equals(key, "Cookie", StringComparison.Ordinal)) && string.Equals(key, "Cookie", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x8000u) != 0); bool wasSet = ((_flag0 & 0x8000u) != 0);
Cookie = StringValues.Empty; Cookie = StringValues.Empty;
return wasSet; return wasSet;
} }
if (_Expect.Count > 0 if (_Expect.Count > 0
&& string.Equals(key, "Expect", StringComparison.Ordinal)) && string.Equals(key, "Expect", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x20000u) != 0); bool wasSet = ((_flag0 & 0x20000u) != 0);
Expect = StringValues.Empty; Expect = StringValues.Empty;
return wasSet; return wasSet;
} }
if (_Pragma.Count > 0 if (_Pragma.Count > 0
&& string.Equals(key, "Pragma", StringComparison.Ordinal)) && string.Equals(key, "Pragma", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x20000000u) != 0); bool wasSet = ((_flag0 & 0x20000000u) != 0);
Pragma = StringValues.Empty; Pragma = StringValues.Empty;
@ -1819,35 +1799,35 @@ namespace Microsoft.Net.Http.Server
break; break;
case 7: case 7:
if (_Expires.Count > 0 if (_Expires.Count > 0
&& string.Equals(key, "Expires", StringComparison.Ordinal)) && string.Equals(key, "Expires", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x40000u) != 0); bool wasSet = ((_flag0 & 0x40000u) != 0);
Expires = StringValues.Empty; Expires = StringValues.Empty;
return wasSet; return wasSet;
} }
if (_Referer.Count > 0 if (_Referer.Count > 0
&& string.Equals(key, "Referer", StringComparison.Ordinal)) && string.Equals(key, "Referer", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag1 & 0x1u) != 0); bool wasSet = ((_flag1 & 0x1u) != 0);
Referer = StringValues.Empty; Referer = StringValues.Empty;
return wasSet; return wasSet;
} }
if (_Trailer.Count > 0 if (_Trailer.Count > 0
&& string.Equals(key, "Trailer", StringComparison.Ordinal)) && string.Equals(key, "Trailer", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag1 & 0x4u) != 0); bool wasSet = ((_flag1 & 0x4u) != 0);
Trailer = StringValues.Empty; Trailer = StringValues.Empty;
return wasSet; return wasSet;
} }
if (_Upgrade.Count > 0 if (_Upgrade.Count > 0
&& string.Equals(key, "Upgrade", StringComparison.Ordinal)) && string.Equals(key, "Upgrade", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag1 & 0x20u) != 0); bool wasSet = ((_flag1 & 0x20u) != 0);
Upgrade = StringValues.Empty; Upgrade = StringValues.Empty;
return wasSet; return wasSet;
} }
if (_Warning.Count > 0 if (_Warning.Count > 0
&& string.Equals(key, "Warning", StringComparison.Ordinal)) && string.Equals(key, "Warning", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag1 & 0x100u) != 0); bool wasSet = ((_flag1 & 0x100u) != 0);
Warning = StringValues.Empty; Warning = StringValues.Empty;
@ -1856,14 +1836,14 @@ namespace Microsoft.Net.Http.Server
break; break;
case 8: case 8:
if (_IfMatch.Count > 0 if (_IfMatch.Count > 0
&& string.Equals(key, "If-Match", StringComparison.Ordinal)) && string.Equals(key, "If-Match", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x200000u) != 0); bool wasSet = ((_flag0 & 0x200000u) != 0);
IfMatch = StringValues.Empty; IfMatch = StringValues.Empty;
return wasSet; return wasSet;
} }
if (_IfRange.Count > 0 if (_IfRange.Count > 0
&& string.Equals(key, "If-Range", StringComparison.Ordinal)) && string.Equals(key, "If-Range", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x1000000u) != 0); bool wasSet = ((_flag0 & 0x1000000u) != 0);
IfRange = StringValues.Empty; IfRange = StringValues.Empty;
@ -1872,7 +1852,7 @@ namespace Microsoft.Net.Http.Server
break; break;
case 9: case 9:
if (_Translate.Count > 0 if (_Translate.Count > 0
&& string.Equals(key, "Translate", StringComparison.Ordinal)) && string.Equals(key, "Translate", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag1 & 0x10u) != 0); bool wasSet = ((_flag1 & 0x10u) != 0);
Translate = StringValues.Empty; Translate = StringValues.Empty;
@ -1881,21 +1861,21 @@ namespace Microsoft.Net.Http.Server
break; break;
case 10: case 10:
if (_Connection.Count > 0 if (_Connection.Count > 0
&& string.Equals(key, "Connection", StringComparison.Ordinal)) && string.Equals(key, "Connection", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x80u) != 0); bool wasSet = ((_flag0 & 0x80u) != 0);
Connection = StringValues.Empty; Connection = StringValues.Empty;
return wasSet; return wasSet;
} }
if (_KeepAlive.Count > 0 if (_KeepAlive.Count > 0
&& string.Equals(key, "Keep-Alive", StringComparison.Ordinal)) && string.Equals(key, "Keep-Alive", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x4000000u) != 0); bool wasSet = ((_flag0 & 0x4000000u) != 0);
KeepAlive = StringValues.Empty; KeepAlive = StringValues.Empty;
return wasSet; return wasSet;
} }
if (_UserAgent.Count > 0 if (_UserAgent.Count > 0
&& string.Equals(key, "User-Agent", StringComparison.Ordinal)) && string.Equals(key, "User-Agent", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag1 & 0x40u) != 0); bool wasSet = ((_flag1 & 0x40u) != 0);
UserAgent = StringValues.Empty; UserAgent = StringValues.Empty;
@ -1904,7 +1884,7 @@ namespace Microsoft.Net.Http.Server
break; break;
case 11: case 11:
if (_ContentMd5.Count > 0 if (_ContentMd5.Count > 0
&& string.Equals(key, "Content-Md5", StringComparison.Ordinal)) && string.Equals(key, "Content-Md5", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x1000u) != 0); bool wasSet = ((_flag0 & 0x1000u) != 0);
ContentMd5 = StringValues.Empty; ContentMd5 = StringValues.Empty;
@ -1913,14 +1893,14 @@ namespace Microsoft.Net.Http.Server
break; break;
case 12: case 12:
if (_ContentType.Count > 0 if (_ContentType.Count > 0
&& string.Equals(key, "Content-Type", StringComparison.Ordinal)) && string.Equals(key, "Content-Type", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x4000u) != 0); bool wasSet = ((_flag0 & 0x4000u) != 0);
ContentType = StringValues.Empty; ContentType = StringValues.Empty;
return wasSet; return wasSet;
} }
if (_MaxForwards.Count > 0 if (_MaxForwards.Count > 0
&& string.Equals(key, "Max-Forwards", StringComparison.Ordinal)) && string.Equals(key, "Max-Forwards", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x10000000u) != 0); bool wasSet = ((_flag0 & 0x10000000u) != 0);
MaxForwards = StringValues.Empty; MaxForwards = StringValues.Empty;
@ -1929,35 +1909,35 @@ namespace Microsoft.Net.Http.Server
break; break;
case 13: case 13:
if (_Authorization.Count > 0 if (_Authorization.Count > 0
&& string.Equals(key, "Authorization", StringComparison.Ordinal)) && string.Equals(key, "Authorization", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x20u) != 0); bool wasSet = ((_flag0 & 0x20u) != 0);
Authorization = StringValues.Empty; Authorization = StringValues.Empty;
return wasSet; return wasSet;
} }
if (_CacheControl.Count > 0 if (_CacheControl.Count > 0
&& string.Equals(key, "Cache-Control", StringComparison.Ordinal)) && string.Equals(key, "Cache-Control", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x40u) != 0); bool wasSet = ((_flag0 & 0x40u) != 0);
CacheControl = StringValues.Empty; CacheControl = StringValues.Empty;
return wasSet; return wasSet;
} }
if (_ContentRange.Count > 0 if (_ContentRange.Count > 0
&& string.Equals(key, "Content-Range", StringComparison.Ordinal)) && string.Equals(key, "Content-Range", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x2000u) != 0); bool wasSet = ((_flag0 & 0x2000u) != 0);
ContentRange = StringValues.Empty; ContentRange = StringValues.Empty;
return wasSet; return wasSet;
} }
if (_IfNoneMatch.Count > 0 if (_IfNoneMatch.Count > 0
&& string.Equals(key, "If-None-Match", StringComparison.Ordinal)) && string.Equals(key, "If-None-Match", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x800000u) != 0); bool wasSet = ((_flag0 & 0x800000u) != 0);
IfNoneMatch = StringValues.Empty; IfNoneMatch = StringValues.Empty;
return wasSet; return wasSet;
} }
if (_LastModified.Count > 0 if (_LastModified.Count > 0
&& string.Equals(key, "Last-Modified", StringComparison.Ordinal)) && string.Equals(key, "Last-Modified", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x8000000u) != 0); bool wasSet = ((_flag0 & 0x8000000u) != 0);
LastModified = StringValues.Empty; LastModified = StringValues.Empty;
@ -1966,14 +1946,14 @@ namespace Microsoft.Net.Http.Server
break; break;
case 14: case 14:
if (_AcceptCharset.Count > 0 if (_AcceptCharset.Count > 0
&& string.Equals(key, "Accept-Charset", StringComparison.Ordinal)) && string.Equals(key, "Accept-Charset", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x2u) != 0); bool wasSet = ((_flag0 & 0x2u) != 0);
AcceptCharset = StringValues.Empty; AcceptCharset = StringValues.Empty;
return wasSet; return wasSet;
} }
if (_ContentLength.Count > 0 if (_ContentLength.Count > 0
&& string.Equals(key, "Content-Length", StringComparison.Ordinal)) && string.Equals(key, "Content-Length", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x400u) != 0); bool wasSet = ((_flag0 & 0x400u) != 0);
ContentLength = StringValues.Empty; ContentLength = StringValues.Empty;
@ -1982,14 +1962,14 @@ namespace Microsoft.Net.Http.Server
break; break;
case 15: case 15:
if (_AcceptEncoding.Count > 0 if (_AcceptEncoding.Count > 0
&& string.Equals(key, "Accept-Encoding", StringComparison.Ordinal)) && string.Equals(key, "Accept-Encoding", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x4u) != 0); bool wasSet = ((_flag0 & 0x4u) != 0);
AcceptEncoding = StringValues.Empty; AcceptEncoding = StringValues.Empty;
return wasSet; return wasSet;
} }
if (_AcceptLanguage.Count > 0 if (_AcceptLanguage.Count > 0
&& string.Equals(key, "Accept-Language", StringComparison.Ordinal)) && string.Equals(key, "Accept-Language", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x8u) != 0); bool wasSet = ((_flag0 & 0x8u) != 0);
AcceptLanguage = StringValues.Empty; AcceptLanguage = StringValues.Empty;
@ -1998,21 +1978,21 @@ namespace Microsoft.Net.Http.Server
break; break;
case 16: case 16:
if (_ContentEncoding.Count > 0 if (_ContentEncoding.Count > 0
&& string.Equals(key, "Content-Encoding", StringComparison.Ordinal)) && string.Equals(key, "Content-Encoding", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x100u) != 0); bool wasSet = ((_flag0 & 0x100u) != 0);
ContentEncoding = StringValues.Empty; ContentEncoding = StringValues.Empty;
return wasSet; return wasSet;
} }
if (_ContentLanguage.Count > 0 if (_ContentLanguage.Count > 0
&& string.Equals(key, "Content-Language", StringComparison.Ordinal)) && string.Equals(key, "Content-Language", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x200u) != 0); bool wasSet = ((_flag0 & 0x200u) != 0);
ContentLanguage = StringValues.Empty; ContentLanguage = StringValues.Empty;
return wasSet; return wasSet;
} }
if (_ContentLocation.Count > 0 if (_ContentLocation.Count > 0
&& string.Equals(key, "Content-Location", StringComparison.Ordinal)) && string.Equals(key, "Content-Location", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x800u) != 0); bool wasSet = ((_flag0 & 0x800u) != 0);
ContentLocation = StringValues.Empty; ContentLocation = StringValues.Empty;
@ -2021,14 +2001,14 @@ namespace Microsoft.Net.Http.Server
break; break;
case 17: case 17:
if (_IfModifiedSince.Count > 0 if (_IfModifiedSince.Count > 0
&& string.Equals(key, "If-Modified-Since", StringComparison.Ordinal)) && string.Equals(key, "If-Modified-Since", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x400000u) != 0); bool wasSet = ((_flag0 & 0x400000u) != 0);
IfModifiedSince = StringValues.Empty; IfModifiedSince = StringValues.Empty;
return wasSet; return wasSet;
} }
if (_TransferEncoding.Count > 0 if (_TransferEncoding.Count > 0
&& string.Equals(key, "Transfer-Encoding", StringComparison.Ordinal)) && string.Equals(key, "Transfer-Encoding", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag1 & 0x8u) != 0); bool wasSet = ((_flag1 & 0x8u) != 0);
TransferEncoding = StringValues.Empty; TransferEncoding = StringValues.Empty;
@ -2037,14 +2017,14 @@ namespace Microsoft.Net.Http.Server
break; break;
case 19: case 19:
if (_IfUnmodifiedSince.Count > 0 if (_IfUnmodifiedSince.Count > 0
&& string.Equals(key, "If-Unmodified-Since", StringComparison.Ordinal)) && string.Equals(key, "If-Unmodified-Since", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x2000000u) != 0); bool wasSet = ((_flag0 & 0x2000000u) != 0);
IfUnmodifiedSince = StringValues.Empty; IfUnmodifiedSince = StringValues.Empty;
return wasSet; return wasSet;
} }
if (_ProxyAuthorization.Count > 0 if (_ProxyAuthorization.Count > 0
&& string.Equals(key, "Proxy-Authorization", StringComparison.Ordinal)) && string.Equals(key, "Proxy-Authorization", StringComparison.Ordinal))
{ {
bool wasSet = ((_flag0 & 0x40000000u) != 0); bool wasSet = ((_flag0 & 0x40000000u) != 0);
ProxyAuthorization = StringValues.Empty; ProxyAuthorization = StringValues.Empty;

View File

@ -54,11 +54,8 @@ Func<int,string> IsRead = Index => "((_flag" + (Index / 32) + " & 0x" + (1<<(Ind
Func<int,string> MarkRead = Index => "_flag" + (Index / 32) + " |= 0x" + (1<<(Index % 32)).ToString("x") + "u"; Func<int,string> MarkRead = Index => "_flag" + (Index / 32) + " |= 0x" + (1<<(Index % 32)).ToString("x") + "u";
Func<int,string> Clear = Index => "_flag" + (Index / 32) + " &= ~0x" + (1<<(Index % 32)).ToString("x") + "u"; Func<int,string> Clear = Index => "_flag" + (Index / 32) + " &= ~0x" + (1<<(Index % 32)).ToString("x") + "u";
#> #>
//----------------------------------------------------------------------- // Copyright (c) .NET Foundation. All rights reserved.
// <copyright> // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Katana Contributors. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
// <auto-generated /> // <auto-generated />
using System; using System;
@ -70,7 +67,7 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Primitives; using Microsoft.Extensions.Primitives;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
[GeneratedCode("TextTemplatingFileGenerator", "")] [GeneratedCode("TextTemplatingFileGenerator", "")]
internal partial class RequestHeaders internal partial class RequestHeaders
@ -141,7 +138,7 @@ namespace Microsoft.Net.Http.Server
break; break;
<# } #> <# } #>
} }
value = null; value = StringValues.Empty;
return false; return false;
} }
@ -173,10 +170,10 @@ namespace Microsoft.Net.Http.Server
case <#=length.Key#>: case <#=length.Key#>:
<# foreach(var prop in length) { #> <# foreach(var prop in length) { #>
if (_<#=prop.Name#>.Count > 0 if (_<#=prop.Name#>.Count > 0
&& string.Equals(key, "<#=prop.Key#>", StringComparison.Ordinal)) && string.Equals(key, "<#=prop.Key#>", StringComparison.Ordinal))
{ {
bool wasSet = <#=IsRead(prop.Index)#>; bool wasSet = <#=IsRead(prop.Index)#>;
<#=prop.Name#> = null; <#=prop.Name#> = StringValues.Empty;
return wasSet; return wasSet;
} }
<# } #> <# } #>

View File

@ -8,7 +8,7 @@ using System.Linq;
using System.Threading; using System.Threading;
using Microsoft.Extensions.Primitives; using Microsoft.Extensions.Primitives;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal partial class RequestHeaders : IDictionary<string, StringValues> internal partial class RequestHeaders : IDictionary<string, StringValues>
{ {

View File

@ -8,7 +8,7 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal class RequestStream : Stream internal class RequestStream : Stream
{ {

View File

@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal unsafe class RequestStreamAsyncResult : IAsyncResult, IDisposable internal unsafe class RequestStreamAsyncResult : IAsyncResult, IDisposable
{ {

View File

@ -4,7 +4,7 @@
using System; using System;
using System.Text; using System.Text;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
// We don't use the cooked URL because http.sys unescapes all percent-encoded values. However, // We don't use the cooked URL because http.sys unescapes all percent-encoded values. However,
// we also can't just use the raw Uri, since http.sys supports not only UTF-8, but also ANSI/DBCS and // we also can't just use the raw Uri, since http.sys supports not only UTF-8, but also ANSI/DBCS and

View File

@ -9,16 +9,17 @@ using System.IO;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Primitives; using Microsoft.Extensions.Primitives;
using static Microsoft.Net.Http.Server.UnsafeNclNativeMethods; using static Microsoft.AspNetCore.Server.HttpSys.UnsafeNclNativeMethods;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
public sealed class Response public sealed class Response
{ {
private ResponseState _responseState; private ResponseState _responseState;
private string _reasonPhrase; private string _reasonPhrase;
private ResponseStream _nativeStream; private ResponseBody _nativeStream;
private AuthenticationSchemes _authChallenges; private AuthenticationSchemes _authChallenges;
private TimeSpan? _cacheTtl; private TimeSpan? _cacheTtl;
private long _expectedBodyLength; private long _expectedBodyLength;
@ -37,7 +38,7 @@ namespace Microsoft.Net.Http.Server
Headers.Clear(); Headers.Clear();
_reasonPhrase = null; _reasonPhrase = null;
_boundaryType = BoundaryType.None; _boundaryType = BoundaryType.None;
_nativeResponse.Response_V1.StatusCode = (ushort)HttpStatusCode.OK; _nativeResponse.Response_V1.StatusCode = (ushort)StatusCodes.Status200OK;
_nativeResponse.Response_V1.Version.MajorVersion = 1; _nativeResponse.Response_V1.Version.MajorVersion = 1;
_nativeResponse.Response_V1.Version.MinorVersion = 1; _nativeResponse.Response_V1.Version.MinorVersion = 1;
_responseState = ResponseState.Created; _responseState = ResponseState.Created;
@ -274,7 +275,7 @@ namespace Microsoft.Net.Http.Server
{ {
if (_nativeStream == null) if (_nativeStream == null)
{ {
_nativeStream = new ResponseStream(RequestContext); _nativeStream = new ResponseBody(RequestContext);
} }
} }
@ -391,8 +392,7 @@ namespace Microsoft.Net.Http.Server
internal HttpApi.HTTP_FLAGS ComputeHeaders(long writeCount, bool endOfRequest = false) internal HttpApi.HTTP_FLAGS ComputeHeaders(long writeCount, bool endOfRequest = false)
{ {
// 401 if (StatusCode == (ushort)StatusCodes.Status401Unauthorized)
if (StatusCode == (ushort)HttpStatusCode.Unauthorized)
{ {
RequestContext.Server.Settings.Authentication.SetAuthenticationChallenge(RequestContext); RequestContext.Server.Settings.Authentication.SetAuthenticationChallenge(RequestContext);
} }

View File

@ -10,11 +10,11 @@ using System.Runtime.InteropServices;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using static Microsoft.Net.Http.Server.UnsafeNclNativeMethods; using static Microsoft.AspNetCore.Server.HttpSys.UnsafeNclNativeMethods;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal class ResponseStream : Stream internal class ResponseBody : Stream
{ {
private RequestContext _requestContext; private RequestContext _requestContext;
private long _leftToWrite = long.MinValue; private long _leftToWrite = long.MinValue;
@ -24,7 +24,7 @@ namespace Microsoft.Net.Http.Server
// The last write needs special handling to cancel. // The last write needs special handling to cancel.
private ResponseStreamAsyncResult _lastWrite; private ResponseStreamAsyncResult _lastWrite;
internal ResponseStream(RequestContext requestContext) internal ResponseBody(RequestContext requestContext)
{ {
_requestContext = requestContext; _requestContext = requestContext;
} }

View File

@ -7,9 +7,9 @@ using System.IO;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using static Microsoft.Net.Http.Server.UnsafeNclNativeMethods; using static Microsoft.AspNetCore.Server.HttpSys.UnsafeNclNativeMethods;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal unsafe class ResponseStreamAsyncResult : IAsyncResult, IDisposable internal unsafe class ResponseStreamAsyncResult : IAsyncResult, IDisposable
{ {
@ -18,13 +18,13 @@ namespace Microsoft.Net.Http.Server
private SafeNativeOverlapped _overlapped; private SafeNativeOverlapped _overlapped;
private HttpApi.HTTP_DATA_CHUNK[] _dataChunks; private HttpApi.HTTP_DATA_CHUNK[] _dataChunks;
private FileStream _fileStream; private FileStream _fileStream;
private ResponseStream _responseStream; private ResponseBody _responseStream;
private TaskCompletionSource<object> _tcs; private TaskCompletionSource<object> _tcs;
private uint _bytesSent; private uint _bytesSent;
private CancellationToken _cancellationToken; private CancellationToken _cancellationToken;
private CancellationTokenRegistration _cancellationRegistration; private CancellationTokenRegistration _cancellationRegistration;
internal ResponseStreamAsyncResult(ResponseStream responseStream, CancellationToken cancellationToken) internal ResponseStreamAsyncResult(ResponseBody responseStream, CancellationToken cancellationToken)
{ {
_responseStream = responseStream; _responseStream = responseStream;
_tcs = new TaskCompletionSource<object>(); _tcs = new TaskCompletionSource<object>();
@ -38,7 +38,7 @@ namespace Microsoft.Net.Http.Server
_cancellationRegistration = cancellationRegistration; _cancellationRegistration = cancellationRegistration;
} }
internal ResponseStreamAsyncResult(ResponseStream responseStream, ArraySegment<byte> data, bool chunked, internal ResponseStreamAsyncResult(ResponseBody responseStream, ArraySegment<byte> data, bool chunked,
CancellationToken cancellationToken) CancellationToken cancellationToken)
: this(responseStream, cancellationToken) : this(responseStream, cancellationToken)
{ {
@ -94,7 +94,7 @@ namespace Microsoft.Net.Http.Server
} }
} }
internal ResponseStreamAsyncResult(ResponseStream responseStream, FileStream fileStream, long offset, internal ResponseStreamAsyncResult(ResponseBody responseStream, FileStream fileStream, long offset,
long count, bool chunked, CancellationToken cancellationToken) long count, bool chunked, CancellationToken cancellationToken)
: this(responseStream, cancellationToken) : this(responseStream, cancellationToken)
{ {

View File

@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal enum SslStatus : byte internal enum SslStatus : byte
{ {

View File

@ -6,7 +6,7 @@ using System.IO;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.AspNetCore.Server.WebListener namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal class ResponseStream : Stream internal class ResponseStream : Stream
{ {
@ -73,7 +73,7 @@ namespace Microsoft.AspNetCore.Server.WebListener
await _onStart(); await _onStart();
await _innerStream.WriteAsync(buffer, offset, count, cancellationToken); await _innerStream.WriteAsync(buffer, offset, count, cancellationToken);
} }
#if NETSTANDARD1_3 #if NETSTANDARD1_3
public IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state) public IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
#else #else
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state) public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)

View File

@ -6,9 +6,8 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Http.Features.Authentication; using Microsoft.AspNetCore.Http.Features.Authentication;
using Microsoft.Net.Http.Server;
namespace Microsoft.AspNetCore.Server.WebListener namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal sealed class StandardFeatureCollection : IFeatureCollection internal sealed class StandardFeatureCollection : IFeatureCollection
{ {

View File

@ -4,7 +4,7 @@
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
// See the native HTTP_TIMEOUT_LIMIT_INFO structure documentation for additional information. // See the native HTTP_TIMEOUT_LIMIT_INFO structure documentation for additional information.
// http://msdn.microsoft.com/en-us/library/aa364661.aspx // http://msdn.microsoft.com/en-us/library/aa364661.aspx

View File

@ -4,7 +4,7 @@
using System; using System;
using System.Globalization; using System.Globalization;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
public class UrlPrefix public class UrlPrefix
{ {

View File

@ -4,7 +4,7 @@
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
/// <summary> /// <summary>
/// A collection or URL prefixes /// A collection or URL prefixes

View File

@ -4,7 +4,7 @@
using System; using System;
using System.Globalization; using System.Globalization;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal static class ValidationHelper internal static class ValidationHelper
{ {

View File

@ -3,8 +3,8 @@
using System; using System;
using Microsoft.AspNetCore.Hosting.Server; using Microsoft.AspNetCore.Hosting.Server;
using Microsoft.AspNetCore.Server.WebListener; using Microsoft.AspNetCore.Server.HttpSys;
using Microsoft.AspNetCore.Server.WebListener.Internal; using Microsoft.AspNetCore.Server.HttpSys.Internal;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;

View File

@ -6,9 +6,10 @@ using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
/// <summary> /// <summary>
/// An HTTP server wrapping the Http.Sys APIs that accepts requests. /// An HTTP server wrapping the Http.Sys APIs that accepts requests.
@ -301,7 +302,7 @@ namespace Microsoft.Net.Http.Server
// Block potential DOS attacks // Block potential DOS attacks
if (requestMemory.UnknownHeaderCount > UnknownHeaderLimit) if (requestMemory.UnknownHeaderCount > UnknownHeaderLimit)
{ {
SendError(requestMemory.RequestId, HttpStatusCode.BadRequest, authChallenges: null); SendError(requestMemory.RequestId, StatusCodes.Status400BadRequest, authChallenges: null);
return false; return false;
} }
return true; return true;
@ -311,14 +312,14 @@ namespace Microsoft.Net.Http.Server
{ {
if (!Settings.Authentication.AllowAnonymous && !requestMemory.CheckAuthenticated()) if (!Settings.Authentication.AllowAnonymous && !requestMemory.CheckAuthenticated())
{ {
SendError(requestMemory.RequestId, HttpStatusCode.Unauthorized, SendError(requestMemory.RequestId, StatusCodes.Status401Unauthorized,
AuthenticationManager.GenerateChallenges(Settings.Authentication.Schemes)); AuthenticationManager.GenerateChallenges(Settings.Authentication.Schemes));
return false; return false;
} }
return true; return true;
} }
private unsafe void SendError(ulong requestId, HttpStatusCode httpStatusCode, IList<string> authChallenges) private unsafe void SendError(ulong requestId, int httpStatusCode, IList<string> authChallenges)
{ {
HttpApi.HTTP_RESPONSE_V2 httpResponse = new HttpApi.HTTP_RESPONSE_V2(); HttpApi.HTTP_RESPONSE_V2 httpResponse = new HttpApi.HTTP_RESPONSE_V2();
httpResponse.Response_V1.Version = new HttpApi.HTTP_VERSION(); httpResponse.Response_V1.Version = new HttpApi.HTTP_VERSION();

View File

@ -6,7 +6,7 @@ using System.ComponentModel;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
[SuppressMessage("Microsoft.Usage", "CA2237:MarkISerializableTypesWithSerializable")] [SuppressMessage("Microsoft.Usage", "CA2237:MarkISerializableTypesWithSerializable")]
public class WebListenerException : Win32Exception public class WebListenerException : Win32Exception

View File

@ -2,9 +2,8 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
using Microsoft.Net.Http.Server;
namespace Microsoft.AspNetCore.Server.WebListener namespace Microsoft.AspNetCore.Server.HttpSys
{ {
public class WebListenerOptions public class WebListenerOptions
{ {

View File

@ -5,7 +5,7 @@ using System;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Logging.Abstractions;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
public class WebListenerSettings public class WebListenerSettings
{ {

View File

@ -11,7 +11,7 @@ using System.Security.Cryptography;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
namespace Microsoft.Net.Http.Server namespace Microsoft.AspNetCore.Server.HttpSys
{ {
internal static class WebSocketHelpers internal static class WebSocketHelpers
{ {

View File

@ -1,15 +1,19 @@
{ {
"version": "1.2.0-*", "version": "1.2.0-*",
"description": ".NET HTTP server that uses the Windows HTTP Server API.", "description": "ASP.NET Core HTTP server that uses the Windows HTTP Server API.",
"packOptions": { "packOptions": {
"tags": [ "tags": [
"netcore", "aspnetcore",
"weblistener" "weblistener"
] ]
}, },
"dependencies": { "dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "1.2.0-*", "Microsoft.AspNetCore.Hosting": "1.2.0-*",
"Microsoft.Extensions.Primitives": "1.2.0-*", "Microsoft.Extensions.TaskCache.Sources": {
"version": "1.2.0-*",
"type": "build"
},
"Microsoft.Net.Http.Headers": "1.2.0-*",
"NETStandard.Library": "1.6.2-*" "NETStandard.Library": "1.6.2-*"
}, },
"buildOptions": { "buildOptions": {
@ -22,13 +26,7 @@
"xmlDoc": true "xmlDoc": true
}, },
"frameworks": { "frameworks": {
"net451": { "net451": {},
"frameworkAssemblies": {
"System.Runtime": {
"type": "build"
}
}
},
"netstandard1.3": { "netstandard1.3": {
"dependencies": { "dependencies": {
"Microsoft.Extensions.RuntimeEnvironment.Sources": { "Microsoft.Extensions.RuntimeEnvironment.Sources": {

Some files were not shown because too many files have changed in this diff Show More