unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jameson Graef Rollins <jrollins@finestructure.net>
To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>,
	Notmuch Mail <notmuch@notmuchmail.org>
Subject: Re: [PATCH v2 5/5] cli: lazily create the crypto gpg context only when needed
Date: Fri, 18 May 2012 13:42:11 -0700	[thread overview]
Message-ID: <87ehqh9q70.fsf@servo.finestructure.net> (raw)
In-Reply-To: <4FB6B2F5.6090105@fifthhorseman.net>

[-- Attachment #1: Type: text/plain, Size: 1031 bytes --]

On Fri, May 18 2012, Daniel Kahn Gillmor <dkg@fifthhorseman.net> wrote:
> You could provide a "destructor" function for notmuch_crypto_t, which
> whoever is responsible for the struct would need to call when they are
> ready to dispose of it.
>
> The destructor would just destroy any GMIME crypto contexts pointed to
> by the struct, and reset those pointers to NULL.

That sounds reasonable.  I'll see if I can hack something like that.

> Since the common workflow is a singleton notmuch_crypto_t that is a
> subobject of the singleton notmuch_params_t, you could just call that
> destructor function before the notmuch_params_t falls out of scope.

Just to be clear, notmuch_crypto_t is not only used as a subobject of
notmuch_show_params_t.  At least in what I submitted it is used on it's
own in notmuch-reply.c, in place of notmuch_show_params_t, since the
reply code was only using the crypto context to decrypt messages being
replied to.  So it's probably best to handle it independently of
notmuch_show_params_t.

jamie.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

  reply	other threads:[~2012-05-18 20:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-18 17:32 [PATCH v2 0/5] cli: improve handling of crypto parameters and contexts Jameson Graef Rollins
2012-05-18 17:32 ` [PATCH v2 1/5] cli: new crypto structure to store crypto contexts and parameters Jameson Graef Rollins
2012-05-18 17:32   ` [PATCH v2 2/5] cli: modify mime_node_open to take crypto struct as argument Jameson Graef Rollins
2012-05-18 17:32     ` [PATCH v2 3/5] cli: modify mime_node_context to use the new notmuch_crypto_t Jameson Graef Rollins
2012-05-18 17:32       ` [PATCH v2 4/5] cli: new crypto verify flag to handle verification Jameson Graef Rollins
2012-05-18 17:32         ` [PATCH v2 5/5] cli: lazily create the crypto gpg context only when needed Jameson Graef Rollins
2012-05-18 19:21           ` Austin Clements
2012-05-18 19:45             ` Jameson Graef Rollins
2012-05-18 20:37               ` Daniel Kahn Gillmor
2012-05-18 20:42                 ` Jameson Graef Rollins [this message]
2012-05-19 11:26         ` [PATCH v2 4/5] cli: new crypto verify flag to handle verification Jani Nikula
2012-05-19 16:28           ` Jameson Graef Rollins
2012-05-18 19:09       ` [PATCH v2 3/5] cli: modify mime_node_context to use the new notmuch_crypto_t Austin Clements
2012-05-18 19:17         ` Jameson Graef Rollins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ehqh9q70.fsf@servo.finestructure.net \
    --to=jrollins@finestructure.net \
    --cc=dkg@fifthhorseman.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).