aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-02-24 09:35:10 +0100
committerDavid Robillard <d@drobilla.net>2019-04-13 19:48:23 +0200
commita3695dd1e422bd3e3b22b1ad78a4a0a59b34507c (patch)
tree5cc172b6a3e2a4ccce8466a79f5d671f9bc30b01
parentc253b08dd86107c70434f53aebd8777b7e525ef9 (diff)
downloadserd-a3695dd1e422bd3e3b22b1ad78a4a0a59b34507c.tar.gz
serd-a3695dd1e422bd3e3b22b1ad78a4a0a59b34507c.tar.bz2
serd-a3695dd1e422bd3e3b22b1ad78a4a0a59b34507c.zip
Make reader tolerant of being started several times
-rw-r--r--src/reader.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/reader.c b/src/reader.c
index 5f085fe3..95508849 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -239,6 +239,7 @@ serd_reader_start_stream(SerdReader* reader,
const SerdNode* name,
size_t page_size)
{
+ serd_reader_finish(reader);
return serd_byte_source_open_source(
&reader->source, read_func, error_func, NULL, stream, name, page_size);
}
@@ -246,6 +247,8 @@ serd_reader_start_stream(SerdReader* reader,
SerdStatus
serd_reader_start_file(SerdReader* reader, const char* uri, bool bulk)
{
+ serd_reader_finish(reader);
+
char* const path = serd_file_uri_parse(uri, NULL);
if (!path) {
return SERD_ERR_BAD_ARG;
@@ -275,6 +278,7 @@ serd_reader_start_string(SerdReader* reader,
const char* utf8,
const SerdNode* name)
{
+ serd_reader_finish(reader);
return serd_byte_source_open_string(&reader->source, utf8, name);
}