Page MenuHome GnuPG

906_0139-agent-Avoid-tight-timer-tick-when-possible.patch
Needs ReviewPublic

Authored by dkg on Nov 15 2016, 12:58 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Date: Tue, 1 Nov 2016 00:14:10 -0400
Subject: agent: Avoid tight timer tick when possible.

  • agent/gpg-agent.c (need_tick): Evaluate whether the short-phase

handle_tick() is needed.
(handle_connections): On each cycle of the select loop, adjust whether
we should call handle_tick() or not.

  • agent/call-scd.c (start_scd): Call interrupt_main_thread_loop() once

the scdaemon thread context has started up.

With this change, an idle gpg-agent that has no scdaemon running only
wakes up once a minute (to check_own_socket).

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>

agent/call-scd.c | 4 +++-
agent/gpg-agent.c | 25 ++++++++++++++++++++++++-
2 files changed, 27 insertions(+), 2 deletions(-)

Test Plan

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped