]
Nick Belaevski reassigned RF-8079:
----------------------------------
Assignee: Nick Belaevski
File Upload Control intermittently fails
----------------------------------------
Key: RF-8079
URL:
https://jira.jboss.org/jira/browse/RF-8079
Project: RichFaces
Issue Type: Bug
Components: component-input
Affects Versions: 3.3.2.SR1
Environment: linux, tomcat 6, myfaces 1.2.6, richfaces 3.3.2 SR1, mysql 5.0
Reporter: James Goodfellow
Assignee: Nick Belaevski
We started using the richfaces file upload control in our web server
(tomcat/myfaces/richfaces). Once deployed we had complaints from our users (especially
those with slow connections) that the file upload didn't complete. I found it
difficult to reproduce when running the webserver locally but it did happen occasionally.
After debugging I determined that the upload failed to complete because the
"fileUploadListener" handler was not being called some of the time. Further, I
found that in the cases where the "fileUploadListener" wasn't called, the
MultipartRequest indicated that it did not have the "javax.faces.ViewState"
request parameter. I verified from the client that the "javax.faces.ViewState"
parameter was in the multipart content so this lead me to believe that the problem was in
the parsing of that content. I have determined that the problem is in the way the parsing
uses the read buffer. If the input stream returns content that ends on a parameter
boundary, that parameter can get missed. It is also the case that bytes are being checked
in the read buffer beyond the end index which can lead to unknown results. It would be
very difficult to give a test case because the problem is intermittent. The problems I
found are in org.ajax4jsf.request.MultipartRequest. Here is an example:
private Param readHeader() throws IOException {
...
for (int i = this.pos; i < localRead; i++) {
...
if (checkSequence(buffer, i + CR_LF.length,
CR_LF)) {
In this case "i" can be up to "localRead - 1" where the checkSequence
method accesses "localRead + 1" and "localRead + 2" positions of the
read buffer which are beyond the boundary of localRead.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: