Skip to content

Commit 64f45c6

Browse files
committed
fix rebase merge error
1 parent 2e38fa9 commit 64f45c6

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
@@ -3242,29 +3242,28 @@ internal void ReadSni(TaskCompletionSource<object> completion)
32423242

32433243
readPacket = ReadAsync(handle, out error);
32443244

3245-
if (!(TdsEnums.SNI_SUCCESS == error || TdsEnums.SNI_SUCCESS_IO_PENDING == error))
3246-
{
3247-
DecrementPendingCallbacks(false); // Failure - we won't receive callback!
3248-
}
3245+
if (!(TdsEnums.SNI_SUCCESS == error || TdsEnums.SNI_SUCCESS_IO_PENDING == error))
3246+
{
3247+
DecrementPendingCallbacks(false); // Failure - we won't receive callback!
32493248
}
32503249
}
3251-
else
3252-
{
3253-
// this call to IncrementPendingCallbacks is required for balance
3254-
// the _pendingCallbacks counter will be unconditionally decremented in ReadAsyncCallback
3255-
// so we must make sure that even though we are not making a network call that we do
3256-
// not cause an incorrect decrement which will cause disconnection from the native
3257-
// component
3258-
IncrementPendingCallbacks();
3259-
readPacket = default;
3260-
error = TdsEnums.SNI_SUCCESS;
3261-
}
32623250
}
3263-
finally
3251+
else
32643252
{
3265-
Interlocked.Decrement(ref _readingCount);
3253+
// this call to IncrementPendingCallbacks is required for balance
3254+
// the _pendingCallbacks counter will be unconditionally decremented in ReadAsyncCallback
3255+
// so we must make sure that even though we are not making a network call that we do
3256+
// not cause an incorrect decrement which will cause disconnection from the native
3257+
// component
3258+
IncrementPendingCallbacks();
3259+
readPacket = default;
3260+
error = TdsEnums.SNI_SUCCESS;
32663261
}
32673262
}
3263+
finally
3264+
{
3265+
Interlocked.Decrement(ref _readingCount);
3266+
}
32683267

32693268
if (handle.IsNull)
32703269
{

0 commit comments

Comments
 (0)