[svn] GnuPG - r4739 - trunk/keyserver

svn author wk cvs at cvs.gnupg.org
Mon Apr 7 21:55:45 CEST 2008


Author: wk
Date: 2008-04-07 21:55:44 +0200 (Mon, 07 Apr 2008)
New Revision: 4739

Modified:
   trunk/keyserver/gpgkeys_kdns.c
Log:
Allow requesting TCP queries.


Modified: trunk/keyserver/gpgkeys_kdns.c
===================================================================
--- trunk/keyserver/gpgkeys_kdns.c	2008-04-07 19:31:12 UTC (rev 4738)
+++ trunk/keyserver/gpgkeys_kdns.c	2008-04-07 19:55:44 UTC (rev 4739)
@@ -63,9 +63,10 @@
 /* The replacement string for the at sign.  */
 static const char *kdns_at_repl;
 
+/* Flag indicating that a TCP conenction should be used.  */
+static int kdns_usevc;
 
 
-
 
 /* Retrieve one key.  ADDRESS should be an RFC-2822 addr-spec. */
 static int
@@ -103,9 +104,8 @@
   if (opt->verbose > 2)
     fprintf(console, PGM": looking up `%s'\n", name);
 
-
   if ( adns_synchronous (adns_ctx, name, (adns_r_unknown | my_adns_r_cert),
-                         adns_qf_quoteok_query,
+                         adns_qf_quoteok_query|(kdns_usevc?adns_qf_usevc:0),
                          &answer) )
     {
       fprintf (console, PGM": DNS query failed: %s\n", strerror (errno));
@@ -191,14 +191,15 @@
          " -o\toutput to this file\n"
          "\n", fp);
   fputs ("This keyserver helper accepts URLs of the form:\n"
-         "  kdns://[NAMESERVER]/[ROOT][?at=[STRING]]\n"
+         "  kdns://[NAMESERVER]/[ROOT][?at=STRING]\n"
          "with\n"
          "  NAMESERVER  used for queries (default: system standard)\n"
          "  ROOT        a DNS name appended to the query (default: none)\n"
-         "  STRING      A string to replace the '@' (default: \".\")\n"
+         "  STRING      a string to replace the '@' (default: \".\")\n"
+         "If a long answer is expected add the parameter \"usevc=1\".\n"
          "\n", fp);
   fputs ("Example:  A query for \"hacker at gnupg.org\" with\n"
-         "  kdns://10.0.0.1/example.net?at=_key?\n"
+         "  kdns://10.0.0.1/example.net?at=_key&usevc=1\n"
          "setup as --auto-key-lookup does a CERT record query\n"
          "with type PGP on the nameserver 10.0.0.1 for\n"
          "  hacker._key_.gnupg.org.example.net\n"
@@ -308,8 +309,11 @@
       return KEYSERVER_INTERNAL_ERROR;
     }
 
-  fprintf (console, PGM": HOST=%s\n", opt->host? opt->host:"(none)");
-  fprintf (console, PGM": PATH=%s\n", opt->path? opt->path:"(none)");
+  if (opt->verbose)
+    {
+      fprintf (console, PGM": HOST=%s\n", opt->host? opt->host:"(none)");
+      fprintf (console, PGM": PATH=%s\n", opt->path? opt->path:"(none)");
+    }
   if (opt->path && *opt->path == '/')
     {
       char *p, *pend;
@@ -325,11 +329,9 @@
               if (pend)
                 *pend++ = 0;
               if (!strncmp (p, "at=", 3))
-                {
-                  /* Found.  */
-                  kdns_at_repl = p+3;
-                  break;
-                }
+                kdns_at_repl = p+3;
+              else if (!strncmp (p, "usevc=", 6))
+                kdns_usevc = !!atoi (p+6);
             }
           while ((p = pend));
         }
@@ -341,9 +343,13 @@
     }
   if (!strcmp (kdns_at_repl, "."))
     kdns_at_repl = "";
-  fprintf (console, PGM": kdns_root=%s\n", kdns_root);
-  fprintf (console, PGM": kdns_at=%s\n", kdns_at_repl);
 
+  if (opt->verbose)
+    {
+      fprintf (console, PGM": kdns_root=%s\n", kdns_root);
+      fprintf (console, PGM": kdns_at=%s\n", kdns_at_repl);
+      fprintf (console, PGM": kdns_usevc=%d\n", kdns_usevc);
+    }
 
   if (opt->debug)
     my_adns_initflags |= adns_if_debug;




More information about the Gnupg-commits mailing list