curl-library
Re: keeping connection on multi_remove_handle for FTP
Date: Tue, 5 Dec 2006 08:55:51 +0100
>> as long as I can clearly establish from the FTP request the current state
>> and tell "am I at the end?" (if not, this is a cancellation, if yes, this
>> is a simple removal after operation). can I test conn.proto.ftp->state
>> for that (FTP_STOP)?
>
> Yes it sounds right, but you should probably also check
> conn->proto.ftpc.ctl_valid to be TRUE as otherwise you're adviced to not
> use the control connection at all since it may (no longer) be working
> nicely.
I think that i put the finger on the right thing:
near multi.c:410:
/* if we have a connection we must call Curl_done() here so that we
don't leave a half-baked one around */
if(easy->easy_conn)
Curl_done(&easy->easy_conn, easy->result);
these lines do not taken into account the CURLMState, i.e. if we are not at
CURM_STATE_COMPLETED and easy->result is OK, we are cancelling, so we should
not pass easy->result but some error (new one CURLE_CANCELLED?)
Armel
Received on 2006-12-05