#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
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{3A1E31E3-2794-4CA3-B8E2-253E96BDE514}"
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}"
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
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}"
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}"
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("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5E9B546C-17AC-4BDF-BCB3-5955D4755ED8}"
ProjectSection(SolutionItems) = preProject
@ -29,7 +23,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "HotAddSample", "samples\HotAddSample\HotAddSample.xproj", "{8BFA392A-8B67-4454-916B-67C545EDFAEF}"
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
Global
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.Build.0 = 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.Build.0 = 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.Build.0 = 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.Build.0 = Debug|Any CPU
{8BFA392A-8B67-4454-916B-67C545EDFAEF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@ -141,12 +105,9 @@ Global
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{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}
{4492FF4C-9032-411D-853F-46B01755E504} = {E183C826-1360-4DFF-9994-F33CED5C8525}
{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}
{E837249E-E666-4DF2-AFC3-7A4D70234F9F} = {E183C826-1360-4DFF-9994-F33CED5C8525}
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.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Server.WebListener;
using Microsoft.AspNetCore.Server.HttpSys;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Server;
namespace HotAddSample
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -10,7 +10,7 @@ using System.Security.Claims;
using System.Security.Principal;
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.
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa364638(v=vs.85).aspx

View File

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

View File

@ -3,7 +3,7 @@
using System;
namespace Microsoft.Net.Http.Server
namespace Microsoft.AspNetCore.Server.HttpSys
{
internal static class Constants
{
@ -13,6 +13,7 @@ namespace Microsoft.Net.Http.Server
internal const string Close = "close";
internal const string Zero = "0";
internal const string SchemeDelimiter = "://";
internal const int Status101SwitchingProtocols = 101;
internal static Version V1_0 = new Version(1, 0);
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.Extensions.Internal;
using Microsoft.Net.Http.Headers;
using Microsoft.Net.Http.Server;
namespace Microsoft.AspNetCore.Server.WebListener
namespace Microsoft.AspNetCore.Server.HttpSys
{
internal class FeatureContext :
IHttpRequestFeature,

View File

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

View File

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

View File

@ -4,7 +4,7 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
namespace Microsoft.AspNetCore.Server.WebListener.Internal
namespace Microsoft.AspNetCore.Server.HttpSys.Internal
{
public class WebListenerOptionsSetup : IConfigureOptions<WebListenerOptions>
{
@ -17,7 +17,7 @@ namespace Microsoft.AspNetCore.Server.WebListener.Internal
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 Microsoft.Extensions.Logging;
namespace Microsoft.AspNetCore.Server.WebListener
namespace Microsoft.AspNetCore.Server.HttpSys
{
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)
{
if (logger == null)

View File

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

View File

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

View File

@ -1,7 +1,7 @@
// 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.
namespace Microsoft.Net.Http.Server
namespace Microsoft.AspNetCore.Server.HttpSys
{
#if NET451
/// <devdoc>

View File

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

View File

@ -1,7 +1,7 @@
// 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.
namespace Microsoft.Net.Http.Server
namespace Microsoft.AspNetCore.Server.HttpSys
{
internal enum ContextAttribute
{

View File

@ -4,7 +4,7 @@
using System;
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
internal class CookedUrl

View File

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

View File

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

View File

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

View File

@ -3,7 +3,7 @@
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.
internal sealed class HttpRequestQueueV2Handle : SafeHandleZeroOrMinusOneIsInvalid

View File

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

View File

@ -1,7 +1,7 @@
// 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.
namespace Microsoft.Net.Http.Server
namespace Microsoft.AspNetCore.Server.HttpSys
{
internal enum HttpSysRequestHeader
{

View File

@ -1,7 +1,7 @@
// 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.
namespace Microsoft.Net.Http.Server
namespace Microsoft.AspNetCore.Server.HttpSys
{
internal enum HttpSysResponseHeader
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
// 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.
namespace Microsoft.Net.Http.Server
namespace Microsoft.AspNetCore.Server.HttpSys
{
using System;
using System.Globalization;

View File

@ -1,7 +1,7 @@
// 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.
namespace Microsoft.Net.Http.Server
namespace Microsoft.AspNetCore.Server.HttpSys
{
internal enum SecurityStatus
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -10,4 +10,4 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyCompany("Microsoft Corporation.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[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.
// 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
{

View File

@ -14,7 +14,7 @@ using System.Threading;
using System.Threading.Tasks;
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
// failures are handled internally and reported via ClientCertException or ClientCertError.

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
// 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.
namespace Microsoft.Net.Http.Server
namespace Microsoft.AspNetCore.Server.HttpSys
{
internal static class HttpKnownHeaderNames
{

View File

@ -1,7 +1,7 @@
// 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.
namespace Microsoft.Net.Http.Server
namespace Microsoft.AspNetCore.Server.HttpSys
{
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)
{
if (code >= 100 && code < 600)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,25 +1,5 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// 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>
//-----------------------------------------------------------------------
// 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.
// <auto-generated />
using System;
@ -31,7 +11,7 @@ using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Primitives;
namespace Microsoft.Net.Http.Server
namespace Microsoft.AspNetCore.Server.HttpSys
{
[GeneratedCode("TextTemplatingFileGenerator", "")]
internal partial class RequestHeaders
@ -82,7 +62,7 @@ namespace Microsoft.Net.Http.Server
private StringValues _Via;
private StringValues _Warning;
internal StringValues Accept
internal StringValues Accept
{
get
{
@ -104,7 +84,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues AcceptCharset
internal StringValues AcceptCharset
{
get
{
@ -126,7 +106,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues AcceptEncoding
internal StringValues AcceptEncoding
{
get
{
@ -148,7 +128,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues AcceptLanguage
internal StringValues AcceptLanguage
{
get
{
@ -170,7 +150,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues Allow
internal StringValues Allow
{
get
{
@ -192,7 +172,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues Authorization
internal StringValues Authorization
{
get
{
@ -214,7 +194,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues CacheControl
internal StringValues CacheControl
{
get
{
@ -236,7 +216,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues Connection
internal StringValues Connection
{
get
{
@ -258,7 +238,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues ContentEncoding
internal StringValues ContentEncoding
{
get
{
@ -280,7 +260,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues ContentLanguage
internal StringValues ContentLanguage
{
get
{
@ -302,7 +282,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues ContentLength
internal StringValues ContentLength
{
get
{
@ -324,7 +304,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues ContentLocation
internal StringValues ContentLocation
{
get
{
@ -346,7 +326,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues ContentMd5
internal StringValues ContentMd5
{
get
{
@ -368,7 +348,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues ContentRange
internal StringValues ContentRange
{
get
{
@ -390,7 +370,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues ContentType
internal StringValues ContentType
{
get
{
@ -412,7 +392,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues Cookie
internal StringValues Cookie
{
get
{
@ -434,7 +414,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues Date
internal StringValues Date
{
get
{
@ -456,7 +436,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues Expect
internal StringValues Expect
{
get
{
@ -478,7 +458,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues Expires
internal StringValues Expires
{
get
{
@ -500,7 +480,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues From
internal StringValues From
{
get
{
@ -522,7 +502,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues Host
internal StringValues Host
{
get
{
@ -544,7 +524,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues IfMatch
internal StringValues IfMatch
{
get
{
@ -566,7 +546,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues IfModifiedSince
internal StringValues IfModifiedSince
{
get
{
@ -588,7 +568,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues IfNoneMatch
internal StringValues IfNoneMatch
{
get
{
@ -610,7 +590,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues IfRange
internal StringValues IfRange
{
get
{
@ -632,7 +612,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues IfUnmodifiedSince
internal StringValues IfUnmodifiedSince
{
get
{
@ -654,7 +634,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues KeepAlive
internal StringValues KeepAlive
{
get
{
@ -676,7 +656,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues LastModified
internal StringValues LastModified
{
get
{
@ -698,7 +678,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues MaxForwards
internal StringValues MaxForwards
{
get
{
@ -720,7 +700,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues Pragma
internal StringValues Pragma
{
get
{
@ -742,7 +722,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues ProxyAuthorization
internal StringValues ProxyAuthorization
{
get
{
@ -764,7 +744,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues Range
internal StringValues Range
{
get
{
@ -786,7 +766,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues Referer
internal StringValues Referer
{
get
{
@ -808,7 +788,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues Te
internal StringValues Te
{
get
{
@ -830,7 +810,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues Trailer
internal StringValues Trailer
{
get
{
@ -852,7 +832,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues TransferEncoding
internal StringValues TransferEncoding
{
get
{
@ -874,7 +854,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues Translate
internal StringValues Translate
{
get
{
@ -896,7 +876,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues Upgrade
internal StringValues Upgrade
{
get
{
@ -918,7 +898,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues UserAgent
internal StringValues UserAgent
{
get
{
@ -940,7 +920,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues Via
internal StringValues Via
{
get
{
@ -962,7 +942,7 @@ namespace Microsoft.Net.Http.Server
}
}
internal StringValues Warning
internal StringValues Warning
{
get
{
@ -1732,7 +1712,7 @@ namespace Microsoft.Net.Http.Server
{
case 2:
if (_Te.Count > 0
&& string.Equals(key, "Te", StringComparison.Ordinal))
&& string.Equals(key, "Te", StringComparison.Ordinal))
{
bool wasSet = ((_flag1 & 0x2u) != 0);
Te = StringValues.Empty;
@ -1740,8 +1720,8 @@ namespace Microsoft.Net.Http.Server
}
break;
case 3:
if (_Via.Count > 0
&& string.Equals(key, "Via", StringComparison.Ordinal))
if (_Via.Count > 0
&& string.Equals(key, "Via", StringComparison.Ordinal))
{
bool wasSet = ((_flag1 & 0x80u) != 0);
Via = StringValues.Empty;
@ -1749,22 +1729,22 @@ namespace Microsoft.Net.Http.Server
}
break;
case 4:
if (_Date.Count > 0
&& string.Equals(key, "Date", StringComparison.Ordinal))
if (_Date.Count > 0
&& string.Equals(key, "Date", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x10000u) != 0);
Date = StringValues.Empty;
return wasSet;
}
if (_From.Count > 0
&& string.Equals(key, "From", StringComparison.Ordinal))
&& string.Equals(key, "From", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x80000u) != 0);
From = StringValues.Empty;
return wasSet;
}
if (_Host.Count > 0
&& string.Equals(key, "Host", StringComparison.Ordinal))
&& string.Equals(key, "Host", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x100000u) != 0);
Host = StringValues.Empty;
@ -1773,14 +1753,14 @@ namespace Microsoft.Net.Http.Server
break;
case 5:
if (_Allow.Count > 0
&& string.Equals(key, "Allow", StringComparison.Ordinal))
&& string.Equals(key, "Allow", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x10u) != 0);
Allow = StringValues.Empty;
return wasSet;
}
if (_Range.Count > 0
&& string.Equals(key, "Range", StringComparison.Ordinal))
&& string.Equals(key, "Range", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x80000000u) != 0);
Range = StringValues.Empty;
@ -1789,28 +1769,28 @@ namespace Microsoft.Net.Http.Server
break;
case 6:
if (_Accept.Count > 0
&& string.Equals(key, "Accept", StringComparison.Ordinal))
&& string.Equals(key, "Accept", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x1u) != 0);
Accept = StringValues.Empty;
return wasSet;
}
if (_Cookie.Count > 0
&& string.Equals(key, "Cookie", StringComparison.Ordinal))
&& string.Equals(key, "Cookie", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x8000u) != 0);
Cookie = StringValues.Empty;
return wasSet;
}
if (_Expect.Count > 0
&& string.Equals(key, "Expect", StringComparison.Ordinal))
&& string.Equals(key, "Expect", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x20000u) != 0);
Expect = StringValues.Empty;
return wasSet;
}
if (_Pragma.Count > 0
&& string.Equals(key, "Pragma", StringComparison.Ordinal))
&& string.Equals(key, "Pragma", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x20000000u) != 0);
Pragma = StringValues.Empty;
@ -1819,35 +1799,35 @@ namespace Microsoft.Net.Http.Server
break;
case 7:
if (_Expires.Count > 0
&& string.Equals(key, "Expires", StringComparison.Ordinal))
&& string.Equals(key, "Expires", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x40000u) != 0);
Expires = StringValues.Empty;
return wasSet;
}
if (_Referer.Count > 0
&& string.Equals(key, "Referer", StringComparison.Ordinal))
&& string.Equals(key, "Referer", StringComparison.Ordinal))
{
bool wasSet = ((_flag1 & 0x1u) != 0);
Referer = StringValues.Empty;
return wasSet;
}
if (_Trailer.Count > 0
&& string.Equals(key, "Trailer", StringComparison.Ordinal))
&& string.Equals(key, "Trailer", StringComparison.Ordinal))
{
bool wasSet = ((_flag1 & 0x4u) != 0);
Trailer = StringValues.Empty;
return wasSet;
}
if (_Upgrade.Count > 0
&& string.Equals(key, "Upgrade", StringComparison.Ordinal))
&& string.Equals(key, "Upgrade", StringComparison.Ordinal))
{
bool wasSet = ((_flag1 & 0x20u) != 0);
Upgrade = StringValues.Empty;
return wasSet;
}
if (_Warning.Count > 0
&& string.Equals(key, "Warning", StringComparison.Ordinal))
&& string.Equals(key, "Warning", StringComparison.Ordinal))
{
bool wasSet = ((_flag1 & 0x100u) != 0);
Warning = StringValues.Empty;
@ -1856,14 +1836,14 @@ namespace Microsoft.Net.Http.Server
break;
case 8:
if (_IfMatch.Count > 0
&& string.Equals(key, "If-Match", StringComparison.Ordinal))
&& string.Equals(key, "If-Match", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x200000u) != 0);
IfMatch = StringValues.Empty;
return wasSet;
}
if (_IfRange.Count > 0
&& string.Equals(key, "If-Range", StringComparison.Ordinal))
&& string.Equals(key, "If-Range", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x1000000u) != 0);
IfRange = StringValues.Empty;
@ -1872,7 +1852,7 @@ namespace Microsoft.Net.Http.Server
break;
case 9:
if (_Translate.Count > 0
&& string.Equals(key, "Translate", StringComparison.Ordinal))
&& string.Equals(key, "Translate", StringComparison.Ordinal))
{
bool wasSet = ((_flag1 & 0x10u) != 0);
Translate = StringValues.Empty;
@ -1881,21 +1861,21 @@ namespace Microsoft.Net.Http.Server
break;
case 10:
if (_Connection.Count > 0
&& string.Equals(key, "Connection", StringComparison.Ordinal))
&& string.Equals(key, "Connection", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x80u) != 0);
Connection = StringValues.Empty;
return wasSet;
}
if (_KeepAlive.Count > 0
&& string.Equals(key, "Keep-Alive", StringComparison.Ordinal))
&& string.Equals(key, "Keep-Alive", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x4000000u) != 0);
KeepAlive = StringValues.Empty;
return wasSet;
}
if (_UserAgent.Count > 0
&& string.Equals(key, "User-Agent", StringComparison.Ordinal))
&& string.Equals(key, "User-Agent", StringComparison.Ordinal))
{
bool wasSet = ((_flag1 & 0x40u) != 0);
UserAgent = StringValues.Empty;
@ -1904,7 +1884,7 @@ namespace Microsoft.Net.Http.Server
break;
case 11:
if (_ContentMd5.Count > 0
&& string.Equals(key, "Content-Md5", StringComparison.Ordinal))
&& string.Equals(key, "Content-Md5", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x1000u) != 0);
ContentMd5 = StringValues.Empty;
@ -1913,14 +1893,14 @@ namespace Microsoft.Net.Http.Server
break;
case 12:
if (_ContentType.Count > 0
&& string.Equals(key, "Content-Type", StringComparison.Ordinal))
&& string.Equals(key, "Content-Type", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x4000u) != 0);
ContentType = StringValues.Empty;
return wasSet;
}
if (_MaxForwards.Count > 0
&& string.Equals(key, "Max-Forwards", StringComparison.Ordinal))
&& string.Equals(key, "Max-Forwards", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x10000000u) != 0);
MaxForwards = StringValues.Empty;
@ -1929,35 +1909,35 @@ namespace Microsoft.Net.Http.Server
break;
case 13:
if (_Authorization.Count > 0
&& string.Equals(key, "Authorization", StringComparison.Ordinal))
&& string.Equals(key, "Authorization", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x20u) != 0);
Authorization = StringValues.Empty;
return wasSet;
}
if (_CacheControl.Count > 0
&& string.Equals(key, "Cache-Control", StringComparison.Ordinal))
&& string.Equals(key, "Cache-Control", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x40u) != 0);
CacheControl = StringValues.Empty;
return wasSet;
}
if (_ContentRange.Count > 0
&& string.Equals(key, "Content-Range", StringComparison.Ordinal))
&& string.Equals(key, "Content-Range", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x2000u) != 0);
ContentRange = StringValues.Empty;
return wasSet;
}
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);
IfNoneMatch = StringValues.Empty;
return wasSet;
}
if (_LastModified.Count > 0
&& string.Equals(key, "Last-Modified", StringComparison.Ordinal))
&& string.Equals(key, "Last-Modified", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x8000000u) != 0);
LastModified = StringValues.Empty;
@ -1966,14 +1946,14 @@ namespace Microsoft.Net.Http.Server
break;
case 14:
if (_AcceptCharset.Count > 0
&& string.Equals(key, "Accept-Charset", StringComparison.Ordinal))
&& string.Equals(key, "Accept-Charset", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x2u) != 0);
AcceptCharset = StringValues.Empty;
return wasSet;
}
if (_ContentLength.Count > 0
&& string.Equals(key, "Content-Length", StringComparison.Ordinal))
&& string.Equals(key, "Content-Length", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x400u) != 0);
ContentLength = StringValues.Empty;
@ -1982,14 +1962,14 @@ namespace Microsoft.Net.Http.Server
break;
case 15:
if (_AcceptEncoding.Count > 0
&& string.Equals(key, "Accept-Encoding", StringComparison.Ordinal))
&& string.Equals(key, "Accept-Encoding", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x4u) != 0);
AcceptEncoding = StringValues.Empty;
return wasSet;
}
if (_AcceptLanguage.Count > 0
&& string.Equals(key, "Accept-Language", StringComparison.Ordinal))
&& string.Equals(key, "Accept-Language", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x8u) != 0);
AcceptLanguage = StringValues.Empty;
@ -1998,21 +1978,21 @@ namespace Microsoft.Net.Http.Server
break;
case 16:
if (_ContentEncoding.Count > 0
&& string.Equals(key, "Content-Encoding", StringComparison.Ordinal))
&& string.Equals(key, "Content-Encoding", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x100u) != 0);
ContentEncoding = StringValues.Empty;
return wasSet;
}
if (_ContentLanguage.Count > 0
&& string.Equals(key, "Content-Language", StringComparison.Ordinal))
&& string.Equals(key, "Content-Language", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x200u) != 0);
ContentLanguage = StringValues.Empty;
return wasSet;
}
if (_ContentLocation.Count > 0
&& string.Equals(key, "Content-Location", StringComparison.Ordinal))
&& string.Equals(key, "Content-Location", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x800u) != 0);
ContentLocation = StringValues.Empty;
@ -2021,14 +2001,14 @@ namespace Microsoft.Net.Http.Server
break;
case 17:
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);
IfModifiedSince = StringValues.Empty;
return wasSet;
}
if (_TransferEncoding.Count > 0
&& string.Equals(key, "Transfer-Encoding", StringComparison.Ordinal))
&& string.Equals(key, "Transfer-Encoding", StringComparison.Ordinal))
{
bool wasSet = ((_flag1 & 0x8u) != 0);
TransferEncoding = StringValues.Empty;
@ -2037,14 +2017,14 @@ namespace Microsoft.Net.Http.Server
break;
case 19:
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);
IfUnmodifiedSince = StringValues.Empty;
return wasSet;
}
if (_ProxyAuthorization.Count > 0
&& string.Equals(key, "Proxy-Authorization", StringComparison.Ordinal))
&& string.Equals(key, "Proxy-Authorization", StringComparison.Ordinal))
{
bool wasSet = ((_flag0 & 0x40000000u) != 0);
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> Clear = Index => "_flag" + (Index / 32) + " &= ~0x" + (1<<(Index % 32)).ToString("x") + "u";
#>
//-----------------------------------------------------------------------
// <copyright>
// Copyright (c) Katana Contributors. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
// 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.
// <auto-generated />
using System;
@ -70,7 +67,7 @@ using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Primitives;
namespace Microsoft.Net.Http.Server
namespace Microsoft.AspNetCore.Server.HttpSys
{
[GeneratedCode("TextTemplatingFileGenerator", "")]
internal partial class RequestHeaders
@ -141,7 +138,7 @@ namespace Microsoft.Net.Http.Server
break;
<# } #>
}
value = null;
value = StringValues.Empty;
return false;
}
@ -173,10 +170,10 @@ namespace Microsoft.Net.Http.Server
case <#=length.Key#>:
<# foreach(var prop in length) { #>
if (_<#=prop.Name#>.Count > 0
&& string.Equals(key, "<#=prop.Key#>", StringComparison.Ordinal))
&& string.Equals(key, "<#=prop.Key#>", StringComparison.Ordinal))
{
bool wasSet = <#=IsRead(prop.Index)#>;
<#=prop.Name#> = null;
<#=prop.Name#> = StringValues.Empty;
return wasSet;
}
<# } #>

View File

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

View File

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

View File

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

View File

@ -4,7 +4,7 @@
using System;
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 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.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
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
{
private ResponseState _responseState;
private string _reasonPhrase;
private ResponseStream _nativeStream;
private ResponseBody _nativeStream;
private AuthenticationSchemes _authChallenges;
private TimeSpan? _cacheTtl;
private long _expectedBodyLength;
@ -37,7 +38,7 @@ namespace Microsoft.Net.Http.Server
Headers.Clear();
_reasonPhrase = null;
_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.MinorVersion = 1;
_responseState = ResponseState.Created;
@ -274,7 +275,7 @@ namespace Microsoft.Net.Http.Server
{
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)
{
// 401
if (StatusCode == (ushort)HttpStatusCode.Unauthorized)
if (StatusCode == (ushort)StatusCodes.Status401Unauthorized)
{
RequestContext.Server.Settings.Authentication.SetAuthenticationChallenge(RequestContext);
}

View File

@ -10,11 +10,11 @@ using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
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 long _leftToWrite = long.MinValue;
@ -24,7 +24,7 @@ namespace Microsoft.Net.Http.Server
// The last write needs special handling to cancel.
private ResponseStreamAsyncResult _lastWrite;
internal ResponseStream(RequestContext requestContext)
internal ResponseBody(RequestContext requestContext)
{
_requestContext = requestContext;
}

View File

@ -7,9 +7,9 @@ using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
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
{
@ -18,13 +18,13 @@ namespace Microsoft.Net.Http.Server
private SafeNativeOverlapped _overlapped;
private HttpApi.HTTP_DATA_CHUNK[] _dataChunks;
private FileStream _fileStream;
private ResponseStream _responseStream;
private ResponseBody _responseStream;
private TaskCompletionSource<object> _tcs;
private uint _bytesSent;
private CancellationToken _cancellationToken;
private CancellationTokenRegistration _cancellationRegistration;
internal ResponseStreamAsyncResult(ResponseStream responseStream, CancellationToken cancellationToken)
internal ResponseStreamAsyncResult(ResponseBody responseStream, CancellationToken cancellationToken)
{
_responseStream = responseStream;
_tcs = new TaskCompletionSource<object>();
@ -38,7 +38,7 @@ namespace Microsoft.Net.Http.Server
_cancellationRegistration = cancellationRegistration;
}
internal ResponseStreamAsyncResult(ResponseStream responseStream, ArraySegment<byte> data, bool chunked,
internal ResponseStreamAsyncResult(ResponseBody responseStream, ArraySegment<byte> data, bool chunked,
CancellationToken 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)
: this(responseStream, cancellationToken)
{

View File

@ -1,7 +1,7 @@
// 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.
namespace Microsoft.Net.Http.Server
namespace Microsoft.AspNetCore.Server.HttpSys
{
internal enum SslStatus : byte
{

View File

@ -6,7 +6,7 @@ using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.AspNetCore.Server.WebListener
namespace Microsoft.AspNetCore.Server.HttpSys
{
internal class ResponseStream : Stream
{
@ -73,7 +73,7 @@ namespace Microsoft.AspNetCore.Server.WebListener
await _onStart();
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)
#else
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 Microsoft.AspNetCore.Http.Features;
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
{

View File

@ -4,7 +4,7 @@
using System;
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.
// http://msdn.microsoft.com/en-us/library/aa364661.aspx

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,7 +6,7 @@ using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
namespace Microsoft.Net.Http.Server
namespace Microsoft.AspNetCore.Server.HttpSys
{
[SuppressMessage("Microsoft.Usage", "CA2237:MarkISerializableTypesWithSerializable")]
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.
using System;
using Microsoft.Net.Http.Server;
namespace Microsoft.AspNetCore.Server.WebListener
namespace Microsoft.AspNetCore.Server.HttpSys
{
public class WebListenerOptions
{

View File

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

View File

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

View File

@ -1,15 +1,19 @@
{
"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": {
"tags": [
"netcore",
"aspnetcore",
"weblistener"
]
},
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "1.2.0-*",
"Microsoft.Extensions.Primitives": "1.2.0-*",
"Microsoft.AspNetCore.Hosting": "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-*"
},
"buildOptions": {
@ -22,13 +26,7 @@
"xmlDoc": true
},
"frameworks": {
"net451": {
"frameworkAssemblies": {
"System.Runtime": {
"type": "build"
}
}
},
"net451": {},
"netstandard1.3": {
"dependencies": {
"Microsoft.Extensions.RuntimeEnvironment.Sources": {

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