aboutsummaryrefslogtreecommitdiffstats
path: root/common/estream.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2006-08-11 11:04:38 +0000
committerWerner Koch <[email protected]>2006-08-11 11:04:38 +0000
commit6c943736098d4d6fbbaefcf558c5c16a060219e6 (patch)
tree7f40f7eb35f2df3bbcc4de5df7e97f18278888e3 /common/estream.c
parentMoved 1.9 branch to trunk (diff)
downloadgnupg-6c943736098d4d6fbbaefcf558c5c16a060219e6.tar.gz
gnupg-6c943736098d4d6fbbaefcf558c5c16a060219e6.zip
Added http.c from 1.4.
Added support for estream and gnutls.
Diffstat (limited to '')
-rw-r--r--common/estream.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/common/estream.c b/common/estream.c
index c2030371b..c523f09b1 100644
--- a/common/estream.c
+++ b/common/estream.c
@@ -559,7 +559,7 @@ static es_cookie_io_functions_t estream_functions_mem =
es_func_mem_read,
es_func_mem_write,
es_func_mem_seek,
- es_func_mem_destroy,
+ es_func_mem_destroy
};
/* Implementation of fd I/O. */
@@ -1402,16 +1402,19 @@ es_writen (estream_t ES__RESTRICT stream,
if (! (stream->flags & ES_FLAG_WRITING))
{
/* Switching to writing mode -> discard input data and seek to
- position at which reading has stopped. */
-
- err = es_seek (stream, 0, SEEK_CUR, NULL);
- if (err)
- {
- if (errno == ESPIPE)
- err = 0;
- else
- goto out;
- }
+ position at which reading has stopped. We can do this only
+ if a seek function has been registered. */
+ if (stream->intern->func_seek)
+ {
+ err = es_seek (stream, 0, SEEK_CUR, NULL);
+ if (err)
+ {
+ if (errno == ESPIPE)
+ err = 0;
+ else
+ goto out;
+ }
+ }
}
switch (stream->intern->strategy)