Added timeout check to mbuser

This commit is contained in:
Michiel Broek 2003-05-08 18:59:31 +00:00
parent 77ba5b42d9
commit 932601b885
4 changed files with 158 additions and 151 deletions

View File

@ -20,6 +20,9 @@ v0.37.3 09-Apr-2003.
Added menu function display file. Added menu function display file.
Display ascii textfiles now uses the More Y/n/= prompt. Display ascii textfiles now uses the More Y/n/= prompt.
mbuser:
Added nopper code during pack.
mbcico: mbcico:
Removed some heavy debug code from ttyio functions to increase Removed some heavy debug code from ttyio functions to increase
throughput. throughput.

View File

@ -4,7 +4,7 @@
* Purpose ...............: Hangup functions * Purpose ...............: Hangup functions
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2002 * Copyright (C) 1997-2003
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -77,7 +77,6 @@ void Good_Bye(int onsig)
if ((pExitinfo = fopen(temp,"rb")) != NULL) { if ((pExitinfo = fopen(temp,"rb")) != NULL) {
fread(&usrconfighdr, sizeof(usrconfighdr), 1, pUsrConfig); fread(&usrconfighdr, sizeof(usrconfighdr), 1, pUsrConfig);
offset = usrconfighdr.hdrsize + (grecno * usrconfighdr.recsize); offset = usrconfighdr.hdrsize + (grecno * usrconfighdr.recsize);
fread(&exitinfo, sizeof(exitinfo), 1, pExitinfo); fread(&exitinfo, sizeof(exitinfo), 1, pExitinfo);
usrconfig = exitinfo; usrconfig = exitinfo;
@ -94,6 +93,7 @@ void Good_Bye(int onsig)
usrconfig.iLastMsgArea = iMsgAreaNumber; usrconfig.iLastMsgArea = iMsgAreaNumber;
offset = usrconfighdr.hdrsize + (grecno * usrconfighdr.recsize); offset = usrconfighdr.hdrsize + (grecno * usrconfighdr.recsize);
Syslog('b', "Good_Bye: write users.data at offset %ld", offset);
if (fseek(pUsrConfig, offset, 0) != 0) { if (fseek(pUsrConfig, offset, 0) != 0) {
WriteError("Can't move pointer in file %s", temp); WriteError("Can't move pointer in file %s", temp);
ExitClient(MBERR_GENERAL); ExitClient(MBERR_GENERAL);

View File

@ -69,6 +69,7 @@ int InitExitinfo()
fread(&usrconfighdr, sizeof(usrconfighdr), 1, pUsrConfig); fread(&usrconfighdr, sizeof(usrconfighdr), 1, pUsrConfig);
offset = usrconfighdr.hdrsize + (grecno * usrconfighdr.recsize); offset = usrconfighdr.hdrsize + (grecno * usrconfighdr.recsize);
Syslog('b', "InitExitinfo: read users.data offset %ld", offset);
if (fseek(pUsrConfig, offset, 0) != 0) { if (fseek(pUsrConfig, offset, 0) != 0) {
WriteError("$Can't move pointer in %s", temp); WriteError("$Can't move pointer in %s", temp);
free(temp); free(temp);

View File

@ -252,6 +252,7 @@ void UserPack(int days, int level, int pack)
memset(&usr, 0, sizeof(usr)); memset(&usr, 0, sizeof(usr));
if (CFG.slow_util && do_quiet) if (CFG.slow_util && do_quiet)
usleep(1); usleep(1);
Nopper();
} }
fclose(fin); fclose(fin);
delete = 0; delete = 0;
@ -311,6 +312,7 @@ void UserPack(int days, int level, int pack)
if (CFG.slow_util && do_quiet) if (CFG.slow_util && do_quiet)
usleep(1); usleep(1);
Nopper();
if (usr.Deleted) { if (usr.Deleted) {
if (!do_quiet) { if (!do_quiet) {
printf("Delete user %s\n", usr.Name); printf("Delete user %s\n", usr.Name);
@ -371,6 +373,7 @@ void UserPack(int days, int level, int pack)
record = 0; record = 0;
while (fread(&usr, sizeof(usr), 1,fout) == 1) { while (fread(&usr, sizeof(usr), 1,fout) == 1) {
Nopper();
record++; record++;
fwrite(&usr, sizeof(usr), 1, fin); fwrite(&usr, sizeof(usr), 1, fin);
if (record >= highest) if (record >= highest)