cURL / Mailing Lists / curl-library / Single Mail

curl-library

[PATCH] Re: Longer FTP Uploads with Curl 7.9.8

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 13 Jun 2002 23:46:03 +0200 (MET DST)

On Thu, 13 Jun 2002, Tom Mattison wrote:

> I'm experiencing some new behaviour with using curl-lib 7.9.8 in my OS X
> cocoa app. I just made the big move from 7.9.6 and am wondering about the
> differences I'm seeing.

You're absolutely right questioning this.

> My app does alot of FTP transfers. I noticed that 7.9.8 was taking longer
> to upload files than 7.9.6. After turning on verbose logging, I see why.
> The connection is getting explicitly closed except for file uploads. If I
> to some commands (CURL_POSTQUOTE, renaming a file), I see "* Closing
> Connection #0". I see the same thing if I connect using 'NOBODY'.

Now, all this of course needs to find their explanations.

Digging into the code, I can clearly see that I've broken the NOBODY stuff.
I'd be interested in how my patch below works for this.

> I tried explicity setting FRESH_CONNECT and FORBID_REUSE to 0, wondering if
> the default behaviour had changed, but that doesn't seem to affect the
> output.

No, those are still used the same, these new behaviors are all due to my
fiddling of what to do when a FTP transfer is considered done, and thus how
to use the internals ftp->dont_check and data->set.no_body.

My patch that at least should make NOBODY work better:

diff -u -r1.147 ftp.c
--- ftp.c 13 Jun 2002 09:21:08 -0000 1.147
+++ ftp.c 13 Jun 2002 21:31:34 -0000
@@ -669,13 +669,14 @@
       return CURLE_FTP_WRITE_ERROR;
     }
   }
- if(ftp->dont_check) {
+ if(ftp->dont_check)
     /* if we don't check, we can't re-use this connection as it leaves the
        control connection in a weird status */
     conn->bits.close = TRUE;
- }

- conn->bits.resume_done = FALSE; /* clean this for next connection */
+ /* reset these for next connection */
+ conn->bits.resume_done = FALSE;
+ ftp->dont_check = FALSE;

   /* Send any post-transfer QUOTE strings? */
   if(!result && data->set.postquote)
@@ -1604,7 +1605,7 @@

   if(data->set.no_body)
     /* don't transfer the data */
- ftp->dont_check = TRUE;
+ ;
   /* Get us a second connection up and connected */
   else if(data->set.ftp_use_port) {
     /* We have chosen to use the PORT command */

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink
Received on 2002-06-13