mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
gpg: New maintainer option --debug-set-iobuf-size.
* g10/gpg.c (opts): Add new option. (opt_set_iobuf_size): New var. (set_debug): Set the option. * tests/openpgp/armor.scm: Use this option to revert the buffer size to the one which used to exhibit the tested bugs. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
bfc1181644
commit
db7661b5a2
4 changed files with 23 additions and 6 deletions
13
g10/gpg.c
13
g10/gpg.c
|
@ -223,6 +223,7 @@ enum cmd_and_opt_values
|
|||
oDebugLevel,
|
||||
oDebugAll,
|
||||
oDebugIOLBF,
|
||||
oDebugSetIobufSize,
|
||||
oStatusFD,
|
||||
oStatusFile,
|
||||
oAttributeFD,
|
||||
|
@ -642,6 +643,7 @@ static ARGPARSE_OPTS opts[] = {
|
|||
ARGPARSE_s_s (oDebugLevel, "debug-level", "@"),
|
||||
ARGPARSE_s_n (oDebugAll, "debug-all", "@"),
|
||||
ARGPARSE_s_n (oDebugIOLBF, "debug-iolbf", "@"),
|
||||
ARGPARSE_s_u (oDebugSetIobufSize, "debug-set-iobuf-size", "@"),
|
||||
ARGPARSE_s_i (oStatusFD, "status-fd", "@"),
|
||||
ARGPARSE_s_s (oStatusFile, "status-file", "@"),
|
||||
ARGPARSE_s_i (oAttributeFD, "attribute-fd", "@"),
|
||||
|
@ -956,6 +958,8 @@ int g10_errors_seen = 0;
|
|||
|
||||
static int utf8_strings = 0;
|
||||
static int maybe_setuid = 1;
|
||||
static unsigned int opt_set_iobuf_size;
|
||||
static unsigned int opt_set_iobuf_size_used;
|
||||
|
||||
static char *build_list( const char *text, char letter,
|
||||
const char *(*mapf)(int), int (*chkf)(int) );
|
||||
|
@ -1276,6 +1280,10 @@ set_debug (const char *level)
|
|||
|
||||
if (opt.debug)
|
||||
parse_debug_flag (NULL, &opt.debug, debug_flags);
|
||||
|
||||
if (opt_set_iobuf_size || opt_set_iobuf_size_used)
|
||||
log_debug ("iobuf buffer size is %uk\n",
|
||||
iobuf_set_buffer_size (opt_set_iobuf_size));
|
||||
}
|
||||
|
||||
|
||||
|
@ -2742,6 +2750,11 @@ main (int argc, char **argv)
|
|||
|
||||
case oDebugIOLBF: break; /* Already set in pre-parse step. */
|
||||
|
||||
case oDebugSetIobufSize:
|
||||
opt_set_iobuf_size = pargs.r.ret_ulong;
|
||||
opt_set_iobuf_size_used = 1;
|
||||
break;
|
||||
|
||||
case oStatusFD:
|
||||
set_status_fd ( translate_sys2libc_fd_int (pargs.r.ret_int, 1) );
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue