Improved protocol selection

This commit is contained in:
Michiel Broek 2004-11-28 16:15:35 +00:00
parent 70792652c8
commit cfdad80d1d
3 changed files with 7 additions and 5 deletions

@ -45,6 +45,7 @@ v0.71.0 27-Oct-2004
After upload, files are now stored correctly in the filebase.
In change protocol, changed the colors.
With user chat, the timeout timer wasn't refreshed.
Improved test for users protocol available.
mbnewusr:
Rewrote terminal i/o.

@ -849,6 +849,7 @@ void Chg_Protocol()
temp = calloc(PATH_MAX, sizeof(char));
ReadExitinfo();
Set_Protocol(exitinfo.sProtocol);
Syslog('+', "Old protocol %s", sProtName);
while(TRUE) {
@ -944,6 +945,7 @@ void Set_Protocol(char *Protocol)
int precno = 0;
char *temp;
memset(&sProtName, 0, sizeof(sProtName));
temp = calloc(PATH_MAX, sizeof(char));
sprintf(temp, "%s/etc/protocol.data", getenv("MBSE_ROOT"));
@ -962,8 +964,7 @@ void Set_Protocol(char *Protocol)
fread(&PROThdr, sizeof(PROThdr), 1, pProtConfig);
while (fread(&PROT, PROThdr.recsize, 1, pProtConfig) == 1) {
if ((strcmp(PROT.ProtName, Protocol)) == 0) {
tlf(sProtName);
if (((strcmp(PROT.ProtName, Protocol)) == 0) && PROT.Available) {
strcpy(sProtName, PROT.ProtName);
strcpy(sProtUp, PROT.ProtUp);
strcpy(sProtDn, PROT.ProtDn);

@ -434,11 +434,11 @@ int upload(up_list **upload_list)
if (strncasecmp(sProtName, "xmodem", 6) == 0)
protocol = ZM_XMODEM;
if ((strstr(sProtName, "1K") || strstr(sProtName, "1k")) && (protocol != ZM_ZMODEM)) {
if (strstr(sProtName, "-1K") && (protocol != ZM_ZMODEM)) {
Syslog('x', "%s: want 1K blocks", protname());
want1k = TRUE;
}
if ((strstr(sProtName, "G")) && (protocol == ZM_YMODEM)) {
if ((strstr(sProtName, "-G")) && (protocol == ZM_YMODEM)) {
Syslog('x', "%s: want Ymodem-G", protname());
wantg = TRUE;
}