Hi, I was trying to add a
login(string username, string password)
method to the code, and i was guessing that by simply adding 2 send commands, it would do the trick. But it seems like the system sends the second command to soon for the password request. Any suggestions !?
Thank you !
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The TelnetProtocolHandler.Transpose has a problem
It check for LF or CR and then adds CRLF. But if the "terminal" sends CRLF both already then you can't logon etc as each <return> key press is done twice.
I commented out both:
/* case 10: // \n
if (receivedDX[TELOPT_BINARY + 128] != DO)
{
while (nbuf.Length - nbufptr < crlf.Length)
{
xbuf = new byte[nbuf.Length * 2];
Array.Copy(nbuf, 0, xbuf, 0, nbufptr);
nbuf = xbuf;
}
for (int j = 0; j < crlf.Length; j++)
nbuf[nbufptr++] = crlf[j];
break;
}
else
{
// copy verbatim in binary mode.
nbuf[nbufptr++] = buf[i];
}
break;
// carriage return is CR NUL
case 13: // \r
if (receivedDX[TELOPT_BINARY + 128] != DO)
{
while (nbuf.Length - nbufptr < cr.Length)
{
xbuf = new byte[nbuf.Length * 2];
Array.Copy(nbuf, 0, xbuf, 0, nbufptr);
nbuf = xbuf;
}
for (int j = 0; j < cr.Length; j++)
nbuf[nbufptr++] = cr[j];
}
else
{
// copy verbatim in binary mode.
nbuf[nbufptr++] = buf[i];
}
break; */
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I was trying to add a
login(string username, string password)
method to the code, and i was guessing that by simply adding 2 send commands, it would do the trick. But it seems like the system sends the second command to soon for the password request. Any suggestions !?
Thank you !
The TelnetProtocolHandler.Transpose has a problem
It check for LF or CR and then adds CRLF. But if the "terminal" sends CRLF both already then you can't logon etc as each <return> key press is done twice.
I commented out both:
/* case 10: // \n
if (receivedDX[TELOPT_BINARY + 128] != DO)
{
while (nbuf.Length - nbufptr < crlf.Length)
{
xbuf = new byte[nbuf.Length * 2];
Array.Copy(nbuf, 0, xbuf, 0, nbufptr);
nbuf = xbuf;
}
for (int j = 0; j < crlf.Length; j++)
nbuf[nbufptr++] = crlf[j];
break;
}
else
{
// copy verbatim in binary mode.
nbuf[nbufptr++] = buf[i];
}
break;
// carriage return is CR NUL
case 13: // \r
if (receivedDX[TELOPT_BINARY + 128] != DO)
{
while (nbuf.Length - nbufptr < cr.Length)
{
xbuf = new byte[nbuf.Length * 2];
Array.Copy(nbuf, 0, xbuf, 0, nbufptr);
nbuf = xbuf;
}
for (int j = 0; j < cr.Length; j++)
nbuf[nbufptr++] = cr[j];
}
else
{
// copy verbatim in binary mode.
nbuf[nbufptr++] = buf[i];
}
break; */