From bdb1f1236cb3e92385e30b4e0c5b7bdcb90ef963 Mon Sep 17 00:00:00 2001 From: g8bpq Date: Sun, 3 Dec 2023 11:49:48 +0000 Subject: [PATCH] 6.0.24.22 --- BPQINP3.c | 10 +- BPQMail.c | 3 +- BPQMail.vcproj.DESKTOP-TGEL8RC.John.user | 65 ------ BPQWinAPP.vcproj.DESKTOP-TGEL8RC.John.user | 65 ------ Bpq32.c | 2 + CBPQ32.vcproj.DESKTOP-MHE5LO8.johnw.user | 65 ------ CBPQ32.vcproj.DESKTOP-TGEL8RC.John.user | 65 ------ FormatHTML.cpp | 60 +++++ FormatHTML.vcproj | 219 ++++++++++++++++++ L4Code.c | 2 +- MailNode.vcproj.DESKTOP-TGEL8RC.John.user | 65 ------ MailNode.vcxproj | 6 +- MailNode.vcxproj.filters | 3 + MailNode.vcxproj.user | 2 +- RigControl.c | 7 +- Versions.h | 4 +- WebMail.c | 9 + WinRPRHelper.vcproj.DESKTOP-TGEL8RC.John.user | 65 ------ ...orControl.vcproj.DESKTOP-TGEL8RC.John.user | 65 ------ upnp-DESKTOP-TGEL8RC.c | 187 --------------- upnp.c | 2 + 21 files changed, 317 insertions(+), 654 deletions(-) delete mode 100644 BPQMail.vcproj.DESKTOP-TGEL8RC.John.user delete mode 100644 BPQWinAPP.vcproj.DESKTOP-TGEL8RC.John.user delete mode 100644 CBPQ32.vcproj.DESKTOP-MHE5LO8.johnw.user delete mode 100644 CBPQ32.vcproj.DESKTOP-TGEL8RC.John.user create mode 100644 FormatHTML.cpp create mode 100644 FormatHTML.vcproj delete mode 100644 MailNode.vcproj.DESKTOP-TGEL8RC.John.user delete mode 100644 WinRPRHelper.vcproj.DESKTOP-TGEL8RC.John.user delete mode 100644 WinmorControl.vcproj.DESKTOP-TGEL8RC.John.user delete mode 100644 upnp-DESKTOP-TGEL8RC.c diff --git a/BPQINP3.c b/BPQINP3.c index e541518..bfe7cb0 100644 --- a/BPQINP3.c +++ b/BPQINP3.c @@ -358,9 +358,7 @@ VOID ProcessINP3RIF(struct ROUTE * Route, UCHAR * ptr1, int msglen, int Port) // Update Timestamp on Route - time((time_t *)&Stamp); - - Stamp = Stamp % 86400; // Secs into day + Stamp = time(NULL) % 86400; // Secs into day HH = Stamp / 3600; Stamp -= HH * 3600; @@ -370,6 +368,12 @@ VOID ProcessINP3RIF(struct ROUTE * Route, UCHAR * ptr1, int msglen, int Port) while (msglen > 0) { + if (msglen < 10) + { + Debugprintf("Corrupt INP3 Message"); + return; + } + memset(alias, ' ', 6); memcpy(axcall, ptr1, 7); diff --git a/BPQMail.c b/BPQMail.c index f586b86..bd37641 100644 --- a/BPQMail.c +++ b/BPQMail.c @@ -1120,8 +1120,9 @@ // 6.0.25.1 ?? -// Add FBB reject.sys style filters (3) +// Add FBB reject.sys style filters (3) // Improve Webmail on 64 bit builds +// Fix setting status '$' on Bulls sent via WebMail (22) diff --git a/BPQMail.vcproj.DESKTOP-TGEL8RC.John.user b/BPQMail.vcproj.DESKTOP-TGEL8RC.John.user deleted file mode 100644 index 40182c4..0000000 --- a/BPQMail.vcproj.DESKTOP-TGEL8RC.John.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/BPQWinAPP.vcproj.DESKTOP-TGEL8RC.John.user b/BPQWinAPP.vcproj.DESKTOP-TGEL8RC.John.user deleted file mode 100644 index 40182c4..0000000 --- a/BPQWinAPP.vcproj.DESKTOP-TGEL8RC.John.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/Bpq32.c b/Bpq32.c index f3e6c00..f2c5451 100644 --- a/Bpq32.c +++ b/Bpq32.c @@ -1201,6 +1201,8 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses // Add FTDX10 Rigcontrol (19) // Fix 64 bit bug in displaying INP3 Messages (20) // Improve restart of WinRPR TNC on remote host (21) +// Fix some Rigcontrol issues with empty timebands (22) +// Fix 64 bit bug in processing INP3 Messages (22) #define CKernel diff --git a/CBPQ32.vcproj.DESKTOP-MHE5LO8.johnw.user b/CBPQ32.vcproj.DESKTOP-MHE5LO8.johnw.user deleted file mode 100644 index 2ab49a6..0000000 --- a/CBPQ32.vcproj.DESKTOP-MHE5LO8.johnw.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/CBPQ32.vcproj.DESKTOP-TGEL8RC.John.user b/CBPQ32.vcproj.DESKTOP-TGEL8RC.John.user deleted file mode 100644 index fdd7820..0000000 --- a/CBPQ32.vcproj.DESKTOP-TGEL8RC.John.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/FormatHTML.cpp b/FormatHTML.cpp new file mode 100644 index 0000000..f27498c --- /dev/null +++ b/FormatHTML.cpp @@ -0,0 +1,60 @@ +// FormatHTML.cpp : Defines the entry point for the console application. +// +#include + +int main () { + FILE *fp, *fp2; + char str[256]; + char newstr[256]; + char * ptr, * inptr; + + /* opening file for reading */ + fp = fopen("D:/AtomProject/test.html" , "r"); + fp2 = fopen("D:/AtomProject/test.html.c" , "w"); + + if(fp == NULL) { + perror("Error opening file"); + return(-1); + } + + while(fgets (str, 256, fp) != NULL) + { + // Replace any " with \" and add " on front and \r\n" on end + + char c; + ptr = newstr; + inptr = str; + + c = *(inptr++); + + *(ptr++) = '"'; + + while (c && c != 10) + { + if (c == '"') + *(ptr++) = '\\'; + + *(ptr++) = c; + + c = *(inptr++); + } + + + *(ptr++) = '\\'; + *(ptr++) = 'r'; + *(ptr++) = '\\'; + *(ptr++) = 'n'; + *(ptr++) = '"'; + *(ptr++) = 10; + *(ptr++) = 0; + + puts(newstr); + fputs(newstr, fp2); + + } + + fclose(fp); + fclose(fp2); + + return(0); +} \ No newline at end of file diff --git a/FormatHTML.vcproj b/FormatHTML.vcproj new file mode 100644 index 0000000..95563d4 --- /dev/null +++ b/FormatHTML.vcproj @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/L4Code.c b/L4Code.c index 424522d..483746e 100644 --- a/L4Code.c +++ b/L4Code.c @@ -115,7 +115,7 @@ VOID NETROMMSG(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG) { // INP3 - ProcessINP3RIF(LINK->NEIGHBOUR, &L3MSG->L3SRCE[1], L3MSG->LENGTH - 9, L3MSG->Port); + ProcessINP3RIF(LINK->NEIGHBOUR, &L3MSG->L3SRCE[1], L3MSG->LENGTH - (MSGHDDRLEN + 2), L3MSG->Port); // = 2 = PID + FF Flag ReleaseBuffer(L3MSG); return; } diff --git a/MailNode.vcproj.DESKTOP-TGEL8RC.John.user b/MailNode.vcproj.DESKTOP-TGEL8RC.John.user deleted file mode 100644 index 40182c4..0000000 --- a/MailNode.vcproj.DESKTOP-TGEL8RC.John.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/MailNode.vcxproj b/MailNode.vcxproj index aae4482..429ce34 100644 --- a/MailNode.vcxproj +++ b/MailNode.vcxproj @@ -74,6 +74,7 @@ true + D:\linbpq C:\Dev\Msdev2005\$(SolutionName)\$(ProjectName)\$(Configuration)\ @@ -117,10 +118,10 @@ Level3 - ProgramDatabase + EditAndContinue - kernel32.lib;WS2_32.Lib;..\lib\libconfigd.lib;DbgHelp.lib;setupapi.lib;miniupnpc.lib;zlibstat.lib;%(AdditionalDependencies) + kernel32.lib;WS2_32.Lib;C:\OneDrive\Dev\Source\bpq32\libconfig\x64\Release\libconfig.lib;DbgHelp.lib;setupapi.lib;C:\Dev\Msdev2005\projects\bpq32\CKernel\x64\Debug\miniupnpc.lib;C:\OneDrive\Dev\Source\zlib-1.2.11\contrib\vstudio\vc14\x64\ZlibStatDebug\zlibstat.lib;%(AdditionalDependencies) c:\LINBPQ\$(ProjectName).exe true true @@ -215,6 +216,7 @@ + diff --git a/MailNode.vcxproj.filters b/MailNode.vcxproj.filters index 9f953ec..d32f45b 100644 --- a/MailNode.vcxproj.filters +++ b/MailNode.vcxproj.filters @@ -315,6 +315,9 @@ Source Files + + Source Files + diff --git a/MailNode.vcxproj.user b/MailNode.vcxproj.user index 448994b..3ea46b0 100644 --- a/MailNode.vcxproj.user +++ b/MailNode.vcxproj.user @@ -1,7 +1,7 @@  - C:\Dev\Msdev2005\projects\bpq32\BPQMail\x64\Debug\LinBPQ.exe + c:\linbpq\linbpq.exe c:\linbpq WindowsLocalDebugger diff --git a/RigControl.c b/RigControl.c index ca335a4..0e56d6e 100644 --- a/RigControl.c +++ b/RigControl.c @@ -6212,7 +6212,7 @@ CheckOtherParams: RIG->defaultFreq = atoi(&ptr[12]); } - else if (atoi(ptr)) + else if (atoi(ptr) || ptr[2] == ':') break; // Not scan freq oe timeband, so see if another param ptr = strtok_s(NULL, " \t\n\r", &Context); @@ -6590,7 +6590,7 @@ CheckScan: VARAMode[0] = 0; Dwell = 0.0; - while (strchr(ptr, ':')) + while (ptr && strchr(ptr, ':')) { // New TimeBand @@ -6612,6 +6612,9 @@ CheckScan: ptr = strtok_s(NULL, " \t\n\r", &Context); } + if (ptr == 0) + break; + if (strchr(ptr, ',')) // New Format { DecodeModePtr(ptr, &Dwell, &Freq, Mode, &PMinLevel, &PMaxLevel, &PacketMode, diff --git a/Versions.h b/Versions.h index 29b6e9e..56bfe73 100644 --- a/Versions.h +++ b/Versions.h @@ -10,8 +10,8 @@ #endif -#define KVers 6,0,24,21 -#define KVerstring "6.0.24.21\0" +#define KVers 6,0,24,22 +#define KVerstring "6.0.24.22\0" #ifdef CKernel diff --git a/WebMail.c b/WebMail.c index 1b4cd33..f626975 100644 --- a/WebMail.c +++ b/WebMail.c @@ -2773,6 +2773,9 @@ VOID SaveNewMessage(struct HTTPConnectionInfo * Session, char * MsgPtr, char * R BuildNNTPList(Msg); // Build NNTP Groups list + if (Msg->status != 'H' && Msg->type == 'B' && memcmp(Msg->fbbs, zeros, NBMASK) != 0) + Msg->status = '$'; // Has forwarding + if (EnableUI) SendMsgUI(Msg); @@ -3698,6 +3701,9 @@ VOID WriteOneRecipient(struct MsgInfo * Msg, WebMailInfo * WebMail, int MsgLen, MatchMessagetoBBSList(Msg, 0); + if (Msg->status != 'H' && Msg->type == 'B' && memcmp(Msg->fbbs, zeros, NBMASK) != 0) + Msg->status = '$'; // Has forwarding + BuildNNTPList(Msg); // Build NNTP Groups list } @@ -4278,6 +4284,9 @@ VOID BuildMessageFromHTMLInput(struct HTTPConnectionInfo * Session, char * Reply MatchMessagetoBBSList(Msg, 0); + if (Msg->status != 'H' && Msg->type == 'B' && memcmp(Msg->fbbs, zeros, NBMASK) != 0) + Msg->status = '$'; // Has forwarding + BuildNNTPList(Msg); // Build NNTP Groups list SaveMessageDatabase(); diff --git a/WinRPRHelper.vcproj.DESKTOP-TGEL8RC.John.user b/WinRPRHelper.vcproj.DESKTOP-TGEL8RC.John.user deleted file mode 100644 index d4a1f25..0000000 --- a/WinRPRHelper.vcproj.DESKTOP-TGEL8RC.John.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/WinmorControl.vcproj.DESKTOP-TGEL8RC.John.user b/WinmorControl.vcproj.DESKTOP-TGEL8RC.John.user deleted file mode 100644 index 40182c4..0000000 --- a/WinmorControl.vcproj.DESKTOP-TGEL8RC.John.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/upnp-DESKTOP-TGEL8RC.c b/upnp-DESKTOP-TGEL8RC.c deleted file mode 100644 index 70a8081..0000000 --- a/upnp-DESKTOP-TGEL8RC.c +++ /dev/null @@ -1,187 +0,0 @@ -// Includes code from MiniUPnPc, used subject to the following conditions: - -/* - -MiniUPnPc -Copyright (c) 2005-2020, Thomas BERNARD -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ - -#define MINIUPNP_STATICLIB - -#include -#ifdef _WIN32 -#include "upnpcommands.h" -#include "miniupnpc.h" -#include "upnperrors.h" -#include -#else -#include -#include -#include -#include -#endif - -int AddMap(char * controlURL, char * eport, char * iport, char * proto); -int DeleteMap(char * controlURL, char * eport, char * iport, char * proto); - -void Consoleprintf(const char * format, ...); - -struct UPNP -{ - struct UPNP * Next; - char * Protocol; - char * LANport; - char * WANPort; -}; - -extern struct UPNP * UPNPConfig; - -char * controlURL = 0; -char * servicetype = 0; -char iaddr[] = "IP"; -char * inClient = NULL; -#ifdef LINBPQ -char desc[] = "LinBPQ "; -#else -char desc[] = "BPQ32 "; -#endif -char * remoteHost = NULL; -char * leaseDuration = NULL; - -struct UPNPDev * devlist = 0; -char lanaddr[64] = "unset"; /* my ip address on the LAN */ -struct UPNPUrls urls; -struct IGDdatas data; - -int i; -const char * rootdescurl = 0; -const char * multicastif = 0; -const char * minissdpdpath = 0; -int localport = UPNP_LOCAL_PORT_ANY; -int retcode = 0; -int error = 0; -int ipv6 = 0; -int ignore = 0; -unsigned char ttl = 2; - - -int upnpInit() -{ - struct UPNP * Config = UPNPConfig; - int i; -#ifdef WIN32 - WSADATA wsaData; - int nResult = WSAStartup(MAKEWORD(2,2), &wsaData); - if(nResult != NO_ERROR) - { - fprintf(stderr, "WSAStartup() failed.\n"); - return -1; - } -#endif - - while (Config) - { - if (devlist == NULL) - { - devlist = upnpDiscover(2000, multicastif, minissdpdpath, localport, ipv6, ttl, &error); - - if (devlist == NULL) - { - Consoleprintf("Failed to find a UPNP device"); - return 0; - } - - i = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr)); - } - - AddMap(devlist->descURL, Config->LANport, Config->WANPort, Config->Protocol); - Config = Config->Next; - } - - return 0; -} - -int upnpClose() -{ - struct UPNP * Config = UPNPConfig; - int i; - - while (Config) - { - if (devlist == NULL) - { - devlist = upnpDiscover(2000, multicastif, minissdpdpath, localport, ipv6, ttl, &error); - - if (devlist == NULL) - { - Consoleprintf("Failed to find a UPNP device"); - return 0; - } - - i = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr)); - } - - DeleteMap(devlist->descURL, Config->LANport, Config->WANPort, Config->Protocol); - Config = Config->Next; - } - - return 0; -} - -int AddMap(char * controlURL, char * eport, char * iport, char * proto) -{ - int r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, - eport, iport, lanaddr, desc, - proto, remoteHost, leaseDuration); - - if (r != UPNPCOMMAND_SUCCESS) - { - Consoleprintf("UPNP AddPortMapping(%s, %s, %s) failed with code %d (%s)", eport, iport, lanaddr, r, strupnperror(r)); - return -2; - } - Consoleprintf("UPNP AddPortMapping(%s, %s, %s) Succeeded", eport, iport, lanaddr, r); - return 0; -} - -int DeleteMap(char * controlURL, char * eport, char * iport, char * proto) -{ - int r = UPNP_DeletePortMapping(urls.controlURL, data.first.servicetype, eport, proto, remoteHost); - - if(r != UPNPCOMMAND_SUCCESS) - { - Consoleprintf("UPNP DeletePortMapping(%s, %s, %s) failed with code %d (%s)", eport, iport, lanaddr, r, strupnperror(r)); - return -2; - } - Consoleprintf("UPNP DeletePortMapping(%s, %s, %s) Succeeded", eport, iport, lanaddr, r); - - return 0; -} - - - - diff --git a/upnp.c b/upnp.c index 6299446..dbc7c8d 100644 --- a/upnp.c +++ b/upnp.c @@ -42,12 +42,14 @@ POSSIBILITY OF SUCH DAMAGE. #endif #ifdef LINBPQ #ifndef MACBPQ +#ifndef WIN32 #include #include #include #include #endif #endif +#endif #ifdef MACBPQ #include #include