master 24.22
John Wiseman 2 years ago
parent e1344273fd
commit 35db10eca1

@ -1199,7 +1199,8 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
// Fix some 63 port bugs in RigCOntrol (17)
// Fix 63 port bug in Bridging (18)
// Add FTDX10 Rigcontrol (19)
// Fix 64 bit bug in displaying INP3 Messages
// Fix 64 bit bug in displaying INP3 Messages (20)
// Improve restart of WinRPR TNC on remote host (21)
#define CKernel

@ -10,8 +10,8 @@
#endif
#define KVers 6,0,24,20
#define KVerstring "6.0.24.20\0"
#define KVers 6,0,24,21
#define KVerstring "6.0.24.21\0"
#ifdef CKernel

@ -106,6 +106,7 @@ int ConnecttoWinRPR(int port);
BOOL KillOldTNC(char * Path);
int KillTNC(struct TNCINFO * TNC);
void CountRestarts(struct TNCINFO * TNC);
static BOOL RestartTNC(struct TNCINFO * TNC)
{
@ -789,16 +790,15 @@ void * WinRPRExtInit(EXTPORTDATA * PortEntry)
return ExtProc;
}
if (TNC->AutoStartDelay == 0)
TNC->AutoStartDelay = 2000;
sprintf(msg,"WinRPR Host %s %d", TNC->HostName, htons(TNC->destaddr.sin_port));
WritetoConsoleLocal(msg);
TNC->Port = port;
TNC->Hardware = H_WINRPR;
if (TNC->ProgramPath)
TNC->WeStartedTNC = RestartTNC(TNC);
// Set up DED addresses for streams
for (Stream = 0; Stream <= MaxStreams; Stream++)
@ -887,6 +887,9 @@ void * WinRPRExtInit(EXTPORTDATA * PortEntry)
TNC->WEB_MODE = zalloc(20);
TNC->WEB_BUFFERS = zalloc(100);
TNC->WEB_TRAFFIC = zalloc(100);
TNC->WEB_RESTARTTIME = zalloc(100);
TNC->WEB_RESTARTS = zalloc(100);
#ifndef LINBPQ
@ -1451,14 +1454,9 @@ VOID WinRPRThread(void * portptr)
// can only check if running on local host
TNC->PID = GetListeningPortsPID(TNC->destaddr.sin_port);
if (TNC->PID == 0)
{
TNC->CONNECTING = FALSE;
sprintf(TNC->WEB_COMMSSTATE, "Waiting for TNC");
MySetWindowText(TNC->xIDC_COMMSSTATE, TNC->WEB_COMMSSTATE);
return; // Not listening so no point trying to connect
}
goto TNCNotRunning;
// Get the File Name in case we want to restart it.
@ -1480,17 +1478,25 @@ VOID WinRPRThread(void * portptr)
}
}
}
goto TNCRunning;
}
#endif
// // If we started the TNC make sure it is still running.
TNCNotRunning:
// Not running or can't check, restart if we have a path
if (TNC->ProgramPath)
{
Consoleprintf("Trying to (re)start TNC %s", TNC->ProgramPath);
// if (!IsProcess(TNC->PID))
// {
// RestartTNC(TNC);
// Sleep(3000);
// }
if (RestartTNC(TNC))
CountRestarts(TNC);
Sleep(TNC->AutoStartDelay);
}
TNCRunning:
TNC->destaddr.sin_addr.s_addr = inet_addr(TNC->HostName);
TNC->Datadestaddr.sin_addr.s_addr = inet_addr(TNC->HostName);

Loading…
Cancel
Save

Powered by TurnKey Linux.