RE: Reply all - issue
[notmuch-archives.git] / 8b / a2158e62fe27a6d22ce1e51b386aa738dd7930
1 Return-Path: <dkg@fifthhorseman.net>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id E0271431FB6\r
6         for <notmuch@notmuchmail.org>; Fri, 18 May 2012 13:37:19 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id GuKB1eiofPX8 for <notmuch@notmuchmail.org>;\r
16         Fri, 18 May 2012 13:37:19 -0700 (PDT)\r
17 Received: from che.mayfirst.org (che.mayfirst.org [209.234.253.108])\r
18         by olra.theworths.org (Postfix) with ESMTP id 53809431FAE\r
19         for <notmuch@notmuchmail.org>; Fri, 18 May 2012 13:37:19 -0700 (PDT)\r
20 Received: from [192.168.23.207] (dsl254-070-154.nyc1.dsl.speakeasy.net\r
21         [216.254.70.154])\r
22         by che.mayfirst.org (Postfix) with ESMTPSA id E0385F970\r
23         for <notmuch@notmuchmail.org>; Fri, 18 May 2012 16:37:14 -0400 (EDT)\r
24 Message-ID: <4FB6B2F5.6090105@fifthhorseman.net>\r
25 Date: Fri, 18 May 2012 16:37:09 -0400\r
26 From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>\r
27 User-Agent: Mozilla/5.0 (X11; Linux i686;\r
28         rv:10.0.3) Gecko/20120329 Icedove/10.0.3\r
29 MIME-Version: 1.0\r
30 To: Notmuch Mail <notmuch@notmuchmail.org>\r
31 Subject: Re: [PATCH v2 5/5] cli: lazily create the crypto gpg context only\r
32         when needed\r
33 References: <1337362357-31281-1-git-send-email-jrollins@finestructure.net>\r
34         <1337362357-31281-2-git-send-email-jrollins@finestructure.net>\r
35         <1337362357-31281-3-git-send-email-jrollins@finestructure.net>\r
36         <1337362357-31281-4-git-send-email-jrollins@finestructure.net>\r
37         <1337362357-31281-5-git-send-email-jrollins@finestructure.net>\r
38         <1337362357-31281-6-git-send-email-jrollins@finestructure.net>\r
39         <20120518192157.GV11804@mit.edu>\r
40         <87txzd9su3.fsf@servo.finestructure.net>\r
41 In-Reply-To: <87txzd9su3.fsf@servo.finestructure.net>\r
42 X-Enigmail-Version: 1.4.1\r
43 Content-Type: multipart/signed; micalg=pgp-sha512;\r
44         protocol="application/pgp-signature";\r
45         boundary="------------enig95E528317834EF181F89AF5F"\r
46 X-BeenThere: notmuch@notmuchmail.org\r
47 X-Mailman-Version: 2.1.13\r
48 Precedence: list\r
49 Reply-To: notmuch <notmuch@notmuchmail.org>\r
50 List-Id: "Use and development of the notmuch mail system."\r
51         <notmuch.notmuchmail.org>\r
52 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
54 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
55 List-Post: <mailto:notmuch@notmuchmail.org>\r
56 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
57 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
59 X-List-Received-Date: Fri, 18 May 2012 20:37:20 -0000\r
60 \r
61 This is an OpenPGP/MIME signed message (RFC 2440 and 3156)\r
62 --------------enig95E528317834EF181F89AF5F\r
63 Content-Type: text/plain; charset=UTF-8\r
64 Content-Transfer-Encoding: quoted-printable\r
65 \r
66 On 05/18/2012 03:45 PM, Jameson Graef Rollins wrote:\r
67 > On Fri, May 18 2012, Austin Clements <amdragon@MIT.EDU> wrote:\r
68 >> It's slightly awkward that it's the caller's responsibility to free\r
69 >> this lazily constructed object.  That should probably be documented.\r
70 >> We could more carefully reference count it, but I think that would\r
71 >> actually be worse because the reference count would probably bounce\r
72 >> through zero frequently.\r
73 >=20\r
74 > I agree that this is awkward.  Is there a suggestion on how to do it\r
75 > better?  We only want to initialize it if it's needed, and only\r
76 > _mime_node_create knows that.  And we don't want to free it with\r
77 > _mime_node_context_free, or something, only to have to reinitialize it\r
78 > again with the next node or message.  Thoughts?\r
79 \r
80 You could provide a "destructor" function for notmuch_crypto_t, which\r
81 whoever is responsible for the struct would need to call when they are\r
82 ready to dispose of it.\r
83 \r
84 The destructor would just destroy any GMIME crypto contexts pointed to\r
85 by the struct, and reset those pointers to NULL.\r
86 \r
87 Since the common workflow is a singleton notmuch_crypto_t that is a\r
88 subobject of the singleton notmuch_params_t, you could just call that\r
89 destructor function before the notmuch_params_t falls out of scope.\r
90 \r
91 If you want to be fancy/symmetric, you could use the same pattern to\r
92 create a "destructor" function for notmuch_params_t (it would just\r
93 invoke the destructor on its crypto member), but this seems like\r
94 overkill to me, and not in line with the talloc approach of the rest of\r
95 the codebase.\r
96 \r
97 I agree that it's a little awkward, but i think there's something of an\r
98 impedance mismatch between gmime's object interface and notmuch's use of\r
99 talloc and friends.\r
100 \r
101         --dkg\r
102 \r
103 \r
104 --------------enig95E528317834EF181F89AF5F\r
105 Content-Type: application/pgp-signature; name="signature.asc"\r
106 Content-Description: OpenPGP digital signature\r
107 Content-Disposition: attachment; filename="signature.asc"\r
108 \r
109 -----BEGIN PGP SIGNATURE-----\r
110 Version: GnuPG v1.4.12 (GNU/Linux)\r
111 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/\r
112 \r
113 iQJ8BAEBCgBmBQJPtrL1XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w\r
114 ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQwRUU1QkU5NzkyODJEODBCOUY3NTQwRjFD\r
115 Q0QyRUQ5NEQyMTczOUU5AAoJEMzS7ZTSFznpm0gQAKXRfjkE3yzlbGVGfOj8HzP4\r
116 nLHpm5fmPUkd6cZegq51a21lNHkO02zKGQonPHO2mUQHnZ3616sdK/BqBiBebB8b\r
117 sXWwl+d2n8OOnxNh9L/I4ihSL5mn86+fC6eTR/TVQjVE7jKSdkK0pRSbZUN8atYd\r
118 JirQ2TyyqUr4IVaD3RGHdeOU/cAPbPLjbS7YcdRep0ImfFSADZmvZE1weImy721S\r
119 0v4otH87fim5trf3tBIpJqFFfgXMMxmlw+L2xFGGewdnEwliB8v0se+pTJiABjHW\r
120 u8l3EUU5Y7GRzjv3RoLLdUooergHQi2I9Z+AZK1fcVwWicxLhVWIXuOcJ4KpknNi\r
121 MCuN5+S+EGCvK8lcfbUyy5UiDm5fF270xR/mAeTbm2/hQ3Y+MAFRuhT4ZZIlpMOP\r
122 Ldzk92B/zSh4mxRCZtoi6lLnRsd6B3GP2VRlHs5caKXG3weQhGTQIO7QmpcIcAFf\r
123 Rp+eH83OgaTQ2UEmzfQLVMlenF+NBykurRJ2//bC7kHbliMj0NKp5DqRnWChjLiB\r
124 oBBE4CMjkPYCX1PWnS/XJhwL/DZAvPNTghqIDq3hcAZRu13Hc0xXpIAUTx3lYOfc\r
125 TCPamfMs1ZhogJDjNOfhhRo+KQgjPKpR2HIDn2VU3xMlTHG7PquuLY2WkqPoYAsP\r
126 dBw+rfzJywAASGm1WxtC\r
127 =W4+Y\r
128 -----END PGP SIGNATURE-----\r
129 \r
130 --------------enig95E528317834EF181F89AF5F--\r