From e73d1030f7e855bad0c3f0c791695ae62fb4fe2d Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Tue, 14 Feb 2006 22:43:48 +0000
Subject: [PATCH] Modify how Line1 is generated for door.sys files generated
 for native executables. If "Intercept Standard I/O" is enabled, Line1
 becomes: COM0:STDIO If not, Line1 becomes: COM0:SOCKET<Socket Handle> ie:
 COM0:SOCKET54

Currently, this is #ifdef'ed out since I'd like DMs approval before I do
this.
---
 src/sbbs3/xtrn_sec.cpp | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/src/sbbs3/xtrn_sec.cpp b/src/sbbs3/xtrn_sec.cpp
index 449feb376e..6cfc148a8b 100644
--- a/src/sbbs3/xtrn_sec.cpp
+++ b/src/sbbs3/xtrn_sec.cpp
@@ -492,6 +492,31 @@ void sbbs_t::xtrndat(char *name, char *dropdir, uchar type, ulong tleft
 		if(tleft>0x7fff)	/* Reduce time-left for broken 16-bit doors		*/
 			tleft=0x7fff;	/* That interpret this value as a signed short	*/
 
+#if 0
+		if(misc&XTRN_NATIVE) {
+			if(misc&IO_INTS) {
+				strcpy(str,"COM0:STDIO\n");
+			}
+			else {
+				sprintf(str,"COM0:SOCKET%d\n",
+#ifdef __unix__
+					client_socket
+#else
+					client_socket_dup
+#endif
+				);
+			}
+		}
+		else {
+			sprintf(str,"COM%d:\n"
+				,online==ON_REMOTE ? cfg.com_port:0);	/* 01: COM port - 0 if Local */
+		}
+#else
+		sprintf(str,"COM%d:\n"
+			,online==ON_REMOTE ? cfg.com_port:0);	/* 01: COM port - 0 if Local */
+#endif
+		lfexpand(str,misc);
+		write(file,str,strlen(str));
 		/* Note about door.sys, line 2 (April-24-2005):
 		   It *should* be the DCE rate (any number, including the popular modem
 		   DCE rates of 14400, 28800, and 33600).  However, according to Deuce,
@@ -500,8 +525,7 @@ void sbbs_t::xtrndat(char *name, char *dropdir, uchar type, ulong tleft
 		   changing this value to the DTE rate until/unless some other doors
 		   have an issue with that. <sigh>
 		*/
-		sprintf(str,"COM%d:\n%lu\n%u\n%u\n%lu\n%c\n%c\n%c\n%c\n"
-			,online==ON_REMOTE ? cfg.com_port:0	/* 01: COM port - 0 if Local */
+		sprintf(str,"%lu\n%u\n%u\n%lu\n%c\n%c\n%c\n%c\n"
 			,dte_rate /* was cur_rate */		/* 02: DCE rate, see note above */
 			,8									/* 03: Data bits */
 			,cfg.node_num						/* 04: Node number */
-- 
GitLab