Removed support for non-batching and bidirectional transfer protocols

This commit is contained in:
Michiel Broek
2004-11-05 20:25:33 +00:00
parent 769a1884b3
commit c22e9948e1
19 changed files with 128 additions and 289 deletions

View File

@@ -896,8 +896,7 @@ void Chg_Protocol()
strcpy(sProtUp, PROT.ProtUp);
strcpy(sProtDn, PROT.ProtDn);
strcpy(sProtAdvice, PROT.Advice);
uProtBatch = PROT.Batch;
uProtBidir = PROT.Bidir;
uProtInternal = PROT.Internal;
iProtEfficiency = PROT.Efficiency;
iFoundProt = TRUE;
} else
@@ -965,8 +964,7 @@ void Set_Protocol(char *Protocol)
strcpy(sProtUp, PROT.ProtUp);
strcpy(sProtDn, PROT.ProtDn);
strcpy(sProtAdvice, PROT.Advice);
uProtBatch = PROT.Batch;
uProtBidir = PROT.Bidir;
uProtInternal = PROT.Internal;
iProtEfficiency = PROT.Efficiency;
} else
precno++;

View File

@@ -972,8 +972,8 @@ int NewfileScan(int AskStart)
*/
int Upload()
{
char File[81], temp[81];
int Area, x = 0, err;
char temp[81];
int Area, err;
unsigned long OldArea;
time_t ElapstimeStart, ElapstimeFin, iTime;
DIR *dirp;
@@ -1001,79 +1001,6 @@ int Upload()
Area = area.Upload;
SetFileArea(Area);
/*
* Only ask for a filename for non-batching protocols,
* ie. the stone age Xmodem for example.
*/
if (!uProtBatch) {
/* Please enter file to upload: */
pout(YELLOW, BLACK, (char *) Language(276));
colour(CFG.InputColourF, CFG.InputColourB);
GetstrC(File, 80);
if ((strcmp(File, "")) == 0)
return 0;
if (*(File) == '.' || *(File) == '*' || *(File) == ' ' || *(File) == '/') {
Enter(1);
/* Illegal Filename! */
pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(247));
Enter(2);
Pause();
return 0;
}
Strlen = strlen(File);
Strlen--;
if (*(File + Strlen) == '.' || *(File + Strlen) == '/' || *(File + Strlen) == ' ') {
Enter(1);
/* Illegal Filename! */
pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(247));
Enter(2);
Pause();
return 0;
}
if ((!strcmp(File, "files.bbs")) || (!strcmp(File, "00index")) || (strstr(File, (char *)".html"))) {
Enter(1);
/* Illegal Filename! */
pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(247));
Enter(2);
Syslog('!', "Attempted to upload %s", File);
Pause();
return 0;
}
/*
* Check for a space or ; in filename being uploaded
*/
if (((strchr(File, 32)) != NULL) || ((strchr(File, ';')) != NULL)) {
Enter(1);
/* Illegal Filename! */
pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(247));
Enter(2);
Pause();
return 0;
}
/* MOET IN ALLE AREAS ZOEKEN */
if (area.Dupes) {
x = CheckFile(File, Area);
if (x) {
Enter(1);
/* The file already exists on the system */
pout(WHITE, CYAN, (char *) Language(282));
Enter(2);
SetFileArea(OldArea);
Pause();
return 0;
}
}
SetFileArea(OldArea);
}
SetFileArea(Area);
Syslog('+', "Upload area is %d %s", Area, area.Name);
@@ -1099,10 +1026,7 @@ int Upload()
PUTSTR((char *) Language(283));
Enter(2);
if (uProtBatch)
Syslog('+', "Upload using %s", sProtName);
else
Syslog('+', "Upload \"%s\" using %s", File, sProtName);
Syslog('+', "Upload using %s", sProtName);
sprintf(temp, "%s/%s/upl", CFG.bbs_usersdir, exitinfo.Name);
if (chdir(temp)) {
@@ -1571,60 +1495,13 @@ int Upload_Home()
sFileName = calloc(PATH_MAX, sizeof(char));
temp = calloc(PATH_MAX, sizeof(char));
if (!uProtBatch) {
Enter(1);
/* Please enter file to upload: */
pout(YELLOW, BLACK, (char *) Language(276));
colour(CFG.InputColourF, CFG.InputColourB);
GetstrC(File, 80);
if ((strcmp(File, "")) == 0) {
free(File);
free(sFileName);
free(temp);
return 0;
}
if (File[0] == '.' || File[0] == '*' || File[0] == ' ') {
Enter(1);
/* Illegal Filename! */
pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(247));
Enter(2);
Pause();
free(File);
free(sFileName);
free(temp);
return 0;
}
Strlen = strlen(File);
Strlen--;
if (File[Strlen] == '.' || File[Strlen] == '/' || File[Strlen] == ' ') {
Enter(1);
/* Illegal Filename! */
pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(247));
Enter(2);
Pause();
free(File);
free(sFileName);
free(temp);
return 0;
}
}
clear();
Enter(2);
/* Please start your upload now ...*/
sprintf(temp, "%s, %s", sProtAdvice, (char *) Language(283));
pout(CFG.HiliteF, CFG.HiliteB, temp);
Enter(2);
if (uProtBatch)
Syslog('+', "Upload using %s", sProtName);
else
Syslog('+', "Upload \"%s\" using %s", File, sProtName);
Syslog('+', "Upload using %s", sProtName);
sprintf(temp, "%s/%s/upl", CFG.bbs_usersdir, exitinfo.Name);
if (chdir(temp)) {

View File

@@ -1012,7 +1012,7 @@ void OLR_Upload(void)
{
char *File, *temp, *Arc, Dirpath[PATH_MAX], Filename[81], msg[81];
time_t ElapstimeStart, ElapstimeFin, iTime;
int err, Strlen, RetVal = FALSE;
int err, RetVal = FALSE;
FILE *fp;
if (strlen(CFG.bbsid) == 0) {
@@ -1034,60 +1034,12 @@ void OLR_Upload(void)
File = calloc(PATH_MAX, sizeof(char));
temp = calloc(PATH_MAX, sizeof(char));
if (!uProtBatch) {
Enter(1);
/* Please enter file to upload: */
pout(YELLOW, BLACK, (char *) Language(276));
colour(CFG.InputColourF, CFG.InputColourB);
GetstrC(File, 80);
Syslog('+', "Filename entered \"%s\"", File);
if ((strcmp(File, "")) == 0)
return;
if (File[0] == '.' || File[0] == '*' || File[0] == ' ') {
Enter(1);
/* Illegal filename! */
pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(247));
Enter(2);
Pause();
return;
}
Strlen = strlen(File);
Strlen--;
if (File[Strlen] == '.' || File[Strlen] == '/' || File[Strlen] == ' ') {
Enter(1);
/* Illegal Filename! */
pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(247));
Enter(2);
Pause();
return;
}
if (strncasecmp(File, CFG.bbsid, strlen(CFG.bbsid))) {
Enter(1);
/* Illegal filename! */
pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(247));
Enter(2);
Pause();
return;
}
Syslog('+', "Filename accepted");
}
Enter(1);
/* Please start your upload now */
sprintf(msg, "%s, %s", sProtAdvice, (char *) Language(283));
pout(CFG.HiliteF, CFG.HiliteB, msg);
Enter(2);
if (uProtBatch)
Syslog('+', "Upload using %s", sProtName);
else
Syslog('+', "Upload \"%s\" using %s", File, sProtName);
Syslog('+', "Upload using %s", sProtName);
sprintf(temp, "%s/%s/upl", CFG.bbs_usersdir, exitinfo.Name);

View File

@@ -57,8 +57,16 @@
*/
int transfer(down_list **download_list, up_list **upload_list, int direction)
int download(down_list **download_list)
{
return 0;
}
int upload(up_list **upload_list)
{
return 0;
}

View File

@@ -3,7 +3,6 @@
/* $Id$ */
typedef enum {FT_UPLOAD, FT_DOWNLOAD, FT_BIDIRECT} TRANSFERTYPE;
/*
@@ -31,7 +30,8 @@ typedef struct _up_list {
} up_list;
int transfer(down_list **, up_list **, int);
int download(down_list **);
int upload(up_list **);
#endif