Summary: | [CURL] Upload doesn't work because cancel is called | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Marco Barisione <marco.barisione> | ||||
Component: | WebKitGTK | Assignee: | Marco Barisione <marco.barisione> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Major | CC: | louis | ||||
Priority: | P2 | Keywords: | Gtk | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Attachments: |
|
Description
Marco Barisione
2008-09-29 07:27:36 PDT
Created attachment 23907 [details]
Don't call cancel if the upload was successful
FormDataStream::read() returns 0 when retrieving data from the form fails, but also when there is no more data to send. This means that cancel is always called even when the data was successfully sent.
This patch prevents cancellation of a request, but still does not successfully upload the file. Here is what I tried, open rapidshare.com and try uploading a file. I observed the HTTP traffic and noticed that POST packet is not seen, i.e. nothing is posted to the server! (In reply to comment #2) > This patch prevents cancellation of a request, but still does not successfully > upload the file. > Here is what I tried, > open rapidshare.com and try uploading a file. > I observed the HTTP traffic and noticed that POST packet is not seen, i.e. > nothing is posted to the server! Really? I tried it and upload was working even before. What doesn't work is showing the page you get after you upload a file. I suspect that your problem could be a separate issue, I will test it in the next days. I merged the latest code in my code and it is able POST the contents successfully now. The problem which you mentioned that next page is not displayed, when I included the patch that is provided for this bug with the latest code the code started working fine. So I think if you merge the patch for this bug in the latest code uploading will work fine! Comment on attachment 23907 [details]
Don't call cancel if the upload was successful
Sounds reasonable. The only complain would be to always put the Vector on the stack. In the majority of code we have early exits. e.g
if (!httpBody())
return false;
return m_formDataElementIndex < m_resourceHandle()->request().httpBody()->elements().size();
but this is no hard requirement but something to keep in mind.
Okay this does not even compile because of the const, non-const mismatch. I will land a compiling version. The patch was applied. Closing this bug. |