WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
126686
[SOUP] Partial file left on disk after a download fails or is cancelled in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=126686
Summary
[SOUP] Partial file left on disk after a download fails or is cancelled in We...
Carlos Garcia Campos
Reported
2014-01-09 02:25:19 PST
We are currently writing the downloads directly into the destination, and when a download fails or is cancelled after the destination has been decided, the partial file is left on the disk. Deleting the final file is not safe because there might be a race condition, so we can use an intermediate file like other browsers do, a file in the same directory than the target destination but with .wkdownload suffix, that is removed when the download fails or is cancelled. If the download finishes successfully the intermediate file is renamed to the final destination.
Attachments
Patch
(13.94 KB, patch)
2014-01-09 02:37 PST
,
Carlos Garcia Campos
mrobinson
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Carlos Garcia Campos
Comment 1
2014-01-09 02:37:48 PST
Created
attachment 220706
[details]
Patch
Martin Robinson
Comment 2
2014-01-09 07:04:15 PST
Comment on
attachment 220706
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=220706&action=review
> Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp:313 > +static gboolean writeNextChunkIdle(SoupMessage *message) > +{ > + soup_message_body_append(message->response_body, SOUP_MEMORY_STATIC, "chunk", 5); > + return FALSE; > +} > + > +static void writeNextChunk(SoupMessage *message)
Asterisks are in the wrong place here.
Carlos Garcia Campos
Comment 3
2014-01-09 08:04:58 PST
Committed
r161555
: <
http://trac.webkit.org/changeset/161555
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug