File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -78,13 +78,13 @@ public static bool UseCompatibilityProcessSni
78
78
{
79
79
if ( s_useCompatibilityProcessSni == Tristate . NotInitialized )
80
80
{
81
- if ( AppContext . TryGetSwitch ( UseCompatibilityProcessSniString , out bool returnedValue ) && returnedValue )
81
+ if ( AppContext . TryGetSwitch ( UseCompatibilityProcessSniString , out bool returnedValue ) && ! returnedValue )
82
82
{
83
- s_useCompatibilityProcessSni = Tristate . True ;
83
+ s_useCompatibilityProcessSni = Tristate . False ;
84
84
}
85
85
else
86
86
{
87
- s_useCompatibilityProcessSni = Tristate . False ;
87
+ s_useCompatibilityProcessSni = Tristate . True ;
88
88
}
89
89
}
90
90
return s_useCompatibilityProcessSni == Tristate . True ;
Original file line number Diff line number Diff line change @@ -3207,7 +3207,13 @@ internal void ReadSni(TaskCompletionSource<object> completion)
3207
3207
}
3208
3208
}
3209
3209
else
3210
- {
3210
+ {
3211
+ // this call to IncrementPendingCallbacks is required for balance
3212
+ // the _pendingCallbacks counter will be unconditionally decremented in ReadAsyncCallback
3213
+ // so we must make sure that even though we are not making a network call that we do
3214
+ // not cause an incorrect decrement which will cause disconnection from the native
3215
+ // component
3216
+ IncrementPendingCallbacks ( ) ;
3211
3217
readPacket = default ;
3212
3218
error = TdsEnums . SNI_SUCCESS ;
3213
3219
}
You can’t perform that action at this time.
0 commit comments