summaryrefslogtreecommitdiff
path: root/CommonCode.c
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2024-06-09 21:48:46 +0100
committerDave Hibberd <hibby@debian.org>2024-06-09 21:48:46 +0100
commit3b36ba2a0634cf5f39e75f5054de6562e1ce29c9 (patch)
tree47c3b90cbc690400a801d9b4f7c5fb8d48d19608 /CommonCode.c
parentec1e97d9855423f0f9f386bb929f35cb44fb54e6 (diff)
parent951f1d912a5cd1557caa3ef60becfd8f81b456a8 (diff)
Update upstream source from tag 'upstream/6.0.24.38'
Update to upstream version '6.0.24.38' with Debian dir 05f0c663f1ee53dd2a7c1d3dae50dd42ace74c27
Diffstat (limited to 'CommonCode.c')
-rw-r--r--CommonCode.c11
1 files changed, 9 insertions, 2 deletions
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;
}