Skip to content

Commit

Permalink
Change StreamEvent.Abort to use byte instead of bool (dotnet#32517)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotalik authored Feb 19, 2020
1 parent 9d85b82 commit b49ab01
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,15 +304,15 @@ internal struct StreamEventDataRecv
internal ulong TotalBufferLength;
internal QuicBuffer* Buffers;
internal uint BufferCount;
internal byte Flags;
internal uint Flags;
}

[StructLayout(LayoutKind.Explicit)]
internal struct StreamEventDataSendComplete
{
[FieldOffset(7)]
[FieldOffset(0)]
internal byte Canceled;
[FieldOffset(8)]
[FieldOffset(1)]
internal IntPtr ClientContext;

internal bool IsCanceled()
Expand All @@ -336,7 +336,7 @@ internal struct StreamEventDataPeerRecvAbort
[StructLayout(LayoutKind.Sequential)]
internal struct StreamEventDataSendShutdownComplete
{
internal bool Graceful;
internal byte Graceful;
}

[StructLayout(LayoutKind.Explicit)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ internal override long StreamId
{
get
{
ThrowIfDisposed();

if (_streamId == -1)
{
_streamId = GetStreamId();
Expand Down Expand Up @@ -390,6 +392,8 @@ internal override ValueTask ShutdownWriteCompleted(CancellationToken cancellatio

internal override void Shutdown()
{
ThrowIfDisposed();

MsQuicApi.Api.StreamShutdownDelegate(_ptr, (uint)QUIC_STREAM_SHUTDOWN_FLAG.GRACEFUL, errorCode: 0);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,10 @@ from writeSize in sizes
select new object[] { readSize, writeSize };
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/32049")]
[Fact]
public async Task Read_StreamAborted_Throws()
{
const int ExpectedErrorCode = 1234;
const int ExpectedErrorCode = 0xfffffff;

await Task.Run(async () =>
{
Expand Down

0 comments on commit b49ab01

Please sign in to comment.