Closed
Bug 315767
Opened 19 years ago
Closed 18 years ago
Submission of large files using multipart-post doesn't work
Categories
(Core Graveyard :: XForms, defect)
Core Graveyard
XForms
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: jhpedemonte, Assigned: jhpedemonte)
References
()
Details
(Keywords: fixed1.8.0.4, fixed1.8.1)
Attachments
(3 files, 1 obsolete file)
The testcase (https://bugzilla.mozilla.org/attachment.cgi?id=197763) fails when trying to submit a large file. For me, it works fine when attaching a file with size 28K. But when trying to submit a file of size 100K, I see the appropriate network messages on the status bar (that it is communicating with the destination server), but the echo.sh page never loads.
Comment 1•19 years ago
|
||
(In reply to comment #0) > The testcase (https://bugzilla.mozilla.org/attachment.cgi?id=197763) fails when > trying to submit a large file. For me, it works fine when attaching a file > with size 28K. But when trying to submit a file of size 100K, I see the > appropriate network messages on the status bar (that it is communicating with > the destination server), but the echo.sh page never loads. > Stupid question: It's not just a limit on echo.sh? (I haven't tested myself)
Assignee | ||
Comment 2•19 years ago
|
||
Doesn't seem to be a problem with the server. We created an HTML testcase, using HTML file submission, and that one worked fine. Debugging a little more, it looks like the file input stream is returning NS_BASE_STREAM_WOULD_BLOCK at some point. No idea why, yet. CCing Darin, since he wrote some of the submission code and might be able to help.
Assignee | ||
Comment 3•18 years ago
|
||
So we get status == NS_BASE_STREAM_WOULD_BLOCK in nsXFormsSubmissionElement::OnStopRequest(), which is called because we set the notification callbacks to this class object at the bottom of nsXFormsSubmissionElement::SendData(). The listener is set as the output end of an nsIPipe, whose docs explain that a non-blocking stream will return NS_BASE_STREAM_WOULD_BLOCK if more input can't be read without blocking the thread. Creating the pipe with the output set to blocking won't work, since this blocks the thread indefinitely. Reading the nsIPipe docs, I'm guessing that we need to use an nsIAsyncOutputStream, and use AsyncWait to get the remainder of the data.
Assignee | ||
Comment 4•18 years ago
|
||
Log of HTTP submit and response, using large file (~150K). As you can see, response is cut off.
Assignee | ||
Comment 5•18 years ago
|
||
NSPR log of Http:5 of same failure case.
Comment 6•18 years ago
|
||
This should work. The problem is that we were passing 0 for the segmentSize of the pipe, which causes the pipe to use its default configuration, ignoring the value of maxSize passed to it. The real fix to this bug is to change NS_NewPipe to honor maxSize even when segmentSize is 0.
Assignee | ||
Comment 7•18 years ago
|
||
Comment on attachment 214573 [details] [diff] [review] v1 patch Sweet, works for me. However, I did notice that the throbber was not doing its thing when awaiting the response. Since I am testing with a large file, it took a while to submit and get the response. But the only indication that any waiting was taking place came from looking at the status bar. It would be nice if the throbber also showed progress.
Attachment #214573 -
Flags: review+
Comment 8•18 years ago
|
||
Hmm.. not sure why the throbber wouldn't spin. If the progress bar is moving, then the throbber should as well. That's really odd.
Assignee | ||
Comment 9•18 years ago
|
||
Sorry, should have been more specific. There is no progress bar, but I do see the "Transferring from..." text in the status bar.
Comment 10•18 years ago
|
||
Ah, ok. That still seems wierd. Afterall, we hook up the document's loadgroup to the channel used for submission, and that should be sufficient to drive the proper progress notifications.
Comment 11•18 years ago
|
||
I believe we only do the throbber/progress bar stuff if we have a channel with LOAD_DOCUMENT_URI In the loadgroup, or something like that...
Assignee | ||
Comment 12•18 years ago
|
||
Sweet! Adding the LOAD_DOCUMENT_URI flag made the throbber work. Here's that patch, with Darin's fix.
Attachment #214573 -
Attachment is obsolete: true
Attachment #214679 -
Flags: review?(darin)
Updated•18 years ago
|
Attachment #214679 -
Flags: review?(darin) → review+
Assignee | ||
Updated•18 years ago
|
Attachment #214679 -
Flags: review?(aaronr)
Attachment #214679 -
Flags: review?(aaronr) → review+
Assignee | ||
Comment 13•18 years ago
|
||
Checked in to trunk. -> FIXED Darin, did you already open a bug for the NS_NewPipe issue?
Comment 14•18 years ago
|
||
No, I did not. If you can do that, I'd appreciate it.
Updated•18 years ago
|
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: xf-to-branch
Updated•18 years ago
|
Keywords: fixed1.8.0.3,
fixed1.8.1
Updated•18 years ago
|
Whiteboard: xf-to-branch
Updated•8 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•