Skip to content

Commit 689e904

Browse files
committed
fix rebase merge error
1 parent 546b456 commit 689e904

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

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

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3212,29 +3212,28 @@ internal void ReadSni(TaskCompletionSource<object> completion)
32123212

32133213
readPacket = ReadAsync(handle, out error);
32143214

3215-
if (!(TdsEnums.SNI_SUCCESS == error || TdsEnums.SNI_SUCCESS_IO_PENDING == error))
3216-
{
3217-
DecrementPendingCallbacks(false); // Failure - we won't receive callback!
3218-
}
3215+
if (!(TdsEnums.SNI_SUCCESS == error || TdsEnums.SNI_SUCCESS_IO_PENDING == error))
3216+
{
3217+
DecrementPendingCallbacks(false); // Failure - we won't receive callback!
32193218
}
32203219
}
3221-
else
3222-
{
3223-
// this call to IncrementPendingCallbacks is required for balance
3224-
// the _pendingCallbacks counter will be unconditionally decremented in ReadAsyncCallback
3225-
// so we must make sure that even though we are not making a network call that we do
3226-
// not cause an incorrect decrement which will cause disconnection from the native
3227-
// component
3228-
IncrementPendingCallbacks();
3229-
readPacket = default;
3230-
error = TdsEnums.SNI_SUCCESS;
3231-
}
32323220
}
3233-
finally
3221+
else
32343222
{
3235-
Interlocked.Decrement(ref _readingCount);
3223+
// this call to IncrementPendingCallbacks is required for balance
3224+
// the _pendingCallbacks counter will be unconditionally decremented in ReadAsyncCallback
3225+
// so we must make sure that even though we are not making a network call that we do
3226+
// not cause an incorrect decrement which will cause disconnection from the native
3227+
// component
3228+
IncrementPendingCallbacks();
3229+
readPacket = default;
3230+
error = TdsEnums.SNI_SUCCESS;
32363231
}
32373232
}
3233+
finally
3234+
{
3235+
Interlocked.Decrement(ref _readingCount);
3236+
}
32383237

32393238
if (handle.IsNull)
32403239
{

0 commit comments

Comments
 (0)