Loading docs/examples/curlx.c +18 −10 Original line number Diff line number Diff line Loading @@ -200,7 +200,8 @@ static int ssl_app_verify_callback(X509_STORE_CTX *ctx, void *arg) if(p->verbose > 1) X509_print_ex(p->errorbio, ctx->cert, 0, 0); if(accessinfo = my_get_ext(ctx->cert, p->accesstype, NID_sinfo_access)) { accessinfo = my_get_ext(ctx->cert, p->accesstype, NID_sinfo_access); if(accessinfo) { if(p->verbose) BIO_printf(p->errorbio, "Setting URL from SIA to: %s\n", accessinfo); Loading Loading @@ -355,7 +356,8 @@ int main(int argc, char **argv) } else if(strcmp(*args, "-accesstype") == 0) { if(args[1]) { if((p.accesstype = OBJ_obj2nid(OBJ_txt2obj(*++args, 0))) == 0) p.accesstype = OBJ_obj2nid(OBJ_txt2obj(*++args, 0)); if(p.accesstype == 0) badarg=1; } else Loading Loading @@ -410,16 +412,19 @@ int main(int argc, char **argv) p.errorbio = BIO_new_fp(stderr, BIO_NOCLOSE); if(!(p.curl = curl_easy_init())) { p.curl = curl_easy_init(); if(!p.curl) { BIO_printf(p.errorbio, "Cannot init curl lib\n"); goto err; } if(!(p12bio = BIO_new_file(p.p12file, "rb"))) { p12bio = BIO_new_file(p.p12file, "rb"); if(!p12bio) { BIO_printf(p.errorbio, "Error opening P12 file %s\n", p.p12file); goto err; } if(!(p.p12 = d2i_PKCS12_bio(p12bio, NULL))) { p.p12 = d2i_PKCS12_bio(p12bio, NULL); if(!p.p12) { BIO_printf(p.errorbio, "Cannot decode P12 structure %s\n", p.p12file); goto err; } Loading Loading @@ -447,16 +452,19 @@ int main(int argc, char **argv) } else if(p.accesstype != 0) { /* see whether we can find an AIA or SIA for a given access type */ if(!(serverurl = my_get_ext(p.usercert, p.accesstype, NID_info_access))) { serverurl = my_get_ext(p.usercert, p.accesstype, NID_info_access); if(!serverurl) { int j=0; BIO_printf(p.errorbio, "no service URL in user cert " "cherching in others certificats\n"); for(j=0; j<sk_X509_num(p.ca); j++) { if((serverurl = my_get_ext(sk_X509_value(p.ca, j), p.accesstype, NID_info_access))) serverurl = my_get_ext(sk_X509_value(p.ca, j), p.accesstype, NID_info_access); if(serverurl) break; if((serverurl = my_get_ext(sk_X509_value(p.ca, j), p.accesstype, NID_sinfo_access))) serverurl = my_get_ext(sk_X509_value(p.ca, j), p.accesstype, NID_sinfo_access); if(serverurl) break; } } Loading docs/examples/externalsocket.c +6 −5 Original line number Diff line number Diff line Loading @@ -90,9 +90,8 @@ int main(void) #ifdef WIN32 WSADATA wsaData; int initwsa; if((initwsa = WSAStartup(MAKEWORD(2, 0), &wsaData)) != 0) { int initwsa = WSAStartup(MAKEWORD(2, 0), &wsaData); if(initwsa != 0) { printf("WSAStartup failed: %d\n", initwsa); return 1; } Loading @@ -107,7 +106,8 @@ int main(void) curl_easy_setopt(curl, CURLOPT_URL, "http://99.99.99.99:9999"); /* Create the socket "manually" */ if((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == CURL_SOCKET_BAD) { sockfd = socket(AF_INET, SOCK_STREAM, 0); if(sockfd == CURL_SOCKET_BAD) { printf("Error creating listening socket.\n"); return 3; } Loading @@ -116,7 +116,8 @@ int main(void) servaddr.sin_family = AF_INET; servaddr.sin_port = htons(PORTNUM); if(INADDR_NONE == (servaddr.sin_addr.s_addr = inet_addr(IPADDR))) servaddr.sin_addr.s_addr = inet_addr(IPADDR); if(INADDR_NONE == servaddr.sin_addr.s_addr) return 2; if(connect(sockfd, (struct sockaddr *) &servaddr, sizeof(servaddr)) == Loading docs/examples/rtsp.c +6 −4 Original line number Diff line number Diff line Loading @@ -62,12 +62,14 @@ static int _getch(void) /* error handling macros */ #define my_curl_easy_setopt(A, B, C) \ if((res = curl_easy_setopt((A), (B), (C))) != CURLE_OK) \ res = curl_easy_setopt((A), (B), (C)); \ if(!res) \ fprintf(stderr, "curl_easy_setopt(%s, %s, %s) failed: %d\n", \ #A, #B, #C, res); #define my_curl_easy_perform(A) \ if((res = curl_easy_perform((A))) != CURLE_OK) \ res = curl_easy_perform(A); \ if(!res) \ fprintf(stderr, "curl_easy_perform(%s) failed: %d\n", #A, res); Loading lib/checksrc.pl +8 −0 Original line number Diff line number Diff line Loading @@ -356,6 +356,14 @@ sub scanfile { } } if($nostr =~ /^((.*)(if) *\()(.*)\)/) { my $pos = length($1); if($4 =~ / = /) { checkwarn("ASSIGNWITHINCONDITION", $line, $pos+1, $file, $l, "assignment within conditional expression"); } } # check spaces after open parentheses if($l =~ /^(.*[a-z])\( /i) { checkwarn("SPACEAFTERPAREN", Loading lib/cookie.c +2 −2 Original line number Diff line number Diff line Loading @@ -798,8 +798,8 @@ Curl_cookie_add(struct Curl_easy *data, /* Check if the domain is a Public Suffix and if yes, ignore the cookie. This needs a libpsl compiled with builtin data. */ if(domain && co->domain && !isip(co->domain)) { if(((psl = psl_builtin()) != NULL) && !psl_is_cookie_domain_acceptable(psl, domain, co->domain)) { psl = psl_builtin(); if(psl && !psl_is_cookie_domain_acceptable(psl, domain, co->domain)) { infof(data, "cookie '%s' dropped, domain '%s' must not set cookies for '%s'\n", co->name, domain, co->domain); Loading Loading
docs/examples/curlx.c +18 −10 Original line number Diff line number Diff line Loading @@ -200,7 +200,8 @@ static int ssl_app_verify_callback(X509_STORE_CTX *ctx, void *arg) if(p->verbose > 1) X509_print_ex(p->errorbio, ctx->cert, 0, 0); if(accessinfo = my_get_ext(ctx->cert, p->accesstype, NID_sinfo_access)) { accessinfo = my_get_ext(ctx->cert, p->accesstype, NID_sinfo_access); if(accessinfo) { if(p->verbose) BIO_printf(p->errorbio, "Setting URL from SIA to: %s\n", accessinfo); Loading Loading @@ -355,7 +356,8 @@ int main(int argc, char **argv) } else if(strcmp(*args, "-accesstype") == 0) { if(args[1]) { if((p.accesstype = OBJ_obj2nid(OBJ_txt2obj(*++args, 0))) == 0) p.accesstype = OBJ_obj2nid(OBJ_txt2obj(*++args, 0)); if(p.accesstype == 0) badarg=1; } else Loading Loading @@ -410,16 +412,19 @@ int main(int argc, char **argv) p.errorbio = BIO_new_fp(stderr, BIO_NOCLOSE); if(!(p.curl = curl_easy_init())) { p.curl = curl_easy_init(); if(!p.curl) { BIO_printf(p.errorbio, "Cannot init curl lib\n"); goto err; } if(!(p12bio = BIO_new_file(p.p12file, "rb"))) { p12bio = BIO_new_file(p.p12file, "rb"); if(!p12bio) { BIO_printf(p.errorbio, "Error opening P12 file %s\n", p.p12file); goto err; } if(!(p.p12 = d2i_PKCS12_bio(p12bio, NULL))) { p.p12 = d2i_PKCS12_bio(p12bio, NULL); if(!p.p12) { BIO_printf(p.errorbio, "Cannot decode P12 structure %s\n", p.p12file); goto err; } Loading Loading @@ -447,16 +452,19 @@ int main(int argc, char **argv) } else if(p.accesstype != 0) { /* see whether we can find an AIA or SIA for a given access type */ if(!(serverurl = my_get_ext(p.usercert, p.accesstype, NID_info_access))) { serverurl = my_get_ext(p.usercert, p.accesstype, NID_info_access); if(!serverurl) { int j=0; BIO_printf(p.errorbio, "no service URL in user cert " "cherching in others certificats\n"); for(j=0; j<sk_X509_num(p.ca); j++) { if((serverurl = my_get_ext(sk_X509_value(p.ca, j), p.accesstype, NID_info_access))) serverurl = my_get_ext(sk_X509_value(p.ca, j), p.accesstype, NID_info_access); if(serverurl) break; if((serverurl = my_get_ext(sk_X509_value(p.ca, j), p.accesstype, NID_sinfo_access))) serverurl = my_get_ext(sk_X509_value(p.ca, j), p.accesstype, NID_sinfo_access); if(serverurl) break; } } Loading
docs/examples/externalsocket.c +6 −5 Original line number Diff line number Diff line Loading @@ -90,9 +90,8 @@ int main(void) #ifdef WIN32 WSADATA wsaData; int initwsa; if((initwsa = WSAStartup(MAKEWORD(2, 0), &wsaData)) != 0) { int initwsa = WSAStartup(MAKEWORD(2, 0), &wsaData); if(initwsa != 0) { printf("WSAStartup failed: %d\n", initwsa); return 1; } Loading @@ -107,7 +106,8 @@ int main(void) curl_easy_setopt(curl, CURLOPT_URL, "http://99.99.99.99:9999"); /* Create the socket "manually" */ if((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == CURL_SOCKET_BAD) { sockfd = socket(AF_INET, SOCK_STREAM, 0); if(sockfd == CURL_SOCKET_BAD) { printf("Error creating listening socket.\n"); return 3; } Loading @@ -116,7 +116,8 @@ int main(void) servaddr.sin_family = AF_INET; servaddr.sin_port = htons(PORTNUM); if(INADDR_NONE == (servaddr.sin_addr.s_addr = inet_addr(IPADDR))) servaddr.sin_addr.s_addr = inet_addr(IPADDR); if(INADDR_NONE == servaddr.sin_addr.s_addr) return 2; if(connect(sockfd, (struct sockaddr *) &servaddr, sizeof(servaddr)) == Loading
docs/examples/rtsp.c +6 −4 Original line number Diff line number Diff line Loading @@ -62,12 +62,14 @@ static int _getch(void) /* error handling macros */ #define my_curl_easy_setopt(A, B, C) \ if((res = curl_easy_setopt((A), (B), (C))) != CURLE_OK) \ res = curl_easy_setopt((A), (B), (C)); \ if(!res) \ fprintf(stderr, "curl_easy_setopt(%s, %s, %s) failed: %d\n", \ #A, #B, #C, res); #define my_curl_easy_perform(A) \ if((res = curl_easy_perform((A))) != CURLE_OK) \ res = curl_easy_perform(A); \ if(!res) \ fprintf(stderr, "curl_easy_perform(%s) failed: %d\n", #A, res); Loading
lib/checksrc.pl +8 −0 Original line number Diff line number Diff line Loading @@ -356,6 +356,14 @@ sub scanfile { } } if($nostr =~ /^((.*)(if) *\()(.*)\)/) { my $pos = length($1); if($4 =~ / = /) { checkwarn("ASSIGNWITHINCONDITION", $line, $pos+1, $file, $l, "assignment within conditional expression"); } } # check spaces after open parentheses if($l =~ /^(.*[a-z])\( /i) { checkwarn("SPACEAFTERPAREN", Loading
lib/cookie.c +2 −2 Original line number Diff line number Diff line Loading @@ -798,8 +798,8 @@ Curl_cookie_add(struct Curl_easy *data, /* Check if the domain is a Public Suffix and if yes, ignore the cookie. This needs a libpsl compiled with builtin data. */ if(domain && co->domain && !isip(co->domain)) { if(((psl = psl_builtin()) != NULL) && !psl_is_cookie_domain_acceptable(psl, domain, co->domain)) { psl = psl_builtin(); if(psl && !psl_is_cookie_domain_acceptable(psl, domain, co->domain)) { infof(data, "cookie '%s' dropped, domain '%s' must not set cookies for '%s'\n", co->name, domain, co->domain); Loading