From 592e5967b8fcd79423802071319d0c646f2080df Mon Sep 17 00:00:00 2001 From: Dave Hibberd Date: Tue, 29 Sep 2026 21:39:24 +0100 Subject: New upstream version 6.0.25.41+repack --- AGWAPI.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'AGWAPI.c') diff --git a/AGWAPI.c b/AGWAPI.c index 5dc2f9c..590d62d 100644 --- a/AGWAPI.c +++ b/AGWAPI.c @@ -550,16 +550,20 @@ int AGWConnected(struct BPQConnectionInfo * Con, int Stream) if (ApplCall[i]==32) ApplCall[i]=0; -// See if incomming connection +// See if incoming connection if (Con->Listening) { // Allocate Session and send "c" Message // // Find an AGW session + + Debugprintf("Incoming AGW Call for ApplCall %s", ApplCall); for (sockptr=&Sockets[1]; sockptr <= &Sockets[CurrentSockets]; sockptr++) { + Debugprintf("Trying Socket %d, Calls %s %s", i, sockptr->CallSign1, sockptr->CallSign2); + if (sockptr->SocketActive && (memcmp(sockptr->CallSign1, ApplCall, 10) == 0) || (memcmp(sockptr->CallSign2, ApplCall, 10) == 0)) { @@ -572,6 +576,7 @@ int AGWConnected(struct BPQConnectionInfo * Con, int Stream) int maxframe; int l4window; + Debugprintf("Connection Found, Checking for duplicate calls"); keyptr=(byte *)&Con->CallKey; @@ -594,13 +599,13 @@ int AGWConnected(struct BPQConnectionInfo * Con, int Stream) for (i = 0; i < CurrentConnections; i++) { - if (Con->BPQStream == Stream) + if (AGWConnections[i].BPQStream == Stream) continue; // Dont Check ourself! if (AGWConnections[i].SocketIndex == sockptr && memcmp(&Con->CallKey, &AGWConnections[i].CallKey,21) == 0) { - SendMsg(Stream, "AGWtoBPQ - Callsign is already connected\r", 43); + SendMsg(Stream, "AGWAPI - Callsign is already connected\r", 43); Sleep (500); Disconnect(Stream); Con->CallKey[0]=0; @@ -628,7 +633,7 @@ int AGWConnected(struct BPQConnectionInfo * Con, int Stream) // Not listening ?? - OutputDebugString("Inbound Connection on Outgoing Stream"); + Debugprintf("Inbound Connection on Outgoing Stream"); SendMsg(Stream, "AGWtoBPQ - Inbound Connection on Outgoing Stream\r", 49); Sleep (500); @@ -1393,12 +1398,12 @@ int ProcessAGWCommand(struct AGWSocketConnectionInfo * sockptr) if (sockptr->AGWRXHeader.DataKind == 'V') // Unproto with VIA string { Digis = sockptr->MsgData[0]; // Number of digis - - if (Digis > 7) - { - AGWDataSocket_Disconnect(sockptr); - return 0; - } + + if (Digis > 7) + { + AGWDataSocket_Disconnect(sockptr); + return 0; + } for (j = 1; j<= Digis; j++) { -- cgit v1.2.3