[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 202/254: typecheck-gcc.h: check CURLINFO_CERTINFO
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 202/254: typecheck-gcc.h: check CURLINFO_CERTINFO |
Date: |
Sat, 17 Jun 2017 16:53:54 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to annotated tag gnurl-7.54.1
in repository gnurl.
commit efc7c1d86f1543870712d1a0ef4eecd67e933921
Author: Daniel Stenberg <address@hidden>
AuthorDate: Thu Jun 1 15:03:30 2017 +0200
typecheck-gcc.h: check CURLINFO_CERTINFO
... and update the certinfo.c example accordingly.
Fixes https://github.com/curl/curl/issues/846
---
docs/KNOWN_BUGS | 9 ---------
docs/examples/certinfo.c | 19 +++++++------------
include/curl/typecheck-gcc.h | 9 +++++++++
3 files changed, 16 insertions(+), 21 deletions(-)
diff --git a/docs/KNOWN_BUGS b/docs/KNOWN_BUGS
index 4415ce211..517cd144a 100644
--- a/docs/KNOWN_BUGS
+++ b/docs/KNOWN_BUGS
@@ -49,7 +49,6 @@ problems may have been fixed or changed somewhat since this
was written!
5.7 Visual Studio project gaps
5.8 configure finding libs in wrong directory
5.9 Utilize Requires.private directives in libcurl.pc
- 5.10 Fix the gcc typechecks
6. Authentication
6.1 NTLM authentication and unicode
@@ -364,14 +363,6 @@ problems may have been fixed or changed somewhat since
this was written!
https://github.com/curl/curl/issues/864
-5.10 Fix the gcc typechecks
-
- Issue #846 identifies a problem with the gcc-typechecks and how the types are
- documented and checked for CURLINFO_CERTINFO but our attempts to fix the
- issue were futile and needs more attention.
-
- https://github.com/curl/curl/issues/846
-
6. Authentication
6.1 NTLM authentication and unicode
diff --git a/docs/examples/certinfo.c b/docs/examples/certinfo.c
index de2e31088..1aee614ce 100644
--- a/docs/examples/certinfo.c
+++ b/docs/examples/certinfo.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2015, Daniel Stenberg, <address@hidden>, et al.
+ * Copyright (C) 1998 - 2017, Daniel Stenberg, <address@hidden>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -56,24 +56,19 @@ int main(void)
res = curl_easy_perform(curl);
if(!res) {
- union {
- struct curl_slist *to_info;
- struct curl_certinfo *to_certinfo;
- } ptr;
+ struct curl_certinfo *certinfo;
- ptr.to_info = NULL;
+ res = curl_easy_getinfo(curl, CURLINFO_CERTINFO, &certinfo);
- res = curl_easy_getinfo(curl, CURLINFO_CERTINFO, &ptr.to_info);
-
- if(!res && ptr.to_info) {
+ if(!res && certinfo) {
int i;
- printf("%d certs!\n", ptr.to_certinfo->num_of_certs);
+ printf("%d certs!\n", certinfo->num_of_certs);
- for(i = 0; i < ptr.to_certinfo->num_of_certs; i++) {
+ for(i = 0; i < certinfo->num_of_certs; i++) {
struct curl_slist *slist;
- for(slist = ptr.to_certinfo->certinfo[i]; slist; slist = slist->next)
+ for(slist = certinfo->certinfo[i]; slist; slist = slist->next)
printf("%s\n", slist->data);
}
diff --git a/include/curl/typecheck-gcc.h b/include/curl/typecheck-gcc.h
index 1d1066d78..0a08175f7 100644
--- a/include/curl/typecheck-gcc.h
+++ b/include/curl/typecheck-gcc.h
@@ -127,6 +127,9 @@ __extension__ ({
\
if(_curl_is_tlssessioninfo_info(_curl_info)) \
if(!_curl_is_arr((arg), struct curl_tlssessioninfo *)) \
_curl_easy_getinfo_err_curl_tlssesssioninfo(); \
+ if(_curl_is_certinfo_info(_curl_info)) \
+ if(!_curl_is_arr((arg), struct curl_certinfo *)) \
+ _curl_easy_getinfo_err_curl_certinfo(); \
if(_curl_is_socket_info(_curl_info)) \
if(!_curl_is_arr((arg), curl_socket_t)) \
_curl_easy_getinfo_err_curl_socket(); \
@@ -210,6 +213,9 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
_CURL_WARNING(_curl_easy_getinfo_err_curl_tlssesssioninfo,
"curl_easy_getinfo expects a pointer to "
"'struct curl_tlssessioninfo *' for this info")
+_CURL_WARNING(_curl_easy_getinfo_err_curl_certinfo,
+ "curl_easy_getinfo expects a pointer to "
+ "'struct curl_certinfo *' for this info")
_CURL_WARNING(_curl_easy_getinfo_err_curl_socket,
"curl_easy_getinfo expects a pointer to curl_socket_t for this info")
@@ -380,6 +386,9 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_socket,
#define _curl_is_tlssessioninfo_info(info) \
(((info) == CURLINFO_TLS_SSL_PTR) || ((info) == CURLINFO_TLS_SESSION))
+/* true if info expects a pointer to struct curl_certinfo * argument */
+#define _curl_is_certinfo_info(info) ((info) == CURLINFO_CERTINFO)
+
/* true if info expects a pointer to struct curl_socket_t argument */
#define _curl_is_socket_info(info) \
(CURLINFO_SOCKET < (info))
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 251/254: libressl: OCSP and intermediate certs workaround no longer needed, (continued)
- [GNUnet-SVN] [gnurl] 251/254: libressl: OCSP and intermediate certs workaround no longer needed, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 80/254: typecheck-gcc: add support for CURLINFO_SOCKET, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 104/254: tftp: silence bad-function-cast warning, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 107/254: sendrecv: fix MinGW-w64 warning, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 152/254: ssh: ignore timeouts during disconnect, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 211/254: dedotdot: fixed output for ".." and "." only input, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 206/254: curl_endian: remove unused functions, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 169/254: examples: fix Wimplicit-fallthrough warnings, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 158/254: cmake: remove CURL_CA_BUNDLE from cmake TODO, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 178/254: RELEASE-NOTES: synced with 3aaac8c2f, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 202/254: typecheck-gcc.h: check CURLINFO_CERTINFO,
gnunet <=
- [GNUnet-SVN] [gnurl] 230/254: test1521: make the code < 80 columns wide, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 72/254: ssh: fix compiler warning from e40e9d7f0de, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 50/254: curl_setup: Ensure no more than one IDN lib is enabled, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 120/254: formboundary: convert assert into run-time check, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 114/254: tool_msgs: remove wrong cast, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 98/254: tests: fix -Wcast-qual warnings, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 228/254: typecheck-gcc: allow CURLOPT_STDERR to be NULL too, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 212/254: tool_util: remove unused tvdiff_secs and remove tool_ prefix, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 143/254: RELEASE-NOTES: synced with eb16305e6, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 93/254: unit1305: fix compiler warning, gnunet, 2017/06/17