diff --git a/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpContext.IHttpConnectionFeature.cs b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpContext.IHttpConnectionFeature.cs index 74defed9b5..d5a72cf013 100644 --- a/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpContext.IHttpConnectionFeature.cs +++ b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpContext.IHttpConnectionFeature.cs @@ -29,7 +29,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration { if (LocalIpAddress == null) { - InitializeRemoteEndpoint(); + InitializeLocalEndpoint(); } return LocalIpAddress; } @@ -56,7 +56,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration { if (LocalIpAddress == null) { - InitializeRemoteEndpoint(); + InitializeLocalEndpoint(); } return LocalPort; diff --git a/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpContext.cs b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpContext.cs index 0b62412c61..1eed1d6c20 100644 --- a/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpContext.cs +++ b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpContext.cs @@ -111,7 +111,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration ResetFeatureCollection(); - if (_server.IsWebSocketAvailible(pInProcessHandler)) + if (!_server.IsWebSocketAvailible(pInProcessHandler)) { _currentIHttpUpgradeFeature = null; } diff --git a/src/RequestHandler/managedexports.cxx b/src/RequestHandler/managedexports.cxx index 5608aac3e5..85eb5b4d47 100644 --- a/src/RequestHandler/managedexports.cxx +++ b/src/RequestHandler/managedexports.cxx @@ -194,7 +194,7 @@ http_read_request_bytes( _Out_ BOOL* pfCompletionPending ) { - HRESULT hr; + HRESULT hr = S_OK; if (pInProcessHandler == NULL) { @@ -206,7 +206,7 @@ http_read_request_bytes( } IHttpRequest *pHttpRequest = (IHttpRequest*)pInProcessHandler->QueryHttpContext()->GetRequest(); - + // Check if there is anything to read if (pHttpRequest->GetRemainingEntityBytes() > 0) { BOOL fAsync = TRUE; @@ -225,8 +225,8 @@ http_read_request_bytes( } else { - // nothing to read - hr = S_OK; + *pdwBytesReceived = 0; + *pfCompletionPending = FALSE; } return hr;