The current Curl download implementation has a few shortcomings: 1) Downloading from secure locations fails. We need to provide Curl with the path to a certificate file (.pem file). 2) Cookies are not set in the download request. We need to give Curl the path to the cookie file. 3) When a normal load is converted to a download, some of the headers from the original request is not sent (e.g. Referer, User agent).
Created attachment 206260 [details] Patch
Comment on attachment 206260 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=206260&action=review Looks good. Please address my minor comments when you land! > Source/WebCore/platform/network/curl/CurlDownload.cpp:352 > + String value = it->value; This could be a const reference to avoid a copy. > Source/WebCore/platform/network/curl/CurlDownload.cpp:353 > + String headerString(key); You convert an AtomicString to a String in 351, then make a copy here. Why not just do "String headerString(it->key);"? > Source/WebCore/platform/network/curl/CurlDownload.cpp:405 > + writeDataToFile(static_cast<char*>(data), size); Why are you casting to a char*? The function signature is "const char*".
Created attachment 207250 [details] Patch
(In reply to comment #2) Thanks for reviewing! Updated patch accordingly. > (From update of attachment 206260 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=206260&action=review > > Looks good. Please address my minor comments when you land! > > > Source/WebCore/platform/network/curl/CurlDownload.cpp:352 > > + String value = it->value; > > This could be a const reference to avoid a copy. > > > Source/WebCore/platform/network/curl/CurlDownload.cpp:353 > > + String headerString(key); > > You convert an AtomicString to a String in 351, then make a copy here. Why not just do "String headerString(it->key);"? > > > Source/WebCore/platform/network/curl/CurlDownload.cpp:405 > > + writeDataToFile(static_cast<char*>(data), size); > > Why are you casting to a char*? The function signature is "const char*".
Comment on attachment 207250 [details] Patch Nice work! r=me.
Comment on attachment 207250 [details] Patch Clearing flags on attachment: 207250 Committed r152976: <http://trac.webkit.org/changeset/152976>
All reviewed patches have been landed. Closing bug.