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.
Created attachment 745 [details] Split the message download into 256kB chunks
Hi, Thanks for the patch. Do all IMAP servers support that?
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,
I'd rather be in favor of something that disables chunked download automatically if it fails...
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 :)
Yep, that would be nicer.
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.