Bug 28312

Summary: [CURL] Crash in download handler for local files
Product: WebKit Reporter: Brent Fulgham <bfulgham>
Component: WebCore Misc.Assignee: Brent Fulgham <bfulgham>
Status: RESOLVED FIXED    
Severity: Normal Keywords: Curl
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
Attachments:
Description Flags
Correct crash due to improper handling of local files. kevino: review+

Brent Fulgham
Reported 2009-08-14 12:39:14 PDT
When the CURL backend handle the 'download' of a local file, it does not perform the normal header processing for data received over the network. This means that the URL is not set properly, and the 'didReceiveResponse' processing is never performed. This was the cause of an earlier bug in the write callback, as evidenced by the following comment: // since the code in headerCallback will not have run for local files // the code to set the URL and fire didReceiveResponse is never run, // which means the ResourceLoader's response does not contain the URL. // Run the code here for local files to resolve the issue. // TODO: See if there is a better approach for handling this. I have resolved the current error in the same fashion, by dealing with this special case and manually firing the 'didReceiveResponse'. This specialized handling is now in its own function which cleans things up a bit. The current bug was demonstrated by LayoutTests/fast/encoding/char-encoding-mac.html.
Attachments
Correct crash due to improper handling of local files. (3.69 KB, patch)
2009-08-14 12:45 PDT, Brent Fulgham
kevino: review+
Brent Fulgham
Comment 1 2009-08-14 12:45:49 PDT
Created attachment 34868 [details] Correct crash due to improper handling of local files.
Brent Fulgham
Comment 2 2009-08-14 13:16:33 PDT
The problem here is actually in the POST handler. The proper fix seems to be to add the 'didReceiveResponse' to the readCallback handler.
Brent Fulgham
Comment 3 2009-08-14 15:02:48 PDT
Further testing indicates the original patch actually was correct.
Brent Fulgham
Comment 4 2009-08-14 16:09:10 PDT
Note You need to log in before you can comment on or make changes to this bug.