cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: libcurlnet: meaning of CURL_OK value after Perform()

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 5 May 2009 10:14:06 +0200 (CEST)

On Tue, 5 May 2009, AMBROSINI Marco wrote:

>>> 1) When I call a command, does Curl close every time the connection with
>>> the FTP server (quit)?
>
>> libcurl doesn't, no. Your binding may.
>
> How can I do that? DO you have a link or an example to show me?

You need to understand how things relate and contstructed first.

curl is a command line tool (and you're posting this to the mailing list for
curl users)

libcurl is a library that offers URL transfer powers.

You're using libcurlnet, which is a binding for .NET that uses libcurl. It has
a layer on top of libcurl that does the .NET adaptions and whatever magic the
author(s) thought was necessary or just good to do to make it useful.

(Now remember that I referred you to the more appropriate curl-library mailing
list for this topic, but you gladly ignored that and that doesn't really help
you get answers.)

libcurl itself requires nothing in particular to re-use FTP control
connections, only that you re-use the same handle. I have no idea what
libcurlnet does or does not do to change that.

> I tried to delete a file on a FTP server without having the permission and I
> got the CURL_OK code.

Again, you're not telling us exactly what you did and again you may be seeing
effects from binding behavior. Possibly you need to check the response headers
from the server to be able to tell exactly what the response is.

>> You probably need to use a timeout of some sorts.
>
> How can I do that? Can you give me an example? I need to know if a file is
> downloaded or uploaded completely.

No I can't. You're on the wrong list and you're using a binding I'm not
familiar with.

>>> 4) Are the delete and update commands available even if a http proxy is
>>> used? Also without setting CURLOPT_HTTPPROXYTUNNEL = true?
>
>> "delete and update commands" ?
>
> "delete": a file is deleted in a FTP server
> "Update": a file is uploaded in a ftp server

If you use a proxytunnel you can use everything the FTP protocol and libcurl
allows, so you can upload, download and rename etc just fine.

> I am using Curl because using .NET Framework and http proxy these commands
> are not allowed.

I don't think the binding limits this, I think your proxy doesn't allow you to
tunnel through it to a port 21 on the outside (the FTP server default port).

> Can I delete or upload a file with an http roxy also without setting
> CURLOPT_HTTPPROXYTUNNEL = true?

You can't delete. You might be able to upload but that depends a lot on the
particular proxy and possibly on the ftp server too. FTP over a HTTP proxy is
not standardized.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2009-05-05