[gmime-devel] g_mime_object_get_header_list on first part in g_mime_message_foreach()?



When i pass a GMimeMessage object to g_mime_message_foreach(), it
invokes the callback on a series of GMimePart objects, the first of
which is the top-level message itself.  but this object is actually
pretty strange:

 a) when i call g_mime_object_get_headers() on it, i get the full list of
    headers in a text blob.

 b) when i call gmime_object_get_header_list(), though, and loop through
    it with g_mime_object_get_header_list(), i only get the Content-Type
    header.

For every object after the first in g_mime_message_foreach walk, these
queries return the same set.  So i'm pretty confused as to why it would
be different for the first part.

I note that if i invoke g_mime_object_get_header_list() directly on the
the GMimeMessage object, i get a GMimeHeaderList that contains all the
headers, not just the Content-Type.  Should i be understanding the
object differently somehow, or is this a bug?

       --dkg

PS i also see the same oddness when looping into an encrypted part using
   g_mime_multipart_encrypted_decrypt() with a GMimeGpgContext -- the
   returned GMimeObject has the same behavior as the first visited part
   in the g_mime_message_foreach() walk.

Attachment: signature.asc
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]