cURL / Mailing Lists / curl-library / Single Mail

curl-library

Q. about LibCurl and ports

From: Roger Tremblay <hollowman314159_at_yahoo.ca>
Date: Fri, 10 Feb 2012 13:06:30 -0800 (PST)

Different transactions require connecting on different ports depending on the protocol that prefixes the url related to a transaction. For example, FTP is the protocole for

the url ftp://server:port</path>/file. And the typical port for FTP is 21.

Via Curl, the port can be specified either textually in the url (as above) with command
curl_easy_setopt( m_CurlHandle, CURLOPT_URL, ...);
or separately with command
curl_easy_setopt( m_CurlHandle, CURLOPT_PORT, ...);

The question is, if a user does not configure the handle with CURLOPT_PORT, will LibCurl determine automatically the typical port to connect to, based on the protocol specified by the URL parameter?

My testst indicate that it does (at least for FTP, FTP, and SFTP). But regardeless of the results, I'd like to have confirmation from LibCurl contributors/users

Thx

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-02-10