Files
SSH.NET/test/Renci.SshNet.Tests/Common/ScpTranscriptResult.cs
T
Rob Hague 5ef2f6ce69 Fail SCP download when the channel closes mid-file
When the channel was closed before all of the file content announced in a
C record had been received, PipeStream.Read kept returning 0 and the copy
loop spun forever. Throw an SshException in this case, matching ReadByte.
2026-10-14 09:40:28 +02:00

40 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
namespace Renci.SshNet.Tests.Common
{
/// <summary>
/// The outcome of <see cref="ScpServerTranscript.Run"/>.
/// </summary>
public sealed class ScpTranscriptResult
{
public ScpTranscriptResult(bool completed, Exception exception, IReadOnlyList<byte[]> sentData, IReadOnlyList<string> execRequests)
{
Completed = completed;
Exception = exception;
SentData = sentData;
ExecRequests = execRequests;
}
/// <summary>
/// Gets a value indicating whether the operation finished within the timeout.
/// </summary>
public bool Completed { get; }
/// <summary>
/// Gets the exception thrown by the operation, if any.
/// </summary>
public Exception Exception { get; }
/// <summary>
/// Gets the data the client sent on the channel, one entry per send.
/// </summary>
public IReadOnlyList<byte[]> SentData { get; }
/// <summary>
/// Gets the commands the client sent in exec requests.
/// </summary>
public IReadOnlyList<string> ExecRequests { get; }
}
}