• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision6963 (tree)
Time2017-10-27 18:40:53
Authordoda

Log Message

telnet 接続時、端末の幅/高さが 255 の時に端末サイズがサーバに伝わらないのを修正 #37605

telnet サブオプションで値に 255 を使う時は 255(IAC) を二つ連続で送る必要がある。

RFC 855:
| Finally, if parameters in an option "subnegotiation" include a byte
| with a value of 255, it is necessary to double this byte in
| accordance the general TELNET rules.

HIBYTE の方が 255 になる事はないだろうが、念の為対応しておく。

Change Summary

Incremental Difference

--- trunk/teraterm/teraterm/telnet.c (revision 6962)
+++ trunk/teraterm/teraterm/telnet.c (revision 6963)
@@ -176,16 +176,27 @@
176176 TmpBuff[i++] = IAC;
177177 TmpBuff[i++] = SB;
178178 TmpBuff[i++] = NAWS;
179+
180+ if (HIBYTE(tr.WinSize.x) == IAC) {
181+ TmpBuff[i++] = IAC;
182+ }
179183 TmpBuff[i++] = HIBYTE(tr.WinSize.x);
180-// if (LOBYTE(tr.WinSize.x) == IAC) {
181-// tr.SendBackBuff[i++] = IAC;
182-// }
184+
185+ if (LOBYTE(tr.WinSize.x) == IAC) {
186+ TmpBuff[i++] = IAC;
187+ }
183188 TmpBuff[i++] = LOBYTE(tr.WinSize.x);
189+
190+ if (HIBYTE(tr.WinSize.y) == IAC) {
191+ TmpBuff[i++] = IAC;
192+ }
184193 TmpBuff[i++] = HIBYTE(tr.WinSize.y);
185-// if (LOBYTE(tr.WinSize.y) == IAC) {
186-// tr.SendBackBuff[i++] = IAC;
187-// }
194+
195+ if (LOBYTE(tr.WinSize.y) == IAC) {
196+ TmpBuff[i++] = IAC;
197+ }
188198 TmpBuff[i++] = LOBYTE(tr.WinSize.y);
199+
189200 TmpBuff[i++] = IAC;
190201 TmpBuff[i++] = SE;
191202
Show on old repository browser