| | | 1 | | namespace Renci.SshNet.Messages.Connection |
| | | 2 | | { |
| | | 3 | | /// <summary> |
| | | 4 | | /// Represents SSH_MSG_CHANNEL_SUCCESS message. |
| | | 5 | | /// </summary> |
| | | 6 | | [Message("SSH_MSG_CHANNEL_WINDOW_ADJUST", 93)] |
| | | 7 | | public class ChannelWindowAdjustMessage : ChannelMessage |
| | | 8 | | { |
| | | 9 | | /// <summary> |
| | | 10 | | /// Gets number of bytes to add to the window. |
| | | 11 | | /// </summary> |
| | 6560 | 12 | | public uint BytesToAdd { get; private set; } |
| | | 13 | | |
| | | 14 | | /// <summary> |
| | | 15 | | /// Gets the size of the message in bytes. |
| | | 16 | | /// </summary> |
| | | 17 | | /// <value> |
| | | 18 | | /// The size of the messages in bytes. |
| | | 19 | | /// </value> |
| | | 20 | | protected override int BufferCapacity |
| | | 21 | | { |
| | | 22 | | get |
| | 0 | 23 | | { |
| | 0 | 24 | | var capacity = base.BufferCapacity; |
| | 0 | 25 | | capacity += 4; // BytesToAdd |
| | 0 | 26 | | return capacity; |
| | 0 | 27 | | } |
| | | 28 | | } |
| | | 29 | | |
| | | 30 | | /// <summary> |
| | | 31 | | /// Initializes a new instance of the <see cref="ChannelWindowAdjustMessage"/> class. |
| | | 32 | | /// </summary> |
| | 3274 | 33 | | public ChannelWindowAdjustMessage() |
| | 3274 | 34 | | { |
| | 3274 | 35 | | } |
| | | 36 | | |
| | | 37 | | /// <summary> |
| | | 38 | | /// Initializes a new instance of the <see cref="ChannelWindowAdjustMessage"/> class. |
| | | 39 | | /// </summary> |
| | | 40 | | /// <param name="localChannelNumber">The local channel number.</param> |
| | | 41 | | /// <param name="bytesToAdd">The bytes to add.</param> |
| | | 42 | | public ChannelWindowAdjustMessage(uint localChannelNumber, uint bytesToAdd) |
| | 6 | 43 | | : base(localChannelNumber) |
| | 6 | 44 | | { |
| | 6 | 45 | | BytesToAdd = bytesToAdd; |
| | 6 | 46 | | } |
| | | 47 | | |
| | | 48 | | /// <summary> |
| | | 49 | | /// Called when type specific data need to be loaded. |
| | | 50 | | /// </summary> |
| | | 51 | | protected override void LoadData() |
| | 3274 | 52 | | { |
| | 3274 | 53 | | base.LoadData(); |
| | | 54 | | |
| | 3274 | 55 | | BytesToAdd = ReadUInt32(); |
| | 3274 | 56 | | } |
| | | 57 | | |
| | | 58 | | /// <summary> |
| | | 59 | | /// Called when type specific data need to be saved. |
| | | 60 | | /// </summary> |
| | | 61 | | protected override void SaveData() |
| | 0 | 62 | | { |
| | 0 | 63 | | base.SaveData(); |
| | | 64 | | |
| | 0 | 65 | | Write(BytesToAdd); |
| | 0 | 66 | | } |
| | | 67 | | |
| | | 68 | | internal override void Process(Session session) |
| | 3274 | 69 | | { |
| | 3274 | 70 | | session.OnChannelWindowAdjustReceived(this); |
| | 3274 | 71 | | } |
| | | 72 | | } |
| | | 73 | | } |