cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: A new callback function: XFERINFO ?

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Sun, 16 Jun 2013 09:23:17 +0200

On Sat, Jun 15, 2013 at 04:45:06PM -0700, NSRT Mail account. wrote:
> Thinking about this more, does it really make sense to combine upload and
> download into a single transfer function? Perhaps they should be two seperate
> functions? One only called while uploading, the other only called while
> downloading?
>
> I guess there's pros and cons. Discuss!

Each transfer consists of both upload and download phases. Mostly, one is
extremely short while the other takes the bulk of the time, but they can
both be significant sometimes (think of POSTing a large file and getting
another file in return).

Something else that might be useful in a progress callback is the state
of the transfer. The various phases like DNS resolution, connecting,
authenticating, uploading, downloading, logging off might be useful in GUI
applications or for debugging. Formalizing it in this callback would make it
usable (in a way that isn't generally possible by trying to parse the debug
output), but the callback's one second resolution really does limit it to
things like user interface notifications. Maybe a new curl_easy_getinfo to
get the transfer phase is a better way to handle this.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-06-16