<?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>118356</bug_id>
          
          <creation_ts>2013-07-03 06:09:49 -0700</creation_ts>
          <short_desc>[Curl] Download does not replace existing file.</short_desc>
          <delta_ts>2013-07-15 11:27:30 -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>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Curl</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter>peavo</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>commit-queue</cc>
    
    <cc>galpeter</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>905840</commentid>
    <comment_count>0</comment_count>
    <who name="">peavo</who>
    <bug_when>2013-07-03 06:09:49 -0700</bug_when>
    <thetext>If the download target file already exists, it is not replaced after the download has finished.
At this point, the user would have already approved to replace the file, so it should be replaced.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>905844</commentid>
    <comment_count>1</comment_count>
      <attachid>205997</attachid>
    <who name="">peavo</who>
    <bug_when>2013-07-03 06:19:32 -0700</bug_when>
    <thetext>Created attachment 205997
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>908330</commentid>
    <comment_count>2</comment_count>
    <who name="Peter Gal">galpeter</who>
    <bug_when>2013-07-15 01:30:16 -0700</bug_when>
    <thetext>Well I&apos;m not a reviewer but this looks good to me. 

I&apos;ve just got one (two) question(s) if the MoveFileEx fails then the old file will be still there? and if so won&apos;t that cause problems?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>908455</commentid>
    <comment_count>3</comment_count>
    <who name="">peavo</who>
    <bug_when>2013-07-15 10:26:56 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; Well I&apos;m not a reviewer but this looks good to me. 
&gt; 
&gt; I&apos;ve just got one (two) question(s) if the MoveFileEx fails then the old file will be still there? and if so won&apos;t that cause problems?

Thanks for commenting :)

I think this scenario should be ok, as the old file is a temporary file in a Windows temp folder. The next download will generate a new, unique, temporary file name, to download to, and not have any references to the previous temporary file.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>908461</commentid>
    <comment_count>4</comment_count>
      <attachid>205997</attachid>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2013-07-15 10:59:57 -0700</bug_when>
    <thetext>Comment on attachment 205997
Patch

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>908466</commentid>
    <comment_count>5</comment_count>
      <attachid>205997</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-07-15 11:22:21 -0700</bug_when>
    <thetext>Comment on attachment 205997
Patch

Clearing flags on attachment: 205997

Committed r152649: &lt;http://trac.webkit.org/changeset/152649&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>908467</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-07-15 11:22:23 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>908468</commentid>
    <comment_count>7</comment_count>
    <who name="">peavo</who>
    <bug_when>2013-07-15 11:27:30 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (From update of attachment 205997 [details])
&gt; r=me

Thanks for reviewing!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>205997</attachid>
            <date>2013-07-03 06:19:32 -0700</date>
            <delta_ts>2013-07-15 11:22:21 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-118356-20130703151701.patch</filename>
            <type>text/plain</type>
            <size>1714</size>
            <attacher>peavo</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDE1MjM1MSkKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE3IEBACisyMDEzLTA3LTAzICBwZWF2b0Bv
dXRsb29rLmNvbSAgPHBlYXZvQG91dGxvb2suY29tPgorCisgICAgICAgIFtDdXJsXSBEb3dubG9h
ZCBkb2VzIG5vdCByZXBsYWNlIGV4aXN0aW5nIGZpbGUuCisgICAgICAgIGh0dHBzOi8vYnVncy53
ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0xMTgzNTYKKworICAgICAgICBSZXZpZXdlZCBieSBO
T0JPRFkgKE9PUFMhKS4KKworICAgICAgICBJZiB0aGUgZG93bmxvYWQgdGFyZ2V0IGZpbGUgYWxy
ZWFkeSBleGlzdHMsIGl0IGlzIG5vdCByZXBsYWNlZCBhZnRlciB0aGUgZG93bmxvYWQgaGFzIGZp
bmlzaGVkLgorICAgICAgICBBdCB0aGlzIHBvaW50LCB0aGUgdXNlciB3b3VsZCBoYXZlIGFscmVh
ZHkgYXBwcm92ZWQgdG8gcmVwbGFjZSB0aGUgZmlsZSwgc28gaXQgc2hvdWxkIGJlIHJlcGxhY2Vk
LgorC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