Tor 0.4.9.3-alpha-dev
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Functions
approx_time.h File Reference

Header for approx_time.c. More...

#include <time.h>

Go to the source code of this file.

Functions

time_t approx_time (void)
 
void update_approx_time (time_t now)
 

Detailed Description

Header for approx_time.c.

Definition in file approx_time.h.

Function Documentation

◆ approx_time()

time_t approx_time ( void  )

Return a cached estimate of the current time from when update_approx_time() was last called. This is a hack to avoid calling time(NULL) on critical paths: please do not even think of calling it anywhere else.

Definition at line 32 of file approx_time.c.

Referenced by build_service_desc_plaintext(), cache_intro_state_new(), can_client_refetch_desc(), cell_queues_check_size(), cert_is_valid(), channel_mark_circid_unusable(), channelpadding_send_padding_callback(), circpad_cell_event_nonpadding_received(), circpad_cell_event_nonpadding_sent(), circpad_cell_event_padding_received(), circpad_cell_event_padding_sent(), circpad_circuit_machineinfo_new(), circpad_marked_circuit_for_padding(), circuit_about_to_free(), circuit_build_times_needs_circuits_now(), circuit_build_times_network_is_live(), circuit_get_open_circ_or_launch(), circuit_guard_state_new(), circuit_receive_relay_cell(), circuit_set_n_circid_chan(), circuit_set_p_circid_chan(), cleanup_intro_points(), connection_ap_handle_onion(), connection_ap_handshake_attach_chosen_circuit(), connection_ap_handshake_rewrite_and_attach(), connection_buf_read_from_socket(), connection_consider_empty_read_buckets(), connection_consider_empty_write_buckets(), connection_dir_client_reached_eof(), connection_dir_is_global_write_low(), connection_edge_flushed_some(), connection_edge_process_inbuf(), connection_handle_read_impl(), connection_handle_write_impl(), connection_init_accepted_conn(), consdiffmgr_add_consensus(), consdiffmgr_cleanup(), consensus_cache_entry_decref(), create_initial_guard_context(), decode_intro_legacy_key(), dir_consensus_request_set_additional_headers(), dirauth_get_voting_schedule(), directory_handle_command_post(), dirserv_read_measured_bandwidths(), dnsserv_launch_request(), do_hup(), entry_guard_add_to_sample_impl(), entry_guard_consider_retry(), entry_guard_failed(), entry_guard_state_should_expire(), entry_guard_succeeded(), entry_guards_note_guard_failure(), entry_guards_note_guard_success(), entry_guards_note_internet_connectivity(), entry_guards_upgrade_waiting_circuits(), evdns_server_callback(), get_guard_state_for_bridge_desc_fetch(), get_unique_circ_id_by_chan(), handle_introduce1(), handle_relay_msg(), handle_response_fetch_certificate(), handle_response_fetch_consensus(), handle_response_fetch_desc(), handle_response_fetch_microdesc(), have_been_under_memory_pressure(), hs_client_decode_descriptor(), hs_get_responsible_hsdirs(), hs_get_time_period_num(), keypin_open_journal(), log_buggy_rs_source(), log_master_signing_key_cert_expiration(), lookup_v3_desc_as_client(), maintain_layer2_guards(), make_guard_confirmed(), mark_circuit_unusable_for_new_conns(), microdesc_note_outdated_dirserver(), networkstatus_set_current_consensus(), nodelist_set_consensus(), onion_pending_add(), overload_general_onionskin_assessment(), overload_happened_recently(), parse_from_state_handle_time(), pathbias_count_build_attempt(), pathbias_count_build_success(), pathbias_should_count(), process_signal(), reasonably_live_consensus_is_missing(), rep_hist_note_overload(), retry_all_socks_conn_waiting_for_desc(), router_add_to_routerlist(), router_descriptor_is_older_than(), routerlist_descriptors_added(), running_long_enough_to_decide_unreachable(), sampled_guards_update_consensus_presence(), sampled_guards_update_from_consensus(), select_confirmed_guard_for_circuit(), select_filtered_guard_for_circuit(), select_primary_guard_for_circuit(), service_intro_point_new(), should_collect_v3_stats(), sr_get_current(), sr_get_previous(), sr_state_get_start_time_of_current_protocol_run(), update_guard_selection_choice(), write_http_response_header_impl(), and write_metrics_http_response().

◆ update_approx_time()

void update_approx_time ( time_t  now)

Update the cached estimate of the current time. This function SHOULD be called once per second, and MUST be called before the first call to get_approx_time.

Definition at line 41 of file approx_time.c.

Referenced by run_main_loop_once(), subsys_wallclock_initialize(), and update_current_time().