Bug 2033 - [PATCH] chunked download (fix for slow connection vs long messages)
Summary: [PATCH] chunked download (fix for slow connection vs long messages)
Status: RESOLVED LATER
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: Folders/IMAP (show other bugs)
Version: other
Hardware: PC Linux
: P3 normal
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2009-10-31 22:27 UTC by Jindrich Makovicka
Modified: 2012-09-12 11:37 UTC (History)
0 users

See Also:


Attachments
Split the message download into 256kB chunks (2.31 KB, patch)
2009-10-31 22:27 UTC, Jindrich Makovicka
no flags Details | Diff
Split the message download into 256kB chunks (2.32 KB, patch)
2009-10-31 22:31 UTC, Jindrich Makovicka
no flags Details | Diff

Description Jindrich Makovicka 2009-10-31 22:27:15 UTC
Created attachment 744 [details]
Split the message download into 256kB chunks

When trying to download a multi-megabyte message over very slow line (eg. GPRS), some IMAP servers (observed on GMail) drop the connection if the request takes too long. The attached patch modifies the IMAP backend so it downloads the message in 256 kilobyte chunks, which allows fetching large messages over these lines, and should not introduce a noticeable overhead.

With some more coding, it could also allow resuming broken downloads of large messages if the connection drops, but I didn't implement this yet, as just the above patch solved my problem now.
Comment 1 Jindrich Makovicka 2009-10-31 22:31:11 UTC
Created attachment 745 [details]
Split the message download into 256kB chunks
Comment 2 Colin Leroy 2011-01-28 16:10:04 UTC
Hi,

Thanks for the patch. Do all IMAP servers support that?
Comment 3 Ricardo Mones 2011-01-28 16:23:18 UTC
Seems that not all servers do because they're not required to.
I'd make the size configurable (hidden option maybe) with a default value of 0 meaning not to chunk anything and greater than zero meaning the Kb chunk size.

See: http://kb.mozillazine.org/Entire_message_fetched_when_opening_a_IMAP_message

regards,
Comment 4 Colin Leroy 2011-01-28 17:10:23 UTC
I'd rather be in favor of something that disables chunked download automatically if it fails...
Comment 5 Ricardo Mones 2011-01-28 19:36:09 UTC
That could be too, but then the result of the test should be saved in the account properties, so it's never retried when failed.

IMO is a waste of time to retry chunked download if we already know the server doesn't support it and IMAP is already slow enough, doesn't need more delays :)
Comment 6 Colin Leroy 2011-01-28 20:48:25 UTC
Yep, that would be nicer.
Comment 7 Colin Leroy 2012-09-12 11:37:17 UTC
This could be a nice addition if the patch was more complete like described in comments 4 and 5. Also, it's strange that mmap_string_unref() is replaced by free() in the patch.

Note You need to log in before you can comment on or make changes to this bug.