From 951f1d912a5cd1557caa3ef60becfd8f81b456a8 Mon Sep 17 00:00:00 2001 From: Dave Hibberd Date: Sun, 9 Jun 2024 21:48:39 +0100 Subject: New upstream version 6.0.24.38 --- CommonCode.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'CommonCode.c') diff --git a/CommonCode.c b/CommonCode.c index 29555b8..3b7fb70 100644 --- a/CommonCode.c +++ b/CommonCode.c @@ -2184,7 +2184,7 @@ int OpenCOMMPort(struct TNCINFO * conn, char * Port, int Speed, BOOL Quiet) HANDLE OpenCOMPort(char * pPort, int speed, BOOL SetDTR, BOOL SetRTS, BOOL Quiet, int Stopbits) { - char szPort[80]; + char szPort[256]; BOOL fRetVal ; COMMTIMEOUTS CommTimeOuts ; int Err; @@ -2576,8 +2576,9 @@ BOOL WriteCOMBlock(HANDLE fd, char * Block, int BytesToWrite) int ToSend = BytesToWrite; int Sent = 0, ret; + int loops = 100; - while (ToSend) + while (ToSend && loops-- > 0) { ret = write(fd, &Block[Sent], ToSend); @@ -2596,6 +2597,12 @@ BOOL WriteCOMBlock(HANDLE fd, char * Block, int BytesToWrite) Sent += ret; ToSend -= ret; } + +// if (ToSend) +// { +// // Send timed out. Close and reopen device +// +// } return TRUE; } -- cgit v1.2.3