Commit 12322121 authored by Marc Gravell's avatar Marc Gravell

simplify EOF reporting

parent 3e5e3476
...@@ -1341,17 +1341,26 @@ private void OnDebugAbort() ...@@ -1341,17 +1341,26 @@ private void OnDebugAbort()
// this CEX is just a hardcore "seriously, read the actual value" - there's no // this CEX is just a hardcore "seriously, read the actual value" - there's no
// convenient "Thread.VolatileRead<T>(ref T field) where T : class", and I don't // convenient "Thread.VolatileRead<T>(ref T field) where T : class", and I don't
// want to make the field volatile just for this one place that needs it // want to make the field volatile just for this one place that needs it
if (isReading && Volatile.Read(ref _ioPipe) == null) if (isReading)
{ {
// yeah, that's fine... don't worry about it var pipe = Volatile.Read(ref _ioPipe);
if (pipe == null)
{
return;
// yeah, that's fine... don't worry about it; we nuked it
} }
else
// check for confusing read errors - no need to present "Reading is not allowed after reader was completed."
if (pipe is SocketConnection sc && sc.ShutdownKind == PipeShutdownKind.ReadEndOfStream)
{ {
RecordConnectionFailed(ConnectionFailureType.SocketClosed, new EndOfStreamException());
return;
}
}
Trace("Faulted"); Trace("Faulted");
RecordConnectionFailed(ConnectionFailureType.InternalFailure, ex); RecordConnectionFailed(ConnectionFailureType.InternalFailure, ex);
} }
} }
}
private int ProcessBuffer(ref ReadOnlySequence<byte> buffer) private int ProcessBuffer(ref ReadOnlySequence<byte> buffer)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment