mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
b5c04173c8
When the clock jumps, and we have a record of last user activity, adjust that record. This way if I'm inactive for 10 minutes and then the laptop is sleeping for an hour, I'll still count as having been inactive for 10 minutes. Previously, we treat every jump as if it were activity, which is ridiculous, and would prevent a Tor instance with a jumpy clock from ever going dormant.
25 lines
763 B
C
25 lines
763 B
C
/* Copyright (c) 2001 Matej Pfajfar.
|
|
* Copyright (c) 2001-2004, Roger Dingledine.
|
|
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
|
|
* Copyright (c) 2007-2018, The Tor Project, Inc. */
|
|
/* See LICENSE for licensing information */
|
|
|
|
#ifndef TOR_NETSTATUS_H
|
|
#define TOR_NETSTATUS_H
|
|
|
|
int net_is_disabled(void);
|
|
int net_is_completely_disabled(void);
|
|
|
|
void note_user_activity(time_t now);
|
|
void reset_user_activity(time_t now);
|
|
time_t get_last_user_activity_time(void);
|
|
|
|
void set_network_participation(bool participation);
|
|
bool is_participating_on_network(void);
|
|
|
|
void netstatus_flush_to_state(or_state_t *state, time_t now);
|
|
void netstatus_load_from_state(const or_state_t *state, time_t now);
|
|
void netstatus_note_clock_jumped(time_t seconds_diff);
|
|
|
|
#endif
|