1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-02 03:52:49 -05:00

Factor out ssh2_timer_update.

This is a preliminary refactoring for an upcoming change which will
need to affect every use of schedule_timer to wait for the next rekey:
those calls to schedule_timer are now centralised into a function that
does an organised piece of thinking about when the next timer should
be.

A side effect of this change is that the translation from
CONF_ssh_rekey_time to an actual tick count is now better proofed
against integer overflow (just in case the user entered a completely
silly value).
This commit is contained in:
Simon Tatham
2018-04-14 14:48:02 +01:00
parent a0b91e99b8
commit d50150c40f
2 changed files with 55 additions and 19 deletions

View File

@ -27,6 +27,13 @@ typedef struct terminal_tag Terminal;
#include "network.h"
#include "misc.h"
/*
* We express various time intervals in unsigned long minutes, but may need to
* clip some values so that the resulting number of ticks does not overflow an
* integer value.
*/
#define MAX_TICK_MINS (INT_MAX / (60 * TICKSPERSEC))
/*
* Fingerprints of the PGP master keys that can be used to establish a trust
* path between an executable and other files.