Title: [146922] trunk/Source/WebCore
Revision
146922
Author
commit-qu...@webkit.org
Date
2013-03-26 13:04:25 -0700 (Tue, 26 Mar 2013)

Log Message

[BlackBerry] In RSSFilterStream, don't swallow headers when there's no body
https://bugs.webkit.org/show_bug.cgi?id=113334

Patch by Joe Mason <jma...@blackberry.com> on 2013-03-26
Reviewed by Rob Buis.

RIM PR 316345

When receiving an HTTP response that has a Content-Type header such as text/xml, but no
body, RSSFilterStream::notifyHeadersReceived reads the Content-Type as "potential RSS", and
calls saveHeaders. It expects to sniff the body in notifyDataReceived to see if it's RSS,
and then call sendSavedHeaders to pass on the headers. But since there is no body,
notifyDataReceived is never called. So call sendSavedHeaders in notifyClose too (it will not
send them again if they were already sent.)

* platform/network/blackberry/rss/RSSFilterStream.cpp:
(WebCore::RSSFilterStream::notifyClose):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (146921 => 146922)


--- trunk/Source/WebCore/ChangeLog	2013-03-26 19:48:34 UTC (rev 146921)
+++ trunk/Source/WebCore/ChangeLog	2013-03-26 20:04:25 UTC (rev 146922)
@@ -1,3 +1,22 @@
+2013-03-26  Joe Mason  <jma...@blackberry.com>
+
+        [BlackBerry] In RSSFilterStream, don't swallow headers when there's no body
+        https://bugs.webkit.org/show_bug.cgi?id=113334
+
+        Reviewed by Rob Buis.
+
+        RIM PR 316345
+
+        When receiving an HTTP response that has a Content-Type header such as text/xml, but no
+        body, RSSFilterStream::notifyHeadersReceived reads the Content-Type as "potential RSS", and
+        calls saveHeaders. It expects to sniff the body in notifyDataReceived to see if it's RSS,
+        and then call sendSavedHeaders to pass on the headers. But since there is no body,
+        notifyDataReceived is never called. So call sendSavedHeaders in notifyClose too (it will not
+        send them again if they were already sent.)
+
+        * platform/network/blackberry/rss/RSSFilterStream.cpp:
+        (WebCore::RSSFilterStream::notifyClose):
+
 2013-03-26  Dmitry Zvorygin  <zvory...@chromium.org>
 
         Web Inspector: Faster drawer animation.

Modified: trunk/Source/WebCore/platform/network/blackberry/rss/RSSFilterStream.cpp (146921 => 146922)


--- trunk/Source/WebCore/platform/network/blackberry/rss/RSSFilterStream.cpp	2013-03-26 19:48:34 UTC (rev 146921)
+++ trunk/Source/WebCore/platform/network/blackberry/rss/RSSFilterStream.cpp	2013-03-26 20:04:25 UTC (rev 146922)
@@ -501,10 +501,17 @@
 
 void RSSFilterStream::notifyClose(int status)
 {
+    // If there was no data, we might get here with the type still unknown. No data at all -> no RSS
+    // data.
+    if (m_resourceType == TypeUnknown)
+        m_resourceType = TypeNotRSS;
+
     if (isRSSContent(m_resourceType))
         handleRSSContent();
-    else
+    else {
+        sendSavedHeaders();
         FilterStream::notifyClose(status);
+    }
 }
 
 bool RSSFilterStream::convertContentToHtml(std::string& result)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to