cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: keeping connection on multi_remove_handle for FTP

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 14 Dec 2006 19:15:04 +0100 (CET)

On Thu, 14 Dec 2006, Armel Asselin wrote:

>> I guess what I'm trying to say is: this problem is somewhat more
>> complicated than at least I previously were thinking.

> I'm trying to find a definitive solution to that. In fact there two cases at
> hand, either the buffer was sent totally, or it was not.

Correct. But there's also the a response that we might be waiting for more
data for, or we don't.

> If it was sent totally, we can definitely go on with a ABOR command

Not really. First we also need to know that we also have received the whole
response to that previous command.

> [only necessary if a data connection was there or to be opened]

This whole precudure is only required if you intend to use the connection
again.

> If it was sent partially, we have no other choice than finishing current
> buffer, else the server may get a truncated command which actually means
> something else. then we can proceed with the above case.

if(outstanding send)
    complete the send

if(not whole response received yet)
    receive the full response

if(data connection in use) {
   send ABOR

   receive ABOR response

   close data connection and free associated resources
}

ftp control connection ready for re-use

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2006-12-14