From: Zbigniew Jędrzejewski-Szmek Date: Tue, 18 Mar 2014 02:11:18 +0000 (-0400) Subject: journal-remote: do not attempt to read from µhttpd connections X-Git-Tag: v212~116 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=9786767a36803f6a27870e6f2a666113565e19d2 journal-remote: do not attempt to read from µhttpd connections This chunk got lost in one of the rebases :( --- diff --git a/src/journal/journal-remote-parse.c b/src/journal/journal-remote-parse.c index c961844c4..142de0ed1 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();