Closed Bug 394992 Opened 18 years ago Closed 9 years ago

0 byte downloads don't actually get created

Categories

(Core Graveyard :: Embedding: APIs, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: Mardak, Unassigned)

References

Details

Attachments

(2 files)

From bug 394615, which works around this issue in the UI.. It seems like WebBrowserPersist isn't creating an empty file for 0 byte downloads possibly because it doesn't bother setting data->mStream until it gets an OnDataAvailable. Perhaps the if block.. if (!data->mStream) // Make the output stream can be moved to the end of OnStartRequest?? And hopefully it'll create the file and leave it at 0 with no Write calls. http://mxr.mozilla.org/mozilla/source/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp#830
> can be moved to the end of OnStartRequest? Seems reasonable. Want to post a patch?
Keywords: helpwanted
Attached image screenshot of v1
Here's a picture of it successfully creating a 0byte file. Testcase would just be to download a 0 byte file similar to litmus testcase for bug 394615.
Assignee: nobody → edilee
Status: NEW → ASSIGNED
Attached patch v1Splinter Review
Create the out stream data->mStream once at OnStart instead of checking if it should be created each time OnData.
Attachment #282958 - Flags: superreview?(cbiesinger)
Attachment #282958 - Flags: review?(cbiesinger)
Keywords: helpwanted
biesi: Just making sure I assumed correctly... no need to send status changes from OnStart?
I'm actually just going to use the testcase in http://litmus.mozilla.org/show_test.cgi?id=4631 for this, too, since it explicitly asks the tester to check that the file is both saved to disk _and_ correctly appears in the download manager, and so it'll cover this bug as well. in-litmus+, for that.
Flags: in-litmus? → in-litmus+
Flags: in-testsuite?
biesi - any update on the review for this?
Assignee: edilee → nobody
Attachment #282958 - Flags: superreview?(cbiesinger)
Attachment #282958 - Flags: review?(cbiesinger)
Status: ASSIGNED → NEW
Marking a bunch of bugs in the "Embedding: APIs" component INCOMPLETE in preparation to archive that component. If I have done this incorrectly, please reopen the bugs and move them to a more correct component as we don't have "embedding" APIs any more.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → INCOMPLETE
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: