curl-library
Progress function
Date: Mon, 08 Apr 2002 01:08:32 GMT
Dear All,
I'm using libcurl under Windows with Borland Delphi 5.
All ok, but progress function don't work.
The function is called by libcurl and if I set the result <> 0 the libcurl,
rightly, exit with error.
The problem is that parms contain random values.
I don't understund it because I use another callback, WRITEFUNCTION and with
this is ALL OK.
This callbacks are called by libcurl in different ways?
This is WriteFunction:
function WriteFunction(ptr: pchar; size, nmemb: Longint; stream: pointer):
longint; stdcall;
begin
WriteFunction := size * nmemb;
end;
curl_easy_setopt(fCurl, CURLOPT_WRITEFUNCTION, @WriteFunction);
and this work OK, this is, instead, ProgressFunction
function Prova(p:pointer; dltotal, dlnow, ultotal, ulnow: longint): longint;
stdcall;
begin
Prova := 0;
end;
curl_easy_setopt(fCurl, CURLOPT_PROGRESSFUNCTION, @Prova);
Functions is called and libcurl understund result value of the function, but
values dltotal, dlnow, ultotal and ulnow have random value.
P.S. I'm using libcurl under linux and with PHP and I'm very happy so I
decided to use it with Windows...
Received on 2002-04-08