Skip to content

Commit 3b8f850

Browse files
committed
Sync method signature for CreatePhysicalSNIHandle
1 parent 596ee25 commit 3b8f850

File tree

6 files changed

+32
-7
lines changed

6 files changed

+32
-7
lines changed

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,8 @@ internal void Connect(ServerInfo serverInfo,
450450
false,
451451
true,
452452
fParallel,
453+
TransparentNetworkResolutionState.DisabledMode,
454+
-1,
453455
_connHandler.ConnectionOptions.IPAddressPreference,
454456
FQDNforDNSCache,
455457
ref _connHandler.pendingSQLDNSObject,
@@ -550,6 +552,8 @@ internal void Connect(ServerInfo serverInfo,
550552
true,
551553
true,
552554
fParallel,
555+
TransparentNetworkResolutionState.DisabledMode,
556+
-1,
553557
_connHandler.ConnectionOptions.IPAddressPreference,
554558
FQDNforDNSCache,
555559
ref _connHandler.pendingSQLDNSObject,

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObject.netcore.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ internal abstract void CreatePhysicalSNIHandle(
7575
bool flushCache,
7676
bool async,
7777
bool fParallel,
78+
TransparentNetworkResolutionState transparentNetworkResolutionState,
79+
int totalTimeout,
7880
SqlConnectionIPAddressPreference iPAddressPreference,
7981
string cachedFQDN,
8082
ref SQLDNSInfo pendingDNSInfo,

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObjectManaged.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ internal override void CreatePhysicalSNIHandle(
8585
bool flushCache,
8686
bool async,
8787
bool parallel,
88+
TransparentNetworkResolutionState transparentNetworkResolutionState,
89+
int totalTimeout,
8890
SqlConnectionIPAddressPreference iPAddressPreference,
8991
string cachedFQDN,
9092
ref SQLDNSInfo pendingDNSInfo,

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObjectNative.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ internal override void CreatePhysicalSNIHandle(
162162
bool flushCache,
163163
bool async,
164164
bool fParallel,
165-
SqlConnectionIPAddressPreference ipPreference,
165+
TransparentNetworkResolutionState transparentNetworkResolutionState,
166+
int totalTimeout,
167+
SqlConnectionIPAddressPreference iPAddressPreference,
166168
string cachedFQDN,
167169
ref SQLDNSInfo pendingDNSInfo,
168170
string serverSPN,
@@ -191,7 +193,7 @@ internal override void CreatePhysicalSNIHandle(
191193
bool ret = SQLFallbackDNSCache.Instance.GetDNSInfo(cachedFQDN, out cachedDNSInfo);
192194

193195
_sessionHandle = new SNIHandle(myInfo, serverName, ref serverSPN, timeout.MillisecondsRemainingInt, out instanceName,
194-
flushCache, !async, fParallel, ipPreference, cachedDNSInfo, hostNameInCertificate);
196+
flushCache, !async, fParallel, iPAddressPreference, cachedDNSInfo, hostNameInCertificate);
195197
spns = new[] { serverSPN.TrimEnd() };
196198
}
197199

src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,12 @@ internal void Connect(ServerInfo serverInfo,
516516
totalTimeout,
517517
_connHandler.ConnectionOptions.IPAddressPreference,
518518
FQDNforDNSCache,
519-
hostNameInCertificate);
519+
ref _connHandler.pendingSQLDNSObject,
520+
serverInfo.ServerSPN,
521+
integratedSecurity || authType == SqlAuthenticationMethod.ActiveDirectoryIntegrated,
522+
isTlsFirst,
523+
hostNameInCertificate,
524+
serverCertificateFilename);
520525

521526
_authenticationProvider?.Initialize(serverInfo, _physicalStateObj, this);
522527

@@ -610,7 +615,12 @@ internal void Connect(ServerInfo serverInfo,
610615
totalTimeout,
611616
_connHandler.ConnectionOptions.IPAddressPreference,
612617
serverInfo.ResolvedServerName,
613-
hostNameInCertificate);
618+
ref _connHandler.pendingSQLDNSObject,
619+
serverInfo.ServerSPN,
620+
integratedSecurity,
621+
isTlsFirst,
622+
hostNameInCertificate,
623+
serverCertificateFilename);
614624

615625
_authenticationProvider?.Initialize(serverInfo, _physicalStateObj, this);
616626

src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParserStateObject.netfx.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,14 @@ internal void CreatePhysicalSNIHandle(
114114
bool fParallel,
115115
TransparentNetworkResolutionState transparentNetworkResolutionState,
116116
int totalTimeout,
117-
SqlConnectionIPAddressPreference ipPreference,
117+
SqlConnectionIPAddressPreference iPAddressPreference,
118118
string cachedFQDN,
119-
string hostNameInCertificate = "")
119+
ref SQLDNSInfo pendingDNSInfo,
120+
string serverSPN,
121+
bool isIntegratedSecurity = false,
122+
bool tlsFirst = false,
123+
string hostNameInCertificate = "",
124+
string serverCertificateFilename = "")
120125
{
121126
ConsumerInfo myInfo = CreateConsumerInfo(async);
122127

@@ -127,7 +132,7 @@ internal void CreatePhysicalSNIHandle(
127132

128133
_sessionHandle = new SNIHandle(myInfo, serverName, ref spn, timeout.MillisecondsRemainingInt,
129134
out instanceName, flushCache, !async, fParallel, transparentNetworkResolutionState, totalTimeout,
130-
ipPreference, cachedDNSInfo, hostNameInCertificate);
135+
iPAddressPreference, cachedDNSInfo, hostNameInCertificate);
131136
}
132137

133138
internal uint CheckConnection() => SniNativeWrapper.SniCheckConnection(Handle);

0 commit comments

Comments
 (0)