From 49ce3e5160a9576e797bf87cef012b09d1c54ecb Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Thu, 12 Jul 2007 21:11:10 +0000 Subject: Fixed some compile warnings and errors and improved portability in the examples. Removed ftp3rdparty.c since libcurl doesn't support 3rd party FTP transfers any longer. --- docs/examples/curlx.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'docs/examples/curlx.c') diff --git a/docs/examples/curlx.c b/docs/examples/curlx.c index 31f01e8ad..636c8b4fe 100644 --- a/docs/examples/curlx.c +++ b/docs/examples/curlx.c @@ -81,6 +81,7 @@ #include #include +#include #include #include #include @@ -94,13 +95,13 @@ #include #include -static char *curlx_usage[]={ +static const char *curlx_usage[]={ "usage: curlx args\n", " -p12 arg - tia file ", " -envpass arg - environement variable which content the tia private key password", " -out arg - output file (response)- default stdout", " -in arg - input file (request)- default stdin", - " -connect arg - URL of the server for the connection ex: www.openevidenve.org", + " -connect arg - URL of the server for the connection ex: www.openevidence.org", " -mimetype arg - MIME type for data in ex : application/timestamp-query or application/dvcs -default application/timestamp-query", " -acceptmime arg - MIME type acceptable for the response ex : application/timestamp-response or application/dvcs -default none", " -accesstype arg - an Object identifier in an AIA/SIA method, e.g. AD_DVCS or ad_timestamping", @@ -268,19 +269,21 @@ int main(int argc, char **argv) { char* mimetype; char* mimetypeaccept=NULL; char* contenttype; - char** pp; + const char** pp; unsigned char* hostporturl = NULL; - binaryptr=(char*)malloc(tabLength); BIO * p12bio ; char **args = argv + 1; unsigned char * serverurl; sslctxparm p; char *response; - p.verbose = 0; CURLcode res; struct curl_slist * headers=NULL; + int badarg=0; + + binaryptr=(char*)malloc(tabLength); + p.verbose = 0; p.errorbio = BIO_new_fp (stderr, BIO_NOCLOSE); curl_global_init(CURL_GLOBAL_DEFAULT); @@ -292,7 +295,6 @@ int main(int argc, char **argv) { ERR_load_crypto_strings(); - int badarg=0; while (*args && *args[0] == '-') { if (!strcmp (*args, "-in")) { @@ -407,10 +409,9 @@ 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))) { + int j=0; BIO_printf(p.errorbio,"no service URL in user cert " "cherching in others certificats\n"); - int j=0; - int find=0; for (j=0;j