cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: PORT mode & progress updates

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 11 May 2003 18:50:59 +0200 (CEST)

On Fri, 9 May 2003, George Comninos wrote:

> I've just recently taken over some work trying to integrate libcurl into
> our app, and am running into a problem with progress updates not occurring
> while downloading or uploading files when we're in PORT mode (vs PASV).

The code doing progress updates should behave identical, no matter which of
those FTP commands that were previously issued. The stream is TCP and works
the same.

> From looking at the code it looks like Curl_pgrsUpdate() is only called
> after getting EWOULDBLOCK back from the send call.

Not at all. It calls Curl_pgrsUpdate() after it has called Curl_write(), yes,
but that is generally more often than when EWOULDBLOCK is returned.

> But we never get that because it looks like the data socket is using
> blocking mode.

Why? libcurl is designed to work with non-blocking sockets and you'll make it
work a lot more how you'd want it using non-blocking ones. The support for
using blocking sockets is mainly if you're stuck in an operating system from
30 years ago and can't be made to upgrade...

> Is there something I'm missing? perhaps some build flag or curl option I'm
> not setting properly? I'm currently setting a progress callback with
> CURLOPT_PROGRESSFUNCTION and have set CURLOPT_NOPROGRESS to FALSE.
>
> I've also tried grabbing the latest source (7.10.4) and built the command
> line curl app as is and I get the same behavior -- I only see progress
> update when the transfer is completed if I'm using -P mode.

I think it looks like a problem I thought I fixed in 7.10.4.

Can you make sure that 'writedone = TRUE' is made ALWAYS after Curl_write()
has been called, and let me know if that fixes your problem?

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com
Received on 2003-05-11