Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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 @@ -2740,6 +2740,9 @@ private bool TryProcessEnvChange(int tokenLength, TdsParserStateObject stateObj,
// to MARS initialization!
int packetSize = int.Parse(env._newValue, NumberStyles.Integer, CultureInfo.InvariantCulture);

SqlClientEventSource.Log.TryTraceEvent("{0}.{1} | Info | Server sent env packet size change of {2}, ClientConnectionID {3}",
nameof(TdsParser), nameof(TryProcessEnvChange), packetSize, _connHandler._clientConnectionId);

if (_physicalStateObj.SetPacketSize(packetSize))
{
// If packet size changed, we need to release our SNIPackets since
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3182,6 +3182,9 @@ private bool TryProcessEnvChange(int tokenLength, TdsParserStateObject stateObj,
// to MARS initialization!
int packetSize = int.Parse(env._newValue, NumberStyles.Integer, CultureInfo.InvariantCulture);

SqlClientEventSource.Log.TryTraceEvent("{0}.{1} | Info | Server sent env packet size change of {2}, ClientConnectionID {3}",
nameof(TdsParser), nameof(TryProcessEnvChange), packetSize, _connHandler._clientConnectionId);

if (_physicalStateObj.SetPacketSize(packetSize))
{
// If packet size changed, we need to release our SNIPackets since
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,9 @@ internal bool SetPacketSize(int size)
(_outBytesUsed == _outputHeaderLen && _outputPacketNumber == 1),
"SetPacketSize called with data in the buffer!");

SqlClientEventSource.Log.TryTraceEvent("{0}.{1} | Info | State Object Id {2}, Setting packet size to {3}",
nameof(TdsParserStateObject), nameof(SetPacketSize), _objectID, size);

if (_inBuff == null || _inBuff.Length != size)
{ // We only check _inBuff, since two buffers should be consistent.
// Allocate or re-allocate _inBuff.
Expand Down