diff options
author | Werner Koch <wk@gnupg.org> | 2010-11-23 19:46:41 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2010-11-23 19:46:41 +0100 |
commit | b3f9e2130e64e1a57d2b60444edf6f839c1a90b1 (patch) | |
tree | ec62e5100ce63278fcb3c743a19b7bcad85f51a7 /common | |
parent | 2010-11-17 Marcus Brinkmann <mb@g10code.com> (diff) | |
download | gnupg2-b3f9e2130e64e1a57d2b60444edf6f839c1a90b1.tar.xz gnupg2-b3f9e2130e64e1a57d2b60444edf6f839c1a90b1.zip |
Change stack size for Wince.
Allow for a longer agent atartup under wince.
Print gpg output via estream.
Diffstat (limited to 'common')
-rw-r--r-- | common/ChangeLog | 7 | ||||
-rw-r--r-- | common/asshelp.c | 41 |
2 files changed, 36 insertions, 12 deletions
diff --git a/common/ChangeLog b/common/ChangeLog index 88675f5b3..310963067 100644 --- a/common/ChangeLog +++ b/common/ChangeLog @@ -1,3 +1,10 @@ +2010-11-23 Werner Koch <wk@g10code.com> + + * asshelp.c (SECS_TO_WAIT_FOR_AGENT, SECS_TO_WAIT_FOR_DIRMNGR): + Use these constants. For W32CE increase them to 30 seconds. + (start_new_gpg_agent): Print time to startup agent. + (start_new_dirmngr): Ditto. + 2010-11-04 Werner Koch <wk@g10code.com> * logging.c (do_logv) [W32]: Don't set a default log stream if the diff --git a/common/asshelp.c b/common/asshelp.c index 8e25eb3ea..313d0ddd4 100644 --- a/common/asshelp.c +++ b/common/asshelp.c @@ -42,6 +42,15 @@ # define lock_spawn_t dotlock_t #endif +/* The time we wait until the agent or the dirmngr are ready for + operation after we started them before giving up. */ +#ifdef HAVE_W32CE_SYSTEM +# define SECS_TO_WAIT_FOR_AGENT 30 +# define SECS_TO_WAIT_FOR_DIRMNGR 30 +#else +# define SECS_TO_WAIT_FOR_AGENT 5 +# define SECS_TO_WAIT_FOR_DIRMNGR 5 +#endif /* A bitfield that specifies the assuan categories to log. This is identical to the default log handler of libassuan. We need to do @@ -335,6 +344,7 @@ start_new_gpg_agent (assuan_context_t *r_ctx, gpg_error_t err = 0; char *infostr, *p; assuan_context_t ctx; + int did_success_msg = 0; *r_ctx = NULL; @@ -423,16 +433,19 @@ start_new_gpg_agent (assuan_context_t *r_ctx, if (verbose) log_info (_("waiting %d seconds for the agent " - "to come up\n"), 5); - for (i=0; i < 5; i++) + "to come up\n"), SECS_TO_WAIT_FOR_AGENT); + for (i=0; i < SECS_TO_WAIT_FOR_AGENT; i++) { gnupg_sleep (1); err = assuan_socket_connect (ctx, sockname, 0, 0); if (!err) { - if (verbose && !debug) - log_info (_("connection to agent" - " established\n")); + if (verbose) + { + log_info (_("connection to agent " + "established (%ds)\n"), i+1); + did_success_msg = 1; + } break; } } @@ -517,7 +530,7 @@ start_new_gpg_agent (assuan_context_t *r_ctx, return gpg_err_make (errsource, GPG_ERR_NO_AGENT); } - if (debug) + if (debug && !did_success_msg) log_debug (_("connection to agent established\n")); err = assuan_transact (ctx, "RESET", @@ -552,6 +565,7 @@ start_new_dirmngr (assuan_context_t *r_ctx, gpg_error_t err; assuan_context_t ctx; const char *sockname; + int did_success_msg = 0; *r_ctx = NULL; @@ -612,16 +626,19 @@ start_new_dirmngr (assuan_context_t *r_ctx, if (verbose) log_info (_("waiting %d seconds for the dirmngr to come up\n"), - 5); - for (i=0; i < 5; i++) + SECS_TO_WAIT_FOR_DIRMNGR); + for (i=0; i < SECS_TO_WAIT_FOR_DIRMNGR; i++) { gnupg_sleep (1); err = assuan_socket_connect (ctx, sockname, 0, 0); if (!err) { - if (verbose && !debug) - log_info (_("connection to the dirmngr" - " established\n")); + if (verbose) + { + log_info (_("connection to the dirmngr" + " established (%ds)\n"), i+1); + did_success_msg = 1; + } break; } } @@ -646,7 +663,7 @@ start_new_dirmngr (assuan_context_t *r_ctx, return gpg_err_make (errsource, GPG_ERR_NO_DIRMNGR); } - if (debug) + if (debug && !did_success_msg) log_debug (_("connection to the dirmngr established\n")); *r_ctx = ctx; |