cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: introduced an auth callback

From: Joe Mason <jmason_at_rim.com>
Date: Mon, 14 May 2012 16:28:37 +0000

> From: curl-library-bounces_at_cool.haxx.se [curl-library-bounces_at_cool.haxx.se] on
> behalf of Steve Holme [steve_holme_at_hotmail.com]
> Sent: Monday, May 14, 2012 12:02 PM
> To: 'libcurl development'
> Subject: RE: introduced an auth callback
>
>
> I have a general question regarding your callback... Could it be used with
> other protocols in libcurl and is there any http specific code in there at
> present?
>
> For example: I am very interested in using it in SMTP as a way for the user
> / developer to specify what protocol to use.

Currently the implementation is HTTP-only. I think the interface should be general enough to work with other protocols, and then we can add other implementations over time.

I'm interested in extending it to FTP as well, but that's lower priority for me. I haven't looked at curl's SMTP support at all.

What additional parameters to the callback would SMTP need? Do you think there should be another parameter for what the protocol is (HTTP, FTP, SMTP, etc)? (We already pass the CURL* and presumably the app can keep track of what protocol it is using with each CURL* handle, but it would be a convenience.)

Perhaps instead of CURLAUTH_TYPE_HOST and CURLAUTH_TYPE_PROXY, it should use CURLAUTH_TYPE_HTTP, and then we can add CURLAUTH_TYPE_FTP and CURLAUTH_TYPE_SMTP as support for those protocols is added.

To set the SMTP protocol type we'd want to add another curl_cb_* function. (That's another good reason to use curl_cb_* instead of in/out parameters in the auth callback!)

Joe
---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

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