Changeset 146922 in webkit


Ignore:
Timestamp:
Mar 26, 2013 1:04:25 PM (11 years ago)
Author:
commit-queue@webkit.org
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 <jmason@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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r146918 r146922  
     12013-03-26  Joe Mason  <jmason@blackberry.com>
     2
     3        [BlackBerry] In RSSFilterStream, don't swallow headers when there's no body
     4        https://bugs.webkit.org/show_bug.cgi?id=113334
     5
     6        Reviewed by Rob Buis.
     7
     8        RIM PR 316345
     9
     10        When receiving an HTTP response that has a Content-Type header such as text/xml, but no
     11        body, RSSFilterStream::notifyHeadersReceived reads the Content-Type as "potential RSS", and
     12        calls saveHeaders. It expects to sniff the body in notifyDataReceived to see if it's RSS,
     13        and then call sendSavedHeaders to pass on the headers. But since there is no body,
     14        notifyDataReceived is never called. So call sendSavedHeaders in notifyClose too (it will not
     15        send them again if they were already sent.)
     16
     17        * platform/network/blackberry/rss/RSSFilterStream.cpp:
     18        (WebCore::RSSFilterStream::notifyClose):
     19
    1202013-03-26  Dmitry Zvorygin  <zvorygin@chromium.org>
    221
  • trunk/Source/WebCore/platform/network/blackberry/rss/RSSFilterStream.cpp

    r138218 r146922  
    502502void RSSFilterStream::notifyClose(int status)
    503503{
     504    // If there was no data, we might get here with the type still unknown. No data at all -> no RSS
     505    // data.
     506    if (m_resourceType == TypeUnknown)
     507        m_resourceType = TypeNotRSS;
     508
    504509    if (isRSSContent(m_resourceType))
    505510        handleRSSContent();
    506     else
     511    else {
     512        sendSavedHeaders();
    507513        FilterStream::notifyClose(status);
     514    }
    508515}
    509516
Note: See TracChangeset for help on using the changeset viewer.