cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: CURLINFO_GNUTLS_SESSION (was Re: Patch: Support CURLINFO_CERTINFO with GnuTLS)

From: Steve Holme <steve_holme_at_hotmail.com>
Date: Wed, 20 Nov 2013 19:48:59 +0000

On Tue, 19 Nov 2013, Christian Grothoff wrote:

> > I understand what you were trying to achieve with the original patch
> > and that it kind of fits in with the CURLINFO_CERTINFO slist paradigm,
> > however, if you take a look at the certinfo.c example, it passes in
> > ptr.to_info rather than the whole union - I guess the benefit here is
> > that you don't need to cast and some might argument that this is
> > easier to understand (I'm not convinced!), and under some compilers
> > there might be a benefit??
>
> I don't know of any benefits under some compilers; I personally wouldn't
> use this style, but I was trying to follow the style I was seeing in the
code.

Me neither - In C I use good old fashioned casts and in C++ I use
static_cast, etc...

> > I'm happy to start pushing your work into the upcoming v7.34.0 release
>
> Which version? The latest patch, or an earlier one?

The latest one - unless anyone else has any preference.

> > * Are you able to write up an example that uses this rather than
> > than the example in the commit comments? A little like
> > certinfo.c ;-)
>
> Sure, but please let me know which version / variant of the
> implementation you'll use so I won't write example for the
> wrong one.

Hehehe - nope we don't want that so please see above ;-)

> > * What happens if, as Dan mentioned, the SSL context isn't initialised
> > / created? Will the calling application simply get an invalid
> > structure or are we able to have curl_easy_getinfo() fail?
>
> There is an 'enum' value for 'invalid', and the void * would be NULL.
> As I figured people might not check the return value of curl_easy_getinfo,
> but would HAVE to do a switch on the enum, I think that's the most
> robust variant we can offer.

Cool.

> > * In your curl_easy_getinfo.3 modification was the intention to have
> > the two paragraphs separate? If so the web page generator will need
> > a blank line. I can add this but I will need to know ;-)
>
> Whatever you like better, I have no strong feelings either way.

If it was intended to be part of the previous paragraph I would have moved
it up, so that the source matched the web generated version, but I'll
probably make it a separate paragraph (as it looks to be) and insert the
blank line ;-)

Kind Regards

Steve

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-11-20