Re: [PATCH 6/8] imap-send: change msg_data from storing (char *, len) to storing strbuf
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 29, 2012, 21:30 UTC
- Message-ID
- <7vboegp04x.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1353841721-16269-7-git-send-email-mhagger@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
> struct msg_data stored (char *, len) of the data to be included in a
That (<type>, <varname>) is a bit funny notation, even though it is understandable.
Show 9 quoted lines
> message, kept the character data NUL-terminated, etc., much like a > strbuf would do. So change it to use a struct strbuf. This makes the > code clearer and reduces copying a little bit. > > A side effect of this change is that the memory for each message is > freed after it is used rather than leaked, though that detail is > unimportant given that imap-send is a top-level command. > > --
?
Show 5 quoted lines
> For some reason, there is a bunch of infrastructure in this file for > dealing with IMAP flags, although there is nothing in the code that > actually allows any flags to be set. If there is no plan to add > support for flags in the future, a bunch of code could be ripped out > and "struct msg_data" could be completely replaced with strbuf.
Yeah, after all these years we have kept the unused flags field there and nobody needed anything out of it. I am OK with a removal if it is done at the very end of the series.
Thanks.