Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ internal class SNICommon
/// <returns>True if certificate is valid</returns>
internal static bool ValidateSslServerCertificate(string targetServerName, X509Certificate cert, SslPolicyErrors policyErrors)
{
using (TrySNIEventScope.Create("SNICommon.ValidateSslServerCertificate | SNI | SCOPE | INFO | Entering Scope {0} "))
using (TrySNIEventScope.Create(nameof(SNICommon)))
{
if (policyErrors == SslPolicyErrors.None)
{
Expand Down Expand Up @@ -258,7 +258,7 @@ internal static bool ValidateSslServerCertificate(string targetServerName, X509C
/// <returns>True if certificate is valid</returns>
internal static bool ValidateSslServerCertificate(X509Certificate clientCert, X509Certificate serverCert, SslPolicyErrors policyErrors)
{
using (TrySNIEventScope.Create("SNICommon.ValidateSslServerCertificate | SNI | SCOPE | INFO | Entering Scope {0} "))
using (TrySNIEventScope.Create(nameof(SNICommon)))
{
if (policyErrors == SslPolicyErrors.None)
{
Expand Down Expand Up @@ -334,7 +334,7 @@ internal static bool ValidateSslServerCertificate(X509Certificate clientCert, X5

internal static IPAddress[] GetDnsIpAddresses(string serverName, TimeoutTimer timeout)
{
using (TrySNIEventScope.Create(nameof(GetDnsIpAddresses)))
using (TrySNIEventScope.Create(nameof(SNICommon)))
{
int remainingTimeout = timeout.MillisecondsRemainingInt;
SqlClientEventSource.Log.TrySNITraceEvent(nameof(SNICommon), EventType.INFO,
Expand All @@ -352,7 +352,7 @@ internal static IPAddress[] GetDnsIpAddresses(string serverName, TimeoutTimer ti

internal static IPAddress[] GetDnsIpAddresses(string serverName)
{
using (TrySNIEventScope.Create(nameof(GetDnsIpAddresses)))
using (TrySNIEventScope.Create(nameof(SNICommon)))
{
SqlClientEventSource.Log.TrySNITraceEvent(nameof(SNICommon), EventType.INFO, "Getting DNS host entries for serverName {0}.", args0: serverName);
return Dns.GetHostAddresses(serverName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public SNIMarsHandle(SNIMarsConnection connection, ushort sessionId, object call
/// <param name="flags">SMUX header flags</param>
private void SendControlPacket(SNISMUXFlags flags)
{
using (TrySNIEventScope.Create("SNIMarsHandle.SendControlPacket | SNI | INFO | SCOPE | Entering Scope {0}"))
using (TrySNIEventScope.Create(nameof(SNIMarsHandle)))
{
SNIPacket packet = RentPacket(headerSize: SNISMUXHeader.HEADER_LENGTH, dataSize: 0);
#if DEBUG
Expand Down Expand Up @@ -195,7 +195,7 @@ public override uint Send(SNIPacket packet)
private uint InternalSendAsync(SNIPacket packet)
{
Debug.Assert(packet.ReservedHeaderSize == SNISMUXHeader.HEADER_LENGTH, "mars handle attempting to send muxed packet without smux reservation in InternalSendAsync");
using (TrySNIEventScope.Create("SNIMarsHandle.InternalSendAsync | SNI | INFO | SCOPE | Entering Scope {0}"))
using (TrySNIEventScope.Create(nameof(SNIMarsHandle)))
{
lock (this)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,7 @@ internal void ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand

internal SqlError ProcessSNIError(TdsParserStateObject stateObj)
{
using (TryEventScope.Create("<sc.TdsParser.ProcessSNIError|ERR>"))
using (TryEventScope.Create(nameof(TdsParser)))
{
#if DEBUG
// There is an exception here for MARS as its possible that another thread has closed the connection just as we see an error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ internal sealed class ManagedSSPIContextProvider : SSPIContextProvider

internal override void GenerateSspiClientContext(ReadOnlyMemory<byte> received, ref byte[] sendBuff, ref uint sendLength, byte[][] _sniSpnBuffer)
{
_sspiClientContextStatus ??= new SspiClientContextStatus();
using (TrySNIEventScope.Create(nameof(ManagedSSPIContextProvider)))
{
_sspiClientContextStatus ??= new SspiClientContextStatus();

SNIProxy.GenSspiClientContext(_sspiClientContextStatus, received, ref sendBuff, _sniSpnBuffer);
SqlClientEventSource.Log.TryTraceEvent("TdsParserStateObjectManaged.GenerateSspiClientContext | Info | Session Id {0}", _physicalStateObj.SessionId);
sendLength = (uint)(sendBuff != null ? sendBuff.Length : 0);
SNIProxy.GenSspiClientContext(_sspiClientContextStatus, received, ref sendBuff, _sniSpnBuffer);
SqlClientEventSource.Log.TryTraceEvent("TdsParserStateObjectManaged.GenerateSspiClientContext | Info | Session Id {0}", _physicalStateObj.SessionId);
sendLength = (uint)(sendBuff != null ? sendBuff.Length : 0);
}
}
}
}
Expand Down