Skip to content

Merge | TdsParserStateObject lifetime-related methods #3394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c79425e
Port PacketHandle to netfx
edwardneal May 16, 2025
e41cf0e
Remove PacketHandle alias shim
edwardneal May 16, 2025
b1a4413
Align netfx use of PacketHandle
edwardneal May 16, 2025
fc3c31e
Merge IsPacketEmpty
edwardneal May 17, 2025
c03e518
Merge ReleasePacket
edwardneal May 17, 2025
adc1dbf
Merge ReadAsync, ReadSyncOverAsync
edwardneal May 17, 2025
3b58d9b
Merge IsFailedHandle
edwardneal May 17, 2025
e06dba9
Merge SniPacketGetData
edwardneal May 17, 2025
1ee1a14
Merge EmptyReadPacket
edwardneal May 17, 2025
51903e6
Merge CheckPacket
edwardneal May 17, 2025
93311c9
Merge WritePacket, IsValidPacket
edwardneal May 17, 2025
95c8414
Merge GetResetWritePacket
edwardneal May 17, 2025
c21d451
Merge ClearAllWritePackets, AddPacketToPendingList, RemovePacketFromP…
edwardneal May 17, 2025
857afe6
Improve diff between versions of TdsParserStateObjectNative
edwardneal May 17, 2025
0767cd7
PR feedback from #3353 - format IsValidPacket
edwardneal May 21, 2025
86180f0
Merge main
edwardneal May 23, 2025
fe5d81c
Address merge conflicts
edwardneal May 23, 2025
bd5a153
Merge DisposePacketCache
edwardneal May 23, 2025
7daf3ab
Merge branch 'merge/packethandle-follow-up' into merge/tdsparserstate…
edwardneal May 28, 2025
469d840
Merge CreateSessionHandle
edwardneal May 29, 2025
596ee25
Move AssignPendingDNSInfo from TdsParser, merge
edwardneal May 29, 2025
3b8f850
Sync method signature for CreatePhysicalSNIHandle
edwardneal May 29, 2025
dfeb360
Port netcore _serverSpn array to netfx
edwardneal Jun 3, 2025
4ab9be1
Merge CreatePhysicalSNIHandle
edwardneal Jun 3, 2025
1e4724e
Refactor to insert FreeGcHandle
edwardneal Jun 3, 2025
f824db7
Move CreateConsumerInfo and _gcHandle to TdsParserStateObjectNative
edwardneal Jun 3, 2025
ab27513
Merge Dispose
edwardneal Jun 3, 2025
34be57d
Merge branch 'main' into merge/tdsparserstateobject-lifetimes
edwardneal Jun 3, 2025
ecd0dd4
Merge main
edwardneal Jun 5, 2025
95322d3
Merge branch 'main' into merge/tdsparserstateobject-lifetimes
benrr101 Jun 23, 2025
72d9c8d
Add region to both TdsParserStateObjectNative files
edwardneal Jun 23, 2025
76a97d3
Make public constructor internal
edwardneal Jun 23, 2025
49da161
Merge branch 'main' into merge/tdsparserstateobject-lifetimes
edwardneal Jul 2, 2025
879246a
Remove redundant assignment to _serverSpn
edwardneal Jul 2, 2025
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 @@ -859,7 +859,5 @@ private void SniWriteStatisticsAndTracing()
statistics.RequestNetworkServerTimer();
}
}

protected abstract PacketHandle EmptyReadPacket { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,20 @@ internal TdsParserStateObjectNative(TdsParser parser, TdsParserStateObject physi
{
}

////////////////
// Properties //
////////////////

internal SNIHandle Handle => _sessionHandle;

internal override uint Status => _sessionHandle != null ? _sessionHandle.Status : TdsEnums.SNI_UNINITIALIZED;

internal override SessionHandle SessionHandle => SessionHandle.FromNativeHandle(_sessionHandle);

protected override PacketHandle EmptyReadPacket => PacketHandle.FromNativePointer(default);

internal override Guid? SessionId => default;

protected override void CreateSessionHandle(TdsParserStateObject physicalConnection, bool async)
{
Debug.Assert(physicalConnection is TdsParserStateObjectNative, "Expected a stateObject of type " + this.GetType());
Expand Down Expand Up @@ -254,10 +262,6 @@ protected override void FreeGcHandle(int remaining, bool release)
}
}

protected override PacketHandle EmptyReadPacket => PacketHandle.FromNativePointer(default);

internal override Guid? SessionId => default;

internal override bool IsFailedHandle() => _sessionHandle.Status != TdsEnums.SNI_SUCCESS;

internal override bool IsPacketEmpty(PacketHandle readPacket)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,5 @@ private void SniWriteStatisticsAndTracing()
}
SqlClientEventSource.Log.TryAdvancedTraceBinEvent("TdsParser.WritePacket | INFO | ADV | State Object Id {0}, Packet sent. Out buffer: {1}, Out Bytes Used: {2}", ObjectID, _outBuff, _outBytesUsed);
}

protected PacketHandle EmptyReadPacket => PacketHandle.FromNativePointer(default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ internal TdsParserStateObjectNative(TdsParser parser)

internal override SessionHandle SessionHandle => SessionHandle.FromNativeHandle(_sessionHandle);

protected override PacketHandle EmptyReadPacket => PacketHandle.FromNativePointer(default);

internal override Guid? SessionId => default;

protected override uint SniPacketGetData(PacketHandle packet, byte[] _inBuff, ref uint dataSize)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@ internal long TimeoutTime

internal abstract SessionHandle SessionHandle { get; }

protected abstract PacketHandle EmptyReadPacket { get; }

protected abstract uint SniPacketGetData(PacketHandle packet, byte[] _inBuff, ref uint dataSize);

internal abstract bool IsFailedHandle();
Expand Down