]> git.sommitrealweird.co.uk Git - onak.git/commitdiff
cscvs to tla changeset 124
authorJonathan McDowell <noodles@earth.li>
Mon, 31 May 2004 23:48:18 +0000 (23:48 +0000)
committerJonathan McDowell <noodles@earth.li>
Mon, 31 May 2004 23:48:18 +0000 (23:48 +0000)
Author: noodles
Date: 2004/05/26 21:20:05
Fix gpg eof timeout problem when sending lots of keys.

add.c

diff --git a/add.c b/add.c
index 2aba92216a39893c362aad6f16ed5264437cd730..32016b5a63d8a2ce782f44e24c0c392ad441c7ff 100644 (file)
--- a/add.c
+++ b/add.c
@@ -5,7 +5,7 @@
  *
  * Copyright 2002 Project Purple
  *
  *
  * Copyright 2002 Project Purple
  *
- * $Id: add.c,v 1.13 2004/05/26 18:53:14 noodles Exp $
+ * $Id: add.c,v 1.14 2004/05/26 21:20:05 noodles Exp $
  */
 
 #include <errno.h>
  */
 
 #include <errno.h>
@@ -56,6 +56,7 @@ int main(int argc, char *argv[])
        start_html("onak : Add");
        if (ctx.buffer == NULL) {
                puts("Error: No keytext to add supplied.");
        start_html("onak : Add");
        if (ctx.buffer == NULL) {
                puts("Error: No keytext to add supplied.");
+               end_html();
        } else {
                readconfig(NULL);
                initlogthing("add", config.logfile);
        } else {
                readconfig(NULL);
                initlogthing("add", config.logfile);
@@ -63,7 +64,11 @@ int main(int argc, char *argv[])
                                        &ctx,
                                        &packets);
                if (packets != NULL) {
                                        &ctx,
                                        &packets);
                if (packets != NULL) {
-                       parse_keys(packets, &keys);
+                       printf("Storing %d keys.\n",
+                               parse_keys(packets, &keys));
+                       end_html();
+                       fclose(stdout);
+                       fclose(stderr);
                        initdb(false);
                        count = update_keys(&keys);
                        printf("Got %d new keys.\n", count);
                        initdb(false);
                        count = update_keys(&keys);
                        printf("Got %d new keys.\n", count);
@@ -77,10 +82,10 @@ int main(int argc, char *argv[])
                        cleanupdb();
                } else {
                        puts("No OpenPGP packets found in input.");
                        cleanupdb();
                } else {
                        puts("No OpenPGP packets found in input.");
+                       end_html();
                }
                cleanuplogthing();
                cleanupconfig();
        }
                }
                cleanuplogthing();
                cleanupconfig();
        }
-       end_html();
        return (EXIT_SUCCESS);
 }
        return (EXIT_SUCCESS);
 }