-
-
Notifications
You must be signed in to change notification settings - Fork 917
/
SftpStatusResponse.cs
43 lines (34 loc) · 1.14 KB
/
SftpStatusResponse.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
namespace Renci.SshNet.Sftp.Responses
{
internal sealed class SftpStatusResponse : SftpResponse
{
public override SftpMessageTypes SftpMessageType
{
get { return SftpMessageTypes.Status; }
}
public SftpStatusResponse(uint protocolVersion)
: base(protocolVersion)
{
}
public StatusCodes StatusCode { get; private set; }
public string ErrorMessage { get; private set; }
public string Language { get; private set; }
protected override void LoadData()
{
base.LoadData();
StatusCode = (StatusCodes)ReadUInt32();
if (ProtocolVersion < 3)
{
return;
}
if (!IsEndOfData)
{
// the SSH File Transfer Protocol specification states that the error message is UTF-8
ErrorMessage = ReadString(Utf8);
// the language of the error message; RFC 1766 states that the language code may be
// expressed as US-ASCII
Language = ReadString(Ascii);
}
}
}
}