[PATCH 8/8] cli: optionally restore message properties from dump file
[notmuch-archives.git] / 51 / be72b432008463cb17e55d340280693fd24a4c
1 Return-Path: <novalazy@gmail.com>\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 57BED431FAF\r
6         for <notmuch@notmuchmail.org>; Mon, 26 Nov 2012 04:05:15 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id Nris0RKcXYEW for <notmuch@notmuchmail.org>;\r
17         Mon, 26 Nov 2012 04:05:13 -0800 (PST)\r
18 Received: from mail-da0-f53.google.com (mail-da0-f53.google.com\r
19         [209.85.210.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 8FF6D431FAE\r
22         for <notmuch@notmuchmail.org>; Mon, 26 Nov 2012 04:05:13 -0800 (PST)\r
23 Received: by mail-da0-f53.google.com with SMTP id x6so2879236dac.26\r
24         for <notmuch@notmuchmail.org>; Mon, 26 Nov 2012 04:05:11 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
26         h=date:message-id:from:to:cc:subject:in-reply-to:references\r
27         :mime-version:content-type:content-disposition\r
28         :content-transfer-encoding;\r
29         bh=WCtQ2ic/6gZmX8BLR4JP6EFuEHW5EAzDGumtAb1J9Jg=;\r
30         b=mG567wbtdaC3fa3VBr2UOTiDiCuKlkRff2Lp+amUo/Ay7TeiGYPsZJPswUgUtD2f7N\r
31         bRYBuoOgpX5Qxy81Hd3Hqv++/AtIhh80vhjtFlnKBmmrdm+fJPLfoozp9I39nxknp/Na\r
32         DYM8SBZXIo8vDl3yB/GSg3Nsh3ualWzdsa40zr0ZxfAGy+4/wQcrnos6H3zh338lWFSY\r
33         AmWsCVyBohVEQyek2xUGk9otvZw4CMh7UgwoWO5KTMl95UaM4896/iGZe2bhMez4Iqqr\r
34         Kq3Gum4RPST/e/qQ+hAUONHE1PEieVVDuw3eDvpdZXD4CRJ29FbxdF4g6SQiK0BaXOuQ\r
35         wTOQ==\r
36 Received: by 10.66.87.42 with SMTP id u10mr25517846paz.62.1353931511628;\r
37         Mon, 26 Nov 2012 04:05:11 -0800 (PST)\r
38 Received: from localhost (215.42.233.220.static.exetel.com.au.\r
39         [220.233.42.215])\r
40         by mx.google.com with ESMTPS id vk5sm8686958pbc.34.2012.11.26.04.05.08\r
41         (version=TLSv1/SSLv3 cipher=OTHER);\r
42         Mon, 26 Nov 2012 04:05:10 -0800 (PST)\r
43 Date: Mon, 26 Nov 2012 23:05:05 +1100\r
44 Message-ID: <20121126230505.GA2095@hili.localdomain>\r
45 From: Peter Wang <novalazy@gmail.com>\r
46 To: Tomi Ollila <tomi.ollila@iki.fi>\r
47 Subject: Re: [PATCH v2 05/20] insert: copy stdin to Maildir tmp file\r
48 In-Reply-To: <m2txscitya.fsf@guru.guru-group.fi>\r
49 References: <1353806206-29133-1-git-send-email-novalazy@gmail.com>\r
50         <1353806206-29133-6-git-send-email-novalazy@gmail.com>\r
51         <m2txscitya.fsf@guru.guru-group.fi>\r
52 MIME-Version: 1.0\r
53 Content-Type: text/plain; charset=utf-8\r
54 Content-Disposition: inline\r
55 Content-Transfer-Encoding: 8bit\r
56 Cc: notmuch@notmuchmail.org\r
57 X-BeenThere: notmuch@notmuchmail.org\r
58 X-Mailman-Version: 2.1.13\r
59 Precedence: list\r
60 List-Id: "Use and development of the notmuch mail system."\r
61         <notmuch.notmuchmail.org>\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
65 List-Post: <mailto:notmuch@notmuchmail.org>\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
68         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
69 X-List-Received-Date: Mon, 26 Nov 2012 12:05:15 -0000\r
70 \r
71 On Mon, 26 Nov 2012 11:39:41 +0200, Tomi Ollila <tomi.ollila@iki.fi> wrote:\r
72 > On Sun, Nov 25 2012, Peter Wang <novalazy@gmail.com> wrote:\r
73\r
74 > > Read the new message from standard input into the Maildir tmp file.\r
75 > > ---\r
76\r
77 > There are a few issues that gort my attention in this particular function:\r
78\r
79\r
80 > >  notmuch-insert.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++----\r
81 > >  1 file changed, 47 insertions(+), 4 deletions(-)\r
82 > >\r
83 > > diff --git a/notmuch-insert.c b/notmuch-insert.c\r
84 > > index 371fb47..88e8533 100644\r
85 > > --- a/notmuch-insert.c\r
86 > > +++ b/notmuch-insert.c\r
87 > > @@ -94,6 +94,47 @@ maildir_open_tmp_file (void *ctx, const char *dir,\r
88 > >      return fd;\r
89 > >  }\r
90 > >  \r
91 > > +/* Copy the contents of fdin into fdout. */\r
92 > > +static notmuch_bool_t\r
93 > > +copy_fd_data (int fdin, int fdout)\r
94 > > +{\r
95 > > +    char buf[4096];\r
96\r
97 > Copying in 4k blocks is slow when at least when doing file to file copy.\r
98 > Also socket buffers can often hold much more data. When reading from\r
99 > network and saving to file (in low-load machine) this is OK, but otherwise\r
100 > something like 64k buffer works better(*).\r
101\r
102 > (*) Now that I said it I have to measure this yet another time ;)\r
103 \r
104 I get up to a whopping 10 ms faster copy of a 100 MiB file by increasing\r
105 the buffer size to 8192 bytes or more (standalone program, stdin to\r
106 disk, no fsync, no xapian).  Feel free to fiddle with it after it's\r
107 pushed, if you think it's worthwhile.\r
108 \r
109 > You're claiming in function name & and its description that this is more\r
110 > "generic" copy function -- yet error message speaks about 'standard input'.\r
111 \r
112 I'll rename it.\r
113 \r
114 Peter\r