[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 06/63: examples: remove dead variable stores
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 06/63: examples: remove dead variable stores |
Date: |
Fri, 07 Jun 2019 18:36:28 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit f91baf842ac869f6a849ce4ac4c5ede8a3b49fd2
Author: Marcel Raad <address@hidden>
AuthorDate: Tue May 21 10:58:21 2019 +0200
examples: remove dead variable stores
Closes https://github.com/curl/curl/pull/3919
---
docs/examples/cacertinmem.c | 32 ++++++++++++++++----------------
docs/examples/resolve.c | 4 ++--
docs/examples/sftpuploadresume.c | 3 +--
docs/examples/usercertinmem.c | 30 +++++++++++++++---------------
4 files changed, 34 insertions(+), 35 deletions(-)
diff --git a/docs/examples/cacertinmem.c b/docs/examples/cacertinmem.c
index 11cc06bee..ea295d016 100644
--- a/docs/examples/cacertinmem.c
+++ b/docs/examples/cacertinmem.c
@@ -123,26 +123,26 @@ int main(void)
CURL *ch;
CURLcode rv;
- rv = curl_global_init(CURL_GLOBAL_ALL);
+ curl_global_init(CURL_GLOBAL_ALL);
ch = curl_easy_init();
- rv = curl_easy_setopt(ch, CURLOPT_VERBOSE, 0L);
- rv = curl_easy_setopt(ch, CURLOPT_HEADER, 0L);
- rv = curl_easy_setopt(ch, CURLOPT_NOPROGRESS, 1L);
- rv = curl_easy_setopt(ch, CURLOPT_NOSIGNAL, 1L);
- rv = curl_easy_setopt(ch, CURLOPT_WRITEFUNCTION, *writefunction);
- rv = curl_easy_setopt(ch, CURLOPT_WRITEDATA, stdout);
- rv = curl_easy_setopt(ch, CURLOPT_HEADERFUNCTION, *writefunction);
- rv = curl_easy_setopt(ch, CURLOPT_HEADERDATA, stderr);
- rv = curl_easy_setopt(ch, CURLOPT_SSLCERTTYPE, "PEM");
- rv = curl_easy_setopt(ch, CURLOPT_SSL_VERIFYPEER, 1L);
- rv = curl_easy_setopt(ch, CURLOPT_URL, "https://www.example.com/");
+ curl_easy_setopt(ch, CURLOPT_VERBOSE, 0L);
+ curl_easy_setopt(ch, CURLOPT_HEADER, 0L);
+ curl_easy_setopt(ch, CURLOPT_NOPROGRESS, 1L);
+ curl_easy_setopt(ch, CURLOPT_NOSIGNAL, 1L);
+ curl_easy_setopt(ch, CURLOPT_WRITEFUNCTION, *writefunction);
+ curl_easy_setopt(ch, CURLOPT_WRITEDATA, stdout);
+ curl_easy_setopt(ch, CURLOPT_HEADERFUNCTION, *writefunction);
+ curl_easy_setopt(ch, CURLOPT_HEADERDATA, stderr);
+ curl_easy_setopt(ch, CURLOPT_SSLCERTTYPE, "PEM");
+ curl_easy_setopt(ch, CURLOPT_SSL_VERIFYPEER, 1L);
+ curl_easy_setopt(ch, CURLOPT_URL, "https://www.example.com/");
/* Turn off the default CA locations, otherwise libcurl will load CA
* certificates from the locations that were detected/specified at
* build-time
*/
- rv = curl_easy_setopt(ch, CURLOPT_CAINFO, NULL);
- rv = curl_easy_setopt(ch, CURLOPT_CAPATH, NULL);
+ curl_easy_setopt(ch, CURLOPT_CAINFO, NULL);
+ curl_easy_setopt(ch, CURLOPT_CAPATH, NULL);
/* first try: retrieve page without ca certificates -> should fail
* unless libcurl was built --with-ca-fallback enabled at build-time
@@ -162,13 +162,13 @@ int main(void)
* handle. normally you would set the ssl ctx function before making
* any transfers, and not use this option.
*/
- rv = curl_easy_setopt(ch, CURLOPT_FRESH_CONNECT, 1L);
+ curl_easy_setopt(ch, CURLOPT_FRESH_CONNECT, 1L);
/* second try: retrieve page using cacerts' certificate -> will succeed
* load the certificate by installing a function doing the necessary
* "modifications" to the SSL CONTEXT just before link init
*/
- rv = curl_easy_setopt(ch, CURLOPT_SSL_CTX_FUNCTION, *sslctx_function);
+ curl_easy_setopt(ch, CURLOPT_SSL_CTX_FUNCTION, *sslctx_function);
rv = curl_easy_perform(ch);
if(rv == CURLE_OK)
printf("*** transfer succeeded ***\n");
diff --git a/docs/examples/resolve.c b/docs/examples/resolve.c
index c3b52d6f0..c0b541500 100644
--- a/docs/examples/resolve.c
+++ b/docs/examples/resolve.c
@@ -31,14 +31,14 @@ int main(void)
{
CURL *curl;
CURLcode res = CURLE_OK;
- struct curl_slist *host = NULL;
/* Each single name resolve string should be written using the format
HOST:PORT:ADDRESS where HOST is the name libcurl will try to resolve,
PORT is the port number of the service where libcurl wants to connect to
the HOST and ADDRESS is the numerical IP address
*/
- host = curl_slist_append(NULL, "example.com:443:127.0.0.1");
+ struct curl_slist *host = curl_slist_append(NULL,
+ "example.com:443:127.0.0.1");
curl = curl_easy_init();
if(curl) {
diff --git a/docs/examples/sftpuploadresume.c b/docs/examples/sftpuploadresume.c
index 98f3b62f0..e7d9d23f6 100644
--- a/docs/examples/sftpuploadresume.c
+++ b/docs/examples/sftpuploadresume.c
@@ -49,9 +49,8 @@ static curl_off_t sftpGetRemoteFileSize(const char
*i_remoteFile)
{
CURLcode result = CURLE_GOT_NOTHING;
curl_off_t remoteFileSizeByte = -1;
- CURL *curlHandlePtr = NULL;
+ CURL *curlHandlePtr = curl_easy_init();
- curlHandlePtr = curl_easy_init();
curl_easy_setopt(curlHandlePtr, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(curlHandlePtr, CURLOPT_URL, i_remoteFile);
diff --git a/docs/examples/usercertinmem.c b/docs/examples/usercertinmem.c
index 40505b0c0..2dc264310 100644
--- a/docs/examples/usercertinmem.c
+++ b/docs/examples/usercertinmem.c
@@ -177,25 +177,25 @@ int main(void)
CURL *ch;
CURLcode rv;
- rv = curl_global_init(CURL_GLOBAL_ALL);
+ curl_global_init(CURL_GLOBAL_ALL);
ch = curl_easy_init();
- rv = curl_easy_setopt(ch, CURLOPT_VERBOSE, 0L);
- rv = curl_easy_setopt(ch, CURLOPT_HEADER, 0L);
- rv = curl_easy_setopt(ch, CURLOPT_NOPROGRESS, 1L);
- rv = curl_easy_setopt(ch, CURLOPT_NOSIGNAL, 1L);
- rv = curl_easy_setopt(ch, CURLOPT_WRITEFUNCTION, writefunction);
- rv = curl_easy_setopt(ch, CURLOPT_WRITEDATA, stdout);
- rv = curl_easy_setopt(ch, CURLOPT_HEADERFUNCTION, writefunction);
- rv = curl_easy_setopt(ch, CURLOPT_HEADERDATA, stderr);
- rv = curl_easy_setopt(ch, CURLOPT_SSLCERTTYPE, "PEM");
+ curl_easy_setopt(ch, CURLOPT_VERBOSE, 0L);
+ curl_easy_setopt(ch, CURLOPT_HEADER, 0L);
+ curl_easy_setopt(ch, CURLOPT_NOPROGRESS, 1L);
+ curl_easy_setopt(ch, CURLOPT_NOSIGNAL, 1L);
+ curl_easy_setopt(ch, CURLOPT_WRITEFUNCTION, writefunction);
+ curl_easy_setopt(ch, CURLOPT_WRITEDATA, stdout);
+ curl_easy_setopt(ch, CURLOPT_HEADERFUNCTION, writefunction);
+ curl_easy_setopt(ch, CURLOPT_HEADERDATA, stderr);
+ curl_easy_setopt(ch, CURLOPT_SSLCERTTYPE, "PEM");
/* both VERIFYPEER and VERIFYHOST are set to 0 in this case because there is
no CA certificate*/
- rv = curl_easy_setopt(ch, CURLOPT_SSL_VERIFYPEER, 0L);
- rv = curl_easy_setopt(ch, CURLOPT_SSL_VERIFYHOST, 0L);
- rv = curl_easy_setopt(ch, CURLOPT_URL, "https://www.example.com/");
- rv = curl_easy_setopt(ch, CURLOPT_SSLKEYTYPE, "PEM");
+ curl_easy_setopt(ch, CURLOPT_SSL_VERIFYPEER, 0L);
+ curl_easy_setopt(ch, CURLOPT_SSL_VERIFYHOST, 0L);
+ curl_easy_setopt(ch, CURLOPT_URL, "https://www.example.com/");
+ curl_easy_setopt(ch, CURLOPT_SSLKEYTYPE, "PEM");
/* first try: retrieve page without user certificate and key -> will fail
*/
@@ -211,7 +211,7 @@ int main(void)
* load the certificate and key by installing a function doing the necessary
* "modifications" to the SSL CONTEXT just before link init
*/
- rv = curl_easy_setopt(ch, CURLOPT_SSL_CTX_FUNCTION, *sslctx_function);
+ curl_easy_setopt(ch, CURLOPT_SSL_CTX_FUNCTION, *sslctx_function);
rv = curl_easy_perform(ch);
if(rv == CURLE_OK) {
printf("*** transfer succeeded ***\n");
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [gnurl] 51/63: http: don't parse body-related headers bodyless responses, (continued)
- [GNUnet-SVN] [gnurl] 51/63: http: don't parse body-related headers bodyless responses, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 53/63: NTLM: reset proxy "multipass" state when CONNECT request is done, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 58/63: curl_share_setopt.3: improve wording [ci ship], gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 56/63: TODO: "at least N milliseconds between requests" [ci skip], gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 46/63: http2: Stop drain from being permanently set on, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 19/63: os400: take care of CURLOPT_SASL_AUTHZID in curl_easy_setopt_ccsid()., gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 24/63: tool_setopt: for builds with disabled-proxy, skip all proxy setopts(), gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 18/63: .github/FUNDING: mention our opencollective "home" [ci skip], gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 20/63: md4: build correctly with openssl without MD4, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 16/63: tests: Fix the line endings for the SASL alt-auth tests, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 06/63: examples: remove dead variable stores,
gnunet <=
- [GNUnet-SVN] [gnurl] 26/63: sectransp: handle errSSLPeerAuthCompleted from SSLRead(), gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 38/63: url: default conn->port to the same as conn->remote_port, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 31/63: nss: allow to specify TLS 1.3 ciphers if supported by NSS, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 36/63: multi: track users of a socket better, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 28/63: FAQ: more minor updates and spelling fixes, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 34/63: cmake: support CMAKE_OSX_ARCHITECTURES when detecting SIZEOF variables, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 41/63: url: Load if_nametoindex() dynamically from iphlpapi.dll on Windows, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 40/63: http: fix "error: equality comparison with extraneous parentheses", gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 48/63: singlesocket: use separate variable for inner loop, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 52/63: test334: verify HTTP 204 response with chunked coding header, gnunet, 2019/06/07