mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
* gpgkeys_curl.c (get_key, main): Don't try and be smart about what
protocols we handle. Directly pass them to curl or fake-curl and see if an error comes back. * curl-shim.h, curl-shim.c (handle_error), ksutil.c (curl_err_to_gpg_err): Add support for CURLE_UNSUPPORTED_PROTOCOL in fake curl. * Makefile.am: Don't need -DFAKE_CURL any longer since it's in config.h.
This commit is contained in:
parent
a918d63fd5
commit
6f0ed8571b
6 changed files with 37 additions and 31 deletions
|
@ -45,6 +45,10 @@ handle_error(CURL *curl,CURLcode err,const char *str)
|
|||
strcpy(curl->errorbuffer,"okay");
|
||||
break;
|
||||
|
||||
case CURLE_UNSUPPORTED_PROTOCOL:
|
||||
strcpy(curl->errorbuffer,"unsupported protocol");
|
||||
break;
|
||||
|
||||
case CURLE_COULDNT_CONNECT:
|
||||
strcpy(curl->errorbuffer,"couldn't connect");
|
||||
break;
|
||||
|
@ -217,16 +221,26 @@ curl_easy_perform(CURL *curl)
|
|||
}
|
||||
}
|
||||
|
||||
if(rc!=0)
|
||||
switch(rc)
|
||||
{
|
||||
if(rc==G10ERR_NETWORK)
|
||||
errstr=strerror(errno);
|
||||
else
|
||||
errstr=g10_errstr(rc);
|
||||
case 0:
|
||||
break;
|
||||
|
||||
case G10ERR_INVALID_URI:
|
||||
err=CURLE_UNSUPPORTED_PROTOCOL;
|
||||
break;
|
||||
|
||||
case G10ERR_NETWORK:
|
||||
errstr=strerror(errno);
|
||||
err=CURLE_COULDNT_CONNECT;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
errstr=g10_errstr(rc);
|
||||
err=CURLE_COULDNT_CONNECT;
|
||||
break;
|
||||
}
|
||||
|
||||
return handle_error(curl,err,errstr);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue