Removed IsLocal from ConnectionInfo

This commit is contained in:
Brennan 2016-01-15 16:07:10 -08:00
parent 9885377148
commit 63cd6149d1
4 changed files with 1 additions and 15 deletions

View File

@ -54,7 +54,6 @@ namespace SampleApp
var connectionFeature = context.Connection; var connectionFeature = context.Connection;
Console.WriteLine($"Peer: {connectionFeature.RemoteIpAddress?.ToString()} {connectionFeature.RemotePort}"); Console.WriteLine($"Peer: {connectionFeature.RemoteIpAddress?.ToString()} {connectionFeature.RemotePort}");
Console.WriteLine($"Sock: {connectionFeature.LocalIpAddress?.ToString()} {connectionFeature.LocalPort}"); Console.WriteLine($"Sock: {connectionFeature.LocalIpAddress?.ToString()} {connectionFeature.LocalPort}");
Console.WriteLine($"IsLocal: {connectionFeature.IsLocal}");
context.Response.ContentLength = 11; context.Response.ContentLength = 11;
context.Response.ContentType = "text/plain"; context.Response.ContentType = "text/plain";

View File

@ -272,8 +272,6 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
int IHttpConnectionFeature.LocalPort { get; set; } int IHttpConnectionFeature.LocalPort { get; set; }
bool IHttpConnectionFeature.IsLocal { get; set; }
object IFeatureCollection.this[Type key] object IFeatureCollection.this[Type key]
{ {
get { return FastFeatureGet(key); } get { return FastFeatureGet(key); }

View File

@ -233,15 +233,6 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
httpConnectionFeature.LocalIpAddress = _localEndPoint?.Address; httpConnectionFeature.LocalIpAddress = _localEndPoint?.Address;
httpConnectionFeature.LocalPort = _localEndPoint?.Port ?? 0; httpConnectionFeature.LocalPort = _localEndPoint?.Port ?? 0;
if (_remoteEndPoint != null && _localEndPoint != null)
{
httpConnectionFeature.IsLocal = _remoteEndPoint.Address.Equals(_localEndPoint.Address);
}
else
{
httpConnectionFeature.IsLocal = false;
}
_prepareRequest?.Invoke(this); _prepareRequest?.Invoke(this);
_manuallySetRequestAbortToken = null; _manuallySetRequestAbortToken = null;

View File

@ -145,8 +145,7 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests
RemoteIPAddress = connection.RemoteIpAddress?.ToString(), RemoteIPAddress = connection.RemoteIpAddress?.ToString(),
RemotePort = connection.RemotePort, RemotePort = connection.RemotePort,
LocalIPAddress = connection.LocalIpAddress?.ToString(), LocalIPAddress = connection.LocalIpAddress?.ToString(),
LocalPort = connection.LocalPort, LocalPort = connection.LocalPort
IsLocal = connection.IsLocal
})); }));
}); });
}); });
@ -165,7 +164,6 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests
var facts = JsonConvert.DeserializeObject<JObject>(connectionFacts); var facts = JsonConvert.DeserializeObject<JObject>(connectionFacts);
Assert.Equal(expectAddress, facts["RemoteIPAddress"].Value<string>()); Assert.Equal(expectAddress, facts["RemoteIPAddress"].Value<string>());
Assert.NotEmpty(facts["RemotePort"].Value<string>()); Assert.NotEmpty(facts["RemotePort"].Value<string>());
Assert.True(facts["IsLocal"].Value<bool>());
} }
} }
} }