mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
Add new regression test
This commit is contained in:
parent
ed776a913f
commit
168583e596
5 changed files with 204 additions and 9 deletions
|
@ -1,3 +1,7 @@
|
|||
2006-04-11 Werner Koch <wk@g10code.com>
|
||||
|
||||
* iobuf.c (IOBUF_BUFFER_SIZE): New to repalce hardwired 8192.
|
||||
|
||||
2006-04-06 David Shaw <dshaw@jabberwocky.com>
|
||||
|
||||
* memory.c (realloc): Fix compile problem with --enable-m-guard.
|
||||
|
|
22
util/iobuf.c
22
util/iobuf.c
|
@ -44,6 +44,12 @@
|
|||
#include "dynload.h"
|
||||
#include "iobuf.h"
|
||||
|
||||
/* The size of the internal buffers.
|
||||
NOTE: If you change this value you MUST also adjust the regression
|
||||
test "armored_key_8192" in armor.test! */
|
||||
#define IOBUF_BUFFER_SIZE 8192
|
||||
|
||||
|
||||
#undef FILE_FILTER_USES_STDIO
|
||||
|
||||
#ifdef HAVE_DOSISH_SYSTEM
|
||||
|
@ -983,7 +989,7 @@ iobuf_temp()
|
|||
{
|
||||
IOBUF a;
|
||||
|
||||
a = iobuf_alloc(3, 8192 );
|
||||
a = iobuf_alloc(3, IOBUF_BUFFER_SIZE );
|
||||
|
||||
return a;
|
||||
}
|
||||
|
@ -1063,7 +1069,7 @@ iobuf_open( const char *fname )
|
|||
return iobuf_fdopen ( translate_file_handle (fd,0), "rb" );
|
||||
else if( (fp = my_fopen_ro(fname, "rb")) == INVALID_FP )
|
||||
return NULL;
|
||||
a = iobuf_alloc(1, 8192 );
|
||||
a = iobuf_alloc(1, IOBUF_BUFFER_SIZE );
|
||||
fcx = xmalloc( sizeof *fcx + strlen(fname) );
|
||||
fcx->fp = fp;
|
||||
fcx->print_only_name = print_only;
|
||||
|
@ -1099,7 +1105,7 @@ iobuf_fdopen( int fd, const char *mode )
|
|||
#else
|
||||
fp = (FILEP_OR_FD)fd;
|
||||
#endif
|
||||
a = iobuf_alloc( strchr( mode, 'w')? 2:1, 8192 );
|
||||
a = iobuf_alloc( strchr( mode, 'w')? 2:1, IOBUF_BUFFER_SIZE );
|
||||
fcx = xmalloc( sizeof *fcx + 20 );
|
||||
fcx->fp = fp;
|
||||
fcx->print_only_name = 1;
|
||||
|
@ -1123,7 +1129,7 @@ iobuf_sockopen ( int fd, const char *mode )
|
|||
sock_filter_ctx_t *scx;
|
||||
size_t len;
|
||||
|
||||
a = iobuf_alloc( strchr( mode, 'w')? 2:1, 8192 );
|
||||
a = iobuf_alloc( strchr( mode, 'w')? 2:1, IOBUF_BUFFER_SIZE );
|
||||
scx = xmalloc( sizeof *scx + 25 );
|
||||
scx->sock = fd;
|
||||
scx->print_only_name = 1;
|
||||
|
@ -1166,7 +1172,7 @@ iobuf_create( const char *fname )
|
|||
return iobuf_fdopen ( translate_file_handle (fd, 1), "wb" );
|
||||
else if( (fp = my_fopen(fname, "wb")) == INVALID_FP )
|
||||
return NULL;
|
||||
a = iobuf_alloc(2, 8192 );
|
||||
a = iobuf_alloc(2, IOBUF_BUFFER_SIZE );
|
||||
fcx = xmalloc( sizeof *fcx + strlen(fname) );
|
||||
fcx->fp = fp;
|
||||
fcx->print_only_name = print_only;
|
||||
|
@ -1201,7 +1207,7 @@ iobuf_append( const char *fname )
|
|||
return NULL;
|
||||
else if( !(fp = my_fopen(fname, "ab")) )
|
||||
return NULL;
|
||||
a = iobuf_alloc(2, 8192 );
|
||||
a = iobuf_alloc(2, IOBUF_BUFFER_SIZE );
|
||||
fcx = xmalloc( sizeof *fcx + strlen(fname) );
|
||||
fcx->fp = fp;
|
||||
strcpy(fcx->fname, fname );
|
||||
|
@ -1229,7 +1235,7 @@ iobuf_openrw( const char *fname )
|
|||
return NULL;
|
||||
else if( (fp = my_fopen(fname, "r+b")) == INVALID_FP )
|
||||
return NULL;
|
||||
a = iobuf_alloc(2, 8192 );
|
||||
a = iobuf_alloc(2, IOBUF_BUFFER_SIZE );
|
||||
fcx = xmalloc( sizeof *fcx + strlen(fname) );
|
||||
fcx->fp = fp;
|
||||
strcpy(fcx->fname, fname );
|
||||
|
@ -1582,7 +1588,7 @@ iobuf_flush(IOBUF a)
|
|||
|
||||
if( a->use == 3 ) { /* increase the temp buffer */
|
||||
char *newbuf;
|
||||
size_t newsize = a->d.size + 8192;
|
||||
size_t newsize = a->d.size + IOBUF_BUFFER_SIZE;
|
||||
|
||||
if( DBG_IOBUF )
|
||||
log_debug("increasing temp iobuf from %lu to %lu\n",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue