summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-03-17 22:11:18 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-03-18 00:02:09 -0400
commit9786767a36803f6a27870e6f2a666113565e19d2 (patch)
tree0391958d27dc6782039d6a671ef8e179cda661a1
parent1dba654b27918c22e413ac5b3c19301f1ff86ad2 (diff)
journal-remote: do not attempt to read from µhttpd connections
This chunk got lost in one of the rebases :(
-rw-r--r--src/journal/journal-remote-parse.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/journal/journal-remote-parse.c b/src/journal/journal-remote-parse.c
index c961844c44..142de0ed1f 100644
--- a/src/journal/journal-remote-parse.c
+++ b/src/journal/journal-remote-parse.c
@@ -54,6 +54,10 @@ static int get_line(RemoteSource *source, char **line, size_t *size) {
goto docopy;
resize:
+ if (source->fd < 0)
+ /* we have to wait for some data to come to us */
+ return -EWOULDBLOCK;
+
if (source->size - source->filled < LINE_CHUNK) {
// XXX: add check for maximum line length
@@ -130,6 +134,10 @@ static int fill_fixed_size(RemoteSource *source, void **data, size_t size) {
assert(data);
while(source->filled < size) {
+ if (source->fd < 0)
+ /* we have to wait for some data to come to us */
+ return -EWOULDBLOCK;
+
if (!GREEDY_REALLOC(source->buf, source->size, size))
return log_oom();