docs/examples/10-at-a-time.c+1 -1
| @@ -107,7 +107,7 @@ int main(void) |
| CURLM *multi; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| multi = curl_multi_init(); |
docs/examples/address-scope.c+1 -1
| @@ -40,7 +40,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/altsvc.c+1 -1
| @@ -34,7 +34,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/anyauthput.c+1 -1
| @@ -116,7 +116,7 @@ int main(int argc, const char **argv) |
| |
| /* In Windows, this inits the Winsock stuff */ |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) { |
| + | if(result != CURLE_OK) { |
| fclose(fp); |
| return (int)result; |
| } |
docs/examples/block_ip.c+1 -1
| @@ -296,7 +296,7 @@ int main(void) |
| return 1; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) { |
| + | if(result != CURLE_OK) { |
| free(filter); |
| return (int)result; |
| } |
docs/examples/cacertinmem.c+1 -1
| @@ -119,7 +119,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/certinfo.c+2 -2
| @@ -42,7 +42,7 @@ int main(void) |
| CURLcode result; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
| @@ -59,7 +59,7 @@ int main(void) |
| |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| struct curl_certinfo *certinfo; |
| |
| result = curl_easy_getinfo(curl, CURLINFO_CERTINFO, &certinfo); |
docs/examples/chkspeed.c+1 -1
| @@ -162,7 +162,7 @@ int main(int argc, const char *argv[]) |
| |
| /* init libcurl */ |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| /* init the curl session */ |
docs/examples/connect-to.c+1 -1
| @@ -35,7 +35,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| /* |
docs/examples/cookie_interface.c+1 -1
| @@ -77,7 +77,7 @@ int main(void) |
| CURLcode result; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/crawler.c+1 -1
| @@ -186,7 +186,7 @@ int main(void) |
| CURLcode result; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| signal(SIGINT, sighandler); |
docs/examples/debug.c+1 -1
| @@ -125,7 +125,7 @@ int main(void) |
| struct data config; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| config.trace_ascii = 1; /* enable ASCII tracing */ |
docs/examples/default-scheme.c+1 -1
| @@ -35,7 +35,7 @@ int main(void) |
| CURLcode result; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/ephiperfifo.c+1 -1
| @@ -464,7 +464,7 @@ int main(void) |
| struct epoll_event events[10]; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| g_should_exit_ = 0; |
docs/examples/evhiperfifo.c+1 -1
| @@ -413,7 +413,7 @@ int main(void) |
| struct GlobalInfo g; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| memset(&g, 0, sizeof(g)); |
docs/examples/externalsocket.c+2 -2
| @@ -104,7 +104,7 @@ int main(void) |
| curl_socket_t sockfd; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
| @@ -163,7 +163,7 @@ int main(void) |
| |
| close(sockfd); |
| |
| - | if(result) { |
| + | if(result != CURLE_OK) { |
| printf("libcurl error: %d\n", result); |
| return 4; |
| } |
docs/examples/fileupload.c+1 -1
| @@ -54,7 +54,7 @@ int main(void) |
| FILE *fd; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| fd = fopen("debugit", "rb"); /* open file to upload */ |
docs/examples/ftp-delete.c+1 -1
| @@ -43,7 +43,7 @@ int main(void) |
| struct curl_slist *headerlist = NULL; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/ftp-wildcard.c+1 -1
| @@ -107,7 +107,7 @@ int main(int argc, const char **argv) |
| |
| /* global initialization */ |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| /* initialization of easy handle */ |
docs/examples/ftpget.c+1 -1
| @@ -62,7 +62,7 @@ int main(void) |
| }; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/ftpgetinfo.c+1 -1
| @@ -56,7 +56,7 @@ int main(void) |
| const char *filename = strrchr(ftpurl, '/') + 1; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/ftpgetresp.c+1 -1
| @@ -53,7 +53,7 @@ int main(void) |
| FILE *respfile; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| /* local filename to store the file as */ |
docs/examples/ftpsget.c+1 -1
| @@ -62,7 +62,7 @@ int main(void) |
| }; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/ftpupload.c+1 -1
| @@ -107,7 +107,7 @@ int main(void) |
| |
| /* In Windows, this inits the Winsock stuff */ |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) { |
| + | if(result != CURLE_OK) { |
| fclose(hd_src); |
| return (int)result; |
| } |
docs/examples/ftpuploadresume.c+1 -1
| @@ -158,7 +158,7 @@ int main(void) |
| CURL *curl = NULL; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/getinfo.c+1 -1
| @@ -34,7 +34,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/getinmemory.c+1 -1
| @@ -65,7 +65,7 @@ int main(void) |
| struct MemoryStruct chunk; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| chunk.memory = malloc(1); /* grown as needed by the realloc above */ |
docs/examples/getredirect.c+1 -1
| @@ -35,7 +35,7 @@ int main(void) |
| CURLcode result; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/getreferrer.c+1 -1
| @@ -34,7 +34,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/ghiper.c+1 -1
| @@ -432,7 +432,7 @@ int main(void) |
| GIOChannel *ch; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| fd = init_fifo(); |
docs/examples/headerapi.c+1 -1
| @@ -42,7 +42,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/hiperfifo.c+1 -1
| @@ -422,7 +422,7 @@ int main(void) |
| struct GlobalInfo g; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| memset(&g, 0, sizeof(g)); |
docs/examples/hsts-preload.c+1 -1
| @@ -92,7 +92,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/htmltidy.c+2 -2
| @@ -89,7 +89,7 @@ int main(int argc, const char **argv) |
| } |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| tdoc = tidyCreate(); |
| @@ -108,7 +108,7 @@ int main(int argc, const char **argv) |
| |
| curl_easy_setopt(curl, CURLOPT_WRITEDATA, &docbuf); |
| result = curl_easy_perform(curl); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| result = tidyParseBuffer(tdoc, &docbuf); /* parse the input */ |
| if(result >= 0) { |
| result = tidyCleanAndRepair(tdoc); /* fix any problems */ |
docs/examples/htmltitle.cpp+1 -1
| @@ -264,7 +264,7 @@ int main(int argc, const char *argv[]) |
| } |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| // Initialize CURL handle |
docs/examples/http-options.c+1 -1
| @@ -34,7 +34,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/http-post.c+1 -1
| @@ -36,7 +36,7 @@ int main(void) |
| |
| /* In Windows, this inits the Winsock stuff */ |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| /* get a curl handle */ |
docs/examples/http2-download.c+1 -1
| @@ -206,7 +206,7 @@ int main(int argc, const char **argv) |
| num_transfers = 3; /* a suitable low default */ |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| trans = calloc(num_transfers, sizeof(*trans)); |
docs/examples/http2-pushinmemory.c+1 -1
| @@ -126,7 +126,7 @@ int main(void) |
| int i; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| /* init a multi stack */ |
docs/examples/http2-serverpush.c+1 -1
| @@ -226,7 +226,7 @@ int main(int argc, const char *argv[]) |
| url = argv[1]; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| /* init a multi stack */ |
docs/examples/http2-upload.c+1 -1
| @@ -309,7 +309,7 @@ int main(int argc, const char **argv) |
| num_transfers = 3; /* a suitable low default */ |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| trans = calloc(num_transfers, sizeof(*trans)); |
docs/examples/http3-present.c+1 -1
| @@ -34,7 +34,7 @@ int main(void) |
| curl_version_info_data *ver; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| ver = curl_version_info(CURLVERSION_NOW); |
docs/examples/http3.c+1 -1
| @@ -34,7 +34,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/httpcustomheader.c+1 -1
| @@ -34,7 +34,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/httpput-postfields.c+1 -1
| @@ -60,7 +60,7 @@ int main(int argc, const char **argv) |
| |
| /* In Windows, this inits the Winsock stuff */ |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| /* get a curl handle */ |
docs/examples/httpput.c+1 -1
| @@ -104,7 +104,7 @@ int main(int argc, const char **argv) |
| |
| /* In Windows, this inits the Winsock stuff */ |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) { |
| + | if(result != CURLE_OK) { |
| fclose(hd_src); |
| return (int)result; |
| } |
docs/examples/https.c+1 -1
| @@ -34,7 +34,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/imap-append.c+1 -1
| @@ -88,7 +88,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/imap-authzid.c+1 -1
| @@ -40,7 +40,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/imap-copy.c+1 -1
| @@ -40,7 +40,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/imap-create.c+1 -1
| @@ -40,7 +40,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/imap-delete.c+1 -1
| @@ -40,7 +40,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/imap-examine.c+1 -1
| @@ -40,7 +40,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/imap-fetch.c+1 -1
| @@ -40,7 +40,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/imap-list.c+1 -1
| @@ -40,7 +40,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/imap-lsub.c+1 -1
| @@ -40,7 +40,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/imap-multi.c+1 -1
| @@ -40,7 +40,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/imap-noop.c+1 -1
| @@ -40,7 +40,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/imap-search.c+1 -1
| @@ -40,7 +40,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/imap-ssl.c+1 -1
| @@ -41,7 +41,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/imap-store.c+1 -1
| @@ -40,7 +40,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/imap-tls.c+1 -1
| @@ -41,7 +41,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/interface.c+1 -1
| @@ -34,7 +34,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/ipv6.c+1 -1
| @@ -34,7 +34,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/keepalive.c+1 -1
| @@ -34,7 +34,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/localport.c+1 -1
| @@ -34,7 +34,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/log_failed_transfers.c+1 -1
| @@ -225,7 +225,7 @@ int main(void) |
| transfer[1].logfile = "400_transfer_log.txt"; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) { |
| + | if(result != CURLE_OK) { |
| fprintf(stderr, "curl_global_init failed\n"); |
| return (int)result; |
| } |
docs/examples/maxconnects.c+1 -1
| @@ -34,7 +34,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/multi-app.c+1 -1
| @@ -47,7 +47,7 @@ int main(void) |
| int i; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| /* Allocate one curl handle per transfer */ |
docs/examples/multi-debugcallback.c+1 -1
| @@ -118,7 +118,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/multi-double.c+1 -1
| @@ -39,7 +39,7 @@ int main(void) |
| CURL *curl2; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/multi-event.c+1 -1
| @@ -221,7 +221,7 @@ int main(int argc, const char **argv) |
| return 0; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) { |
| + | if(result != CURLE_OK) { |
| fprintf(stderr, "Could not init curl\n"); |
| return (int)result; |
| } |
docs/examples/multi-formadd.c+1 -1
| @@ -44,7 +44,7 @@ int main(void) |
| static const char buf[] = "Expect:"; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| CURL_IGNORE_DEPRECATION( |
docs/examples/multi-legacy.c+1 -1
| @@ -53,7 +53,7 @@ int main(void) |
| int i; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| /* Allocate one curl handle per transfer */ |
docs/examples/multi-post.c+1 -1
| @@ -40,7 +40,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/multi-single.c+1 -1
| @@ -39,7 +39,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/multi-uv.c+1 -1
| @@ -237,7 +237,7 @@ int main(int argc, const char **argv) |
| return 0; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| uv.loop = uv_default_loop(); |
docs/examples/netrc.c+1 -1
| @@ -34,7 +34,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/persistent.c+1 -1
| @@ -34,7 +34,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/pop3-authzid.c+1 -1
| @@ -40,7 +40,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/pop3-dele.c+1 -1
| @@ -40,7 +40,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/pop3-list.c+1 -1
| @@ -40,7 +40,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/pop3-multi.c+1 -1
| @@ -41,7 +41,7 @@ int main(void) |
| CURL *curl; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/pop3-noop.c+1 -1
| @@ -40,7 +40,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/pop3-retr.c+1 -1
| @@ -40,7 +40,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/pop3-ssl.c+1 -1
| @@ -41,7 +41,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/pop3-stat.c+1 -1
| @@ -40,7 +40,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/pop3-tls.c+1 -1
| @@ -41,7 +41,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/pop3-top.c+1 -1
| @@ -40,7 +40,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/pop3-uidl.c+1 -1
| @@ -40,7 +40,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/postinmemory.c+1 -1
| @@ -64,7 +64,7 @@ int main(void) |
| static const char *postthis = "Field=1&Field=2&Field=3"; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| chunk.memory = malloc(1); /* grown as needed by realloc above */ |
docs/examples/postit2-formadd.c+1 -1
| @@ -56,7 +56,7 @@ int main(int argc, const char *argv[]) |
| static const char buf[] = "Expect:"; |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| CURL_IGNORE_DEPRECATION( |
docs/examples/postit2.c+1 -1
| @@ -47,7 +47,7 @@ int main(int argc, const char *argv[]) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/progressfunc.c+1 -1
| @@ -78,7 +78,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/protofeats.c+1 -1
| @@ -39,7 +39,7 @@ int main(void) |
| const char * const *ptr; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| ver = curl_version_info(CURLVERSION_NOW); |
docs/examples/range.c+1 -1
| @@ -32,7 +32,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/resolve.c+1 -1
| @@ -43,7 +43,7 @@ int main(void) |
| "example.com:443:127.0.0.1"); |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/rtsp-options.c+1 -1
| @@ -34,7 +34,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/sendrecv.c+1 -1
| @@ -81,7 +81,7 @@ int main(void) |
| size_t request_len = strlen(request); |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| /* A general note of caution here: if you are using curl_easy_recv() or |
docs/examples/sepheaders.c+1 -1
| @@ -47,7 +47,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| /* init the curl session */ |
docs/examples/sessioninfo.c+2 -2
| @@ -53,7 +53,7 @@ static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *stream) |
| |
| result = curl_easy_getinfo(curl, CURLINFO_TLS_SESSION, &info); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| unsigned int cert_list_size; |
| const gnutls_datum_t *chainp; |
| |
| @@ -97,7 +97,7 @@ static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *stream) |
| int main(void) |
| { |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/sftpget.c+1 -1
| @@ -71,7 +71,7 @@ int main(void) |
| }; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/sftpuploadresume.c+2 -2
| @@ -73,7 +73,7 @@ static curl_off_t sftpGetRemoteFileSize(const char *i_remoteFile) |
| if(result == CURLE_OK) { |
| result = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, |
| &remoteFileSizeByte); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return -1; |
| printf("filesize: %" CURL_FORMAT_CURL_OFF_T "\n", remoteFileSizeByte); |
| } |
| @@ -129,7 +129,7 @@ int main(void) |
| CURL *curl = NULL; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/shared-connection-cache.c+1 -1
| @@ -53,7 +53,7 @@ int main(void) |
| int i; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| share = curl_share_init(); |
docs/examples/simple.c+1 -1
| @@ -34,7 +34,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/simplepost.c+1 -1
| @@ -37,7 +37,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/simplessl.c+1 -1
| @@ -71,7 +71,7 @@ int main(void) |
| #endif |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) { |
| + | if(result != CURLE_OK) { |
| return (int)result; |
| } |
| |
docs/examples/smooth-gtk-thread.c+1 -1
| @@ -172,7 +172,7 @@ int main(int argc, const char **argv) |
| |
| /* Must initialize libcurl before any threads are started */ |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| /* Init thread */ |
docs/examples/smtp-authzid.c+1 -1
| @@ -93,7 +93,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/smtp-expn.c+1 -1
| @@ -43,7 +43,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/smtp-mail.c+1 -1
| @@ -90,7 +90,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/smtp-mime.c+1 -1
| @@ -71,7 +71,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/smtp-multi.c+1 -1
| @@ -83,7 +83,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/smtp-ssl.c+1 -1
| @@ -87,7 +87,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/smtp-tls.c+1 -1
| @@ -87,7 +87,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/smtp-vrfy.c+1 -1
| @@ -46,7 +46,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/synctime.c+1 -1
| @@ -275,7 +275,7 @@ int main(int argc, const char *argv[]) |
| |
| /* Init CURL before usage */ |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/threaded.c+1 -1
| @@ -88,7 +88,7 @@ int main(void) |
| |
| /* Must initialize libcurl before any threads are started */ |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| for(i = 0; i < NUMT; i++) { |
docs/examples/unixsocket.c+1 -1
| @@ -43,7 +43,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/url2file.c+1 -1
| @@ -55,7 +55,7 @@ int main(int argc, const char *argv[]) |
| } |
| |
| result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) { |
| + | if(result != CURLE_OK) { |
| fprintf(stderr, "Could not init curl\n"); |
| return (int)result; |
| } |
docs/examples/urlapi.c+1 -1
| @@ -39,7 +39,7 @@ int main(void) |
| CURLUcode uc; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| /* init curl URL */ |
docs/examples/usercertinmem.c+1 -1
| @@ -159,7 +159,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/websocket-cb.c+1 -1
| @@ -46,7 +46,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/websocket-updown.c+3 -3
| @@ -60,14 +60,14 @@ static size_t read_cb(char *buf, size_t nitems, size_t buflen, void *p) |
| struct read_ctx *ctx = p; |
| size_t len = nitems * buflen; |
| size_t left = ctx->blen - ctx->nsent; |
| - | CURLcode result; |
| |
| if(!ctx->nsent) { |
| + | CURLcode result; |
| /* On first call, set the FRAME information to be used (it defaults to |
| * CURLWS_BINARY otherwise). */ |
| result = curl_ws_start_frame(ctx->curl, CURLWS_TEXT, |
| (curl_off_t)ctx->blen); |
| - | if(result) { |
| + | if(result != CURLE_OK) { |
| fprintf(stderr, "error starting frame: %d\n", result); |
| return CURL_READFUNC_ABORT; |
| } |
| @@ -90,7 +90,7 @@ int main(int argc, const char *argv[]) |
| const char *payload = "Hello, friend!"; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| memset(&rctx, 0, sizeof(rctx)); |
docs/examples/websocket.c+7 -7
| @@ -45,7 +45,7 @@ static CURLcode ping(CURL *curl, const char *send_payload) |
| |
| while(blen) { |
| result = curl_ws_send(curl, buf, blen, &sent, 0, CURLWS_PING); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| buf += sent; /* deduct what was sent */ |
| blen -= sent; |
| } |
| @@ -57,7 +57,7 @@ static CURLcode ping(CURL *curl, const char *send_payload) |
| else /* real error sending */ |
| break; |
| } |
| - | if(!result) |
| + | if(result == CURLE_OK) |
| fprintf(stderr, "ws: sent PING with payload\n"); |
| return result; |
| } |
| @@ -71,7 +71,7 @@ static CURLcode recv_pong(CURL *curl, const char *expected_payload) |
| |
| retry: |
| result = curl_ws_recv(curl, buffer, sizeof(buffer), &rlen, &meta); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| /* on small PING content, this example assumes the complete |
| * PONG content arrives in one go. Larger frames will arrive |
| * in chunks, however. */ |
| @@ -104,7 +104,7 @@ retry: |
| be good here. */ |
| goto retry; |
| } |
| - | if(result) |
| + | if(result != CURLE_OK) |
| fprintf(stderr, "ws: curl_ws_recv returned %u, received %u\n", |
| (unsigned int)result, (unsigned int)rlen); |
| return result; |
| @@ -123,10 +123,10 @@ static CURLcode websocket(CURL *curl) |
| int i = 0; |
| do { |
| result = ping(curl, "foobar"); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| break; |
| result = recv_pong(curl, "foobar"); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| break; |
| sleep(1); |
| } while(i++ < 10); |
| @@ -139,7 +139,7 @@ int main(int argc, const char *argv[]) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| curl = curl_easy_init(); |
docs/examples/xmlstream.c+1 -1
| @@ -119,7 +119,7 @@ int main(void) |
| CURL *curl; |
| |
| CURLcode result = curl_global_init(CURL_GLOBAL_ALL); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| return (int)result; |
| |
| /* Initialize a libcurl handle. */ |
docs/libcurl/curl_easy_cleanup.md+1 -1
| @@ -65,7 +65,7 @@ int main(void) |
| CURLcode result; |
| curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); |
| result = curl_easy_perform(curl); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| printf("error: %s\n", curl_easy_strerror(result)); |
| curl_easy_cleanup(curl); |
| } |
docs/libcurl/curl_ws_start_frame.md+2 -2
| @@ -77,13 +77,13 @@ static size_t readcb(char *buf, size_t nitems, size_t buflen, void *p) |
| struct read_ctx *ctx = p; |
| size_t len = nitems * buflen; |
| size_t left = ctx->msg_len - ctx->nsent; |
| - | CURLcode result; |
| |
| if(!ctx->nsent) { |
| + | CURLcode result; |
| /* Want to send TEXT frame. */ |
| result = curl_ws_start_frame(ctx->easy, CURLWS_TEXT, |
| (curl_off_t)ctx->msg_len); |
| - | if(result) { |
| + | if(result != CURLE_OK) { |
| fprintf(stderr, "error starting frame: %d\n", result); |
| return CURL_READFUNC_ABORT; |
| } |
docs/libcurl/opts/CURLINFO_CERTINFO.md+2 -2
| @@ -71,12 +71,12 @@ int main(void) |
| |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| int i; |
| struct curl_certinfo *ci; |
| result = curl_easy_getinfo(curl, CURLINFO_CERTINFO, &ci); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| printf("%d certs!\n", ci->num_of_certs); |
| |
| for(i = 0; i < ci->num_of_certs; i++) { |
docs/libcurl/opts/CURLINFO_CONDITION_UNMET.md+2 -2
| @@ -59,11 +59,11 @@ int main(void) |
| /* Perform the request */ |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| /* check the time condition */ |
| long unmet; |
| result = curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &unmet); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| printf("The time condition was %sfulfilled\n", unmet?"NOT":""); |
| } |
| } |
docs/libcurl/opts/CURLINFO_CONN_ID.md+2 -2
| @@ -51,10 +51,10 @@ int main(void) |
| /* Perform the request */ |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| curl_off_t conn_id; |
| result = curl_easy_getinfo(curl, CURLINFO_CONN_ID, &conn_id); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| printf("Connection used: %" CURL_FORMAT_CURL_OFF_T "\n", conn_id); |
| } |
| } |
docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD.md+2 -2
| @@ -50,11 +50,11 @@ int main(void) |
| /* Perform the request */ |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| /* check the size */ |
| double cl; |
| result = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &cl); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| printf("Size: %.0f\n", cl); |
| } |
| } |
docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD_T.md+2 -2
| @@ -47,12 +47,12 @@ int main(void) |
| /* Perform the request */ |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| /* check the size */ |
| curl_off_t cl; |
| result = |
| curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &cl); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| printf("Download size: %" CURL_FORMAT_CURL_OFF_T "\n", cl); |
| } |
| } |
docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD.md+2 -2
| @@ -49,11 +49,11 @@ int main(void) |
| /* Perform the upload */ |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| /* check the size */ |
| double cl; |
| result = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_UPLOAD, &cl); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| printf("Size: %.0f\n", cl); |
| } |
| } |
docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD_T.md+2 -2
| @@ -46,11 +46,11 @@ int main(void) |
| /* Perform the upload */ |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| /* check the size */ |
| curl_off_t cl; |
| result = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_UPLOAD_T, &cl); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| printf("Upload size: %" CURL_FORMAT_CURL_OFF_T "\n", cl); |
| } |
| } |
docs/libcurl/opts/CURLINFO_CONTENT_TYPE.md+1 -1
| @@ -54,7 +54,7 @@ int main(void) |
| |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| /* extract the content-type */ |
| char *ct = NULL; |
| result = curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &ct); |
docs/libcurl/opts/CURLINFO_COOKIELIST.md+1 -1
| @@ -54,7 +54,7 @@ int main(void) |
| |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| /* extract all known cookies */ |
| struct curl_slist *cookies = NULL; |
| result = curl_easy_getinfo(curl, CURLINFO_COOKIELIST, &cookies); |
docs/libcurl/opts/CURLINFO_EARLYDATA_SENT_T.md+2 -2
| @@ -57,10 +57,10 @@ int main(void) |
| /* Perform the request */ |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| curl_off_t amount; |
| result = curl_easy_getinfo(curl, CURLINFO_EARLYDATA_SENT_T, &amount); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| printf("TLS earlydata: %" CURL_FORMAT_CURL_OFF_T " bytes\n", amount); |
| } |
| } |
docs/libcurl/opts/CURLINFO_FTP_ENTRY_PATH.md+1 -1
| @@ -50,7 +50,7 @@ int main(void) |
| |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| /* extract the entry path */ |
| char *ep = NULL; |
| result = curl_easy_getinfo(curl, CURLINFO_FTP_ENTRY_PATH, &ep); |
docs/libcurl/opts/CURLINFO_HEADER_SIZE.md+1 -1
| @@ -49,7 +49,7 @@ int main(void) |
| if(result == CURLE_OK) { |
| long size; |
| result = curl_easy_getinfo(curl, CURLINFO_HEADER_SIZE, &size); |
| - | if(!result) |
| + | if(result == CURLE_OK) |
| printf("Header size: %ld bytes\n", size); |
| } |
| curl_easy_cleanup(curl); |
docs/libcurl/opts/CURLINFO_HTTPAUTH_AVAIL.md+2 -2
| @@ -46,11 +46,11 @@ int main(void) |
| |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| /* extract the available authentication types */ |
| long auth; |
| result = curl_easy_getinfo(curl, CURLINFO_HTTPAUTH_AVAIL, &auth); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| if(!auth) |
| printf("No auth available, perhaps no 401?\n"); |
| else { |
docs/libcurl/opts/CURLINFO_HTTPAUTH_USED.md+2 -2
| @@ -50,10 +50,10 @@ int main(void) |
| |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| long auth; |
| result = curl_easy_getinfo(curl, CURLINFO_HTTPAUTH_USED, &auth); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| if(!auth) |
| printf("No auth used\n"); |
| else { |
docs/libcurl/opts/CURLINFO_NUM_CONNECTS.md+1 -1
| @@ -49,7 +49,7 @@ int main(void) |
| if(result == CURLE_OK) { |
| long connects; |
| result = curl_easy_getinfo(curl, CURLINFO_NUM_CONNECTS, &connects); |
| - | if(!result) |
| + | if(result == CURLE_OK) |
| printf("It needed %ld connects\n", connects); |
| } |
| curl_easy_cleanup(curl); |
docs/libcurl/opts/CURLINFO_PRIMARY_PORT.md+1 -1
| @@ -56,7 +56,7 @@ int main(void) |
| if(result == CURLE_OK) { |
| long port; |
| result = curl_easy_getinfo(curl, CURLINFO_PRIMARY_PORT, &port); |
| - | if(!result) |
| + | if(result == CURLE_OK) |
| printf("Connected to remote port: %ld\n", port); |
| } |
| curl_easy_cleanup(curl); |
docs/libcurl/opts/CURLINFO_PRIVATE.md+1 -1
| @@ -52,7 +52,7 @@ int main(void) |
| /* extract the private pointer again */ |
| result = curl_easy_getinfo(curl, CURLINFO_PRIVATE, &pointer); |
| |
| - | if(result) |
| + | if(result != CURLE_OK) |
| printf("error: %s\n", curl_easy_strerror(result)); |
| |
| curl_easy_cleanup(curl); |
docs/libcurl/opts/CURLINFO_PROXYAUTH_AVAIL.md+2 -2
| @@ -47,11 +47,11 @@ int main(void) |
| |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| /* extract the available proxy authentication types */ |
| long auth; |
| result = curl_easy_getinfo(curl, CURLINFO_PROXYAUTH_AVAIL, &auth); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| if(!auth) |
| printf("No proxy auth available, perhaps no 407?\n"); |
| else { |
docs/libcurl/opts/CURLINFO_PROXYAUTH_USED.md+2 -2
| @@ -53,10 +53,10 @@ int main(void) |
| |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| long auth; |
| result = curl_easy_getinfo(curl, CURLINFO_PROXYAUTH_USED, &auth); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| if(!auth) |
| printf("No auth used\n"); |
| else { |
docs/libcurl/opts/CURLINFO_PROXY_SSL_VERIFYRESULT.md+2 -2
| @@ -53,7 +53,7 @@ int main(void) |
| curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy.example:443"); |
| |
| result = curl_easy_perform(curl); |
| - | if(result) { |
| + | if(result != CURLE_OK) { |
| printf("error: %s\n", curl_easy_strerror(result)); |
| curl_easy_cleanup(curl); |
| return 1; |
| @@ -61,7 +61,7 @@ int main(void) |
| |
| result = curl_easy_getinfo(curl, CURLINFO_PROXY_SSL_VERIFYRESULT, |
| &verifyresult); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| printf("The peer verification said %s\n", |
| (verifyresult ? "bad" : "fine")); |
| } |
docs/libcurl/opts/CURLINFO_REQUEST_SIZE.md+1 -1
| @@ -47,7 +47,7 @@ int main(void) |
| if(result == CURLE_OK) { |
| long req; |
| result = curl_easy_getinfo(curl, CURLINFO_REQUEST_SIZE, &req); |
| - | if(!result) |
| + | if(result == CURLE_OK) |
| printf("Request size: %ld bytes\n", req); |
| } |
| curl_easy_cleanup(curl); |
docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD.md+2 -2
| @@ -53,11 +53,11 @@ int main(void) |
| /* Perform the request */ |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| /* check the size */ |
| double dl; |
| result = curl_easy_getinfo(curl, CURLINFO_SIZE_DOWNLOAD, &dl); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| printf("Downloaded %.0f bytes\n", dl); |
| } |
| } |
docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD_T.md+2 -2
| @@ -50,11 +50,11 @@ int main(void) |
| /* Perform the request */ |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| /* check the size */ |
| curl_off_t dl; |
| result = curl_easy_getinfo(curl, CURLINFO_SIZE_DOWNLOAD_T, &dl); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| printf("Downloaded %" CURL_FORMAT_CURL_OFF_T " bytes\n", dl); |
| } |
| } |
docs/libcurl/opts/CURLINFO_SIZE_UPLOAD.md+2 -2
| @@ -50,10 +50,10 @@ int main(void) |
| /* Perform the request */ |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| double ul; |
| result = curl_easy_getinfo(curl, CURLINFO_SIZE_UPLOAD, &ul); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| printf("Uploaded %.0f bytes\n", ul); |
| } |
| } |
docs/libcurl/opts/CURLINFO_SIZE_UPLOAD_T.md+2 -2
| @@ -47,10 +47,10 @@ int main(void) |
| /* Perform the request */ |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| curl_off_t ul; |
| result = curl_easy_getinfo(curl, CURLINFO_SIZE_UPLOAD_T, &ul); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| printf("Uploaded %" CURL_FORMAT_CURL_OFF_T " bytes\n", ul); |
| } |
| } |
docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD.md+2 -2
| @@ -50,10 +50,10 @@ int main(void) |
| /* Perform the request */ |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| double speed; |
| result = curl_easy_getinfo(curl, CURLINFO_SPEED_DOWNLOAD, &speed); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| printf("Download speed %.0f bytes/sec\n", speed); |
| } |
| } |
docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD_T.md+2 -2
| @@ -47,10 +47,10 @@ int main(void) |
| /* Perform the request */ |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| curl_off_t speed; |
| result = curl_easy_getinfo(curl, CURLINFO_SPEED_DOWNLOAD_T, &speed); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| printf("Download speed %" CURL_FORMAT_CURL_OFF_T " bytes/sec\n", |
| speed); |
| } |
docs/libcurl/opts/CURLINFO_SPEED_UPLOAD.md+2 -2
| @@ -48,10 +48,10 @@ int main(void) |
| /* Perform the request */ |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| double speed; |
| result = curl_easy_getinfo(curl, CURLINFO_SPEED_UPLOAD, &speed); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| printf("Upload speed %.0f bytes/sec\n", speed); |
| } |
| } |
docs/libcurl/opts/CURLINFO_SPEED_UPLOAD_T.md+2 -2
| @@ -46,10 +46,10 @@ int main(void) |
| /* Perform the request */ |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| curl_off_t speed; |
| result = curl_easy_getinfo(curl, CURLINFO_SPEED_UPLOAD_T, &speed); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| printf("Upload speed %" CURL_FORMAT_CURL_OFF_T " bytes/sec\n", speed); |
| } |
| } |
docs/libcurl/opts/CURLINFO_SSL_VERIFYRESULT.md+2 -2
| @@ -52,7 +52,7 @@ int main(void) |
| curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); |
| |
| result = curl_easy_perform(curl); |
| - | if(result) { |
| + | if(result != CURLE_OK) { |
| printf("error: %s\n", curl_easy_strerror(result)); |
| curl_easy_cleanup(curl); |
| return 1; |
| @@ -60,7 +60,7 @@ int main(void) |
| |
| result = curl_easy_getinfo(curl, CURLINFO_SSL_VERIFYRESULT, |
| &verifyresult); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| printf("The peer verification said %s\n", |
| (verifyresult ? "bad" : "fine")); |
| } |
docs/libcurl/opts/CURLINFO_TLS_SESSION.md+1 -1
| @@ -72,7 +72,7 @@ int main(void) |
| struct curl_tlssessioninfo *tls; |
| curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); |
| result = curl_easy_perform(curl); |
| - | if(result) |
| + | if(result != CURLE_OK) |
| printf("error: %s\n", curl_easy_strerror(result)); |
| curl_easy_getinfo(curl, CURLINFO_TLS_SESSION, &tls); |
| curl_easy_cleanup(curl); |
docs/libcurl/opts/CURLINFO_USED_PROXY.md+2 -2
| @@ -48,11 +48,11 @@ int main(int argc, char *argv[]) |
| |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| /* extract the available proxy authentication types */ |
| long used; |
| result = curl_easy_getinfo(curl, CURLINFO_USED_PROXY, &used); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| printf("The proxy was %sused\n", used ? "" : "NOT "); |
| } |
| } |
docs/libcurl/opts/CURLINFO_XFER_ID.md+2 -2
| @@ -51,10 +51,10 @@ int main(void) |
| /* Perform the request */ |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| curl_off_t xfer_id; |
| result = curl_easy_getinfo(curl, CURLINFO_XFER_ID, &xfer_id); |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| printf("Transfer ID: %" CURL_FORMAT_CURL_OFF_T "\n", xfer_id); |
| } |
| } |
docs/libcurl/opts/CURLOPT_CERTINFO.md+2 -2
| @@ -64,11 +64,11 @@ int main(void) |
| |
| result = curl_easy_perform(curl); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| struct curl_certinfo *ci; |
| result = curl_easy_getinfo(curl, CURLINFO_CERTINFO, &ci); |
| |
| - | if(!result) { |
| + | if(result == CURLE_OK) { |
| int i; |
| printf("%d certs!\n", ci->num_of_certs); |
| |
docs/libcurl/opts/CURLOPT_SSL_CTX_DATA.md+1 -1
| @@ -104,7 +104,7 @@ int main(void) |
| curl_easy_setopt(curl, CURLOPT_SSL_CTX_FUNCTION, *sslctx_function); |
| curl_easy_setopt(curl, CURLOPT_SSL_CTX_DATA, mypem); |
| result = curl_easy_perform(curl); |
| - | if(!result) |
| + | if(result == CURLE_OK) |
| printf("*** transfer succeeded ***\n"); |
| else |
| printf("*** transfer failed ***\n"); |
docs/libcurl/opts/CURLOPT_SSL_CTX_FUNCTION.md+1 -1
| @@ -157,7 +157,7 @@ int main(void) |
| curl_easy_setopt(curl, CURLOPT_SSL_CTX_FUNCTION, *sslctx_function); |
| curl_easy_setopt(curl, CURLOPT_SSL_CTX_DATA, mypem); |
| result = curl_easy_perform(curl); |
| - | if(!result) |
| + | if(result == CURLE_OK) |
| printf("*** transfer succeeded ***\n"); |
| else |
| printf("*** transfer failed ***\n"); |