Re: Query about the content-length value while content-encoding is set to gZip..
- From: Dan Winship <danw gnome org>
- To: sukanya c <sukanya mc gmail com>
- Cc: libsoup-list gnome org
- Subject: Re: Query about the content-length value while content-encoding is set to gZip..
- Date: Tue, 22 Nov 2011 11:08:14 -0500
On 11/22/2011 05:32 AM, sukanya c wrote:
> The issue is When the response is received in the form of chunks, it is
> difficult to predict the response content size much before all the
> chunks received. This requires the application to allocate & reallocate
> memory to copy each response chunk .
You don't need to gather the response body yourself; you can just read
it out of msg->response_body.data after the message has completed.
got-chunk is generally intended for if you are processing each chunk as
it arrives, and don't care about having the data all in one place at the
end.
> Why not Libsoup set the Content-length with the resulting size of
> decompressed content?
In the general case, there is no way for it to know that, although for
gzip coding in particular, the uncompressed length is stored in the gzip
header, so it would be possible to expose that information after it has
read the first chunk... we could add new API for that if you needed it.
If so, file a bug at bugzilla.gnome.org requesting that please.
-- Dan
[
Date Prev][Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]