Re: [PATCH 1/4] show: indicate length of omitted body content (json)
authorPeter Wang <novalazy@gmail.com>
Mon, 6 Aug 2012 14:36:59 +0000 (00:36 +1000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:48:53 +0000 (09:48 -0800)
43/078a3cd975a7674c1a3e388d0d7c5eda72cbe6 [new file with mode: 0644]

diff --git a/43/078a3cd975a7674c1a3e388d0d7c5eda72cbe6 b/43/078a3cd975a7674c1a3e388d0d7c5eda72cbe6
new file mode 100644 (file)
index 0000000..a57ecbb
--- /dev/null
@@ -0,0 +1,102 @@
+Return-Path: <novalazy@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 45797431FAF\r
+       for <notmuch@notmuchmail.org>; Mon,  6 Aug 2012 07:37:07 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id ZOwomuIRqIVh for <notmuch@notmuchmail.org>;\r
+       Mon,  6 Aug 2012 07:37:06 -0700 (PDT)\r
+Received: from mail-gh0-f181.google.com (mail-gh0-f181.google.com\r
+       [209.85.160.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id A85DF431FAE\r
+       for <notmuch@notmuchmail.org>; Mon,  6 Aug 2012 07:37:06 -0700 (PDT)\r
+Received: by ghz3 with SMTP id 3so863543ghz.26\r
+       for <notmuch@notmuchmail.org>; Mon, 06 Aug 2012 07:37:05 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=date:message-id:from:to:cc:subject:in-reply-to:references\r
+       :mime-version:content-type:content-disposition\r
+       :content-transfer-encoding;\r
+       bh=DAiVgAPM6rAgZdt7HNzY6+DMrjf9zMo/5UKQulnLJ/E=;\r
+       b=IO1mLgznH7WT/4SBwTTtzPKXu97EY35mH17Qbm9mjqfsDUxkTzrCV4q2CCpI8QdarK\r
+       8ewzNmRvG60Ycqmg1iSYkFws/L9c379yEQ2luEqJo6IiS/v6ClEjDkJ0ehSeIlzkY/jm\r
+       NeiVMoC+V5JNnJqkeFGkUu6prn3QI2l+UjkyHrl7mkHccLyU5e3238t42ek3PRx5Sp7X\r
+       DSbK4bcHzJ1rLXMsv6/0AlxS6l4pooaIYg7jSsPVM5Xgqz/B7OyRBKYlchzwmPLVVPkL\r
+       kvn4NsLNYqdaiDMVjA2zHJgG901Qe9GboxjqFrCQSqwPYEeCMWQq+EE1Bsl9G1aaYR1l\r
+       BetA==\r
+Received: by 10.68.203.98 with SMTP id kp2mr19386113pbc.132.1344263825501;\r
+       Mon, 06 Aug 2012 07:37:05 -0700 (PDT)\r
+Received: from localhost (215.42.233.220.static.exetel.com.au.\r
+       [220.233.42.215])\r
+       by mx.google.com with ESMTPS id wn1sm1741522pbc.57.2012.08.06.07.37.02\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Mon, 06 Aug 2012 07:37:04 -0700 (PDT)\r
+Date: Tue, 7 Aug 2012 00:36:59 +1000\r
+Message-ID: <20120807003659.GA22470@hili.localdomain>\r
+From: Peter Wang <novalazy@gmail.com>\r
+To: Jameson Graef Rollins <jrollins@finestructure.net>\r
+Subject: Re: [PATCH 1/4] show: indicate length of omitted body content (json)\r
+In-Reply-To: <87y5ltuikh.fsf@servo.finestructure.net>\r
+References: <1344151345-25411-1-git-send-email-novalazy@gmail.com>\r
+       <87y5ltuikh.fsf@servo.finestructure.net>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Disposition: inline\r
+Content-Transfer-Encoding: 8bit\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 06 Aug 2012 14:37:07 -0000\r
+\r
+On Sun, 05 Aug 2012 14:37:02 -0700, Jameson Graef Rollins <jrollins@finestructure.net> wrote:\r
+> On Sun, Aug 05 2012, Peter Wang <novalazy@gmail.com> wrote:\r
+> > diff --git a/devel/schemata b/devel/schemata\r
+> > index 9cb25f5..3df2764 100644\r
+> > --- a/devel/schemata\r
+> > +++ b/devel/schemata\r
+> > @@ -69,7 +69,10 @@ part = {\r
+> >      # A leaf part's body content is optional, but may be included if\r
+> >      # it can be correctly encoded as a string.  Consumers should use\r
+> >      # this in preference to fetching the part content separately.\r
+> > -    content?:       string\r
+> > +    content?:       string,\r
+> > +    # If a leaf part's body content is not included, the content-length\r
+> > +    # may be included instead.\r
+> > +    content-length?: int\r
+> \r
+> Hey, Peter.  Something somewhere, and probably at least here in the\r
+> schemata, should mention what the uids are (b? kB? KiB? YiB?)\r
+\r
+I thought content-length was a MIME header, but it's not.\r
+Anyway, it's the length of the encoded content in bytes.  GMime\r
+doesn't provide an easy way to return the length of the decoded content.\r
+\r
+I actually only need an _estimate_ of the decoded size to present to the\r
+user.  Strictly speaking, that requires knowledge of the transfer encoding.\r
+Previously I planned on guessing it from the content-type, but I think\r
+it's better to return the transfer encoding as well (if any).\r
+\r
+Alternatively, notmuch could put in more effort to return the exact\r
+length of the decoded content.  But it's a waste of time if no consumers\r
+will use it.\r
+\r
+Peter\r