New upstream version 6.0.24.69+repack
This commit is contained in:
parent
fec78cece5
commit
d3b4158645
|
@ -117,6 +117,7 @@ struct UserInfo * FindBBS(char * Name);
|
|||
void ReleaseWebMailStruct(WebMailInfo * WebMail);
|
||||
VOID TidyWelcomeMsg(char ** pPrompt);
|
||||
int MailAPIProcessHTTPMessage(struct HTTPConnectionInfo * Session, char * response, char * Method, char * URL, char * request, BOOL LOCAL, char * Param, char * Token);
|
||||
void UndoTransparency(char * input);
|
||||
|
||||
char UNC[] = "";
|
||||
char CHKD[] = "checked=checked ";
|
||||
|
@ -186,7 +187,7 @@ char RefreshMainPage[] = "<html><head>"
|
|||
char StatusPage [] =
|
||||
|
||||
"<form style=\"font-family: monospace; text-align: center\" method=post action=/Mail/DisSession?%s>"
|
||||
"<br>User Callsign Stream Queue<br>"
|
||||
"<br>User Callsign Stream Queue Sent Rxed<br>"
|
||||
"<select style=\"font-family: monospace;\" tabindex=1 size=10 name=call>";
|
||||
|
||||
char StreamEnd[] =
|
||||
|
@ -1701,6 +1702,8 @@ VOID ProcessConfUpdate(struct HTTPConnectionInfo * Session, char * MsgPtr, char
|
|||
free(Filters);
|
||||
Filters = NULL;
|
||||
|
||||
UndoTransparency(input);
|
||||
|
||||
while (input)
|
||||
{
|
||||
// extract and validate before saving
|
||||
|
@ -1714,7 +1717,7 @@ VOID ProcessConfUpdate(struct HTTPConnectionInfo * Session, char * MsgPtr, char
|
|||
|
||||
input = strstr(input, "&Type=");
|
||||
|
||||
if (Filter.Action == 'H' || Filter.Action == 'R')
|
||||
if (Filter.Action == 'H' || Filter.Action == 'R' || Filter.Action == 'A')
|
||||
{
|
||||
Filter.Type = toupper(input[6]);
|
||||
input = strstr(input, "&From=");
|
||||
|
@ -2755,6 +2758,19 @@ VOID SendUIPage(char * Reply, int * ReplyLen, char * Key)
|
|||
*ReplyLen = Len;
|
||||
}
|
||||
|
||||
void ConvertSpaceTonbsp(char * msg)
|
||||
{
|
||||
// Replace any space with
|
||||
|
||||
char * ptr;
|
||||
|
||||
while (ptr = strchr(msg, ' '))
|
||||
{
|
||||
memmove(ptr + 5, ptr, strlen(ptr) + 1);
|
||||
memcpy(ptr, " ", 6);
|
||||
}
|
||||
}
|
||||
|
||||
VOID SendStatusPage(char * Reply, int * ReplyLen, char * Key)
|
||||
{
|
||||
int Len;
|
||||
|
@ -2776,6 +2792,8 @@ VOID SendStatusPage(char * Reply, int * ReplyLen, char * Key)
|
|||
if (!conn->Active)
|
||||
{
|
||||
strcpy(msg,"Idle "
|
||||
" "
|
||||
" "
|
||||
" "
|
||||
" \r\n");
|
||||
}
|
||||
|
@ -2789,16 +2807,16 @@ VOID SendStatusPage(char * Reply, int * ReplyLen, char * Key)
|
|||
strcpy(Name, conn->UserPointer->Name);
|
||||
Name[9] = 0;
|
||||
|
||||
i=sprintf_s(msg, sizeof(msg), "%s%s%s%s%2d %5d\r\n",
|
||||
i=sprintf_s(msg, sizeof(msg), "%-12s %-9s %3d %6d%6d%6d\r\n",
|
||||
Name,
|
||||
&TenSpaces[strlen(Name) * 6],
|
||||
conn->UserPointer->Call,
|
||||
&TenSpaces[strlen(conn->UserPointer->Call) * 6],
|
||||
conn->BPQStream,
|
||||
conn->OutputQueueLength - conn->OutputGetPointer);
|
||||
conn->OutputQueueLength - conn->OutputGetPointer, conn->bytesSent, conn->bytesRxed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ConvertSpaceTonbsp(msg);
|
||||
Len += sprintf(&Reply[Len], StatusLine, conn->BPQStream, msg);
|
||||
}
|
||||
|
||||
|
|
|
@ -2085,6 +2085,7 @@ hold certain types or sizes of messages.
|
|||
|
||||
The first letter of each valid line specifies the action :
|
||||
|
||||
A = Accept : Message is accepted without checking other filters
|
||||
R = Reject : The message will not be received.
|
||||
H = Hold : The message will be received but held until the sysop reviews.
|
||||
L = Local Hold : Only messages created on this BBS will be held.
|
||||
|
@ -2179,21 +2180,38 @@ BOOL CheckRejFilters(char * From, char * To, char * ATBBS, char * BID, char Type
|
|||
|
||||
while (p)
|
||||
{
|
||||
if (p->Action != 'R')
|
||||
if (p->Action != 'R' && p->Action != 'A')
|
||||
goto Continue;
|
||||
|
||||
if (p->Type != Type && p->Type != '*')
|
||||
goto Continue;
|
||||
|
||||
// wildcardcompare returns true on a match
|
||||
|
||||
if (wildcardcompare(From, p->From) == 0)
|
||||
goto Continue;
|
||||
|
||||
if (wildcardcompare(ToCopy, p->TO) == 0)
|
||||
goto Continue;
|
||||
if (p->TO[0] == '!')
|
||||
{
|
||||
if (wildcardcompare(ToCopy, &p->TO[1]) == 1)
|
||||
goto Continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (wildcardcompare(ToCopy, p->TO) == 0)
|
||||
goto Continue;
|
||||
}
|
||||
|
||||
if (ATBBS)
|
||||
if (wildcardcompare(ATBBS, p->AT) == 0)
|
||||
{
|
||||
char AtCopy[256];
|
||||
|
||||
strcpy(AtCopy, ATBBS);
|
||||
_strupr(AtCopy);
|
||||
|
||||
if (wildcardcompare(AtCopy, p->AT) == 0)
|
||||
goto Continue;
|
||||
}
|
||||
|
||||
if (BID)
|
||||
if (wildcardcompare(BID, p->BID) == 0)
|
||||
|
@ -2202,6 +2220,11 @@ BOOL CheckRejFilters(char * From, char * To, char * ATBBS, char * BID, char Type
|
|||
if (p->MaxLen && Len < p->MaxLen)
|
||||
goto Continue;
|
||||
|
||||
// if type 'A' matches all rules then accept without checking rest
|
||||
|
||||
if (p->Action == 'A')
|
||||
return FALSE;
|
||||
|
||||
return TRUE; // Hold
|
||||
|
||||
Continue:
|
||||
|
@ -2244,6 +2267,7 @@ BOOL CheckHoldFilters(struct MsgInfo * Msg, char * From, char * To, char * ATBBS
|
|||
{
|
||||
char ** Calls;
|
||||
FBBFilter * p = Filters;
|
||||
char ToCopy[256];
|
||||
|
||||
if (HoldFrom && From)
|
||||
{
|
||||
|
@ -2307,6 +2331,9 @@ BOOL CheckHoldFilters(struct MsgInfo * Msg, char * From, char * To, char * ATBBS
|
|||
|
||||
// check fbb reject.sys type filters
|
||||
|
||||
strcpy(ToCopy, To);
|
||||
_strupr(ToCopy);
|
||||
|
||||
while (p)
|
||||
{
|
||||
if (p->Action != 'H')
|
||||
|
@ -2318,9 +2345,16 @@ BOOL CheckHoldFilters(struct MsgInfo * Msg, char * From, char * To, char * ATBBS
|
|||
if (wildcardcompare(Msg->from, p->From) == 0)
|
||||
goto Continue;
|
||||
|
||||
if (wildcardcompare(Msg->to, p->TO) == 0)
|
||||
goto Continue;
|
||||
|
||||
if (p->TO[0] == '!')
|
||||
{
|
||||
if (wildcardcompare(ToCopy, &p->TO[1]) == 1)
|
||||
goto Continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (wildcardcompare(ToCopy, p->TO) == 0)
|
||||
goto Continue;
|
||||
}
|
||||
if (wildcardcompare(Msg->via, p->AT) == 0)
|
||||
goto Continue;
|
||||
|
||||
|
@ -3388,6 +3422,7 @@ void Flush(CIRCUIT * conn)
|
|||
|
||||
SendUnbuffered(conn->BPQStream, &conn->OutputQueue[conn->OutputGetPointer], len);
|
||||
conn->OutputGetPointer+=len;
|
||||
conn->bytesSent += len;
|
||||
tosend-=len;
|
||||
SendUnbuffered(conn->BPQStream, "<A>bort, <CR> Continue..>", 25);
|
||||
FreeSemaphore(&OutputSEM);
|
||||
|
@ -3399,6 +3434,7 @@ void Flush(CIRCUIT * conn)
|
|||
}
|
||||
|
||||
SendUnbuffered(conn->BPQStream, &conn->OutputQueue[conn->OutputGetPointer], len);
|
||||
conn->bytesSent += len;
|
||||
|
||||
conn->OutputGetPointer+=len;
|
||||
|
||||
|
@ -11051,7 +11087,6 @@ int DoReceivedData(int Stream)
|
|||
if (Stream == conn->BPQStream)
|
||||
{
|
||||
conn->SIDResponseTimer = 0; // Got a message, so cancel timeout.
|
||||
|
||||
do
|
||||
{
|
||||
// May have several messages per packet, or message split over packets
|
||||
|
@ -11068,6 +11103,7 @@ int DoReceivedData(int Stream)
|
|||
if (InputLen == 0 && conn->InputMode != 'Y')
|
||||
return 0;
|
||||
|
||||
conn->bytesRxed += InputLen;
|
||||
conn->InputLen += InputLen;
|
||||
|
||||
if (conn->InputLen == 0) return 0;
|
||||
|
|
Binary file not shown.
11
BPQMail.c
11
BPQMail.c
|
@ -1149,6 +1149,9 @@
|
|||
// Fix treating addresses ending in WW as Internet (57)
|
||||
// Run sending to packetnodes.spots.radio in a separate thread (61)
|
||||
// Fix loading ISP Account Name from config file (67)
|
||||
// Fixes to using {FormFolder} in Webmail Templates (68)
|
||||
// Save FBB transfer restart data over program restarts (69)
|
||||
// Add Send and Receive byte counts to status displays (69)
|
||||
|
||||
#include "bpqmail.h"
|
||||
#include "winstdint.h"
|
||||
|
@ -1725,6 +1728,7 @@ int APIENTRY WinMain(HINSTANCE hInstance,
|
|||
// SaveUserDatabase();
|
||||
SaveMessageDatabase();
|
||||
SaveBIDDatabase();
|
||||
SaveRestartData();
|
||||
|
||||
configSaved = 1;
|
||||
SaveConfig(ConfigName);
|
||||
|
@ -3021,9 +3025,9 @@ int RefreshMainWindow()
|
|||
strcpy(msg,"Logging in");
|
||||
else
|
||||
{
|
||||
i=sprintf_s(msg, sizeof(msg), "%-10s %-10s %2d %-10s%5d",
|
||||
i=sprintf_s(msg, sizeof(msg), "%-10s %-10s %2d %-10s%5d %5d %5d",
|
||||
conn->UserPointer->Name, conn->UserPointer->Call, conn->BPQStream,
|
||||
"BBS", conn->OutputQueueLength - conn->OutputGetPointer);
|
||||
"BBS", conn->OutputQueueLength - conn->OutputGetPointer, conn->bytesSent, conn->bytesRxed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3084,6 +3088,7 @@ static PSOCKADDR_IN psin;
|
|||
|
||||
SOCKET sock;
|
||||
|
||||
void GetRestartData();
|
||||
|
||||
BOOL Initialise()
|
||||
{
|
||||
|
@ -3271,6 +3276,8 @@ BOOL Initialise()
|
|||
GetBadWordFile();
|
||||
GetHTMLForms();
|
||||
|
||||
GetRestartData();
|
||||
|
||||
UsingingRegConfig = FALSE;
|
||||
|
||||
// Make sure SYSOPCALL is set
|
||||
|
|
1090
BPQMail.rc
1090
BPQMail.rc
File diff suppressed because it is too large
Load Diff
191
FBBRoutines.c
191
FBBRoutines.c
|
@ -27,6 +27,8 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
|
|||
void _GetSemaphore(struct SEM * Semaphore, int ID, char * File, int Line);
|
||||
|
||||
|
||||
void DeleteRestartData(CIRCUIT * conn);
|
||||
|
||||
int32_t Encode(char * in, char * out, int32_t inlen, BOOL B1Protocol, int Compress);
|
||||
void MQTTMessageEvent(void* message);
|
||||
|
||||
|
@ -41,6 +43,130 @@ int B2RestartCount = 0;
|
|||
|
||||
extern char ProperBaseDir[];
|
||||
|
||||
char RestartDir[MAX_PATH] = "";
|
||||
|
||||
void GetRestartData()
|
||||
{
|
||||
int i;
|
||||
struct FBBRestartData Restart;
|
||||
struct FBBRestartData * RestartRec;
|
||||
char MsgFile[MAX_PATH];
|
||||
FILE * hFile;
|
||||
int FileSize;
|
||||
struct stat STAT;
|
||||
size_t ReadLen = 0;
|
||||
time_t Age;
|
||||
|
||||
strcpy(RestartDir, MailDir);
|
||||
strcat(RestartDir, "/Restart");
|
||||
|
||||
// Make sure RestartDir exists
|
||||
|
||||
#ifdef WIN32
|
||||
CreateDirectory(RestartDir, NULL); // Just in case
|
||||
#else
|
||||
mkdir(RestartDir, S_IRWXU | S_IRWXG | S_IRWXO);
|
||||
chmod(RestartDir, S_IRWXU | S_IRWXG | S_IRWXO);
|
||||
#endif
|
||||
|
||||
// look for restart files. These will be numbered from 1 up
|
||||
|
||||
for (i = 1; 1; i++)
|
||||
{
|
||||
sprintf_s(MsgFile, sizeof(MsgFile), "%s/%d", RestartDir, i);
|
||||
|
||||
if (stat(MsgFile, &STAT) == -1)
|
||||
break;
|
||||
|
||||
FileSize = STAT.st_size;
|
||||
|
||||
Age = time(NULL) - STAT.st_ctime;
|
||||
|
||||
if (Age > 86400 * 2) // Max 2 days
|
||||
continue;
|
||||
|
||||
hFile = fopen(MsgFile, "rb");
|
||||
|
||||
if (hFile == NULL)
|
||||
break;
|
||||
|
||||
// Read Restart Record
|
||||
|
||||
fread(&Restart, 1, sizeof(struct FBBRestartData), hFile);
|
||||
|
||||
if ((Restart.MailBufferSize + sizeof(struct FBBRestartData)) != FileSize) // Duff file
|
||||
{
|
||||
fclose(hFile);
|
||||
break;
|
||||
}
|
||||
|
||||
RestartRec = zalloc(sizeof (struct FBBRestartData));
|
||||
|
||||
GetSemaphore(&AllocSemaphore, 0);
|
||||
|
||||
RestartData = realloc(RestartData,(++RestartCount+1) * sizeof(void *));
|
||||
RestartData[RestartCount] = RestartRec;
|
||||
|
||||
FreeSemaphore(&AllocSemaphore);
|
||||
|
||||
memcpy(RestartRec, &Restart, sizeof(struct FBBRestartData));
|
||||
RestartRec->MailBuffer = malloc(RestartRec->MailBufferSize);
|
||||
ReadLen = fread(RestartRec->MailBuffer, 1, RestartRec->MailBufferSize, hFile);
|
||||
|
||||
Logprintf(LOG_BBS, 0, '?', "Restart Data for %s %s Len %d Loaded", RestartRec->Call, RestartRec->bid, RestartRec->length);
|
||||
fclose(hFile);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SaveRestartData()
|
||||
{
|
||||
// Save restart data to file so we can reload on restart
|
||||
// Restart data has pointers to buffers so we must save copy of data and reconstitue on restart
|
||||
|
||||
// Delete and resave all restart data to keep restart directory clean
|
||||
|
||||
int i, n = 1;
|
||||
char MsgFile[MAX_PATH];
|
||||
FILE * hFile;
|
||||
size_t WriteLen=0;
|
||||
struct FBBRestartData * RestartRec = NULL;
|
||||
struct stat STAT;
|
||||
time_t NOW = time(NULL);
|
||||
|
||||
|
||||
for (i = 1; 1; i++)
|
||||
{
|
||||
sprintf_s(MsgFile, sizeof(MsgFile), "%s/%d", RestartDir, i);
|
||||
|
||||
if (stat(MsgFile, &STAT) == -1)
|
||||
break;
|
||||
|
||||
DeleteFile(MsgFile);
|
||||
}
|
||||
|
||||
for (i = 1; i <= RestartCount; i++)
|
||||
{
|
||||
RestartRec = RestartData[i];
|
||||
|
||||
if (RestartRec == 0)
|
||||
return; // Shouldn't happen!
|
||||
|
||||
if ((NOW - RestartRec->TimeCreated) > 86400 * 2) // Max 2 days
|
||||
continue;
|
||||
|
||||
sprintf_s(MsgFile, sizeof(MsgFile), "%s/%d", RestartDir, n++);
|
||||
|
||||
hFile = fopen(MsgFile, "wb");
|
||||
|
||||
if (hFile)
|
||||
{
|
||||
WriteLen = fwrite(RestartRec, 1, sizeof(struct FBBRestartData), hFile); // Save Header
|
||||
WriteLen = fwrite(RestartRec->MailBuffer, 1, RestartRec->MailBufferSize, hFile); // Save Data
|
||||
fclose(hFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
VOID FBBputs(CIRCUIT * conn, char * buf)
|
||||
{
|
||||
// Sends to user and logs
|
||||
|
@ -985,12 +1111,12 @@ loop:
|
|||
{
|
||||
RestartRec = RestartData[i];
|
||||
|
||||
if ((RestartRec->UserPointer == conn->UserPointer)
|
||||
&& (strcmp(RestartRec->TempMsg->bid, conn->TempMsg->bid) == 0))
|
||||
if ((strcmp(RestartRec->Call, conn->UserPointer->Call) == 0)
|
||||
&& (strcmp(RestartRec->bid, conn->TempMsg->bid) == 0))
|
||||
{
|
||||
if (RestartRec->TempMsg->length <= offset)
|
||||
if (RestartRec->length <= offset)
|
||||
{
|
||||
conn->TempMsg->length = RestartRec->TempMsg->length;
|
||||
conn->TempMsg->length = RestartRec->length;
|
||||
conn->MailBuffer = RestartRec->MailBuffer;
|
||||
conn->MailBufferSize = RestartRec->MailBufferSize;
|
||||
|
||||
|
@ -1019,6 +1145,7 @@ loop:
|
|||
RestartData[n] = RestartData[n+1]; // move down all following entries
|
||||
}
|
||||
RestartCount--;
|
||||
SaveRestartData();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1146,6 +1273,7 @@ loop:
|
|||
{
|
||||
#endif
|
||||
conn->InputMode = 0; // So we won't save Restart data if decode fails
|
||||
DeleteRestartData(conn);
|
||||
Decode(conn, 0); // Setup Next Message will reset InputMode if needed
|
||||
#ifndef LINBPQ
|
||||
}
|
||||
|
@ -1845,14 +1973,14 @@ VOID SaveFBBBinary(CIRCUIT * conn)
|
|||
{
|
||||
RestartRec = RestartData[i];
|
||||
|
||||
if ((RestartRec->UserPointer == conn->UserPointer)
|
||||
&& (strcmp(RestartRec->TempMsg->bid, conn->TempMsg->bid) == 0))
|
||||
if ((strcmp(RestartRec->Call, conn->UserPointer->Call) == 0)
|
||||
&& (strcmp(RestartRec->bid, conn->TempMsg->bid) == 0))
|
||||
{
|
||||
// Fund it, so reuse
|
||||
// Found it, so reuse
|
||||
|
||||
// If we have more data, reset retry count
|
||||
|
||||
if (RestartRec->TempMsg->length < conn->TempMsg->length)
|
||||
if (RestartRec->length < conn->TempMsg->length)
|
||||
RestartRec->Count = 0;;
|
||||
|
||||
break;
|
||||
|
@ -1869,19 +1997,53 @@ VOID SaveFBBBinary(CIRCUIT * conn)
|
|||
RestartData[RestartCount] = RestartRec;
|
||||
|
||||
FreeSemaphore(&AllocSemaphore);
|
||||
RestartRec->TimeCreated = time(NULL);
|
||||
}
|
||||
|
||||
RestartRec->UserPointer = conn->UserPointer;
|
||||
RestartRec->TempMsg = conn->TempMsg;
|
||||
strcpy(RestartRec->Call, conn->UserPointer->Call);
|
||||
RestartRec->length = conn->TempMsg->length;
|
||||
strcpy(RestartRec->bid, conn->TempMsg->bid);
|
||||
RestartRec->MailBuffer = conn->MailBuffer;
|
||||
RestartRec->MailBufferSize = conn->MailBufferSize;
|
||||
|
||||
len = sprintf_s(Msg, sizeof(Msg), "Disconnect received from %s during Binary Transfer - %d Bytes Saved for restart",
|
||||
conn->Callsign, conn->TempMsg->length);
|
||||
|
||||
SaveRestartData();
|
||||
|
||||
WriteLogLine(conn, '|',Msg, len, LOG_BBS);
|
||||
}
|
||||
|
||||
void DeleteRestartData(CIRCUIT * conn)
|
||||
{
|
||||
struct FBBRestartData * RestartRec = NULL;
|
||||
int i, n;
|
||||
|
||||
if (conn->TempMsg == NULL)
|
||||
return;
|
||||
|
||||
for (i = 1; i <= RestartCount; i++)
|
||||
{
|
||||
RestartRec = RestartData[i];
|
||||
|
||||
if ((strcmp(RestartRec->Call, conn->UserPointer->Call) == 0)
|
||||
&& (strcmp(RestartRec->bid, conn->TempMsg->bid) == 0))
|
||||
{
|
||||
// Remove restrt data
|
||||
|
||||
for (n = i; n < RestartCount; n++)
|
||||
{
|
||||
RestartData[n] = RestartData[n+1]; // move down all following entries
|
||||
}
|
||||
|
||||
RestartCount--;
|
||||
SaveRestartData();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BOOL LookupRestart(CIRCUIT * conn, struct FBBHeaderLine * FBBHeader)
|
||||
{
|
||||
int i, n;
|
||||
|
@ -1895,8 +2057,8 @@ BOOL LookupRestart(CIRCUIT * conn, struct FBBHeaderLine * FBBHeader)
|
|||
{
|
||||
RestartRec = RestartData[i];
|
||||
|
||||
if ((RestartRec->UserPointer == conn->UserPointer)
|
||||
&& (strcmp(RestartRec->TempMsg->bid, FBBHeader->BID) == 0))
|
||||
if ((strcmp(RestartRec->Call, conn->UserPointer->Call) == 0)
|
||||
&& (strcmp(RestartRec->bid, FBBHeader->BID) == 0))
|
||||
{
|
||||
char Msg[120];
|
||||
int len;
|
||||
|
@ -1918,15 +2080,16 @@ BOOL LookupRestart(CIRCUIT * conn, struct FBBHeaderLine * FBBHeader)
|
|||
}
|
||||
|
||||
RestartCount--;
|
||||
SaveRestartData();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
len = sprintf_s(Msg, sizeof(Msg), "Restart Data found for %s - Requesting restart from %d",
|
||||
FBBHeader->BID, RestartRec->TempMsg->length);
|
||||
FBBHeader->BID, RestartRec->length);
|
||||
|
||||
WriteLogLine(conn, '|',Msg, len, LOG_BBS);
|
||||
|
||||
return (RestartRec->TempMsg->length);
|
||||
return (RestartRec->length);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
7720
FLDigi64.c
7720
FLDigi64.c
File diff suppressed because it is too large
Load Diff
3814
HALDriver64.c
3814
HALDriver64.c
File diff suppressed because it is too large
Load Diff
|
@ -1866,9 +1866,6 @@ static char ** SeparateMultiString(char * MultiString)
|
|||
return Value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
extern int nextDummyInterlock;
|
||||
|
||||
int standardParams(struct TNCINFO * TNC, char * buf)
|
||||
|
|
6
LinBPQ.c
6
LinBPQ.c
|
@ -787,6 +787,8 @@ int Redirected = 0;
|
|||
static void segvhandler(int sig);
|
||||
static void abrthandler(int sig);
|
||||
|
||||
void GetRestartData();
|
||||
|
||||
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
|
@ -1174,6 +1176,8 @@ int main(int argc, char * argv[])
|
|||
chmod(MailDir, S_IRWXU | S_IRWXG | S_IRWXO);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// Make backup copies of Databases
|
||||
|
||||
// CopyConfigFile(ConfigName);
|
||||
|
@ -1195,6 +1199,7 @@ int main(int argc, char * argv[])
|
|||
GetBadWordFile();
|
||||
GetHTMLForms();
|
||||
GetPGConfig();
|
||||
GetRestartData();
|
||||
|
||||
// Make sure there is a user record for the BBS, with BBS bit set.
|
||||
|
||||
|
@ -1442,6 +1447,7 @@ int main(int argc, char * argv[])
|
|||
SaveMessageDatabase();
|
||||
SaveBIDDatabase();
|
||||
SaveConfig(ConfigName);
|
||||
SaveRestartData();
|
||||
}
|
||||
|
||||
KEEPGOING--; // Give time for links to close
|
||||
|
|
3086
MULTIPSK64.c
3086
MULTIPSK64.c
File diff suppressed because it is too large
Load Diff
|
@ -919,6 +919,9 @@ LRESULT APIENTRY InputProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
DoRefresh(Cinfo);
|
||||
|
||||
Cinfo->Console->bytesRxed += Cinfo->kbptr+1;
|
||||
|
||||
|
||||
if (Cinfo->Console->SysopChatStream)
|
||||
SendUnbuffered(Cinfo->Console->SysopChatStream->BPQStream, &Cinfo->kbbuf[0], Cinfo->kbptr+1);
|
||||
else
|
||||
|
|
3428
SCSTrackeMulti64.c
3428
SCSTrackeMulti64.c
File diff suppressed because it is too large
Load Diff
|
@ -10,8 +10,8 @@
|
|||
|
||||
#endif
|
||||
|
||||
#define KVers 6,0,24,67
|
||||
#define KVerstring "6.0.24.67\0"
|
||||
#define KVers 6,0,24,69
|
||||
#define KVerstring "6.0.24.69\0"
|
||||
|
||||
|
||||
#ifdef CKernel
|
||||
|
|
184
WebMail.c
184
WebMail.c
|
@ -1446,7 +1446,12 @@ void ProcessWebMailMessage(struct HTTPConnectionInfo * Session, char * Key, BOOL
|
|||
|
||||
// Neither do js or file downloads
|
||||
|
||||
if (_memicmp(NodeURL, "/WebMail/WMFile/", 16) == 0)
|
||||
// This could be a request for a Template file
|
||||
// WebMail/Local_Templates/My Forms/inc/logo_ad63.png
|
||||
// WebMail/Standard Templates/
|
||||
|
||||
|
||||
if (_memicmp(NodeURL, "/WebMail/Local", 14) == 0 || (_memicmp(NodeURL, "/WebMail/Standard", 17) == 0))
|
||||
{
|
||||
int FileSize;
|
||||
char * MsgBytes;
|
||||
|
@ -1456,9 +1461,10 @@ void ProcessWebMailMessage(struct HTTPConnectionInfo * Session, char * Key, BOOL
|
|||
char TimeString[64];
|
||||
char FileTimeString[64];
|
||||
struct stat STAT;
|
||||
char * FN = &NodeURL[16];
|
||||
char * FN = &NodeURL[9];
|
||||
char * fileBit = FN;
|
||||
char * ext;
|
||||
char Type[64] = "Content-Type: text/html\r\n";
|
||||
|
||||
UndoTransparency(FN);
|
||||
ext = strchr(FN, '.');
|
||||
|
@ -1491,27 +1497,112 @@ void ProcessWebMailMessage(struct HTTPConnectionInfo * Session, char * Key, BOOL
|
|||
FormatTime2(FileTimeString, STAT.st_ctime);
|
||||
FormatTime2(TimeString, time(NULL));
|
||||
|
||||
if (_stricmp(ext, ".htm") == 0 || _stricmp(ext, ".html") == 0 || _stricmp(ext, ".css") == 0 || _stricmp(ext, ".js") == 0)
|
||||
{
|
||||
*RLen = sprintf(Reply, "HTTP/1.1 200 OK\r\nContent-Length: %d\r\n"
|
||||
"Content-Type: text/css\r\n"
|
||||
"Date: %s\r\n"
|
||||
"Last-Modified: %s\r\n"
|
||||
"\r\n%s", FileSize, TimeString, FileTimeString, MsgBytes);
|
||||
}
|
||||
else
|
||||
{
|
||||
*RLen = sprintf(Reply, "HTTP/1.1 200 OK\r\nContent-Length: %d\r\n"
|
||||
"Content-Type: application/octet-stream\r\n"
|
||||
"Content-Disposition: attachment; filename=\"%s\"\r\n"
|
||||
"Date: %s\r\n"
|
||||
"Last-Modified: %s\r\n"
|
||||
"\r\n%s", FileSize, fileBit, TimeString, FileTimeString, MsgBytes);
|
||||
ext++;
|
||||
|
||||
if (_stricmp(ext, "js") == 0)
|
||||
strcpy(Type, "Content-Type: text/javascript\r\n");
|
||||
|
||||
if (_stricmp(ext, "css") == 0)
|
||||
strcpy(Type, "Content-Type: text/css\r\n");
|
||||
|
||||
}
|
||||
if (_stricmp(ext, "pdf") == 0)
|
||||
strcpy(Type, "Content-Type: application/pdf\r\n");
|
||||
|
||||
if (_stricmp(ext, "jpg") == 0 || _stricmp(ext, "jpeg") == 0 || _stricmp(ext, "png") == 0 ||
|
||||
_stricmp(ext, "gif") == 0 || _stricmp(ext, "bmp") == 0 || _stricmp(ext, "ico") == 0)
|
||||
strcpy(Type, "Content-Type: image\r\n");
|
||||
|
||||
// File may be binary so output header then copy in message
|
||||
|
||||
*RLen = sprintf(Reply, "HTTP/1.1 200 OK\r\nContent-Length: %d\r\n"
|
||||
"%s"
|
||||
"Date: %s\r\n"
|
||||
"Last-Modified: %s\r\n"
|
||||
"\r\n", FileSize, Type,TimeString, FileTimeString);
|
||||
|
||||
memcpy(&Reply[*RLen], MsgBytes, FileSize);
|
||||
*RLen += FileSize;
|
||||
free (MsgBytes);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
if (_memicmp(NodeURL, "/WebMail/WMFile/", 16) == 0)
|
||||
{
|
||||
int FileSize;
|
||||
char * MsgBytes;
|
||||
char MsgFile[512];
|
||||
FILE * hFile;
|
||||
size_t ReadLen;
|
||||
char TimeString[64];
|
||||
char FileTimeString[64];
|
||||
struct stat STAT;
|
||||
char * FN = &NodeURL[16];
|
||||
char * fileBit = FN;
|
||||
char * ext;
|
||||
char Type[64] = "Content-Type: text/html\r\n";
|
||||
|
||||
|
||||
UndoTransparency(FN);
|
||||
ext = strchr(FN, '.');
|
||||
|
||||
sprintf(MsgFile, "%s/%s", BPQDirectory, FN);
|
||||
|
||||
while (strchr(fileBit, '/'))
|
||||
fileBit = strlop(fileBit, '/');
|
||||
|
||||
if (stat(MsgFile, &STAT) == -1)
|
||||
{
|
||||
*RLen = sprintf(Reply, "HTTP/1.1 404 Not Found\r\nContent-Length: 16\r\n\r\nPage not found\r\n");
|
||||
return;
|
||||
}
|
||||
|
||||
hFile = fopen(MsgFile, "rb");
|
||||
|
||||
if (hFile == 0)
|
||||
{
|
||||
*RLen = sprintf(Reply, "HTTP/1.1 404 Not Found\r\nContent-Length: 16\r\n\r\nPage not found\r\n");
|
||||
return;
|
||||
}
|
||||
|
||||
FileSize = STAT.st_size;
|
||||
MsgBytes = malloc(FileSize + 1);
|
||||
ReadLen = fread(MsgBytes, 1, FileSize, hFile);
|
||||
|
||||
fclose(hFile);
|
||||
|
||||
FormatTime2(FileTimeString, STAT.st_ctime);
|
||||
FormatTime2(TimeString, time(NULL));
|
||||
|
||||
ext++;
|
||||
|
||||
if (_stricmp(ext, "js") == 0)
|
||||
strcpy(Type, "Content-Type: text/javascript\r\n");
|
||||
|
||||
if (_stricmp(ext, "css") == 0)
|
||||
strcpy(Type, "Content-Type: text/css\r\n");
|
||||
|
||||
if (_stricmp(ext, "pdf") == 0)
|
||||
strcpy(Type, "Content-Type: application/pdf\r\n");
|
||||
|
||||
if (_stricmp(ext, "jpg") == 0 || _stricmp(ext, "jpeg") == 0 || _stricmp(ext, "png") == 0 ||
|
||||
_stricmp(ext, "gif") == 0 || _stricmp(ext, "bmp") == 0 || _stricmp(ext, "ico") == 0)
|
||||
strcpy(Type, "Content-Type: image\r\n");
|
||||
|
||||
// File may be binary so output header then copy in message
|
||||
|
||||
*RLen = sprintf(Reply, "HTTP/1.1 200 OK\r\nContent-Length: %d\r\n"
|
||||
"%s"
|
||||
"Date: %s\r\n"
|
||||
"Last-Modified: %s\r\n"
|
||||
"\r\n", FileSize, Type,TimeString, FileTimeString);
|
||||
|
||||
memcpy(&Reply[*RLen], MsgBytes, FileSize);
|
||||
*RLen += FileSize;
|
||||
free (MsgBytes);
|
||||
return;
|
||||
}
|
||||
|
||||
Session = NULL;
|
||||
|
||||
|
@ -2883,7 +2974,7 @@ VOID SaveNewMessage(struct HTTPConnectionInfo * Session, char * MsgPtr, char * R
|
|||
|
||||
// RMS Express Forms Support
|
||||
|
||||
char * GetHTMLViewerTemplate(char * FN)
|
||||
char * GetHTMLViewerTemplate(char * FN, struct HtmlFormDir ** FormDir)
|
||||
{
|
||||
int i, j, k, l;
|
||||
|
||||
|
@ -2897,6 +2988,7 @@ char * GetHTMLViewerTemplate(char * FN)
|
|||
{
|
||||
if (strcmp(FN, Dir->Forms[j]->FileName) == 0)
|
||||
{
|
||||
*FormDir = Dir;
|
||||
return CheckFile(Dir, FN);
|
||||
}
|
||||
}
|
||||
|
@ -2917,6 +3009,7 @@ char * GetHTMLViewerTemplate(char * FN)
|
|||
{
|
||||
if (_stricmp(FN, SDir->Forms[k]->FileName) == 0)
|
||||
{
|
||||
*FormDir = SDir;
|
||||
return CheckFile(SDir, SDir->Forms[k]->FileName);
|
||||
}
|
||||
}
|
||||
|
@ -3293,6 +3386,13 @@ BOOL ParseXML(WebMailInfo * WebMail, char * XMLOrig)
|
|||
|
||||
// Extract Fields (stuff between < and >. Ignore Whitespace between fields
|
||||
|
||||
// Add FormFolder Key with our folder
|
||||
|
||||
// XMLKeys->Key = "FormFolder";
|
||||
// XMLKeys->Value = _strdup(FormDir);
|
||||
|
||||
// XMLKeys++;
|
||||
|
||||
ptr1 = strstr(XML, "<xml_file_version>");
|
||||
|
||||
while (ptr1)
|
||||
|
@ -3396,6 +3496,8 @@ int DisplayWebForm(struct HTTPConnectionInfo * Session, struct MsgInfo * Msg, ch
|
|||
size_t varlen, xmllen;
|
||||
char var[100] = "<";
|
||||
KeyValues * KeyValue;
|
||||
struct HtmlFormDir * Dir;
|
||||
char FormDir[MAX_PATH];
|
||||
|
||||
if (ParseXML(WebMail, XML))
|
||||
ptr = FindXMLVariable(WebMail, "display_form");
|
||||
|
@ -3409,7 +3511,11 @@ int DisplayWebForm(struct HTTPConnectionInfo * Session, struct MsgInfo * Msg, ch
|
|||
|
||||
strcpy(FN, ptr);
|
||||
|
||||
Form = GetHTMLViewerTemplate(FN);
|
||||
Form = GetHTMLViewerTemplate(FN, &Dir);
|
||||
|
||||
sprintf(FormDir, "WMFile/%s/%s/", Dir->FormSet, Dir->DirName);
|
||||
|
||||
|
||||
|
||||
if (Form == NULL)
|
||||
{
|
||||
|
@ -3425,6 +3531,15 @@ int DisplayWebForm(struct HTTPConnectionInfo * Session, struct MsgInfo * Msg, ch
|
|||
|
||||
// Don't know why, but {MsgOriginalBody} is sent instead of {var MsgOriginalBody}
|
||||
|
||||
// So is {FormFolder} instread of {var FormFolder}
|
||||
|
||||
// As a fiddle replace {FormFolder} with {var Folder} and look for that
|
||||
|
||||
while (varptr = stristr(Form, "{FormFolder}"))
|
||||
{
|
||||
memcpy(varptr, "{var ", 5);
|
||||
}
|
||||
|
||||
varptr = stristr(Form, "{MsgOriginalBody}");
|
||||
{
|
||||
char * temp, * tempsave;
|
||||
|
@ -3564,6 +3679,23 @@ int DisplayWebForm(struct HTTPConnectionInfo * Session, struct MsgInfo * Msg, ch
|
|||
|
||||
while (KeyValue->Key)
|
||||
{
|
||||
if (_stricmp(var, "Folder") == 0)
|
||||
{
|
||||
// Local form folder, not senders
|
||||
|
||||
xmllen = strlen(FormDir);
|
||||
|
||||
// Ok, we have the position of the variable and the substitution text.
|
||||
// Copy message up to variable to Result, then copy value
|
||||
|
||||
memcpy(Reply, formptr, varptr - formptr - 5); // omit "{var "
|
||||
Reply += (varptr - formptr - 5);
|
||||
|
||||
strcpy(Reply, FormDir);
|
||||
Reply += xmllen;
|
||||
break;
|
||||
}
|
||||
|
||||
if (_stricmp(var, KeyValue->Key) == 0)
|
||||
{
|
||||
xmllen = strlen(KeyValue->Value);
|
||||
|
@ -3579,6 +3711,8 @@ int DisplayWebForm(struct HTTPConnectionInfo * Session, struct MsgInfo * Msg, ch
|
|||
break;
|
||||
}
|
||||
|
||||
KeyValue++;
|
||||
|
||||
if (KeyValue->Key == NULL)
|
||||
{
|
||||
// Not found in XML
|
||||
|
@ -3588,7 +3722,7 @@ int DisplayWebForm(struct HTTPConnectionInfo * Session, struct MsgInfo * Msg, ch
|
|||
sprintf(Err, VarNotFoundMsg, var, "%s");
|
||||
return ReturnRawMessage(User, Msg, Key, SaveReply, RawMessage, (int)(XML - RawMessage), Err);
|
||||
}
|
||||
KeyValue++;
|
||||
|
||||
}
|
||||
|
||||
formptr = endptr + 1;
|
||||
|
@ -5448,8 +5582,6 @@ char * CheckFile(struct HtmlFormDir * Dir, char * FN)
|
|||
|
||||
#endif
|
||||
|
||||
printf("%s\n", MsgFile);
|
||||
|
||||
if (stat(MsgFile, &STAT) != -1)
|
||||
{
|
||||
hFile = fopen(MsgFile, "rb");
|
||||
|
@ -5466,8 +5598,6 @@ char * CheckFile(struct HtmlFormDir * Dir, char * FN)
|
|||
MsgBytes[FileSize] = 0;
|
||||
fclose(hFile);
|
||||
|
||||
printf("%d %s\n", strlen(MsgBytes), MsgBytes);
|
||||
|
||||
return MsgBytes;
|
||||
}
|
||||
return NULL;
|
||||
|
|
3
WinRPR.c
3
WinRPR.c
|
@ -1580,8 +1580,6 @@ TNCRunning:
|
|||
|
||||
// Send INIT script
|
||||
|
||||
// VARA needs each command in a separate send
|
||||
|
||||
ptr1 = &TNC->InitScript[0];
|
||||
|
||||
GetSemaphore(&Semaphore, 52);
|
||||
|
@ -1606,7 +1604,6 @@ TNCRunning:
|
|||
c = *(ptr2 + 1); // Save next char
|
||||
*(ptr2 + 1) = 0; // Terminate string
|
||||
}
|
||||
// VARASendCommand(TNC, ptr1, TRUE);
|
||||
|
||||
if (ptr2)
|
||||
*(1 + ptr2++) = c; // Put char back
|
||||
|
|
10
bpqmail.h
10
bpqmail.h
|
@ -290,6 +290,9 @@ typedef struct ConnectionInfo_S
|
|||
|
||||
struct ConnectionInfo_S * SysopChatStream; // Stream sysop is chatting to
|
||||
|
||||
int bytesSent;
|
||||
int bytesRxed;
|
||||
|
||||
} ConnectionInfo, CIRCUIT;
|
||||
|
||||
// Flags Equates
|
||||
|
@ -336,11 +339,13 @@ typedef struct ConnectionInfo_S
|
|||
|
||||
struct FBBRestartData
|
||||
{
|
||||
struct MsgInfo * TempMsg; // Header while message is being received
|
||||
struct UserInfo * UserPointer;
|
||||
char Call[10];
|
||||
char bid[13];
|
||||
int length;
|
||||
UCHAR * MailBuffer; // Mail Message being received
|
||||
int MailBufferSize; // Total Malloc'ed size. Actual size in in Msg Struct
|
||||
int Count; // Give up if too many restarts
|
||||
time_t TimeCreated;
|
||||
};
|
||||
|
||||
// We need to keep the B2Message file for B2 messages we are sending until the messages is acked, so
|
||||
|
@ -1387,6 +1392,7 @@ BOOL CheckBBSHElements(struct MsgInfo * Msg, struct UserInfo * bbs, struct BBSFo
|
|||
BOOL CheckBBSHElementsFlood(struct MsgInfo * Msg, struct UserInfo * bbs, struct BBSForwardingInfo * ForwardingInfo, char * ATBBS, char ** HElements);
|
||||
int CheckBBSToForNTS(struct MsgInfo * Msg, struct BBSForwardingInfo * ForwardingInfo);
|
||||
int CheckBBSATListWildCarded(struct MsgInfo * Msg, struct BBSForwardingInfo * ForwardingInfo, char * ATBBS);
|
||||
void SaveRestartData();
|
||||
|
||||
VOID ReRouteMessages();
|
||||
|
||||
|
|
|
@ -520,7 +520,8 @@ char * MainConfigtxt()
|
|||
"<textarea cols=\"8\" rows=\"5\" name=\"Hat\">%s</textarea>\r\n"
|
||||
"<textarea cols=\"8\" rows=\"5\" name=\"HBID\">%s</textarea>\r\n"
|
||||
"<p></p>"
|
||||
" FBB reject.sys type filters (all fields must match, wildcards allowed)\r\n"
|
||||
" FBB reject.sys type filters (all fields must match, wildcards allowed)<br>"
|
||||
" 'A' action accepts message if all fields match without checking following lines\r\n"
|
||||
"<p></p>"
|
||||
"<div style='position: absolute; left: 20px;height: 120px; overflow:auto;'>%s</div>"
|
||||
"<div style='position: absolute; top: 1120px;left: 300px; overflow:auto;'>"
|
||||
|
|
Loading…
Reference in New Issue