cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: introduced an auth callback

From: Steve Holme <steve_holme_at_hotmail.com>
Date: Tue, 15 May 2012 16:10:32 +0100

Hi Joe,

On Mon, 14 May 2012, Joe Mason wrote:

> > 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?
>
> 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.

Cool.

> 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.

I believe other protocols such as SMTP, POP3 and IMAP were modelled on FTP
so you should find them familiar ;-)

> What additional parameters to the callback would SMTP need?

I've not really looked too much at what you have done with the callback but
I think all that I would need is a way of specifying which mechanisms are
available from the server to the callback and as the programmer which
mechanisms I want libcurl to use for my application. Both of these arguments
could be implemented as either a bitwise numerical value or as a list of
mechanisms in order of preference - For example the server may tell me that
GSSAPI is preferred, followed by NTLM and then PLAIN. I may want to tell
libcurl that my preference is PLAIN followed by GSSAPI - and yes I would be
mad to do this but hopefully you get my point ;-)

> Do you think there should be another parameter for what the
> protocol is (HTTP, FTP, SMTP, etc)?

I don't think so - if I was using libcurl for various connections, some to
HTTP, some to SMTP and some to POP3 all at the same time via the
multi-interface I would probably have different callbacks for each type of
connection anyway. Assuming that your implementation allows for that ;-)

Cheers

Steve
 

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