diff options
author | Steve Holme <steve_holme@hotmail.com> | 2013-11-30 10:59:01 +0000 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2013-11-30 11:08:56 +0000 |
commit | dc68120e6352cc2516bf25758f3aae71400b9702 (patch) | |
tree | d3b66b009f2d252779058a35293730b8b234e8d6 /docs/examples | |
parent | 0db811b69b2d5a18f8122d94db4e520909fd992b (diff) |
curl_easy_getinfo: Post CURLINFO_TLS_SESSION tidy up
1) Renamed curl_tlsinfo to curl_tlssessioninfo as discussed on the
mailing list.
2) Renamed curl_ssl_backend to curl_sslbackend so it doesn't follow our
function naming convention.
3) Updated sessioninfo.c example accordingly.
Diffstat (limited to 'docs/examples')
-rw-r--r-- | docs/examples/sessioninfo.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/docs/examples/sessioninfo.c b/docs/examples/sessioninfo.c index ac0cbb158..2641c7139 100644 --- a/docs/examples/sessioninfo.c +++ b/docs/examples/sessioninfo.c @@ -32,7 +32,7 @@ static CURL *curl; static size_t wrfu(void *ptr, size_t size, size_t nmemb, void *stream) { - const struct curl_tlsinfo *tlsinfo; + const struct curl_tlssessioninfo *info; unsigned int cert_list_size; const gnutls_datum_t *chainp; CURLcode res; @@ -40,14 +40,13 @@ static size_t wrfu(void *ptr, size_t size, size_t nmemb, void *stream) (void)stream; (void)ptr; - res = curl_easy_getinfo(curl, CURLINFO_TLS_SESSION, &tlsinfo); + res = curl_easy_getinfo(curl, CURLINFO_TLS_SESSION, &info); if(!res) { - switch(tlsinfo->ssl_backend) { + switch(info->backend) { case CURLSSLBACKEND_GNUTLS: - /* tlsinfo->internals is now the gnutls_session_t */ - chainp = gnutls_certificate_get_peers(tlsinfo->internals, - &cert_list_size); + /* info->internals is now the gnutls_session_t */ + chainp = gnutls_certificate_get_peers(info->internals, &cert_list_size); if((chainp) && (cert_list_size)) { unsigned int i; @@ -57,8 +56,7 @@ static size_t wrfu(void *ptr, size_t size, size_t nmemb, void *stream) if(GNUTLS_E_SUCCESS == gnutls_x509_crt_init(&cert)) { if(GNUTLS_E_SUCCESS == - gnutls_x509_crt_import(cert, &chainp[i], - GNUTLS_X509_FMT_DER)) { + gnutls_x509_crt_import(cert, &chainp[i], GNUTLS_X509_FMT_DER)) { if(GNUTLS_E_SUCCESS == gnutls_x509_crt_print(cert, GNUTLS_CRT_PRINT_FULL, &dn)) { fprintf(stderr, "Certificate #%d: %.*s", i, dn.size, dn.data); |