aboutsummaryrefslogtreecommitdiffstats
path: root/common/iobuf.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2019-09-10 13:45:58 +0000
committerWerner Koch <[email protected]>2019-09-10 13:45:58 +0000
commit2f0fdab8aabdf408495163ef99b2d4d111f74692 (patch)
tree8ed0018cf23afd260baaa90df5f859033fe16bfb /common/iobuf.h
parentgpg: New option --use-keyboxd. (diff)
downloadgnupg-2f0fdab8aabdf408495163ef99b2d4d111f74692.tar.gz
gnupg-2f0fdab8aabdf408495163ef99b2d4d111f74692.zip
common: Allow a readlimit for iobuf_esopen.
* common/iobuf.c (file_es_filter_ctx_t): Add fields use_readlimit and readlimit. (file_es_filter): Implement them. (iobuf_esopen): Add new arg readlimit. * g10/decrypt-data.c (decrypt_data): Adjust for change. * g10/import.c (import_keys_es_stream): Ditto. -- This comes handy for (length,datablob) style streams. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'common/iobuf.h')
-rw-r--r--common/iobuf.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/common/iobuf.h b/common/iobuf.h
index 16156383c..9c9650c61 100644
--- a/common/iobuf.h
+++ b/common/iobuf.h
@@ -328,8 +328,10 @@ iobuf_t iobuf_fdopen_nc (int fd, const char *mode);
letter 'w', creates an output filter. Otherwise, creates an input
filter. If KEEP_OPEN is TRUE, then the stream is not closed when
the filter is destroyed. Otherwise, the stream is closed when the
- filter is destroyed. */
-iobuf_t iobuf_esopen (estream_t estream, const char *mode, int keep_open);
+ filter is destroyed. If READLIMIT is not 0 this gives a limit on
+ the number of bytes to read from estream. */
+iobuf_t iobuf_esopen (estream_t estream, const char *mode, int keep_open,
+ size_t readlimit);
/* Create a filter using an existing socket. On Windows creates a
special socket filter. On non-Windows systems simply, this simply