Skip to content

Commit a69a6d6

Browse files
committed
Added comments to clarify code.
Added comments to clarify code.
1 parent 85e9e6b commit a69a6d6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Renci.SshNet/Messages/Connection/ChannelRequest/PseudoTerminalInfo.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,18 +137,22 @@ protected override void SaveData()
137137

138138
if (TerminalModeValues != null)
139139
{
140+
// write total length of encoded terminal modes, which is 1 bytes for the opcode / terminal mode
141+
// and 4 bytes for the uint argument for each entry; the encoded terminal modes are terminated by
142+
// opcode TTY_OP_END (which is 1 byte)
140143
Write((uint) TerminalModeValues.Count*(1 + 4) + 1);
141144

142145
foreach (var item in TerminalModeValues)
143146
{
144147
Write((byte) item.Key);
145148
Write(item.Value);
146149
}
147-
Write((byte)0);
150+
151+
Write((byte) TerminalModes.TTY_OP_END);
148152
}
149153
else
150154
{
151-
Write((uint)0);
155+
Write((uint) 0);
152156
}
153157
}
154158
}

0 commit comments

Comments
 (0)