Fixed files forwarding CSO flag

This commit is contained in:
Michiel Broek 2001-12-27 12:13:01 +00:00
parent 8fd37e8d8a
commit dabde30a5e
4 changed files with 21 additions and 14 deletions

View File

@ -4281,6 +4281,7 @@ v0.33.19 26-Oct-2001
On new systems it will now also create one filearea, three On new systems it will now also create one filearea, three
default mail areas, a newfilereport and the groups belonging default mail areas, a newfilereport and the groups belonging
to these areas. Also 10 oneliners are installed. to these areas. Also 10 oneliners are installed.
Changed help for nodes billing flag.
mbsebbs: mbsebbs:
Added menu 317, change FS editor shortcut keys to (Emacs/ Added menu 317, change FS editor shortcut keys to (Emacs/
@ -4413,6 +4414,8 @@ v0.33.19 26-Oct-2001
Implemented long filenames with hatch. Now uses ticfile key- Implemented long filenames with hatch. Now uses ticfile key-
word Fullname for the long filename. word Fullname for the long filename.
Fixes for Sparc systems. Fixes for Sparc systems.
File forwarding now really depends on the downlink billing
flag.
mbfile: mbfile:
During check the file databases are reset to filemode 0660. During check the file databases are reset to filemode 0660.

View File

@ -66,21 +66,25 @@ void ForwardFile(fidoaddr Node, fa_list *sbl)
*/ */
/* /*
* Check if this node has enough credits for this file. * If Costsharing active for this node
*/ */
T_File.Cost = TIC.FileCost + (TIC.FileCost * nodes.AddPerc / 1000); if (nodes.Billing) {
if ((nodes.Credit < (nodes.StopLevel + T_File.Cost)) && (!TIC.Charge)) { /*
* Check if this node has enough credits for this file.
*/
T_File.Cost = TIC.FileCost + (TIC.FileCost * nodes.AddPerc / 1000);
if ((nodes.Credit < (nodes.StopLevel + T_File.Cost)) && (!TIC.Charge)) {
Syslog('!', "No forward to %s, not enough credit left", aka2str(Node)); Syslog('!', "No forward to %s, not enough credit left", aka2str(Node));
exit; exit;
} }
/* /*
* Check if we are passing the warning level * Check if we are passing the warning level
*/ */
if ((nodes.Credit > nodes.WarnLevel) && if ((nodes.Credit > nodes.WarnLevel) && ((nodes.Credit - T_File.Cost) <= nodes.WarnLevel)) {
((nodes.Credit - T_File.Cost) <= nodes.WarnLevel)) {
Syslog('+', "Low credit warning to %s", aka2str(Node)); Syslog('+', "Low credit warning to %s", aka2str(Node));
/* CREATE NETMAIL */ /* CREATE NETMAIL */
}
} }
fwdfile = calloc(PATH_MAX, sizeof(char)); fwdfile = calloc(PATH_MAX, sizeof(char));
@ -195,7 +199,7 @@ void ForwardFile(fidoaddr Node, fa_list *sbl)
* According to Harald Harms this field must * According to Harald Harms this field must
* be multiplied with 100. * be multiplied with 100.
*/ */
if (TIC.FileCost) if (TIC.FileCost && nodes.Billing)
fprintf(fp, "Cost %ld.00\r\n", T_File.Cost); fprintf(fp, "Cost %ld.00\r\n", T_File.Cost);
if (TIC.TicIn.TotLDesc) if (TIC.TicIn.TotLDesc)
for (i = 0; i < TIC.TicIn.TotLDesc; i++) for (i = 0; i < TIC.TicIn.TotLDesc; i++)
@ -274,7 +278,7 @@ void ForwardFile(fidoaddr Node, fa_list *sbl)
} }
} }
if (TIC.Charge) { if (TIC.Charge && nodes.Billing) {
nodes.Credit -= TIC.FileCost; nodes.Credit -= TIC.FileCost;
Syslog('-', "Cost: %d Left: %d", TIC.FileCost, nodes.Credit); Syslog('-', "Cost: %d Left: %d", TIC.FileCost, nodes.Credit);

View File

@ -343,7 +343,7 @@ int ProcessTic(fa_list *sbl)
*/ */
Kb = TIC.FileSize / 1024; Kb = TIC.FileSize / 1024;
if (SearchNode(TIC.Aka)) { if (SearchNode(TIC.Aka)) {
if (TIC.TicIn.Cost) { if (TIC.TicIn.Cost && nodes.Billing) {
nodes.Debet -= TIC.TicIn.Cost; nodes.Debet -= TIC.TicIn.Cost;
Syslog('f', "Uplink cost %ld, debet %ld", TIC.TicIn.Cost, nodes.Debet); Syslog('f', "Uplink cost %ld, debet %ld", TIC.TicIn.Cost, nodes.Debet);
} }

View File

@ -399,7 +399,7 @@ void E_Files(void)
mvprintw(13, 6, "7. Send TIC file"); mvprintw(13, 6, "7. Send TIC file");
mvprintw(14, 6, "8. Advanced TIC"); mvprintw(14, 6, "8. Advanced TIC");
mvprintw(15, 6, "9. File forward"); mvprintw(15, 6, "9. File forward");
mvprintw(16, 6, "10. Billing"); mvprintw(16, 6, "10. Billing (CSO)");
mvprintw( 7,46, "11. Bill direct"); mvprintw( 7,46, "11. Bill direct");
mvprintw( 8,46, "12. Credit"); mvprintw( 8,46, "12. Credit");
mvprintw( 9,46, "13. Debet"); mvprintw( 9,46, "13. Debet");
@ -437,7 +437,7 @@ void E_Files(void)
case 7: E_BOOL(13,25, nodes.Tic, "Send ^TIC^ files to this node") case 7: E_BOOL(13,25, nodes.Tic, "Send ^TIC^ files to this node")
case 8: E_BOOL(14,25, nodes.AdvTic, "Send ^advanced^ TIC files to this node") case 8: E_BOOL(14,25, nodes.AdvTic, "Send ^advanced^ TIC files to this node")
case 9: E_BOOL(15,25, nodes.FileFwd, "^Forward TIC^ files for this node") case 9: E_BOOL(15,25, nodes.FileFwd, "^Forward TIC^ files for this node")
case 10:E_BOOL(16,25, nodes.Billing, "Send ^bills^ to this node") case 10:E_BOOL(16,25, nodes.Billing, "Send ^bills^ to this node, Costsharing is active")
case 11:E_BOOL( 7,65, nodes.BillDirect, "Send bills ^direct^ after file processing") case 11:E_BOOL( 7,65, nodes.BillDirect, "Send bills ^direct^ after file processing")
case 12:E_INT( 8,65, nodes.Credit, "The ^credit^ this node has for costsharing") case 12:E_INT( 8,65, nodes.Credit, "The ^credit^ this node has for costsharing")
case 13:E_INT( 9,65, nodes.Debet, "The ^debet^ in cents we have credit from this node") case 13:E_INT( 9,65, nodes.Debet, "The ^debet^ in cents we have credit from this node")