Changeset 28569 in webkit


Ignore:
Timestamp:
Dec 8, 2007 4:32:55 PM (16 years ago)
Author:
alp@webkit.org
Message:

2007-12-08 Kevin Ollivier <kevino@theolliviers.com>

Reviewed by Alp Toker.

http://bugs.webkit.org/show_bug.cgi?id=14651
[CURL] didReceiveResponse() only called for HTTP loads

http://bugs.webkit.org/show_bug.cgi?id=14583
[GDK] file:// relative CSS include URLs handled incorrectly

Make sure CURL sets the ResourceResponse URL and calls
didReceiveResponse for local files too.

  • platform/network/curl/ResourceHandleManager.cpp: (WebCore::writeCallback):
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r28568 r28569  
     12007-12-08  Kevin Ollivier  <kevino@theolliviers.com>
     2
     3        Reviewed by Alp Toker.
     4
     5        http://bugs.webkit.org/show_bug.cgi?id=14651
     6        [CURL] didReceiveResponse() only called for HTTP loads
     7
     8        http://bugs.webkit.org/show_bug.cgi?id=14583
     9        [GDK] file:// relative CSS include URLs handled incorrectly
     10
     11        Make sure CURL sets the ResourceResponse URL and calls
     12        didReceiveResponse for local files too.
     13
     14        * platform/network/curl/ResourceHandleManager.cpp:
     15        (WebCore::writeCallback):
     16
    1172007-12-08  Oliver Hunt  <oliver@apple.com>
    218
  • trunk/WebCore/platform/network/curl/ResourceHandleManager.cpp

    r28070 r28569  
    9595        return totalSize;
    9696
     97    // since the code in headerCallback will not have run for local files
     98    // the code to set the URL and fire didReceiveResponse is never run,
     99    // which means the ResourceLoader's response does not contain the URL.
     100    // Run the code here for local files to resolve the issue.
     101    // TODO: See if there is a better approach for handling this.
     102    if (!d->m_response.responseFired()) {
     103        const char* hdr;
     104        err = curl_easy_getinfo(h, CURLINFO_EFFECTIVE_URL, &hdr);
     105        d->m_response.setUrl(KURL(hdr));
     106        if (d->client())
     107            d->client()->didReceiveResponse(job, d->m_response);
     108        d->m_response.setResponseFired(true);
     109    }
     110
    97111    if (d->client())
    98112        d->client()->didReceiveData(job, static_cast<char*>(ptr), totalSize, 0);
     
    162176        if (client)
    163177            client->didReceiveResponse(job, d->m_response);
     178        d->m_response.setResponseFired(true);
     179
    164180    } else {
    165181        int splitPos = header.find(":");
  • trunk/WebCore/platform/network/curl/ResourceResponse.h

    r27714 r28569  
    3535public:
    3636    ResourceResponse()
    37         : ResourceResponseBase(false)
     37        : ResourceResponseBase(false),
     38          m_responseFired(false)
    3839    {
    3940    }
    4041
    4142    ResourceResponse(const KURL& url, const String& mimeType, long long expectedLength, const String& textEncodingName, const String& filename)
    42         : ResourceResponseBase(url, mimeType, expectedLength, textEncodingName, filename)
     43        : ResourceResponseBase(url, mimeType, expectedLength, textEncodingName, filename),
     44          m_responseFired(false)
    4345    {
    4446    }
     47   
     48    void setResponseFired(bool fired) { m_responseFired = fired; }
     49    bool responseFired() { return m_responseFired; }
    4550
    4651private:
     
    5055    {
    5156    }
     57   
     58    bool m_responseFired;
    5259
    5360};
Note: See TracChangeset for help on using the changeset viewer.