GNOME Bugzilla – Bug 656650
Discard request chunks, if application takes care of resending request data incase of failures.
Last modified: 2011-08-17 14:23:40 UTC
Created attachment 193935 [details] [review] As per Mr. Dan Winship's suggestion, added a resend flag to inform libsoup that app takes care of resending request. If the resend flag is set to FALSE, then libsoup can discard the request chunks. We are using Libsoup for an Application, that is capable of sending and receiving mails. The issue is that though the huge mail data is sent in the form of chunks, libsoup consumes more memory. The reason being that, as per the link "http://mail.gnome.org/archives/commits-list/2009-July/msg07959.html", the libsoup doesn't discard the request body till the request is completely sent, even if accumulate flag is set to FALSE. But, while sending huge size of data to the Network, this results in high memory consumption. If the application takes care of resending the data in case of failure, then libsoup can discard the request chunks.
Oops, I'd already written most of a patch for this before you filed the bug. It's now committed to master (but not libsoup 2.35.5 / GNOME 3.1.5). The following fix has been pushed: f8e0491 Add SOUP_MESSAGE_CAN_REBUILD, for regeneratable streamed request bodies
Created attachment 193944 [details] [review] Add SOUP_MESSAGE_CAN_REBUILD, for regeneratable streamed request bodies Long ago, soup_message_body_set_accumulate() was made into a no-op on request bodies, because otherwise there would be no body available to send if the request was restarted. Add a SOUP_MESSAGE_CAN_REBUILD flag, that indicates that the caller takes responsibility for handling this, and properly discard chunks if that is set. Also update chunk-test to test this, and (finally!) remove the FIXME there, since we are now testing the !accumulate codepath again properly.
Thanks for your patch. Please let us know, when the next version can be released, so that we can plan for our libsoup upgrade.
GNOME 3.1.90 will be released next Wednesday. The stable release (GNOME 3.2, with libsoup 2.36.0) will be September 28.