Fix out of process websocket check (#819)

This commit is contained in:
Justin Kotalik 2018-05-07 13:49:27 -07:00 committed by GitHub
parent 2b38e09bef
commit dc9db57389
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 31 deletions

View File

@ -178,7 +178,6 @@ ASPNETCORE_CONFIG::Populate(
IAppHostElement *pWindowsAuthenticationElement = NULL;
IAppHostElement *pBasicAuthenticationElement = NULL;
IAppHostElement *pAnonymousAuthenticationElement = NULL;
IAppHostElement *pWebSocketElement = NULL;
IAppHostElement *pEnvVarList = NULL;
IAppHostElement *pEnvVar = NULL;
IAppHostElementCollection *pEnvVarCollection = NULL;
@ -192,7 +191,6 @@ ASPNETCORE_CONFIG::Populate(
BSTR bstrBasicAuthSection = NULL;
BSTR bstrAnonymousAuthSection = NULL;
BSTR bstrAspNetCoreSection = NULL;
BSTR bstrWebsocketSection = NULL;
m_pEnvironmentVariables = new ENVIRONMENT_VAR_HASH();
if (m_pEnvironmentVariables == NULL)
@ -322,29 +320,18 @@ ASPNETCORE_CONFIG::Populate(
}
}
bstrWebsocketSection = SysAllocString(CS_WEBSOCKET_SECTION);
if (bstrWebsocketSection == NULL)
{
hr = E_OUTOFMEMORY;
goto Finished;
}
hr = pAdminManager->GetAdminSection(bstrWebsocketSection,
m_struConfigPath.QueryStr(),
&pWebSocketElement);
// Even though the applicationhost.config file contains the websocket element,
// the websocket module may still not be enabled. Check if the
PCWSTR pszVariableValue;
DWORD cbLength;
hr = pHttpContext->GetServerVariable("WEBSOCKET_VERSION", &pszVariableValue, &cbLength);
if (FAILED(hr))
{
m_fWebSocketEnabled = FALSE;
}
else
{
hr = GetElementBoolProperty(pWebSocketElement,
CS_ENABLED,
&m_fWebSocketEnabled);
if (FAILED(hr))
{
goto Finished;
}
m_fWebSocketEnabled = TRUE;
}
bstrAspNetCoreSection = SysAllocString(CS_ASPNETCORE_SECTION);
@ -557,12 +544,6 @@ Finished:
pAspNetCoreElement = NULL;
}
if (pWebSocketElement != NULL)
{
pWebSocketElement->Release();
pWebSocketElement = NULL;
}
if (pWindowsAuthenticationElement != NULL)
{
pWindowsAuthenticationElement->Release();

View File

@ -362,7 +362,6 @@ public:
return hr;
}
static
HRESULT
AddWebsocketEnabledToEnvironmentVariables

View File

@ -23,7 +23,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
}
[Fact]
public Task UpgradeFeatureDetectionEnabled_InProcess_IISExpress_CoreClr_x64_Portable()
public Task UpgradeFeatureDetectionDisabled_InProcess_IISExpress_CoreClr_x64_Portable()
{
return UpgradeFeatureDetectionDeployer(RuntimeFlavor.CoreClr,
ApplicationType.Portable,
@ -33,7 +33,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
}
[Fact]
public Task UpgradeFeatureDetectionDisabled_InProcess_IISExpress_CoreClr_x64_Portable()
public Task UpgradeFeatureDetectionEnabled_InProcess_IISExpress_CoreClr_x64_Portable()
{
return UpgradeFeatureDetectionDeployer(RuntimeFlavor.CoreClr,
ApplicationType.Portable,
@ -43,7 +43,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
}
[Fact]
public Task UpgradeFeatureDetectionEnabled_OutOfProcess_IISExpress_CoreClr_x64_Portable()
public Task UpgradeFeatureDetectionDisabled_OutOfProcess_IISExpress_CoreClr_x64_Portable()
{
return UpgradeFeatureDetectionDeployer(RuntimeFlavor.CoreClr,
ApplicationType.Portable,
@ -52,8 +52,9 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
"Disabled");
}
// This test is failing on win7 and win2008
[Fact]
public Task UpgradeFeatureDetectionDisabled_OutOfProcess_IISExpress_CoreClr_x64_Portable()
public Task UpgradeFeatureDetectionEnabled_OutOfProcess_IISExpress_CoreClr_x64_Portable()
{
return UpgradeFeatureDetectionDeployer(RuntimeFlavor.CoreClr,
ApplicationType.Portable,
@ -89,7 +90,6 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
{
var deploymentResult = await deployer.DeployAsync();
deploymentResult.HttpClient.Timeout = TimeSpan.FromSeconds(5);
// Request to base address and check if various parts of the body are rendered & measure the cold startup time.
var response = await RetryHelper.RetryRequest(() =>
{