jcs
/subtext
/amendments
/469
db: Add ftn_max_tossed_message_size and max_sysop_idle_minutes
jcs made amendment 469 about 1 year ago
--- db.c Thu Apr 6 15:33:46 2023
+++ db.c Sat Apr 8 22:50:43 2023
@@ -75,10 +75,13 @@ struct struct_field config_fields[] = {
offsetof(struct config, modem_init),
1, member_size(struct config, modem_init) },
- { "Max Idle Minutes", CONFIG_TYPE_SHORT,
+ { "Max Idle Minutes", CONFIG_TYPE_SHORT,
offsetof(struct config, max_idle_minutes),
- 1, USHRT_MAX },
- { "Max Login Seconds", CONFIG_TYPE_SHORT,
+ 0, USHRT_MAX },
+ { "Max Sysop Idle Minutes", CONFIG_TYPE_SHORT,
+ offsetof(struct config, max_sysop_idle_minutes),
+ 0, USHRT_MAX },
+ { "Max Login Seconds", CONFIG_TYPE_SHORT,
offsetof(struct config, max_login_seconds),
1, USHRT_MAX },
@@ -120,10 +123,12 @@ struct struct_field config_fields[] = {
{ "FTN Hub Binkp Poll Seconds", CONFIG_TYPE_LONG,
offsetof(struct config, binkp_interval_seconds),
1, LONG_MAX },
- { "FTN Hub Binkp Delete After Processing", CONFIG_TYPE_BOOLEAN,
+ { "FTN Delete Packets After Processing", CONFIG_TYPE_BOOLEAN,
offsetof(struct config, binkp_delete_done),
0, 0 },
-
+ { "FTN Max Tossed Message Size", CONFIG_TYPE_LONG,
+ offsetof(struct config, ftn_max_tossed_message_size),
+ 0, LONG_MAX },
};
size_t nconfig_fields = nitems(config_fields);
@@ -348,6 +353,7 @@ db_migrate(struct db *tdb, short is_new, Str255 fullpa
sprintf(tdb->config.modem_init, "ATQ0V1S0=2");
sprintf(tdb->config.modem_parity, "8N1");
tdb->config.max_idle_minutes = 5;
+ tdb->config.max_sysop_idle_minutes = 60;
tdb->config.max_login_seconds = 90;
tdb->config.blanker_idle_seconds = (60 * 60);
tdb->config.blanker_runtime_seconds = 30;
@@ -355,6 +361,8 @@ db_migrate(struct db *tdb, short is_new, Str255 fullpa
tdb->config.binkp_port = 24554;
tdb->config.binkp_interval_seconds = (60 * 60 * 3);
tdb->config.mail_prune_days = 180;
+ tdb->config.ftn_max_tossed_message_size = 16 * 1024;
+
db_config_save(tdb);
/* create a default sysop user */
@@ -699,6 +707,20 @@ db_migrate(struct db *tdb, short is_new, Str255 fullpa
sizeof(new_config));
new_config.mail_prune_days = 180;
+
+ bile_write(tdb->bile, DB_CONFIG_RTYPE, 1, &new_config,
+ sizeof(new_config));
+ break;
+ }
+ case 17: {
+ /* 17->18, more config fields */
+ struct config new_config = { 0 };
+
+ bile_read(tdb->bile, DB_CONFIG_RTYPE, 1, (char *)&new_config,
+ sizeof(new_config));
+
+ new_config.ftn_max_tossed_message_size = 16 * 1024;
+ new_config.max_sysop_idle_minutes = 60;
bile_write(tdb->bile, DB_CONFIG_RTYPE, 1, &new_config,
sizeof(new_config));
--- db.h Wed Mar 15 15:30:12 2023
+++ db.h Sat Apr 8 22:46:01 2023
@@ -19,7 +19,7 @@
#include <time.h>
-#define DB_CUR_VERS 17
+#define DB_CUR_VERS 18
#define SUBTEXT_CREATOR 'SUBT'
#define DB_TYPE 'STDB'
@@ -101,6 +101,8 @@ struct config {
short timezone_utcoff;
char ftn_network[16];
short mail_prune_days;
+ unsigned long ftn_max_tossed_message_size;
+ short max_sysop_idle_minutes;
};
extern struct struct_field config_fields[];