mirror of
https://github.com/curl/curl.git
synced 2026-08-26 01:53:31 +03:00
examples/complicated: fix warnings, bump deprecated callback, tidy up
Also: make them C89, add consts. Closes #15785
This commit is contained in:
parent
fa0ccd9f1f
commit
37fb50a858
15 changed files with 199 additions and 132 deletions
|
|
@ -41,6 +41,11 @@ static CURLcode sslctx_function(CURL *curl, void *sslctx, void *parm)
|
|||
{
|
||||
CURLcode rv = CURLE_ABORTED_BY_CALLBACK;
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Woverlength-strings"
|
||||
#endif
|
||||
|
||||
/** This example uses two (fake) certificates **/
|
||||
static const char mypem[] =
|
||||
"-----BEGIN CERTIFICATE-----\n"
|
||||
|
|
@ -85,6 +90,10 @@ static CURLcode sslctx_function(CURL *curl, void *sslctx, void *parm)
|
|||
"Z05phkOTOPu220+DkdRgfks+KzgHVZhepA==\n"
|
||||
"-----END CERTIFICATE-----\n";
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
BIO *cbio = BIO_new_mem_buf(mypem, sizeof(mypem));
|
||||
X509_STORE *cts = SSL_CTX_get_cert_store((SSL_CTX *)sslctx);
|
||||
int i;
|
||||
|
|
@ -178,5 +187,5 @@ int main(void)
|
|||
|
||||
curl_easy_cleanup(ch);
|
||||
curl_global_cleanup();
|
||||
return rv;
|
||||
return (int)rv;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue