diff options
| author | Dave Hibberd <hibby@debian.org> | 2024-06-09 22:57:10 +0100 |
|---|---|---|
| committer | Dave Hibberd <hibby@debian.org> | 2024-06-09 22:57:10 +0100 |
| commit | 14f7882f2f0faaf530ac1d2811af3742a44bb659 (patch) | |
| tree | 7f0a572d17d7c10467f8e1f86fc3ac8fb4f02298 /CommonCode.c | |
| parent | fbbb08966cb6620ed208d491f8fdf3c18734774e (diff) | |
| parent | a7ecf779fc7dc96aa17d9dfef9ec83965e6903b4 (diff) | |
Merge branch 'debian/latest' into ubuntu/jammy
Diffstat (limited to 'CommonCode.c')
| -rw-r--r-- | CommonCode.c | 11 |
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;
}
|
