<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>21211</bug_id>
          
          <creation_ts>2008-09-29 07:27:36 -0700</creation_ts>
          <short_desc>[CURL] Upload doesn&apos;t work because cancel is called</short_desc>
          <delta_ts>2008-10-15 13:55:02 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Gtk</keywords>
          <priority>P2</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Marco Barisione">marco.barisione</reporter>
          <assigned_to name="Marco Barisione">marco.barisione</assigned_to>
          <cc>louis</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>93223</commentid>
    <comment_count>0</comment_count>
    <who name="Marco Barisione">marco.barisione</who>
    <bug_when>2008-09-29 07:27:36 -0700</bug_when>
    <thetext>When uploading a file with the curl backend cancel is always called at the end of the upload, so the file has been uploaded, the response has been received from the server but no result is shown.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93226</commentid>
    <comment_count>1</comment_count>
      <attachid>23907</attachid>
    <who name="Marco Barisione">marco.barisione</who>
    <bug_when>2008-09-29 07:42:06 -0700</bug_when>
    <thetext>Created attachment 23907
Don&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94350</commentid>
    <comment_count>2</comment_count>
    <who name="Amit">webkit.amit.nargund</who>
    <bug_when>2008-10-07 02:51:25 -0700</bug_when>
    <thetext>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!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94481</commentid>
    <comment_count>3</comment_count>
    <who name="Marco Barisione">marco.barisione</who>
    <bug_when>2008-10-07 17:37:05 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; This patch prevents cancellation of a request, but still does not successfully
&gt; upload the file.
&gt; Here is what I tried,
&gt; open rapidshare.com and try uploading a file.
&gt; I observed the HTTP traffic and noticed that POST packet is not seen, i.e.
&gt; nothing is posted to the server!

Really? I tried it and upload was working even before. What doesn&apos;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.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95152</commentid>
    <comment_count>4</comment_count>
    <who name="Amit">webkit.amit.nargund</who>
    <bug_when>2008-10-13 00:13:02 -0700</bug_when>
    <thetext>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!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95434</commentid>
    <comment_count>5</comment_count>
      <attachid>23907</attachid>
    <who name="Holger Freyther">zecke</who>
    <bug_when>2008-10-15 13:29:12 -0700</bug_when>
    <thetext>Comment on attachment 23907
Don&apos;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 &lt; m_resourceHandle()-&gt;request().httpBody()-&gt;elements().size();

but this is no hard requirement but something to keep in mind.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95441</commentid>
    <comment_count>6</comment_count>
    <who name="Holger Freyther">zecke</who>
    <bug_when>2008-10-15 13:38:54 -0700</bug_when>
    <thetext>Okay this does not even compile because of the const, non-const mismatch. I will land a compiling version.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95444</commentid>
    <comment_count>7</comment_count>
    <who name="Holger Freyther">zecke</who>
    <bug_when>2008-10-15 13:55:02 -0700</bug_when>
    <thetext>The patch was applied. Closing this bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>23907</attachid>
            <date>2008-09-29 07:42:06 -0700</date>
            <delta_ts>2008-10-15 13:29:12 -0700</delta_ts>
            <desc>Don&apos;t call cancel if the upload was successful</desc>
            <filename>has-more-elements.patch</filename>
            <type>text/plain</type>
            <size>3105</size>
            <attacher name="Marco Barisione">marco.barisione</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvcGxhdGZvcm0vbmV0d29yay9jdXJsL1Jlc291cmNlSGFuZGxlTWFuYWdl
ci5jcHAKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PQotLS0gV2ViQ29yZS9wbGF0Zm9ybS9uZXR3b3JrL2N1cmwvUmVzb3Vy
Y2VIYW5kbGVNYW5hZ2VyLmNwcAkocmV2aXNpb25lIDM3MDYxKQorKysgV2ViQ29yZS9wbGF0Zm9y
bS9uZXR3b3JrL2N1cmwvUmVzb3VyY2VIYW5kbGVNYW5hZ2VyLmNwcAkoY29waWEgbG9jYWxlKQpA
QCAtMjM1LDYgKzIzNSw5IEBACiAgICAgaWYgKCFzaXplIHx8ICFubWVtYikKICAgICAgICAgcmV0
dXJuIDA7CiAKKyAgICBpZiAoIWQtPm1fZm9ybURhdGFTdHJlYW0uaGFzTW9yZUVsZW1lbnRzKCkp
CisgICAgICAgIHJldH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VtZW50cyk6CisgICAgICAgICogcGxhdGZvcm0vbmV0d29yay9jdXJsL0Zvcm1EYXRh
U3RyZWFtQ3VybC5oOgorICAgICAgICAqIHBsYXRmb3JtL25ldHdvcmsvY3VybC9SZXNvdXJjZUhh
bmRsZU1hbmFnZXIuY3BwOgorICAgICAgICAoV2ViQ29yZTo6cmVhZENhbGxiYWNrKToKKwogMjAw
OC0wOS0yOSAgVGhpYWdvIE1hY2llaXJhICA8dGhpYWdvLm1hY2llaXJhQG5va2lhLmNvbT4KIAog
ICAgICAgICBSZXZpZXdlZCBieSBTaW1vbi4K
</data>
<flag name="review"
          id="10782"
          type_id="1"
          status="+"
          setter="zecke"
    />
          </attachment>
      

    </bug>

</bugzilla>