WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 94515
[Soup] utilize multipart/x-mixed-replace support recently added to libsoup
https://bugs.webkit.org/show_bug.cgi?id=94515
Summary
[Soup] utilize multipart/x-mixed-replace support recently added to libsoup
Gustavo Noronha (kov)
Reported
2012-08-20 12:41:14 PDT
[Soup] utilize multipart/x-mixed-replace support recently added to libsoup
Attachments
Patch
(16.78 KB, patch)
2012-08-20 13:12 PDT
,
Gustavo Noronha (kov)
no flags
Details
Formatted Diff
Diff
Patch
(17.70 KB, patch)
2012-08-20 15:01 PDT
,
Gustavo Noronha (kov)
no flags
Details
Formatted Diff
Diff
Patch
(20.59 KB, patch)
2012-09-26 12:25 PDT
,
Jussi Kukkonen (jku)
no flags
Details
Formatted Diff
Diff
An even more up-to-date rebase
(20.54 KB, patch)
2012-09-26 12:41 PDT
,
Jussi Kukkonen (jku)
no flags
Details
Formatted Diff
Diff
Patch
(62.08 KB, patch)
2012-10-10 10:23 PDT
,
Gustavo Noronha (kov)
no flags
Details
Formatted Diff
Diff
Patch
(62.12 KB, patch)
2012-10-10 10:45 PDT
,
Gustavo Noronha (kov)
no flags
Details
Formatted Diff
Diff
Patch
(63.17 KB, patch)
2012-10-17 12:18 PDT
,
Gustavo Noronha (kov)
mrobinson
: review+
Details
Formatted Diff
Diff
Show Obsolete
(6)
View All
Add attachment
proposed patch, testcase, etc.
Gustavo Noronha (kov)
Comment 1
2012-08-20 13:12:15 PDT
Created
attachment 159498
[details]
Patch
Martin Robinson
Comment 2
2012-08-20 13:25:02 PDT
Comment on
attachment 159498
[details]
Patch Can we unskip some tests now?
Gyuyoung Kim
Comment 3
2012-08-20 14:05:03 PDT
Comment on
attachment 159498
[details]
Patch
Attachment 159498
[details]
did not pass efl-ews (efl): Output:
http://queues.webkit.org/results/13543462
Dan Winship
Comment 4
2012-08-20 14:37:11 PDT
Comment on
attachment 159498
[details]
Patch
>+LIBSOUP_REQUIRED_VERSION=2.39.6
you should go for 2.39.90 actually, which just now exists
Gustavo Noronha (kov)
Comment 5
2012-08-20 14:53:27 PDT
(In reply to
comment #2
)
> (From update of
attachment 159498
[details]
) > Can we unskip some tests now?
Yes, the patch already unskips them =)
Gustavo Noronha (kov)
Comment 6
2012-08-20 15:01:12 PDT
Created
attachment 159529
[details]
Patch
Martin Robinson
Comment 7
2012-09-21 10:57:03 PDT
Comment on
attachment 159529
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=159529&action=review
Great stuff! I just see a few small nits. Holding off on the r+ until I understand the changes the skipped file
> Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:414 > +static void nextPartCallback(GObject* source, GAsyncResult* res, gpointer data)
Nit: res -> result
> Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:439 > + if (!d->m_inputStream) { > + client->didFinishLoading(handle.get(), 0); > + g_input_stream_close_async(G_INPUT_STREAM(d->m_multipartInputStream.get()), G_PRIORITY_DEFAULT, 0, closeCallback, handle.get()); > + return; > + } > +
Another nit: the indentation looks a bit off here.
> Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:442 > + d->m_response.updateFromSoupMessageHeaders(const_cast<SoupMessageHeaders*>(soup_multipart_input_stream_get_headers(d->m_multipartInputStream.get())));
Instead of casting here, it makes sense to have updateFromSoupMessageHeaders accept a const.
> Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:516 > +
Nit: extra line here.
> LayoutTests/platform/gtk/TestExpectations:1060 > +BUGWKGTK : http/tests/multipart/invalid-image-data.html = TEXT > +BUGWKGTK : http/tests/multipart/load-last-non-html-frame.php = TEXT > +BUGWKGTK : http/tests/multipart/multipart-replace-non-html-content.php = PASS > +BUGWKGTK : http/tests/multipart/policy-ignore-crash.php = PASS > +BUGWKGTK : http/tests/multipart/multipart-wait-before-boundary.html = PASS > +BUGWKGTK : http/tests/multipart/stop-crash.html = PASS
Why can't we unskip these tests now?
Jussi Kukkonen (jku)
Comment 8
2012-09-26 12:23:02 PDT
We agreed with kov that I could add EFL expectation changes to the patch (as efl uses libsoup as well) and rebase it. I did that but I ran into some problems: First,
bug 97565
crashes most of the EFL tests that cover this so I'll have to keep them in TestExpectations Second, invalid-image-data.html and invalid-image-data-standalone.html still don't work (at least on EFL): there is no green image. Shouldn't this patch fix them? I'll still upload my patch just in case it's useful for kov. Changes from kovs last patch: * rebased * updated jhbuilds to use soup 2.40 (stable release from three days ago) * fixed nits from mrobinson (though see below) * the const_cast still has to be done because of soup api but now it happens in updateFromSoupMessageHeaders * modified efl TestExpectations/Skipped I did not touch the gtk TestExpectations as I didn't understand what it meant, so those are still in the old format.
Jussi Kukkonen (jku)
Comment 9
2012-09-26 12:25:56 PDT
Created
attachment 165852
[details]
Patch
Jussi Kukkonen (jku)
Comment 10
2012-09-26 12:41:43 PDT
Created
attachment 165855
[details]
An even more up-to-date rebase
WebKit Review Bot
Comment 11
2012-09-26 12:46:09 PDT
Attachment 165855
[details]
did not pass style-queue: WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. WARNING: Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. LayoutTests/platform/gtk/TestExpectations:1111: use "#" instead of "//" for comments [test/expectations] [5] LayoutTests/platform/gtk/TestExpectations:1112: unrecognized old-style bug identifier "BUGWKGTK" [test/expectations] [5] LayoutTests/platform/gtk/TestExpectations:1113: unrecognized old-style bug identifier "BUGWKGTK" [test/expectations] [5] LayoutTests/platform/gtk/TestExpectations:1114: unrecognized old-style bug identifier "BUGFailed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'ChangeLog', u'LayoutTests/ChangeLog', u'La..." exit_code: 1 WKGTK" [test/expectations] [5] LayoutTests/platform/gtk/TestExpectations:1115: unrecognized old-style bug identifier "BUGWKGTK" [test/expectations] [5] LayoutTests/platform/gtk/TestExpectations:1116: unrecognized old-style bug identifier "BUGWKGTK" [test/expectations] [5] LayoutTests/platform/gtk/TestExpectations:1117: unrecognized old-style bug identifier "BUGWKGTK" [test/expectations] [5] Total errors found: 7 in 13 files If any of these errors are false positives, please file a bug against check-webkit-style.
Jussi Kukkonen (jku)
Comment 12
2012-09-27 01:18:01 PDT
(In reply to
comment #8
)
> Second, invalid-image-data.html and invalid-image-data-standalone.html still don't work (at least on EFL): there is no green image. Shouldn't this patch fix them?
Actually, invalid-image-data-standalone.html does work with the patch on EFL. For some reason invalid-image-data.html does not: there is no green box, not even the outline is there.
Jussi Kukkonen (jku)
Comment 13
2012-09-27 01:56:48 PDT
***
Bug 97664
has been marked as a duplicate of this bug. ***
Carlos Garcia Campos
Comment 14
2012-09-27 07:05:32 PDT
Comment on
attachment 165855
[details]
An even more up-to-date rebase View in context:
https://bugs.webkit.org/attachment.cgi?id=165855&action=review
> Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:1020 > + d->m_inputStream.leakRef();
Why do we need to leak this ref here?
Jussi Kukkonen (jku)
Comment 15
2012-09-27 07:11:58 PDT
(In reply to
comment #8
)
> First,
bug 97565
crashes most of the EFL tests that cover this so I'll have to keep them in TestExpectations
The patch in
bug 97565
has allowed me to test this, and the tests do indeed avoid crashing and actually pass with the patch from this bug and that one: The only problem in EFL after that is invalid-image-data.html. I'm continuing the investigation on that.
Jussi Kukkonen (jku)
Comment 16
2012-10-05 04:49:39 PDT
Comment on
attachment 165855
[details]
An even more up-to-date rebase View in context:
https://bugs.webkit.org/attachment.cgi?id=165855&action=review
> Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:-449 > - d->m_inputStream = adoptGRef(in);
This seems to leak 'in' later on in some cases? There are a couple of possible function exit points before 'd->m_inputStream = adoptGRef(in)' is now called.
Zan Dobersek
Comment 17
2012-10-05 12:38:33 PDT
***
Bug 30845
has been marked as a duplicate of this bug. ***
Gustavo Noronha (kov)
Comment 18
2012-10-10 10:23:55 PDT
Created
attachment 168025
[details]
Patch
Gustavo Noronha (kov)
Comment 19
2012-10-10 10:30:55 PDT
(In reply to
comment #7
)
> > Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:414 > > +static void nextPartCallback(GObject* source, GAsyncResult* res, gpointer data) > > Nit: res -> result
Oops, forgot this one.
> Another nit: the indentation looks a bit off here.
Fixed, the style checker is happy now =)
> > LayoutTests/platform/gtk/TestExpectations:1060 > > +BUGWKGTK : http/tests/multipart/invalid-image-data.html = TEXT > > +BUGWKGTK : http/tests/multipart/load-last-non-html-frame.php = TEXT > > +BUGWKGTK : http/tests/multipart/multipart-replace-non-html-content.php = PASS > > +BUGWKGTK : http/tests/multipart/policy-ignore-crash.php = PASS > > +BUGWKGTK : http/tests/multipart/multipart-wait-before-boundary.html = PASS > > +BUGWKGTK : http/tests/multipart/stop-crash.html = PASS > > Why can't we unskip these tests now?
I reviewed all tests, the two that I had marked as not passing above are still failing, and one is timing out. The one that's timing out and invalid-image-data.html will require more investigation, I could not understand why they are broken yet, I'd like to investigate that in a separate ticket if that's OK with you. The third one, http/tests/multipart/load-last-non-html-frame.php, fails because of a bug in soup's handling of the termination boundary marker, I have a patch up in bugzilla, we will be able to unskip after it's in:
http://bugzilla.gnome.org/show_bug.cgi?id=685752
Gustavo Noronha (kov)
Comment 20
2012-10-10 10:31:45 PDT
(In reply to
comment #14
)
> > Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:1020 > > + d->m_inputStream.leakRef(); > > Why do we need to leak this ref here?
That was a mistake, the intention was to .clear() it, fixed!
Gustavo Noronha (kov)
Comment 21
2012-10-10 10:36:43 PDT
(In reply to
comment #16
)
> > Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:-449 > > - d->m_inputStream = adoptGRef(in); > > This seems to leak 'in' later on in some cases? There are a couple of possible function exit points before 'd->m_inputStream = adoptGRef(in)' is now called.
I made in a GRefPtr itself, that should deal with this.
Martin Robinson
Comment 22
2012-10-10 10:43:55 PDT
Comment on
attachment 168025
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=168025&action=review
Looks good, but I have a remaining question about when you close the multipart input stream.
> Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:378 > + d->m_soupRequest.clear(); > + > + d->m_inputStream.clear(); > > - if (d->m_inputStream) > - d->m_inputStream.clear(); > + d->m_multipartInputStream.clear(); > > d->m_cancellable.clear();
Extreme nit here, but removing the newlines in between these .clear() statements would make this easier for me to read.
> Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:422 > +static void nextPartCallback(GObject* source, GAsyncResult* result, gpointer data)
Perhaps make the name even more explicit: nextMultipartMessagePartCallback?
> Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:435 > + d->m_inputStream = adoptGRef(soup_multipart_input_stream_next_part_finish(d->m_multipartInputStream.get(), result, &error.outPtr()));
I think it makes sense to add ASSERT(!d->m_inputStream); before this line
> Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:439 > + if (error) { > + client->didFail(handle.get(), ResourceError::httpError(d->m_soupMessage.get(), error.get(), d->m_soupRequest.get())); > + cleanupSoupRequestOperation(handle.get()); > + return;
It's okay not to close m_multipartInputStream in this case?
> Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:457 > + if (d->m_cancelled || !client) { > + cleanupSoupRequestOperation(handle.get()); > + return; > + }
Ditto.
> Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:482 > + GRefPtr<GInputStream> in = adoptGRef(soup_request_send_finish(d->m_soupRequest.get(), res, &error.outPtr()));
in -> inputStream perhaps?
Gustavo Noronha (kov)
Comment 23
2012-10-10 10:45:47 PDT
Created
attachment 168030
[details]
Patch
Carlos Garcia Campos
Comment 24
2012-10-11 00:30:24 PDT
Comment on
attachment 168030
[details]
Patch LGTM, but Martin already reviewed it so I'll wait for him to give the final r+
Jussi Kukkonen (jku)
Comment 25
2012-10-11 07:44:29 PDT
Comment on
attachment 168030
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=168030&action=review
> Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:442 > + if (!d->m_inputStream) {
Testing on EFL (WK2), this never seems to be true. At least multipart-html.php just keeps printing "Downloading: /tmp/multipart-html.php" over and over.
Gustavo Noronha (kov)
Comment 26
2012-10-15 05:54:06 PDT
Jussi, do you mind testing with this soup patch? Thanks everyone for the reviews!
https://bugzilla.gnome.org/show_bug.cgi?id=685752
Gustavo Noronha (kov)
Comment 27
2012-10-17 12:18:10 PDT
Created
attachment 169232
[details]
Patch
Jussi Kukkonen (jku)
Comment 28
2012-10-18 03:24:12 PDT
(In reply to
comment #26
)
> Jussi, do you mind testing with this soup patch? Thanks everyone for the reviews!
https://bugzilla.gnome.org/show_bug.cgi?id=685752
Oh, did not notice this on monday... I still see an apparently endless loop in multipart-html.php on current EFL port with this patch, using libsoup 2d939779 (Be more aggressive when looking for the termination boundary). I'm happy to debug this but not entirely sure where to look (let's discuss on IRC if you have hints).
Jussi Kukkonen (jku)
Comment 29
2012-10-18 05:21:06 PDT
Just checked the Gtk result, and that does indeed work here. It's just EFL that's failing. This is multipart-html.php result page: --- Error! Code: 102 Description: Frame load was interrupted URL:
http://localhost/multipart/multipart-html.php
--- (before that it does print the "This text should only appear once N" text with N up to 8 or so) At the same time console keeps printing "Downloading: /tmp/multipart-html.php"
Jussi Kukkonen (jku)
Comment 30
2012-10-18 05:28:46 PDT
...and now I notice that that specific test is marked as expected to time out on GTK as well. Maybe the GTK MiniBrowser just does not report the weird error case ?
Gustavo Noronha (kov)
Comment 31
2012-10-18 06:50:01 PDT
(In reply to
comment #30
)
> ...and now I notice that that specific test is marked as expected to time out on GTK as well. Maybe the GTK MiniBrowser just does not report the weird error case ?
Yeah, the problem only happens on wk2, unsure why right now, in wkgtk it does pass. Are you testing on wk2 efl?
Jussi Kukkonen (jku)
Comment 32
2012-10-26 03:56:14 PDT
(In reply to
comment #31
)
> (In reply to
comment #30
) > > ...and now I notice that that specific test is marked as expected to time out on GTK as well. Maybe the GTK MiniBrowser just does not report the weird error case ? > > Yeah, the problem only happens on wk2, unsure why right now, in wkgtk it does pass. Are you testing on wk2 efl?
Sorry, forgot this. Yes, testing on WK2. If the tests are expected to timeout because of other reasons, then we can handle those later in other bugs: I was just under the impression that I was seeing different results on efl than on gtk but that does not seem to be the case. Also, I can update the efl expectations after this lands.
Martin Robinson
Comment 33
2012-12-09 03:24:07 PST
***
Bug 54251
has been marked as a duplicate of this bug. ***
Martin Robinson
Comment 34
2012-12-09 04:36:36 PST
Comment on
attachment 169232
[details]
Patch Let's do this!
Gustavo Noronha (kov)
Comment 35
2012-12-10 07:06:41 PST
Committed
r137150
: <
http://trac.webkit.org/changeset/137150
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug