Closed
Bug 151867
Opened 22 years ago
Closed 22 years ago
file channel should implement nsIUploadChannel [was: Network should support "file://" protocol]
Categories
(Core :: Networking, defect, P3)
Tracking
()
VERIFIED
FIXED
mozilla1.2alpha
People
(Reporter: cmanske, Assigned: darin.moz)
References
Details
(Keywords: verifyme)
Attachments
(1 file)
13.90 KB,
patch
|
dougt
:
review+
alecf
:
superreview+
|
Details | Diff | Splinter Review |
Currently, nsIWebBrowserPersist has to "special case" transferring files to a
"file://" destination. Thus support should be built into networking code as
suggested by Darin. With this, standard networking
nsIWebProgressListener::onStateChange notifications will occur so we don't have to
do ugly hacks as Composer Publishing did in bug 142171.
Assignee | ||
Updated•22 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla1.1beta
Assignee | ||
Comment 1•22 years ago
|
||
not critical for moz 1.1
Summary: Network should support "file://" protocol → file channel should implement nsIUploadChannel [was: Network should support "file://" protocol]
Target Milestone: mozilla1.1beta → mozilla1.2alpha
Assignee | ||
Comment 2•22 years ago
|
||
tested this patch using netwerk/test/TestUpload
Comment 3•22 years ago
|
||
Comment on attachment 94974 [details] [diff] [review]
v1 patch
+ if (aContentLength < 0) {
+ nsresult rv = aStream->Available(&mUploadStreamLength);
+ if (NS_FAILED(rv)) return rv;
+ }
+ else
+ mUploadStreamLength = aContentLength;
This makes the assumption that all data must be present in the stream (returned
by available) when you call setUploadStream. For example, there is no read to
EOF semantics. Maybe it would be nice to say: here is a input stream - write
everything until eof.
Assignee | ||
Comment 4•22 years ago
|
||
perhaps, but this implementation follows the documentation in
nsIUploadChannel.idl to the letter (or at least that was my attempt).
Comment 5•22 years ago
|
||
Comment on attachment 94974 [details] [diff] [review]
v1 patch
maybe that should be changed. until then, i guess this is good to go.
Attachment #94974 -
Flags: review+
Comment 6•22 years ago
|
||
oh, and btw, this is really good stuff - we could build a location independent
file manager based on our channel notions.
Assignee | ||
Comment 7•22 years ago
|
||
yup :-)
Comment 8•22 years ago
|
||
Comment on attachment 94974 [details] [diff] [review]
v1 patch
sr=alecf
A few possibly irrelevant questions: does the use of mUploadStream to decide if
we're uploading or downloading prevent a channel from being both an upload and
a download stream? does that matter? (i.e. I could see composer wanting to
download a file, and then re-upload it - do they automatically get a new
channel?)
I'm sure you're all over this darin, but figured I'd ask just in case :)
Attachment #94974 -
Flags: superreview+
Assignee | ||
Comment 9•22 years ago
|
||
alec: nsIChannel only supports the notion of fetching an URL. that URL could
require an upload stream to fetch it, and the resulting document might be empty.
that is the case with uploading to a file:// URL. your listener only sees an
OnStartRequest followed by an OnStopRequest with either a success or failure
status code. if they want to later read the document, then they'd need to open
a new channel to the URL and call AsyncOpen without setting an upload stream.
so, setting the upload stream determines the kind of request. it works the same
way with FTP and HTTP.
Assignee | ||
Comment 10•22 years ago
|
||
fixed-on-trunk
dougt, alecf: thanks for the speedy reviews!!
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment 12•22 years ago
|
||
did you try running testUpload? The usage is printed:
usage: testupload.exe <url> <file-to-upload>
Comment 13•22 years ago
|
||
verified. Mozilla 1.3b Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3b)
Gecko/20030108
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•