1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-03-22 14:39:24 -05:00

Keepalives are now in seconds not minutes

[originally from svn r874]
This commit is contained in:
Simon Tatham 2001-01-19 09:01:50 +00:00
parent 20397a174f
commit 72cdcc611a
4 changed files with 12 additions and 5 deletions

View File

@ -140,7 +140,7 @@ typedef struct {
enum { PROT_RAW, PROT_TELNET, PROT_SSH } protocol; enum { PROT_RAW, PROT_TELNET, PROT_SSH } protocol;
int close_on_exit; int close_on_exit;
int warn_on_close; int warn_on_close;
int ping_interval; int ping_interval; /* in seconds */
/* SSH options */ /* SSH options */
char remote_cmd[512]; char remote_cmd[512];
int nopty; int nopty;

View File

@ -44,7 +44,8 @@ void save_settings (char *section, int do_host, Config *cfg) {
} }
write_setting_i (sesskey, "CloseOnExit", !!cfg->close_on_exit); write_setting_i (sesskey, "CloseOnExit", !!cfg->close_on_exit);
write_setting_i (sesskey, "WarnOnClose", !!cfg->warn_on_close); write_setting_i (sesskey, "WarnOnClose", !!cfg->warn_on_close);
write_setting_i (sesskey, "PingInterval", cfg->ping_interval); write_setting_i (sesskey, "PingInterval", cfg->ping_interval / 60); /* minutes */
write_setting_i (sesskey, "PingIntervalSecs", cfg->ping_interval % 60); /* seconds */
write_setting_s (sesskey, "TerminalType", cfg->termtype); write_setting_s (sesskey, "TerminalType", cfg->termtype);
write_setting_s (sesskey, "TerminalSpeed", cfg->termspeed); write_setting_s (sesskey, "TerminalSpeed", cfg->termspeed);
{ {
@ -167,7 +168,13 @@ void load_settings (char *section, int do_host, Config *cfg) {
gppi (sesskey, "CloseOnExit", 1, &cfg->close_on_exit); gppi (sesskey, "CloseOnExit", 1, &cfg->close_on_exit);
gppi (sesskey, "WarnOnClose", 1, &cfg->warn_on_close); gppi (sesskey, "WarnOnClose", 1, &cfg->warn_on_close);
gppi (sesskey, "PingInterval", 0, &cfg->ping_interval); {
/* This is two values for backward compatibility with 0.50/0.51 */
int pingmin, pingsec;
gppi (sesskey, "PingInterval", 0, &pingmin);
gppi (sesskey, "PingIntervalSecs", 0, &pingsec);
cfg->ping_interval = pingmin*60 + pingsec;
}
gpps (sesskey, "TerminalType", "xterm", cfg->termtype, gpps (sesskey, "TerminalType", "xterm", cfg->termtype,
sizeof(cfg->termtype)); sizeof(cfg->termtype));
gpps (sesskey, "TerminalSpeed", "38400,38400", cfg->termspeed, gpps (sesskey, "TerminalSpeed", "38400,38400", cfg->termspeed,

View File

@ -960,7 +960,7 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg,
} }
beginbox(&cp, "Sending of null packets to keep session active", beginbox(&cp, "Sending of null packets to keep session active",
IDC_BOX_CONNECTION2, IDC_BOXT_CONNECTION2); IDC_BOX_CONNECTION2, IDC_BOXT_CONNECTION2);
staticedit(&cp, "Minutes between &keepalives (0 to turn off)", staticedit(&cp, "Seconds between &keepalives (0 to turn off)",
IDC_PINGSTATIC, IDC_PINGEDIT, 25); IDC_PINGSTATIC, IDC_PINGEDIT, 25);
endbox(&cp); endbox(&cp);

View File

@ -1077,7 +1077,7 @@ static LRESULT CALLBACK WndProc (HWND hwnd, UINT message,
{ {
time_t now; time_t now;
time(&now); time(&now);
if (now-last_movement > cfg.ping_interval * 60 - 10) if (now-last_movement > cfg.ping_interval)
{ {
back->special(TS_PING); back->special(TS_PING);
last_movement = now; last_movement = now;