aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2002-08-27 12:44:18 +0000
committerDavid Shaw <[email protected]>2002-08-27 12:44:18 +0000
commit6cb18a86f501a8b62236b0882ef412c5ffafafb5 (patch)
treeb0e4bcc1507c44bb3fd25ba73cee24351ff1817a
parent* Makefile.am: May as well include gpgkeys_hkp.c in the distribution now. (diff)
downloadgnupg-6cb18a86f501a8b62236b0882ef412c5ffafafb5.tar.gz
gnupg-6cb18a86f501a8b62236b0882ef412c5ffafafb5.zip
* gpgkeys_hkp.c: Include util.h on RISC OS as per Stefan. Include a
replacement for hstrerror() for those platforms (such as RISC OS) that don't have it.
Diffstat (limited to '')
-rw-r--r--keyserver/ChangeLog6
-rw-r--r--keyserver/gpgkeys_hkp.c33
2 files changed, 39 insertions, 0 deletions
diff --git a/keyserver/ChangeLog b/keyserver/ChangeLog
index fbbf2887f..62a5cbc4c 100644
--- a/keyserver/ChangeLog
+++ b/keyserver/ChangeLog
@@ -1,3 +1,9 @@
+2002-08-27 David Shaw <[email protected]>
+
+ * gpgkeys_hkp.c: Include util.h on RISC OS as per Stefan. Include
+ a replacement for hstrerror() for those platforms (such as RISC
+ OS) that don't have it.
+
2002-08-26 David Shaw <[email protected]>
* Makefile.am: May as well include gpgkeys_hkp.c in the
diff --git a/keyserver/gpgkeys_hkp.c b/keyserver/gpgkeys_hkp.c
index 499aa104a..f3dc4ec28 100644
--- a/keyserver/gpgkeys_hkp.c
+++ b/keyserver/gpgkeys_hkp.c
@@ -32,6 +32,10 @@
#include <stdlib.h>
#include "keyserver.h"
+#ifdef __riscos__
+#include "util.h"
+#endif
+
#define GET 0
#define SEND 1
#define SEARCH 2
@@ -49,6 +53,35 @@ struct keylist
struct keylist *next;
};
+#ifndef HAVE_HSTRERROR
+const char *hstrerror(int err)
+{
+ if(err<0)
+ return "Resolver internal error";
+
+ switch(err)
+ {
+ case 0:
+ return "Resolver Error 0 (no error)";
+
+ case HOST_NOT_FOUND:
+ return "Unknown host"; /* 1 HOST_NOT_FOUND */
+
+ case TRY_AGAIN:
+ return "Host name lookup failure"; /* 2 TRY_AGAIN */
+
+ case NO_RECOVERY:
+ return "Unknown server error"; /* 3 NO_RECOVERY */
+
+ case NO_ADDRESS:
+ return "No address associated with name"; /* 4 NO_ADDRESS */
+
+ default:
+ return "Unknown resolver error";
+ }
+}
+#endif /* !HAVE_HSTRERROR */
+
int http_connect(const char *http_host,unsigned short port)
{
int sock=-1;