Skip to content

Commit 3b58d9b

Browse files
committed
Merge IsFailedHandle
1 parent adc1dbf commit 3b58d9b

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ internal abstract void CreatePhysicalSNIHandle(
8686

8787
internal abstract void AssignPendingDNSInfo(string userProtocol, string DNSCacheKey, ref SQLDNSInfo pendingDNSInfo);
8888

89-
internal abstract bool IsFailedHandle();
90-
9189
protected abstract void CreateSessionHandle(TdsParserStateObject physicalConnection, bool async);
9290

9391
protected abstract void FreeGcHandle(int remaining, bool release);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,12 @@ protected override void FreeGcHandle(int remaining, bool release)
254254
}
255255
}
256256

257-
internal override bool IsFailedHandle() => _sessionHandle.Status != TdsEnums.SNI_SUCCESS;
258-
259257
protected override PacketHandle EmptyReadPacket => PacketHandle.FromNativePointer(default);
260258

261259
internal override Guid? SessionId => default;
262260

261+
internal override bool IsFailedHandle() => _sessionHandle.Status != TdsEnums.SNI_SUCCESS;
262+
263263
internal override bool IsPacketEmpty(PacketHandle readPacket)
264264
{
265265
Debug.Assert(readPacket.Type == PacketHandle.NativePointerType || readPacket.Type == 0, "unexpected packet type when requiring NativePointer");

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected TdsParserStateObject(TdsParser parser, SNIHandle physicalConnection, b
6464
SQLFallbackDNSCache.Instance.GetDNSInfo(_parser.FQDNforDNSCache, out cachedDNSInfo);
6565

6666
_sessionHandle = new SNIHandle(myInfo, physicalConnection, _parser.Connection.ConnectionOptions.IPAddressPreference, cachedDNSInfo);
67-
if (_sessionHandle.Status != TdsEnums.SNI_SUCCESS)
67+
if (IsFailedHandle())
6868
{
6969
AddError(parser.ProcessSNIError(this));
7070
ThrowExceptionAndWarning();

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ internal TdsParserStateObjectNative(TdsParser parser)
3131

3232
internal override Guid? SessionId => default;
3333

34+
internal override bool IsFailedHandle() => _sessionHandle.Status != TdsEnums.SNI_SUCCESS;
35+
3436
internal override bool IsPacketEmpty(PacketHandle readPacket)
3537
{
3638
Debug.Assert(readPacket.Type == PacketHandle.NativePointerType || readPacket.Type == 0, "unexpected packet type when requiring NativePointer");

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,8 @@ internal long TimeoutTime
481481

482482
internal abstract SessionHandle SessionHandle { get; }
483483

484+
internal abstract bool IsFailedHandle();
485+
484486
internal abstract bool IsPacketEmpty(PacketHandle readPacket);
485487

486488
internal abstract void ReleasePacket(PacketHandle syncReadPacket);

0 commit comments

Comments
 (0)