Bug 125410 - [Soup] Send original encoded data size to didReceiveBuffer
Summary: [Soup] Send original encoded data size to didReceiveBuffer
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Gustavo Noronha (kov)
Depends on:
Reported: 2013-12-08 05:55 PST by Martin Robinson
Modified: 2013-12-10 02:04 PST (History)
5 users (show)

See Also:

Patch (5.18 KB, patch)
2013-12-08 07:07 PST, Gustavo Noronha (kov)
no flags Details | Formatted Diff | Diff
Patch (5.85 KB, patch)
2013-12-09 11:01 PST, Gustavo Noronha (kov)
mrobinson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Robinson 2013-12-08 05:55:01 PST
didReceiveBuffer/didReceiveData accepts the original (encoded) data size, but the libsoup backend is always sending the decoded data size.
Comment 1 Gustavo Noronha (kov) 2013-12-08 07:07:11 PST
Created attachment 218687 [details]
Comment 2 Dan Winship 2013-12-08 23:53:36 PST
Comment on attachment 218687 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=218687&action=review

> Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:607
> +    while (!G_IS_SEEKABLE(baseStream))
> +        baseStream = g_filter_input_stream_get_base_stream(G_FILTER_INPUT_STREAM(baseStream));

This assumes you will always eventually find a seekable stream... does this code get used for non-http requests as well? (eg, data: URIs)

Also, be sure to test that it works right with resources returned from cache
Comment 3 Gustavo Noronha (kov) 2013-12-09 05:51:30 PST
I'm going to run the tests in debug mode and test that it's working with cached resources (though I think the inspector treats those specially). I'm pretty sure the data: URIs use that code indeed, good catch!
Comment 4 Gustavo Noronha (kov) 2013-12-09 11:01:59 PST
Created attachment 218778 [details]
Comment 5 Martin Robinson 2013-12-09 11:26:49 PST
Comment on attachment 218778 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=218778&action=review

> Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:739
> +    d->m_previousPosition = handle->currentStreamPosition();
> +

Maybe try removing this...
Comment 6 Gustavo Noronha (kov) 2013-12-10 02:04:40 PST
Committed r160352: <http://trac.webkit.org/changeset/160352>