After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 521872 - set_respect_content_length() broken since 2.2.16
set_respect_content_length() broken since 2.2.16
Status: RESOLVED FIXED
Product: gmime
Classification: Other
Component: general
2.2.x
Other All
: Normal normal
: ---
Assigned To: Jeffrey Stedfast
Jeffrey Stedfast
Depends on:
Blocks:
 
 
Reported: 2008-03-11 21:43 UTC by Pawel Salek
Modified: 2008-03-13 21:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gmime_parser_test.c (1.09 KB, text/plain)
2008-03-11 21:47 UTC, Pawel Salek
  Details
content.mbox (184 bytes, text/plain)
2008-03-11 21:49 UTC, Pawel Salek
  Details
bugfix.patch (477 bytes, patch)
2008-03-13 20:36 UTC, Pawel Salek
none Details | Review

Description Pawel Salek 2008-03-11 21:43:51 UTC
Please describe the problem:
Parsing messages that contain no content-length header changed in approximately 2.2.16. It used to behave as expected. currently, the parser treats entire stream as single message if set_respect_content_length() is set.

Steps to reproduce:
1. Compile attached test program.
2. Run it on a test mailbox.
3. 


Actual results:
With current svn, only one line is printed.

Expected results:
Both From lines should be printed.

Does this happen every time?
Yes, it does.

Other information:
Comment 1 Pawel Salek 2008-03-11 21:47:50 UTC
Created attachment 107094 [details]
gmime_parser_test.c

Test program.
Comment 2 Pawel Salek 2008-03-11 21:49:38 UTC
Created attachment 107096 [details]
content.mbox

Test mbox. Expected output:
    0    89 Danny <danny@example.com>
   89   184 Barbara <barbara@example.com>
Output with current source:
    0   184 Danny <danny@example.com>
Comment 3 Jeffrey Stedfast 2008-03-12 16:12:09 UTC
hmmm, it's printing both lines for me with svn:

[fejj@tazmanian-devil gmime]$ ./test content.mbox 
    0    89 Danny <danny@example.com>
   89   184 Barbara <barbara@example.com>


note that I did have to change the test program because my gmime is built with --enable-largefile, so I had to change the printf to:

printf("%5lld %5lld %s\n", start, end, mime_message->from);

can you confirm?
Comment 4 Jeffrey Stedfast 2008-03-12 16:19:52 UTC
just rebuilt without --enable-largefile, and I get the same results
Comment 5 Pawel Salek 2008-03-13 08:20:22 UTC
I am running on x86_64, is this the same architecture you use? I use gcc-4.1.2-33 (fc8 setup). I should say there were similar issues reported on balsa-list when debian upgraded from 2.2.15 but the initial reports were rather vague.
Comment 6 Jeffrey Stedfast 2008-03-13 14:57:40 UTC
I'm on IA32, don't have access to any 64bit machines
Comment 7 Pawel Salek 2008-03-13 15:14:17 UTC
Oh, that's the catch! I can confirm 32-bit build behaves as expected. There must be some data/pointer size related error...
Comment 8 Pawel Salek 2008-03-13 20:36:19 UTC
Created attachment 107248 [details] [review]
bugfix.patch

Pretty trivial (easy to say now!) bug fix.
Comment 9 Jeffrey Stedfast 2008-03-13 21:09:07 UTC
thanks! committed to svn, will try to make a release soon.