Skip to content

Commit

Permalink
Disallow negative RemainingTimeout. Fixes #1424
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrainger committed Dec 29, 2023
1 parent 5611920 commit 77479f0
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ public StreamByteHandler(Stream stream)

public ValueTask<int> ReadBytesAsync(Memory<byte> buffer, IOBehavior ioBehavior)
{
return ioBehavior == IOBehavior.Asynchronous ? new ValueTask<int>(DoReadBytesAsync(buffer)) :
return
RemainingTimeout <= 0 ? ValueTaskExtensions.FromException<int>(MySqlException.CreateForTimeout()) :
ioBehavior == IOBehavior.Asynchronous ? new ValueTask<int>(DoReadBytesAsync(buffer)) :
m_stream.CanTimeout ? DoReadBytesSync(buffer) :
DoReadBytesSyncOverAsync(buffer);

Expand Down

0 comments on commit 77479f0

Please sign in to comment.