[Date Prev] [Date Index] [Date Next] [Thread Prev] [Thread Index] [Thread Next]

[PATCH] telnet negotiation

Andras.Horvath Andras.Horvath@cern.ch
Mon, 12 Oct 2009 08:44:03 GMT


Hi,

I'm forwarding this patch on behalf of Nicolas De Metz-Noblat who has
been using conserver-8.1.15 to handle the consoles of ~1000 VME Single
Board processors and PCs, using terminal concentrators.

Quoting:

> However, I was suffering from an abnormal systematic delay for the echo
> when using the Wiener UEL6020 fan tray unit for VME or CompactPCI
> crate as telnet reverse terminal server  (
> http://www.wiener-d.com/products/44/66.html ) -while I did not had
> that effect with my old tools.
> 
> The problem comes from the fact that conserver do not initiate any
> telnet negociation when establishing its connection.  Attached patch -
> forcing telnet ECHO and SGA - seems to cure the problem.

Cheers,

Andras Horvath
diff -urN conserver-8.1.15.orig/conserver/consent.c conserver-8.1.15/conserver/consent.c
--- conserver-8.1.15.orig/conserver/consent.c	2006-06-17 04:03:15.000000000 +0200
+++ conserver-8.1.15/conserver/consent.c	2009-07-31 10:42:15.000000000 +0200
@@ -49,6 +49,7 @@
 #include <access.h>
 #include <readcfg.h>
 #include <main.h>
+#include <arpa/telnet.h>
 
 
 BAUD baud[] = {
@@ -928,6 +929,12 @@
 	    if (ret == 0) {
 		pCE->ioState = ISNORMAL;
 		pCE->stateTimer = 0;
+		PutConsole(pCE, IAC, 2);
+		PutConsole(pCE, DO, 2);
+		PutConsole(pCE, TELOPT_ECHO, 2);
+		PutConsole(pCE, IAC, 2);
+		PutConsole(pCE, DO, 2);
+		PutConsole(pCE, TELOPT_SGA, 2);
 	    } else {
 		pCE->ioState = INCONNECT;
 		pCE->stateTimer = time((time_t *)0) + CONNECTTIMEOUT;
diff -urN conserver-8.1.15.orig/conserver/group.c conserver-8.1.15/conserver/group.c
--- conserver-8.1.15.orig/conserver/group.c	2006-06-17 04:02:00.000000000 +0200
+++ conserver-8.1.15/conserver/group.c	2009-07-31 10:51:15.000000000 +0200
@@ -4535,6 +4535,14 @@
 			}
 			SendIWaitClientsMsg(pCEServing, "up]\r\n");
 			StartInit(pCEServing);
+			if (pCEServing->type == HOST) {
+			    PutConsole(pCEServing, IAC, 2);
+			    PutConsole(pCEServing, DO, 2);
+			    PutConsole(pCEServing, TELOPT_ECHO, 2);
+			    PutConsole(pCEServing, IAC, 2);
+			    PutConsole(pCEServing, DO, 2);
+			    PutConsole(pCEServing, TELOPT_SGA, 2);
+			}
 		    }
 		    break;
 		case ISNORMAL: