1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-03-25 22:19:59 +01:00

* gpgkeys_curl.c: s/MAX_PATH/URLMAX_PATH/g to avoid a clash with

the W32 defined macro.  Removed unneeded initialization of static
variables.
* gpgkeys_http.c: Ditto.
* ksutil.h: s/MAX_PATH/URLMAX_PATH/.
This commit is contained in:
Werner Koch 2005-01-18 11:16:10 +00:00
parent 79161ef7b9
commit 02a85a958c
4 changed files with 29 additions and 11 deletions

View File

@ -1,3 +1,11 @@
2005-01-18 Werner Koch <wk@g10code.com>
* gpgkeys_curl.c: s/MAX_PATH/URLMAX_PATH/g to avoid a clash with
the W32 defined macro. Removed unneeded initialization of static
variables.
* gpgkeys_http.c: Ditto.
* ksutil.h: s/MAX_PATH/URLMAX_PATH/.
2005-01-17 David Shaw <dshaw@grover.jabberwocky.com>
* gpgkeys_curl.c (main): Only allow specified protocols to use the

View File

@ -35,10 +35,15 @@ extern char *optarg;
extern int optind;
static int verbose=0;
static char scheme[MAX_SCHEME+1],auth[MAX_AUTH+1],host[MAX_HOST+1]={'\0'},port[MAX_PORT+1]={'\0'},path[MAX_PATH+1]={'\0'},proxy[MAX_PROXY+1]={'\0'};
static FILE *input=NULL,*output=NULL,*console=NULL;
static char scheme[MAX_SCHEME+1];
static char auth[MAX_AUTH+1];
static char host[MAX_HOST+1];
static char port[MAX_PORT+1];
static char path[URLMAX_PATH+1];
static char proxy[MAX_PROXY+1;
static FILE *input, *output, *console;
static CURL *curl;
static char request[MAX_URL]={'\0'};
static char request[MAX_URL];
static int
curl_err_to_gpg_err(CURLcode error)
@ -217,9 +222,9 @@ main(int argc,char *argv[])
continue;
}
if(sscanf(line,"PATH %" MKSTRING(MAX_PATH) "s\n",path)==1)
if(sscanf(line,"PATH %" MKSTRING(URLMAX_PATH) "s\n",path)==1)
{
path[MAX_PATH]='\0';
path[URLMAX_PATH]='\0';
continue;
}

View File

@ -38,8 +38,12 @@ extern int optind;
static int verbose=0;
static unsigned int http_flags=0;
static char auth[MAX_AUTH+1]={'\0'},host[MAX_HOST+1]={'\0'},proxy[MAX_PROXY+1]={'\0'},port[MAX_PORT+1]={'\0'},path[MAX_PATH+1]={'\0'};
static FILE *input=NULL,*output=NULL,*console=NULL;
static char auth[MAX_AUTH+1];
static char host[MAX_HOST+1];
static char proxy[MAX_PROXY+1];
static char port[MAX_PORT+1];
static char path[URLMAX_PATH+1];
static FILE *input,*output,*console;
#ifdef __riscos__
#define HTTP_PROXY_ENV "GnuPG$HttpProxy"
@ -231,9 +235,9 @@ main(int argc,char *argv[])
continue;
}
if(sscanf(line,"PATH %" MKSTRING(MAX_PATH) "s\n",path)==1)
if(sscanf(line,"PATH %" MKSTRING(URLMAX_PATH) "s\n",path)==1)
{
path[MAX_PATH]='\0';
path[URLMAX_PATH]='\0';
continue;
}

View File

@ -36,9 +36,10 @@
#define MAX_AUTH 128
#define MAX_HOST 80
#define MAX_PORT 10
#define MAX_PATH 1024
#define URLMAX_PATH 1024
#define MAX_PROXY 128
#define MAX_URL (MAX_SCHEME+1+3+MAX_AUTH+1+1+MAX_HOST+1+1+MAX_PORT+1+1+MAX_PATH+1+50)
#define MAX_URL (MAX_SCHEME+1+3+MAX_AUTH+1+1+MAX_HOST+1+1 \
+MAX_PORT+1+1+URLMAX_PATH+1+50)
#define STRINGIFY(x) #x
#define MKSTRING(x) STRINGIFY(x)