unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Peter Wang <novalazy@gmail.com>
To: Jameson Graef Rollins <jrollins@finestructure.net>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH 1/4] show: indicate length of omitted body content (json)
Date: Tue, 7 Aug 2012 00:36:59 +1000	[thread overview]
Message-ID: <20120807003659.GA22470@hili.localdomain> (raw)
In-Reply-To: <87y5ltuikh.fsf@servo.finestructure.net>

On Sun, 05 Aug 2012 14:37:02 -0700, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
> On Sun, Aug 05 2012, Peter Wang <novalazy@gmail.com> wrote:
> > diff --git a/devel/schemata b/devel/schemata
> > index 9cb25f5..3df2764 100644
> > --- a/devel/schemata
> > +++ b/devel/schemata
> > @@ -69,7 +69,10 @@ part = {
> >      # A leaf part's body content is optional, but may be included if
> >      # it can be correctly encoded as a string.  Consumers should use
> >      # this in preference to fetching the part content separately.
> > -    content?:       string
> > +    content?:       string,
> > +    # If a leaf part's body content is not included, the content-length
> > +    # may be included instead.
> > +    content-length?: int
> 
> Hey, Peter.  Something somewhere, and probably at least here in the
> schemata, should mention what the uids are (b? kB? KiB? YiB?)

I thought content-length was a MIME header, but it's not.
Anyway, it's the length of the encoded content in bytes.  GMime
doesn't provide an easy way to return the length of the decoded content.

I actually only need an _estimate_ of the decoded size to present to the
user.  Strictly speaking, that requires knowledge of the transfer encoding.
Previously I planned on guessing it from the content-type, but I think
it's better to return the transfer encoding as well (if any).

Alternatively, notmuch could put in more effort to return the exact
length of the decoded content.  But it's a waste of time if no consumers
will use it.

Peter

  reply	other threads:[~2012-08-06 14:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-05  7:22 [PATCH 1/4] show: indicate length of omitted body content (json) Peter Wang
2012-08-05  7:22 ` [PATCH 2/4] test: conform to content-length fields (json) Peter Wang
2012-08-05  7:22 ` [PATCH 3/4] show: indicate length of omitted body content (text) Peter Wang
2012-08-06 16:50   ` Austin Clements
2012-08-05  7:22 ` [PATCH 4/4] test: conform to content-length fields (text) Peter Wang
2012-08-05  9:32 ` [PATCH 1/4] show: indicate length of omitted body content (json) Tomi Ollila
2012-08-05 21:37 ` Jameson Graef Rollins
2012-08-06 14:36   ` Peter Wang [this message]
2012-08-06 16:47 ` Austin Clements
2012-08-07 13:24   ` Peter Wang
2012-08-07 13:57     ` Austin Clements
2012-08-07 23:01 ` Mark Walters
2012-08-08 12:31   ` Peter Wang
2012-10-20  1:56 ` Ethan Glasser-Camp

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=20120807003659.GA22470@hili.localdomain \
    --to=novalazy@gmail.com \
    --cc=jrollins@finestructure.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).